Results 1 to 4 of 4

Thread: Acessing individual properties of nested QML object from C++

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Apr 2014
    Posts
    125
    Qt products
    Qt5 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Android Maemo/MeeGo

    Question Acessing individual properties of nested QML object from C++

    ---------- Mainitem.qml
    Qt Code:
    1. import QtQuick 1.0
    2.  
    3. Item1 {
    4. width: 100; height: 100
    5.  
    6. ItemA1 {
    7. id: square
    8.  
    9. Rectangle {
    10. color: "red"
    11. width: 10
    12. height: 10
    13. }
    14. }
    15.  
    16. itemB {}
    17. }
    To copy to clipboard, switch view to plain text mode 
    ---------- itemB.qml -------------
    Qt Code:
    1. import QtQuick 1.0
    2.  
    3. Item2 {
    4. property length: 6
    5.  
    6. ItemB1 {
    7. id: idc
    8.  
    9. Rectangle {
    10. color: "red"
    11. width: 10
    12. height: 10
    13. property rectype: 0
    14. }
    15. }
    16.  
    17. }
    To copy to clipboard, switch view to plain text mode 
    Hello;

    How to read the properties of ItemB1 Rectangle (e.g rectype) from my C++ code (we know only the path to Mainitem.qml)?

    Thanks;

    Mut
    Last edited by anda_skoa; 25th March 2016 at 10:15. Reason: missing [code] tags

Similar Threads

  1. Replies: 5
    Last Post: 10th January 2014, 16:20
  2. Replies: 7
    Last Post: 8th January 2014, 01:03
  3. Replies: 4
    Last Post: 2nd October 2012, 17:39
  4. Mapping JS Object properties to QProperties
    By Scorp2us in forum Qt Programming
    Replies: 0
    Last Post: 29th June 2009, 20:52
  5. Acessing other objects "higher up"
    By CryoGenFX in forum Newbie
    Replies: 4
    Last Post: 17th October 2007, 19:55

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.