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. RowLayout in a Flickable containing 2 ColumnLayouts - how to snap to appropriate ColumnLayout
Forum Updated to NodeBB v4.3 + New Features

RowLayout in a Flickable containing 2 ColumnLayouts - how to snap to appropriate ColumnLayout

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
1 Posts 1 Posters 153 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.
  • V Offline
    V Offline
    VFCraig
    wrote on last edited by
    #1

    A VERY SIMPLE example (template) of what is implemented. Hopefully sufficient, as it has minimal correlation to the question.

    Flickable
    {
    flickableDirection: Flickable.AutoFlickIfNeeded | Flickable.HorizontalFlick
    onFlickEnded:
    {
    // What should go here to snap the content visible to the origin of the appropriate
    // ColumnLayout where the center of the content now resides?
    // mapTo()? childAt()? contains()?
    }
    RowLayout
    {
    ColumnLayout
    {
    id: firstColumnLayout

                // Buttons, text, other controls, whatever the user wants to fill this with given the confines
                // of the device screen dimensions +/- header and footer stuff.
            }
    
            ColumnLayout
            {
                id: secondColumnLayout
            
                // Buttons, text, other controls, whatever the user wants to fill this with given the confines            
                // of the device screen dimensions +/- header and footer stuff.            
             }
        }
    

    }

    The row and its columns scroll left and right, as desired, but we want to snap to the appropriate column. The Item documentation talks about contains() as a possible test, but it talks about "local" coordinates for the x/y passed to it without explaining the context as to what constitutes "local".

    I know this is done, but not clear with respect to the methods provided which are used in conjunction with what. These are layouts, collections of assorted items. What item is associated with the x/y point is not what is important. Is there a childOf method that would tell whether the returned item from childAt is in the family tree of the layout? Can it be done without naming the layouts?

    Thanks.

    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