Qt removes certain arguments, such as title and icon, from argv before our QCommandLineParser gets a chance to parse them.
BUG: 373677
dfaure |
Qt removes certain arguments, such as title and icon, from argv before our QCommandLineParser gets a chance to parse them.
BUG: 373677
kdialog --passivepopup "Hello" --title "Test" --icon "dialog-warning"
kdialog --sorry "I'm very sorry" --title "Test"
(kdialog crashes in ~KIconLoader when I pass --icon to --sorry but that also happens without this patch)
(What branch should this go in?)
Automatic diff as part of commit; lint not applicable. |
Automatic diff as part of commit; unit tests not applicable. |
Hm, if '--title' is stripped from arguments due to Qt processing it, is there a way to get the result of that processing? Otherwise, if Qt just silently removes the option, I would consider it a Qt bug that should get fixed.
It's not *just* "silently removed", Qt uses --title to set the title of the first main window...
(see git grep firstWindowTitle in qtbase).
Arguably the Qt bug is the if (type() == Qt::Window) {...} in qwindow.cpp:518, maybe it should test for Qt::Dialog too, but that makes more sense for kdialog than for other apps where the first msg box would steal the user-specified title that was meant for the actual mainwindow...
So, no Qt bug I'd say. At most a missing feature NoBuiltinArgumentHandling.
The comment in this patch could say ".. and applies them to the first Qt::Window, while here we show only dialogs".
There is additional encoding complication with argv on Windows which probably make this patch wrong on non-latin1 Windows systems, but I don't know the details, other than the fact that Qt uses win32 API rather than argv.