path: root/src/tools
diff options
authorJoerg Bornemann <>2016-03-30 18:20:40 +0200
committerJoerg Bornemann <>2016-03-31 08:57:39 +0000
commit479ee4fa461e3c9bd71480d8e7a0bcabced52919 (patch)
tree6d608371899ed9aafe0280bc2b5ca79ae200bad8 /src/tools
parenta4e2f2e687ca7aec88ecf82f72d42ac61e17a5b9 (diff)
moc: bail out early on missing or invalid options file
If moc is invoked with the @ argument and no options file is specified or the options file cannot be read, do not try to parse the empty arguments list. Otherwise QCommandLineParser will print an additional error message that is of no value for the user. Task-number: QTBUG-51847 Change-Id: I9aa1eb20a44097b553123be8bc6fded87473a03a Reviewed-by: Olivier Goffart (Woboq GmbH) <>
Diffstat (limited to 'src/tools')
1 files changed, 2 insertions, 0 deletions
diff --git a/src/tools/moc/main.cpp b/src/tools/moc/main.cpp
index a5cbad7668..18fbc977ab 100644
--- a/src/tools/moc/main.cpp
+++ b/src/tools/moc/main.cpp
@@ -282,6 +282,8 @@ int runMoc(int argc, char **argv)
QStringLiteral("Read additional options from option-file."));
const QStringList arguments = argumentsFromCommandLineAndFile(app.arguments());
+ if (arguments.isEmpty())
+ return 1;