Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
get all (virtual) desktops on a physical Desktop
I am using QList<QScreen*> sl = QGuiApplication::screens() to get all physical Desktops. But how can I access the virtual ones ?
wlof last edited by
Virtual desktops are platform / window manager dependent, so I don't think Qt offers any way to access them.
mcosta last edited by
you can use
QDesktopWidgetto access to all your screens; but if you use a virtual desktop you get always the same widget
Yes, but this will give me the current "root" Window. I need to access all the other screens too.
Virtual desktops are platform / window manager dependent
Okay, thats what I already thought too that this is a window manager thing :(
Best Regards, Martin
Did you check the screen count returned by QDesktopWidget ?
@SGaist yes :-) It's says 2 if I attach a second Monitor. So thats the way I checked that this function may only count physical displays.
Sorry, I've thought you wanted to know the number of screens of the current desktop. As already stated the virtual desktop handling itself is not part of Qt. It something that is highly platform / desktop env dependent. I'm not even sure Windows currently has anything like that. What environment are you currently targeting ?
@SGaist I use Systemversion: OS X 10.9.5 (13F1077) Kernel-Version: Darwin 13.4.0
What would you need from the Space API ?