QPA/windows example: Fix positioning for virtual desktops.
Position window within screen geometry. Change-Id: Id931f386c9ef5564887a2f54b71921f062320f54 Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
This commit is contained in:
parent
10f6c5981c
commit
e752a98b5a
@ -40,6 +40,7 @@
|
|||||||
|
|
||||||
#include <QGuiApplication>
|
#include <QGuiApplication>
|
||||||
#include <QScreen>
|
#include <QScreen>
|
||||||
|
#include <QRect>
|
||||||
|
|
||||||
#include "window.h"
|
#include "window.h"
|
||||||
|
|
||||||
@ -63,6 +64,9 @@ int main(int argc, char **argv)
|
|||||||
if (screen == app.primaryScreen())
|
if (screen == app.primaryScreen())
|
||||||
continue;
|
continue;
|
||||||
Window *window = new Window(screen);
|
Window *window = new Window(screen);
|
||||||
|
QRect geometry = window->geometry();
|
||||||
|
geometry.moveCenter(screen->availableGeometry().center());
|
||||||
|
window->setGeometry(geometry);
|
||||||
window->setVisible(true);
|
window->setVisible(true);
|
||||||
window->setWindowTitle(screen->name());
|
window->setWindowTitle(screen->name());
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user