Results 1 to 2 of 2

Thread: QML item explorer

  1. #1
    Join Date
    Apr 2014
    Posts
    53
    Thanks
    9

    Default QML item explorer

    Does Qt (5.8) have any sort of explorer of QML items ? Or is there any option for to draw a rectangle around the items to visualize its boundaries at runtime? (of course, this is for development only, the prototyping phase)

    Because... I am having a hard time understanding how much width and height do my items take when rendered by QML engine. So, a sort of explorer, like those you have in Firefox or Chrome that help you to understand the how much space is a particular item using , will be of a big help!

    TIA
    Nulik

  2. #2
    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: QML item explorer

    You can easily draw a rectangle around any item with a Rectangle

    Qt Code:
    1. Item {
    2. // any item you have
    3.  
    4. Rectangle {
    5. anchors.fill: parent
    6. color: "transparent"
    7. border.color: "red"
    8. }
    9. }
    To copy to clipboard, switch view to plain text mode 
    You can move the Rectangle code into a helper file, e.g. "SizeHint.qml" and then use it like this
    Qt Code:
    1. Item {
    2. // any item you have
    3. SizeHint {}
    4. }
    To copy to clipboard, switch view to plain text mode 

    And, last but not least, there is GammaRay

    Cheers,
    _

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

    nuliknol (4th January 2017)

Similar Threads

  1. Popup window explorer
    By dorians58 in forum Newbie
    Replies: 3
    Last Post: 23rd July 2010, 05:26
  2. Drop items onto explorer.exe
    By louis_xx in forum Qt Programming
    Replies: 4
    Last Post: 4th December 2008, 08:13
  3. Need suggestion to handle drop item onto Explorer(Shell)
    By Teerayoot in forum Qt Programming
    Replies: 2
    Last Post: 5th May 2007, 19:42
  4. icon visible from explorer
    By ChasW in forum Qt Programming
    Replies: 2
    Last Post: 9th February 2007, 21:30
  5. windows explorer
    By denis in forum Newbie
    Replies: 1
    Last Post: 25th January 2006, 05:59

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.