Change-Id: Ibc989afa4a30dd184d41d1a1cd89f97196e48855 Reviewed-on: http://codereview.qt.nokia.com/3710 Reviewed-by: Gunnar Sletta <gunnar.sletta@nokia.com>
28 lines
595 B
C++
28 lines
595 B
C++
#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();
|
|
|
|
QSurfaceFormat format;
|
|
format.setDepthBufferSize(16);
|
|
format.setSamples(4);
|
|
|
|
QPoint center = screenGeometry.center();
|
|
QRect windowRect(0, 0, 640, 480);
|
|
|
|
PaintedWindow window;
|
|
window.setGeometry(QRect(center - windowRect.center(), windowRect.size()));
|
|
window.show();
|
|
|
|
app.exec();
|
|
}
|