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. [GIVEN UP] Scoping Problem - how to explicitly access a parents property?
Forum Updated to NodeBB v4.3 + New Features

[GIVEN UP] Scoping Problem - how to explicitly access a parents property?

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

    I have a strongly nested set of Items - here an abbreviated example:
    @Rectangle {
    ListView {
    model: A //a QQmlListProperty acting on a C++ list
    delegate: Rectangle {
    Rectangle {
    Button {
    text: model.propertyMadeVisibleFromC++
    }
    ComboBox {
    model: B //some model specifically made for the ComboBox
    currentIndex: model.propertyMadeVisibleFromC++ - now I am accessing the wrong "model" and hence the requested property doesn't exist
    }
    }
    }
    }
    }@
    How could I access the ListView-model from within the ComboBox?

    1 Reply Last reply
    0
    • T Offline
      T Offline
      thEClaw
      wrote on last edited by
      #2

      I switched to a GroupBox with lots of RadioButtons since I have to get this done. Doesn't look too bad, either. But if anybody ever finds out how to address a "model" of an ancestor from within a child that has its own "model", please let the rest of the world know!

      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