Details
-
Bug
-
Resolution: Unresolved
-
P3: Somewhat important
-
None
-
5.14.1
-
None
Description
If I build qtbase/tests/auto/corelib/tools/qcommandlineparser/testhelper and run it with no arguments, -h or --help-all I don't see a difference: just help about the specified options. I don't see help about Qt options like -geometry or -plugin for example.
QCommandLineParser::addHelpOption() returns a QCommandLineOption object, which I can check afterwards:
if (parser.isSet(helpOption))
parser.showHelp();
But is --help-all supposed to be a different option? How can I tell which help option the user chose? (Do I even need to?)
In my application, it doesn't seem like the statement in the docs that "These options are handled automatically by QCommandLineParser." is always true. qtbase/tests/auto/corelib/tools/qcommandlineparser/testhelper does not test the option object, but only tests whether any positional arguments were given; if none were given, it exits, but help is shown. But in my application, positional arguments are optional; so it seems to me that I need to check whether help was explicitly requested and decide for myself whether to show it or not. If I comment out those lines, my application ignores the help option and opens the window as usual, with no content loaded (as if no options were given). So I think showHelp() should show either the basic help or the extended help with all Qt options (which is not happening anyway). And to make the "handled automatically" statement true, it would have to exit if the user has used any of the help options. Maybe it's better to change the docs to recommend testing isSet(helpOption) instead?
Attachments
Issue Links
- relates to
-
QTBUG-97633 Make it possible to disable "--help-all" option if needed when using QCommandLineParser::addHelpOption()
- Reported
- resulted from
-
QTBUG-41802 Optionally show all options parsed in QGuiApplication/QApplication in QCommandLineParser
- Closed
- resulted in
-
QTBUG-100678 QML Runtime Tool help all option is not working
- Closed
-
QTBUG-97517 Qt Designer - Command line option "--help-all" has no effect
- Closed