diff options
Diffstat (limited to 'src/widgets/kernel/qwidget.cpp')
-rw-r--r-- | src/widgets/kernel/qwidget.cpp | 44 |
1 files changed, 11 insertions, 33 deletions
diff --git a/src/widgets/kernel/qwidget.cpp b/src/widgets/kernel/qwidget.cpp index 55326e2ef9..ecf73ee777 100644 --- a/src/widgets/kernel/qwidget.cpp +++ b/src/widgets/kernel/qwidget.cpp @@ -3069,11 +3069,13 @@ void QWidgetPrivate::setEnabled_helper(bool enable) qt_x11_enforce_cursor(q); } #endif +#ifndef QT_NO_CURSOR if (q->testAttribute(Qt::WA_SetCursor) || q->isWindow()) { // enforce the windows behavior of clearing the cursor on // disabled widgets qt_qpa_set_cursor(q, false); } +#endif #if defined(Q_WS_MAC) setEnabled_helper_sys(enable); #endif @@ -5472,18 +5474,6 @@ void QWidget::unsetLocale() d->resolveLocale(); } -static QString constructWindowTitleFromFilePath(const QString &filePath) -{ - QFileInfo fi(filePath); - QString windowTitle = fi.fileName() + QLatin1String("[*]"); -#ifndef Q_WS_MAC - QString appName = QApplication::applicationName(); - if (!appName.isEmpty()) - windowTitle += QLatin1Char(' ') + QChar(0x2014) + QLatin1Char(' ') + appName; -#endif - return windowTitle; -} - /*! \property QWidget::windowTitle \brief the window title (caption) @@ -5500,6 +5490,11 @@ static QString constructWindowTitleFromFilePath(const QString &filePath) windowModified property is false (the default), the placeholder is simply removed. + On some desktop platforms (including Windows and Unix), the application name + (from QGuiApplication::applicationDisplayName) is added at the end of the + window title, if set. This is done by the QPA plugin, so it is shown to the + user, but isn't part of the \l windowTitle string. + \sa windowIcon, windowIconText, windowModified, windowFilePath */ QString QWidget::windowTitle() const @@ -5509,7 +5504,7 @@ QString QWidget::windowTitle() const if (!d->extra->topextra->caption.isEmpty()) return d->extra->topextra->caption; if (!d->extra->topextra->filePath.isEmpty()) - return constructWindowTitleFromFilePath(d->extra->topextra->filePath); + return QFileInfo(d->extra->topextra->filePath).fileName() + QLatin1String("[*]"); } return QString(); } @@ -5681,24 +5676,8 @@ QString QWidget::windowIconText() const This property only makes sense for windows. It associates a file path with a window. If you set the file path, but have not set the window title, Qt - sets the window title to contain a string created using the following - components. - - On Mac OS X: - - \list - \li The file name of the specified path, obtained using QFileInfo::fileName(). - \endlist - - On Windows and X11: - - \list - \li The file name of the specified path, obtained using QFileInfo::fileName(). - \li An optional \c{*} character, if the \l windowModified property is set. - \li The \c{0x2014} unicode character, padded either side by spaces. - \li The application name, obtained from the application's - \l{QCoreApplication::}{applicationName} property. - \endlist + sets the window title to the file name of the specified path, obtained using + QFileInfo::fileName(). 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. @@ -10264,6 +10243,7 @@ void QWidget::setWindowOpacity(qreal opacity) QTLWExtra *extra = d->topData(); extra->opacity = uint(opacity * 255); setAttribute(Qt::WA_WState_WindowOpacitySet); + d->setWindowOpacity_sys(opacity); if (!testAttribute(Qt::WA_WState_Created)) return; @@ -10278,8 +10258,6 @@ void QWidget::setWindowOpacity(qreal opacity) return; } #endif - - d->setWindowOpacity_sys(opacity); } /*! |