Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Unsolved Getting window geometry for all desktop windows

    General and Desktop
    window geometry global
    2
    3
    746
    Loading More Posts
    • 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.
    • M
      muldjord last edited by

      Ok, so I have a piece of software that needs to know the geometry and positions of all desktop windows. I have been searching far and wide for a Qt way of doing this, but it seems that I need to do some system specific coding to make it work.

      But, before I delve too deep into that, I'd like to put the question here, just in case there actually IS a Qt way of doing this. So basically:

      • I need some simple way of iterating all windows (including the ones that aren't part of my own software) and get their size and positions.

      I looked into using QApplication::desktopWidget and then calling grabWindow which then returns a pixmap with a width and height. It would sortof do what I want, but I still wouldn't know the positions and it's quite an expensive way of doing it. I need to do this every 30 ms so it's not exactly a solition after all. Just to let you know that I am aware of the grabWindow call.

      Any input would be appreciated.

      1 Reply Last reply Reply Quote 0
      • raven-worx
        raven-worx Moderators last edited by raven-worx

        no there is no Qt-way. This is actually far beyond of such a framework like Qt is.
        You need to use system specific APIs to do that.

        --- SUPPORT REQUESTS VIA CHAT WILL BE IGNORED ---
        If you have a question please use the forum so others can benefit from the solution in the future

        M 1 Reply Last reply Reply Quote 3
        • M
          muldjord @raven-worx last edited by

          @raven-worx I will look into platform specific code. Thank you.

          1 Reply Last reply Reply Quote 0
          • First post
            Last post