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
QtWS25 Last Chance

Getting window geometry for all desktop windows

Scheduled Pinned Locked Moved Unsolved General and Desktop
window geometryglobal
3 Posts 2 Posters 1.0k 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 18 Jan 2016, 21:26 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
    • R Offline
      R Offline
      raven-worx
      Moderators
      wrote on 19 Jan 2016, 07:05 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 19 Jan 2016, 17:36
      3
      • R raven-worx
        19 Jan 2016, 07:05

        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 19 Jan 2016, 17:36 last edited by
        #3

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

        1 Reply Last reply
        0

        3/3

        19 Jan 2016, 17:36

        • Login

        • Login or register to search.
        3 out of 3
        • First post
          3/3
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved