aboutsummaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorGunnar Sletta <gunnar.sletta@digia.com>2012-12-10 11:46:56 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2012-12-11 12:19:53 +0100
commitf96f0083402ef0210192406aaa943b1b5297a584 (patch)
tree5b58bf825e35c6e707c40bf1ac52ff03dac99b20 /tools
parent5b9d3cb1db1a22d9ae249afd565a80dbd56c42ba (diff)
Add command-line option to enable multisampling
Change-Id: I9ec8961342c23ea2c116c970e84aa412365412a9 Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
Diffstat (limited to 'tools')
-rw-r--r--tools/qmlscene/main.cpp12
1 files changed, 9 insertions, 3 deletions
diff --git a/tools/qmlscene/main.cpp b/tools/qmlscene/main.cpp
index 87a577b44e..a90870aa0b 100644
--- a/tools/qmlscene/main.cpp
+++ b/tools/qmlscene/main.cpp
@@ -152,6 +152,7 @@ struct Options
, slowAnimations(false)
, quitImmediately(false)
, resizeViewToRootItem(false)
+ , multisample(false)
{
}
@@ -167,6 +168,7 @@ struct Options
bool slowAnimations;
bool quitImmediately;
bool resizeViewToRootItem;
+ bool multisample;
QString translationFile;
};
@@ -349,7 +351,7 @@ static void usage()
qWarning(" --maximized ............................... run maximized");
qWarning(" --fullscreen .............................. run fullscreen");
qWarning(" --transparent ............................. Make the window transparent");
- qWarning(" --no-multisample .......................... Disable multisampling (anti-aliasing)");
+ qWarning(" --multisample ............................. Enable multisampling (OpenGL anti-aliasing)");
qWarning(" --no-version-detection .................... Do not try to detect the version of the .qml file");
qWarning(" --slow-animations ......................... Run all animations in slow motion");
qWarning(" --resize-to-root .......................... Resize the window to the size of the root item");
@@ -391,6 +393,8 @@ int main(int argc, char ** argv)
options.translationFile = QLatin1String(argv[++i]);
else if (lowerArgument == QLatin1String("--resize-to-root"))
options.resizeViewToRootItem = true;
+ else if (lowerArgument == QLatin1String("--multisample"))
+ options.multisample = true;
else if (lowerArgument == QLatin1String("-i") && i + 1 < argc)
imports.append(QString::fromLatin1(argv[++i]));
else if (lowerArgument == QLatin1String("-b") && i + 2 < argc) {
@@ -497,14 +501,16 @@ int main(int argc, char ** argv)
}
if (window) {
+ QSurfaceFormat surfaceFormat;
+ if (options.multisample)
+ surfaceFormat.setSamples(16);
if (options.transparent) {
- QSurfaceFormat surfaceFormat;
surfaceFormat.setAlphaBufferSize(8);
- window->setFormat(surfaceFormat);
window->setClearBeforeRendering(true);
window->setColor(QColor(Qt::transparent));
window->setFlags(Qt::FramelessWindowHint);
}
+ window->setFormat(surfaceFormat);
if (options.fullscreen)
window->showFullScreen();