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. Getting window geometry for all desktop windows
Forum Updated to NodeBB v4.3 + New Features

Getting window geometry for all desktop windows

Scheduled Pinned Locked Moved Unsolved General and Desktop
window geometryglobal
3 Posts 2 Posters 1.2k Views
  • 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 Offline
    M Offline
    muldjord
    wrote on last edited by
    #1

    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
    0
    • raven-worxR Offline
      raven-worxR Offline
      raven-worx
      Moderators
      wrote on last edited by raven-worx
      #2

      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
      3
      • raven-worxR 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.

        M Offline
        M Offline
        muldjord
        wrote on last edited by
        #3

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

        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