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. QDeclarativeView question
Forum Updated to NodeBB v4.3 + New Features

QDeclarativeView question

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

    Hi all, I created a Qt Quick C++ & qml application using Qt 4.8.4.

    I have code such as:
    MainView w;
    w.setSource(QUrl::fromLocalFile("mainview.qml");

    Where MainView inherits from QDeclarativeView

    In my mainview.qml file I use a Loader to load various QML files depending on what the user selects from menus. How can I tell in C++ when the underlying QML structure changes? Is there a signal I can hook into?

    I want to cache some look ups (* obj), so I don't have to do a findChild like below:
    QDeclarativeItem obj = this->rootObject()->findChild<QDeclarativeItem>(item);

    Then when a new file is loaded by the Loader I would then kill the cache.

    Maybe there is a better approach.

    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