summaryrefslogtreecommitdiffstats
path: root/examples/opengl/paintedwindow/main.cpp
blob: 345cea7bc5b568b8b7a880726c1a5bcd3cd0b686 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#include <QGuiApplication>
#include <QRect>
#include <QScreen>

#include "paintedwindow.h"

int main(int argc, char **argv)
{
    QGuiApplication app(argc, argv);

    QScreen *screen = QGuiApplication::primaryScreen();

    QRect screenGeometry = screen->availableGeometry();

    QPoint center = screenGeometry.center();
    QRect windowRect(0, 0, 640, 480);

    PaintedWindow window;
    window.setGeometry(QRect(center - windowRect.center(), windowRect.size()));
    window.show();

    app.exec();
}