summaryrefslogtreecommitdiff
path: root/src/tools/qml2puppet
diff options
context:
space:
mode:
authorTim Jenssen <tim.jenssen@qt.io>2023-01-19 14:45:07 +0100
committerTim Jenssen <tim.jenssen@qt.io>2023-01-19 13:56:11 +0000
commit2e87ee5865180a60d7a689e8e7bd369f2c7a1687 (patch)
treedd3038d24485278adb9df9055b41981a257b02e6 /src/tools/qml2puppet
parentb826acd53edd37a10e218c8d9d30a28cca12bc9d (diff)
downloadqt-creator-2e87ee5865180a60d7a689e8e7bd369f2c7a1687.tar.gz
qmlpuppet: better error when Qt is too old
Change-Id: I219f2f8ce551e36d2f749d60a6984c3ccc903e5c Reviewed-by: Burak Hancerli <burak.hancerli@qt.io> Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
Diffstat (limited to 'src/tools/qml2puppet')
-rw-r--r--src/tools/qml2puppet/qml2puppet/qmlbase.h19
1 files changed, 13 insertions, 6 deletions
diff --git a/src/tools/qml2puppet/qml2puppet/qmlbase.h b/src/tools/qml2puppet/qml2puppet/qmlbase.h
index 63a64f0147..5fb67267a9 100644
--- a/src/tools/qml2puppet/qml2puppet/qmlbase.h
+++ b/src/tools/qml2puppet/qml2puppet/qmlbase.h
@@ -41,10 +41,12 @@ public:
, m_args({argc, argv})
{
m_argParser.setApplicationDescription("QML Runtime Provider for QDS");
- m_argParser.addOptions({{"qml-puppet", "Run QML Puppet (default)"},
- {"qml-runtime", "Run QML Runtime"},
- {"appinfo", "Print build information"},
- {"test", "Run test mode"}});
+ m_argParser.addOption({"qml-puppet", "Run QML Puppet (default)"});
+#ifdef ENABLE_INTERNAL_QML_RUNTIME
+ m_argParser.addOption({"qml-runtime", "Run QML Runtime"});
+#endif
+ m_argParser.addOption({"appinfo", "Print build information"});
+ m_argParser.addOption({"test", "Run test mode"});
}
int run()
@@ -94,8 +96,13 @@ private:
QCommandLineOption optVers = m_argParser.addVersionOption();
if (!m_argParser.parse(m_coreApp->arguments())) {
- std::cout << "Error: " << m_argParser.errorText().toStdString() << std::endl
- << std::endl;
+ std::cout << "Error: " << m_argParser.errorText().toStdString() << std::endl;
+ if (m_argParser.errorText().contains("qml-runtime")) {
+ std::cout << "Note: --qml-runtime is only availabe when Qt is 6.4.x or higher"
+ << std::endl;
+ }
+ std::cout << std::endl;
+
m_argParser.showHelp(1);
} else if (m_argParser.isSet(optVers)) {
m_argParser.showVersion();