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. QML Loader: signal when Item is completed
QtWS25 Last Chance

QML Loader: signal when Item is completed

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
qmlloader
1 Posts 1 Posters 1.1k 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.
  • H Offline
    H Offline
    Hazzl
    wrote on 4 Dec 2016, 20:21 last edited by
    #1

    I am changing one page in a SwipeView depending on buttons pressed on a different page of that SwipeView

    SwipeView {
       Item { id: firstPage
          MyButton { onClicked: secondPage.setSource("PageA.qml") }
          MyButton { onClicked: secondPage.setSource("PageB.qml") } 
       }
    
        Loader { id: secondPage }
    }
    

    I need to access the objects on the secondPage from the C++ side. Therefore, I connect to the loaded signal

    QQuickItem *p_loaderPage = object->findChild<QQuickItem *>("loaderPage");
    Q_CHECK_PTR(p_loaderPage);
    connect(p_loaderPage, SIGNAL(loaded()), this, SLOT(findViews()));
    

    When I first load a page (say pageA) everything seems to be working fine. But if I load a new page on top of that (either pageB or pageA a second time), I still get the data from the old page in findViews(). It seems that the signal is triggered too early. I'd appreciate any help.

    1 Reply Last reply
    0

    1/1

    4 Dec 2016, 20:21

    • Login

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