[Solved] Widget integrated going out of its own zone



  • Hello here,
    here is my problem !

    I got a main window (Item) with a 640*480 size.

    I integrated a custom widget defined in another qml file, its size is 100*100. This item contains a Pathview that only shows 3 items from a list containing a lot of items.

    The thing is that when I add my CustomPathView to my main window at coords (0, 0), the PathView goes to the bottom of my main window, displaying 7/8 items... (?!?) My CustomPathView.qml file starts with :

    @ Item {
    width: 100 height: 100
    @
    That's why I really don't understand why it is displaying 8 items...

    Did I do something wrong ? Do I have to precise to my CustomPathView that he can't go out of its zone (how ?) ?

    Thanks in advance for any help about it !

    (sry for my langage, im french, ans sry for my president too...)

    [edit : please use @ code tags, Eddy]


  • Moderators

    You probably need to add
    @
    clip: true
    @
    to the instance of the custom widget.



  • Indeed, I think clip is your friend. You are stumbling into a major difference between the old QWidget based situtation and the way Quick works. With QWidgets, every child widget was nessecarily contained within its parent widget. That is not the case in Quick. In Quick, child items need not even overlap te parent item.



  • "clip" works, thanks to both of you :)


  • Moderators

    You're very welcome! Glad it worked for you. Be sure and edit the title of the thread to add [Solved] at the beginning. Thanks!


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.