Cant get QCommandLineParser to ... parse
Solved
General and Desktop
-
Hey
I'm lost heres my code +/-
QCommandLineParser parser; parser.setApplicationDescription("test App"); parser.addHelpOption(); parser.addVersionOption(); parser.setSingleDashWordOptionMode(QCommandLineParser::ParseAsLongOptions); QCommandLineOption argTEst(QStringList() << "lala" << "ohDearNuggets", "testStuff"); parser.addOption(argTEst); parser.process(app); if (parser.isSet(argTEst)) { qDebug()<< parser.value(argTEst); } qDebug() << parser.optionNames() << parser.positionalArguments();
This always print empty, I can see a valid argument in optionNames()/positionalArguments... But it never return the value when asked...
I start app via
app.exe -lala tralalalal
What am I doing wrong here...
-
See the documentation: "In addition, the valueName needs to be set if the option expects a value. "
-
This post is deleted!
-
See the documentation: "In addition, the valueName needs to be set if the option expects a value. "