summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorLaszlo Agocs <laszlo.agocs@qt.io>2018-03-23 14:00:59 +0100
committerLaszlo Agocs <laszlo.agocs@qt.io>2018-03-26 14:40:00 +0000
commit918df14006b9b3865d117cd4d4f0308e9ddfa9a2 (patch)
tree8855426d2430861c04ab4c745c51342a11dab3b3 /tools
parent0b57dfd682312114c79d2a97a29616e2d772bcc7 (diff)
Reverse the profiling option logic
Make it enabled by default. -p or File->Open withOUT profiling can now be used to open a presentation without profiling (i.e. without Qt 3D QObject tracking). In practice the expectation is likely that the viewer is able to bring up the Qt 3D Object List view by default, when launched from the editor app. For applications the feature remains opt-in (in fact ther is no way to enable profiling from Q3DSWidget, Studio3D, etc. atm). Change-Id: I002909ce77d403c954862962d6b7043f2014b277 Reviewed-by: Andy Nichols <andy.nichols@qt.io>
Diffstat (limited to 'tools')
-rw-r--r--tools/q3dsviewer/main.cpp6
-rw-r--r--tools/q3dsviewer/q3dsmainwindow.cpp6
-rw-r--r--tools/qt3dsexplorer/main.cpp6
3 files changed, 9 insertions, 9 deletions
diff --git a/tools/q3dsviewer/main.cpp b/tools/q3dsviewer/main.cpp
index f5d626a..1b0af05 100644
--- a/tools/q3dsviewer/main.cpp
+++ b/tools/q3dsviewer/main.cpp
@@ -50,8 +50,8 @@ int main(int argc, char *argv[])
cmdLineParser.addOption(fullScreenOption);
QCommandLineOption msaaOption({ "m", "multisample" }, QObject::tr("Forces 4x MSAA"));
cmdLineParser.addOption(msaaOption);
- QCommandLineOption profOption({ "p", "profile" }, QObject::tr("Opens presentation with profiling enabled"));
- cmdLineParser.addOption(profOption);
+ QCommandLineOption noProfOption({ "p", "no-profile" }, QObject::tr("Opens presentation without profiling enabled"));
+ cmdLineParser.addOption(noProfOption);
cmdLineParser.process(app);
#if !defined(Q_OS_ANDROID) && !defined(Q_OS_IOS)
@@ -90,7 +90,7 @@ int main(int argc, char *argv[])
Q3DSEngine::Flags flags = 0;
if (cmdLineParser.isSet(msaaOption))
flags |= Q3DSEngine::Force4xMSAA;
- if (cmdLineParser.isSet(profOption))
+ if (!cmdLineParser.isSet(noProfOption))
flags |= Q3DSEngine::EnableProfiling;
QScopedPointer<Q3DSEngine> engine(new Q3DSEngine);
diff --git a/tools/q3dsviewer/q3dsmainwindow.cpp b/tools/q3dsviewer/q3dsmainwindow.cpp
index e4aeddf..99333a8 100644
--- a/tools/q3dsviewer/q3dsmainwindow.cpp
+++ b/tools/q3dsviewer/q3dsmainwindow.cpp
@@ -63,11 +63,11 @@ Q3DStudioMainWindow::Q3DStudioMainWindow(Q3DSWindow *view, QWidget *parent)
view->engine()->setSource(fn);
};
fileMenu->addAction(tr("&Open..."), this, [=] {
- view->engine()->setFlag(Q3DSEngine::EnableProfiling, false);
+ view->engine()->setFlag(Q3DSEngine::EnableProfiling, true);
open();
} , QKeySequence::Open);
- fileMenu->addAction(tr("Open with &profiling..."), this, [=] {
- view->engine()->setFlag(Q3DSEngine::EnableProfiling, true);
+ fileMenu->addAction(tr("Open without &profiling..."), this, [=] {
+ view->engine()->setFlag(Q3DSEngine::EnableProfiling, false);
open();
});
fileMenu->addAction(tr("&Reload"), this, [=] {
diff --git a/tools/qt3dsexplorer/main.cpp b/tools/qt3dsexplorer/main.cpp
index 77d7a72..e90ecda 100644
--- a/tools/qt3dsexplorer/main.cpp
+++ b/tools/qt3dsexplorer/main.cpp
@@ -45,8 +45,8 @@ int main(int argc, char *argv[])
cmdLineParser.addPositionalArgument(QLatin1String("filename"), QObject::tr("UIP or UIA file to open"));
QCommandLineOption msaaOption({ "m", "multisample" }, QObject::tr("Force 4x MSAA"));
cmdLineParser.addOption(msaaOption);
- QCommandLineOption profOption({ "p", "profile" }, QObject::tr("Open scene with profiling enabled"));
- cmdLineParser.addOption(profOption);
+ QCommandLineOption noProfOption({ "p", "no-profile" }, QObject::tr("Opens presentation without profiling enabled"));
+ cmdLineParser.addOption(noProfOption);
cmdLineParser.process(app);
QStringList fn = cmdLineParser.positionalArguments();
@@ -65,7 +65,7 @@ int main(int argc, char *argv[])
Q3DSEngine::Flags flags = 0;
if (cmdLineParser.isSet(msaaOption))
flags |= Q3DSEngine::Force4xMSAA;
- if (cmdLineParser.isSet(profOption))
+ if (!cmdLineParser.isSet(noProfOption))
flags |= Q3DSEngine::EnableProfiling;
QScopedPointer<Q3DSEngine> engine(new Q3DSEngine);