QScreen with different graphics cards || QScreen and Xinerama?
I just have the following problem:
I have a machine with two nvidia cards and running a Xubuntu (11.10).
Now what i am trying to do is spawn a window on my extended screen which is connected to the secondary graphics card.
QGuiApplication::screens().size() returns 2 for my two screens which is correct so far. My secondary graphics card is running in a seperate X server (which is the usual way to do that i guess). But if i create my window as follows
QWindow w(QGuiApplication::screens()->at(1)); w->show();
The whole application crashes without any message! (is that normal?)
Now i am using Xinerama to have it more "Windows like". But now QGuiApplication::screens()->size() returns 1, which is not correct in my oppinion. Is there another way to have access to the QScreen which represents the screen connected to my second graphics card?
I also tried the virtualSiblings thing of QScreen but there is only one instance and it is the same as my primary screen!
I'm having the same problems with you as well.
Under Qt5.3, in Xinerama mode, QGuiApplication::screens() only returns the single screen which is the union of all available screens. QScreen::geometry returns the union of all screen geometries.
Under Qt 4.8, these calls worked as desired. However, I think with the major reimplementation in Qt5.3, things have changed.
When I disable Xinerama, I can get the correct number of screens and geometry, but every time I try to open a QWindow set to another screen other than the primary, the window only pops up on the primary screen.
I think it might have to do with that all my screens are running their own X servers and hence X displays.
Any help on this would be appreciated as well.
I can't open any windows other than on the primary screen with Xinerama disabled on my Ubuntu 12.04 workstation.
Take a look on "QDesktopWidget":http://qt-project.org/doc/qt-5/QDesktopWidget.html#details
QDesktopWidget will only return the one screen in Xinerama mode.
Under Qt 4.8, it used to return all the screens, but with Qt 5.3, it just returns a single screen. I'm hoping that calling virtualSiblings will give me access. Will try it out tomorrow.
Looks like in Xinerama mode, calling virtualSiblings on the single QScreen returned from QApplication::screens() also only returns a single QScreen instead of the multiple screens that make up the large virtual screen.
It also appears that QDesktopWidget::isVirtualDesktop() also incorrectly returns false instead of true.