We have an application that opens two windows. We want them to open on two different X screens. We don't use Twinview or xinerama. The gfxcard is Nvidia. The code we use is:
ourWindow
->setGeometry
(QApplication::desktop()->availableGeometry
(1));
ourWindow->setGeometry(QApplication::desktop()->availableGeometry(1));
To copy to clipboard, switch view to plain text mode
But when we check the screen number afterwards:
cout <<
"Screennumber: " <<
QApplication::desktop()->screenNumber
(ourWindow.
get()) << endl;
cout << "Screennumber: " << QApplication::desktop()->screenNumber(ourWindow.get()) << endl;
To copy to clipboard, switch view to plain text mode
It gives us screennumber 0. All the screens also opens on the same desktop. Is something buggy or are we doing it wrong?
cout <<
"Number of screens: " <<
QApplication::desktop()->numScreens
() << endl;
cout << "Number of screens: " << QApplication::desktop()->numScreens() << endl;
To copy to clipboard, switch view to plain text mode
gives us Number of screens: 2, so Qt see our two screens.
/regards
Erik
Bookmarks