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. probleme with Flickable
Forum Update on Monday, May 27th 2025

probleme with Flickable

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
5 Posts 3 Posters 643 Views
  • 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.
  • C Offline
    C Offline
    cosmoff
    wrote on last edited by
    #1

    Hello everybody,

    I have a file named classif.qml with the code :

    Item {
        id: classifView
        clip: true
    
        property alias content : item.children
        property alias contentHeight : item.height
    
        /* zone de défilement des paramètres */
        Flickable {
            id: flickable
            flickableDirection: Flickable.VerticalFlick
            contentHeight: item.height
    
            anchors {
                fill: parent
                leftMargin: contentViewGI.flickableLeftMargin
            }
    
            Item {
                id: item
                anchors.fill: parent
            }
     ...
        }
    

    and in my main.qml I have :

    Classif{
        //content :
        contentHeight : 2000
    ...
    }
    

    but It does not work.

    Do you have an idea of the problem ?
    thanks.

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      The file name must follow the casing of the class.

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • C Offline
        C Offline
        cosmoff
        wrote on last edited by
        #3

        thanks for your answer.
        I did not understand what you say. Can you give me an example please ?

        1 Reply Last reply
        0
        • C Offline
          C Offline
          cosmoff
          wrote on last edited by cosmoff
          #4

          oh ok, no I just wrote wrong but the file is Classif.qml, the problem is always here

          1 Reply Last reply
          0
          • johngodJ Offline
            johngodJ Offline
            johngod
            wrote on last edited by
            #5

            I think the problem is anchors.fill: parent inside Item. You're setting a circular dependency, because in child you say anchor to parent. them in parent you say contenHeight should be children height.
            Try to use explicit values for height in Item, and only use anchors for horizontal width or for left/ right.

            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