Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. [Solved] Widget integrated going out of its own zone

[Solved] Widget integrated going out of its own zone

Scheduled Pinned Locked Moved QML and Qt Quick
5 Posts 3 Posters 2.4k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • T Offline
    T Offline
    Thanana
    wrote on last edited by
    #1

    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]

    1 Reply Last reply
    0
    • M Offline
      M Offline
      mlong
      wrote on last edited by
      #2

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

      Software Engineer
      My views and opinions do not necessarily reflect those of anyone -- living or dead, real or fictional -- in this universe or any other similar multiverse node. Void where prohibited. Your mileage may vary. Caveat emptor.

      1 Reply Last reply
      0
      • A Offline
        A Offline
        andre
        wrote on last edited by
        #3

        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.

        1 Reply Last reply
        0
        • T Offline
          T Offline
          Thanana
          wrote on last edited by
          #4

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

          1 Reply Last reply
          0
          • M Offline
            M Offline
            mlong
            wrote on last edited by
            #5

            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!

            Software Engineer
            My views and opinions do not necessarily reflect those of anyone -- living or dead, real or fictional -- in this universe or any other similar multiverse node. Void where prohibited. Your mileage may vary. Caveat emptor.

            1 Reply Last reply
            0

            • Login

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • Users
            • Groups
            • Search
            • Get Qt Extensions
            • Unsolved