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. Dynamic invokation of page1.qml, page2.qml using Loader. How to set a property of the invoked page conditionally?
Forum Updated to NodeBB v4.3 + New Features

Dynamic invokation of page1.qml, page2.qml using Loader. How to set a property of the invoked page conditionally?

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

    I've main.qml, page1.qml, & page2.qml files. mail.qml is the default page getting loaded from main.cpp. Basing some condition, I'm able to load page1.qml OR page2.qml using Loader.

    page1.qml has 2 properties and page2.qml DOES NOT have any properties. I would like to set the property values from main.qml only when the loaded file is page1.qml. Generic statement "componentLoader.item["selectedBrandId"] = selBrandId;" is throwing ERROR "Cannot assign to non-existent property" when page2.qml is dynamically loaded when condition is met, as there are no properties in page2.qml.

    How to fetch the details viz., Id etc. of loaded page in order to proceed with property settings?

    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