diff options
author | Laszlo Agocs <laszlo.agocs@qt.io> | 2017-06-08 12:36:57 +0200 |
---|---|---|
committer | Laszlo Agocs <laszlo.agocs@qt.io> | 2017-07-06 11:12:52 +0000 |
commit | 0e0606a049891c1fbe5910d5bc2ca91810a949f9 (patch) | |
tree | 1e91b864a91391691e2bf117c64b13e3725b0b81 /tools/qmlscene/main.cpp | |
parent | 336ecf47667a020376c72a192f195c277931d75a (diff) |
qmlscene: add an option to request core profile contexts
Helps for example to launch the qtgraphicaleffects testbed with
a core profile context and thus exercise that path.
Change-Id: Ief436ee5221e59d8a14ad74f27583b68e61eb056
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Joni Poikelin <joni.poikelin@qt.io>
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Reviewed-by: Robin Burchell <robin.burchell@crimson.no>
Diffstat (limited to 'tools/qmlscene/main.cpp')
-rw-r--r-- | tools/qmlscene/main.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/tools/qmlscene/main.cpp b/tools/qmlscene/main.cpp index 6ce676456c..f411c6becc 100644 --- a/tools/qmlscene/main.cpp +++ b/tools/qmlscene/main.cpp @@ -156,6 +156,7 @@ struct Options , quitImmediately(false) , resizeViewToRootItem(false) , multisample(false) + , coreProfile(false) , verbose(false) , applicationType(DefaultQmlApplicationType) { @@ -176,6 +177,7 @@ struct Options bool quitImmediately; bool resizeViewToRootItem; bool multisample; + bool coreProfile; bool verbose; QVector<Qt::ApplicationAttribute> applicationAttributes; QString translationFile; @@ -359,6 +361,7 @@ static void usage() puts(" --fullscreen ..................... Run fullscreen"); puts(" --transparent .................... Make the window transparent"); puts(" --multisample .................... Enable multisampling (OpenGL anti-aliasing)"); + puts(" --core-profile ................... Request a core profile OpenGL context"); puts(" --no-version-detection ........... Do not try to detect the version of the .qml file"); puts(" --slow-animations ................ Run all animations in slow motion"); puts(" --resize-to-root ................. Resize the window to the size of the root item"); @@ -523,6 +526,8 @@ int main(int argc, char ** argv) options.resizeViewToRootItem = true; else if (lowerArgument == QLatin1String("--multisample")) options.multisample = true; + else if (lowerArgument == QLatin1String("--core-profile")) + options.coreProfile = true; else if (lowerArgument == QLatin1String("--verbose")) options.verbose = true; else if (lowerArgument == QLatin1String("-i") && i + 1 < size) @@ -641,6 +646,10 @@ int main(int argc, char ** argv) window->setColor(QColor(Qt::transparent)); window->setFlags(Qt::FramelessWindowHint); } + if (options.coreProfile) { + surfaceFormat.setVersion(4, 1); + surfaceFormat.setProfile(QSurfaceFormat::CoreProfile); + } window->setFormat(surfaceFormat); if (window->flags() == Qt::Window) // Fix window flags unless set by QML. |