Best Practice Advice: Enumerate all windows in the desktop(s)

  • My Qt application (that will run on Windows, OS X and Ubuntu) has a need to:

    1. List all windows
    2. Obtain their caption text (if any)
    3. Obtain an Icon of the application, if any, as QIcon or QPixmap (e.g. App Icon)

    I know how to do this for Windows using Win32. I can research Mac and Ubuntu separately, but I was wondering if there's an abstracted Qt approach to assist me?

  • I don't think so.

  • definitely no way with default Qt. IIRC there were already questions like this on devnet and the result was always: Absolutely OS dependent, use the OS API.

  • Got you. I'll created an abstracted QT class to represent the information I need with platform specific "plug-ins" to feed this information in. Each platform will build with its own plug-in.

    It might be a nice idea to add this to Qt once I'm done with all 3 platforms, so that it's available for other Qt users out-of-the-box in future versions. What's the policy of contributing it to Qt?

  • Agree: put this good idea in a wiki page and notify to us. Remember to add the tags to simplify search finding.

Log in to reply

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.