Results 1 to 5 of 5

Thread: How to move an QML object from one QML file to another, dynamically?

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #4
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: How to move an QML object from one QML file to another, dynamically?

    I am not sure I understand, but if you instantiate WindowA and WindowB in another compenent but need access to them from outside that component, then this component must provide the access, e.g. something like

    X.qml
    Qt Code:
    1. Item {
    2. property Item windowA: WIndowA {}
    3. property Item windowB: WindowB {}
    4. }
    To copy to clipboard, switch view to plain text mode 

    main.qml
    Qt Code:
    1. Item {
    2. X { id: x }
    3.  
    4. anchors.right: x.windowA.right
    5. }
    To copy to clipboard, switch view to plain text mode 

    The real question will be, however, is this is a good design. A component is a natural encapsulation unit, it shouldn't be necessary to take things out of it.

    Cheers,
    _

  2. The following user says thank you to anda_skoa for this useful post:

    TheIndependentAquarius (28th January 2014)

Similar Threads

  1. Replies: 4
    Last Post: 7th November 2012, 03:52
  2. Two dynamically created object interaction issue
    By kornicameister in forum Qt Quick
    Replies: 2
    Last Post: 9th September 2011, 11:35
  3. Replies: 19
    Last Post: 18th October 2009, 09:34
  4. finding dynamically create object
    By abrou in forum Newbie
    Replies: 2
    Last Post: 5th March 2008, 21:17
  5. Move mouse over object
    By ToddAtWSU in forum Qt Programming
    Replies: 17
    Last Post: 3rd October 2007, 15:53

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
  •  
Qt is a trademark of The Qt Company.