This code opens new window in selected screen :
int screen_number = 2;//2 is an example, this is 3th screen, because screens are numbered from 0
MyWidget *my_widget;
bool is_virtual_desktop
= QApplication::desktop()->isVirtualDesktop
();
if( is_virtual_desktop )
bottom_left
= QApplication::desktop()->screenGeometry
(screen_number
).
bottomLeft();
else
parentScreen
= QApplication::desktop()->screen
(screen_number
);
my_widget = new MyWidget(parentScreen);
if( is_virtual_desktop )
my_widget->move( bottom_left );
int screen_number = 2;//2 is an example, this is 3th screen, because screens are numbered from 0
MyWidget *my_widget;
QWidget *parent_screen = 0x00;
bool is_virtual_desktop = QApplication::desktop()->isVirtualDesktop();
QPoint bottom_left = QApplication::desktop()->screenGeometry(0).bottomLeft();
if( is_virtual_desktop )
bottom_left = QApplication::desktop()->screenGeometry(screen_number).bottomLeft();
else
parentScreen = QApplication::desktop()->screen(screen_number);
my_widget = new MyWidget(parentScreen);
if( is_virtual_desktop )
my_widget->move( bottom_left );
To copy to clipboard, switch view to plain text mode
Bookmarks