diff options
Diffstat (limited to 'tests/manual/qopenglwidget/openglwidget/main.cpp')
-rw-r--r-- | tests/manual/qopenglwidget/openglwidget/main.cpp | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/tests/manual/qopenglwidget/openglwidget/main.cpp b/tests/manual/qopenglwidget/openglwidget/main.cpp index 68f9be7199..0268d47767 100644 --- a/tests/manual/qopenglwidget/openglwidget/main.cpp +++ b/tests/manual/qopenglwidget/openglwidget/main.cpp @@ -45,20 +45,32 @@ #include <QMdiArea> #include <QLCDNumber> #include <QTimer> - +#include <QSurfaceFormat> +#include <QDebug> int main(int argc, char *argv[]) { QApplication a(argc, argv); + QSurfaceFormat format; + if (QCoreApplication::arguments().contains(QLatin1String("--multisample"))) + format.setSamples(4); + if (QCoreApplication::arguments().contains(QLatin1String("--coreprofile"))) { + format.setVersion(3, 2); + format.setProfile(QSurfaceFormat::CoreProfile); + } + qDebug() << "Requesting" << format; + QMdiArea w; w.resize(400,400); OpenGLWidget *glw = new OpenGLWidget; + glw->setFormat(format); w.addSubWindow(glw); glw->setMinimumSize(100,100); OpenGLWidget *glw2 = new OpenGLWidget; + glw2->setFormat(format); glw2->setMinimumSize(100,100); w.addSubWindow(glw2); @@ -69,5 +81,8 @@ int main(int argc, char *argv[]) w.show(); + if (glw->isValid()) + qDebug() << "Got" << glw->format(); + return a.exec(); } |