Results 1 to 1 of 1

Thread: How to access the public properties of a qml page loaded through a Loader?

  1. #1
    Join Date
    Apr 2011
    Posts
    231
    Thanks
    141
    Thanked 6 Times in 5 Posts

    Default Re: How to access the public properties of a qml page loaded through a Loader?

    AA.qml

    Qt Code:
    1. Item
    2. {
    3. id: drawLinesOnC
    4.  
    5. property string lineColour
    6. property int lineDrawingSourceType
    7. property variant startEndPointArray
    8.  
    9. }
    To copy to clipboard, switch view to plain text mode 

    main.qml

    Qt Code:
    1. Loader
    2. {
    3. id: drawLineLoaderA
    4. source: "AA.qml"
    5. }
    To copy to clipboard, switch view to plain text mode 

    -

    How to access the public properties of AA.qml page loaded through Loader drawLineLoaderA?


    Added after 19 minutes:


    Found the solution :

    Qt Code:
    1. drawLineLoaderA.source = "DrawLineLoader.qml"
    2. drawLineLoaderA.item.lineColour = "black"
    3. drawLineLoaderA.item.lineDrawingSourceType = 2
    To copy to clipboard, switch view to plain text mode 
    Last edited by TheIndependentAquarius; 27th November 2014 at 11:50.

Similar Threads

  1. How to access DOM of a web page in QtWebKit?
    By piotr.dobrogost in forum Qt Programming
    Replies: 3
    Last Post: 13th May 2011, 10:23
  2. Replies: 3
    Last Post: 9th February 2011, 12:07
  3. Replies: 0
    Last Post: 15th March 2010, 09:11
  4. How to know when a web page is loaded when using QtWebKit?
    By piotr.dobrogost in forum Qt Programming
    Replies: 0
    Last Post: 20th August 2009, 10:18
  5. How can I access public variable parent Form
    By validator in forum Qt Programming
    Replies: 14
    Last Post: 18th December 2008, 22:12

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.