Bug report #3714
Qt arguments are not supported
|Affected QGIS version:||master||Regression?:||No|
|Operating System:||Easy fix?:||No|
|Pull Request or Patch supplied:||Yes||Resolution:||end of life|
|Crashes QGIS or corrupts data:||No||Copied to github as #:||13773|
QApplication is able to parse some useful command line arguments such as -style, -stylesheet, -session or -graphicssystem, but QGIS does not support them because it parses arguments before Qt has a chance to check (and remove) them. Instead it complains about invalid arguments.
(Additionally it would be good to unify handling of arguments for unix and windows.)
#5 Updated by Médéric RIBREUX almost 5 years ago
- % Done changed from 0 to 50
- Status changed from Open to Feedback
- Assignee deleted (
- Pull Request or Patch supplied set to No
Hello, bug triage...
something has been done on this bug because I am able to launch QGIS 2.13 master with the
-reverse QApplication argument. With this option, QGIS menus and panels are oriented from right to left (or inverse). So it seems that QApplication arguments are used by QGIS application.
But with this option, QGIS still complains about the fact that the layer
~/-reverse is not valid !
We need a better QApplication argument detection (and management)...
#6 Updated by Sebastian Dietrich almost 5 years ago
- instantiate a dummy QCoreApplication object
- parse the arguments
- instantiate the actual QgsApplication object
-reverseargument, it is:
- ignored by QCoreApplication
- evaluated by QGIS, leading to the mentioned complaint
- accepted by QgsApplication via inheritance of QApplication
thus leading to a complaint and the expected behaviour.
See PR 2491 for a possible solution.
#8 Updated by Sebastian Dietrich almost 5 years ago
Looking at the Qt sources it appears there is no simple solution for
-reverse and other Qt options. QApplication always parses all arguments, eating up all it can handle.
--help and other QGIS options see PR 2496, introducing '--' as an additional option to mark all following arguments as files.
#11 Updated by Martin Dobias over 4 years ago
Thanks for the work, Sebastian!
I think my preference would be to defer solving this to QGIS 3 for two reasons:
- Qt5 comes with nice and shiny QCommandLineParser class to do parsing for us
- bootstrapping of QGIS is already quite complicated. I would like to simplify it, see https://github.com/qgis/qgis3.0_api/issues/9
#16 Updated by Giovanni Manghi over 1 year ago
- Status changed from Open to Closed
- Resolution set to end of life
End of life notice: QGIS 2.18 LTR