Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Examining on-screen widgets

Examining on-screen widgets

Scheduled Pinned Locked Moved Solved General and Desktop
5 Posts 3 Posters 1.1k Views 3 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.
  • JonBJ Offline
    JonBJ Offline
    JonB
    wrote on last edited by JonB
    #1

    I have frequently wanted to click around my Qt widgets app so see what my widget hierarchy looks like at runtime, and also view the widgets' properties etc. As close as possible to the "F12 Developer Tools" mode you can go into in all web browsers.

    In the last picture of the first post at https://forum.qt.io/topic/97513/strange-behavior-of-widgets-in-qvboxlayout, that user shows some kind of "Object Explorer" for his app. Just what I have been looking for. But....

    • What is he using? Is that Qt Creator? I am Python/PyQt, I do not use Qt Creator. If it's Qt Creator, presumably I won't be able to use it again my app?

    • I can see it shows widget name & class. Can user click on those nodes to find out more about the widget, like its size, color, even have it highlight the widget outline on the screen? Or is that the only information it can display?

    1 Reply Last reply
    0
    • sierdzioS Offline
      sierdzioS Offline
      sierdzio
      Moderators
      wrote on last edited by
      #2

      That screenshot is from Qt Designer which is a WYSIWYG editor for .ui files, and it is built into Qt Creator.

      Try opening your .ui files with it, it may work. If you defined your UI in code, then you're out of luck.

      Perhaps some object inspection tool (KDAB's GammaRay for example) will help you - it will show you all objects and properties.

      Also, each QObject has a method called dumpObjectInfo() and dumpObjectTree() link - that might be cumbersome to use, but will get you the information you need, too.

      (Z(:^

      JonBJ 1 Reply Last reply
      3
      • sierdzioS sierdzio

        That screenshot is from Qt Designer which is a WYSIWYG editor for .ui files, and it is built into Qt Creator.

        Try opening your .ui files with it, it may work. If you defined your UI in code, then you're out of luck.

        Perhaps some object inspection tool (KDAB's GammaRay for example) will help you - it will show you all objects and properties.

        Also, each QObject has a method called dumpObjectInfo() and dumpObjectTree() link - that might be cumbersome to use, but will get you the information you need, too.

        JonBJ Offline
        JonBJ Offline
        JonB
        wrote on last edited by JonB
        #3

        @sierdzio

        • There are no .ui files in my Python/PyQt projects. Everything is done by creating widgets in code.
        • I would need the information "interactively" to be of any use.

        So looks like I'm out of luck...!

        1 Reply Last reply
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #4

          Hi,

          You should take a look at KDAB's Gammaray.

          It allows you to take a deep dive into your application.

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          JonBJ 1 Reply Last reply
          1
          • SGaistS SGaist

            Hi,

            You should take a look at KDAB's Gammaray.

            It allows you to take a deep dive into your application.

            JonBJ Offline
            JonBJ Offline
            JonB
            wrote on last edited by JonB
            #5

            @SGaist
            As usual from you, a very interesting link! I'm not sure it does the same sort of thing as I had mind (visualizing layouts & widgets [EDIT hang on, https://doc.qt.io/GammaRay/gammaray-widget-inspector.html might be closest to what I had in mind]), and I won't get code navigation because Python, but I must give it a look. When I have a minute --- it looks quite complex/impressive!

            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