Details
-
Bug
-
Resolution: Unresolved
-
P3: Somewhat important
-
None
-
5.6.0
-
None
-
Debian GNU/Linux sid amd64
Description
Consider this code:
int main(int argc, char **argv) { QApplication app(argc, argv); QWidget widget; widget.show(); widget.setWindowFilePath(QStringLiteral("/my/file")); widget.setWindowTitle(QString()); widget.setWindowFilePath(QStringLiteral("/my/file")); return app.exec(); }
When executed, the window title is the app name (i.e. “test”).
However if the first setWindowFilePath call is commented out, it shows “file”. Also if the file names are different, it also shows the file name.
This is a bit inconsistent.
The documentation says: “If the window title is set at any point, then the window title takes precedence and will be shown instead of the file path string”. However, setting window title to a null string is unsetting it (or otherwise what else would be a way to unset it)?
Removing these lines from QWidget::setWindowFilePath implementation should fix it:
if (filePath == windowFilePath()) return;
I am not sure whether this should be done or the current behavior is expected.