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. How to change the visible property of the dynamically created item to bind with SwipeView.isCurrentItem?
Forum Updated to NodeBB v4.3 + New Features

How to change the visible property of the dynamically created item to bind with SwipeView.isCurrentItem?

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

    Hi,

    I am trying to insert some particular page to SwipeView based on the type of OS that the target machine is running. (Win or Unix)

    The dynamical creation and the insertion of the QML page was not a issue, but changing the visible property is.

    I need to hide the page when it is not the current item. It used to be done with this

    SomeQmlComponent
    {
        visible: SwipeView.isCurrentItem ? true : false
    }
    

    But the same would not work on the pages that are created dynamically.

    This is what I have now:

        Component.onCompleted:
        {
            if (SystemSetting.isRunningEmbedded)
            {
                ComponentCreation.createComponent("pathToQml", swipeView, 1)
            }
    
            for (var i = 0; i < swipeView.count; i++)
            {
                var child = swipeView.itemAt(i)
                child.visible = // what should I do here?
            }
        }
    

    Thanks in advance

    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