From 4f116f00fcd93decbf6fc01b61b0be7c293d3c39 Mon Sep 17 00:00:00 2001 From: Ville Voutilainen Date: Mon, 5 Aug 2019 15:24:16 +0300 Subject: Fix GCC 4.8 build Change-Id: I4994146b359e8e37f6c0fa1b27f03fb9e800fdd5 Fixes: QTBUG-77218 Reviewed-by: Simon Hausmann --- src/widgets/styles/qstyleoption.h | 46 +++++++++++++++++++-------------------- 1 file changed, 23 insertions(+), 23 deletions(-) (limited to 'src/widgets') diff --git a/src/widgets/styles/qstyleoption.h b/src/widgets/styles/qstyleoption.h index 763575ff5b..7f5edf4279 100644 --- a/src/widgets/styles/qstyleoption.h +++ b/src/widgets/styles/qstyleoption.h @@ -118,7 +118,7 @@ public: QStyleOptionFocusRect(); QStyleOptionFocusRect(const QStyleOptionFocusRect &other) : QStyleOption(Version, Type) { *this = other; } - QStyleOptionFocusRect &operator=(const QStyleOptionFocusRect &other) = default; + QStyleOptionFocusRect &operator=(const QStyleOptionFocusRect &) = default; protected: QStyleOptionFocusRect(int version); @@ -143,7 +143,7 @@ public: QStyleOptionFrame(); QStyleOptionFrame(const QStyleOptionFrame &other) : QStyleOption(Version, Type) { *this = other; } - QStyleOptionFrame &operator=(const QStyleOptionFrame &other) = default; + QStyleOptionFrame &operator=(const QStyleOptionFrame &) = default; protected: QStyleOptionFrame(int version); @@ -173,7 +173,7 @@ public: QStyleOptionTabWidgetFrame(); inline QStyleOptionTabWidgetFrame(const QStyleOptionTabWidgetFrame &other) : QStyleOption(Version, Type) { *this = other; } - QStyleOptionTabWidgetFrame &operator=(const QStyleOptionTabWidgetFrame &other) = default; + QStyleOptionTabWidgetFrame &operator=(const QStyleOptionTabWidgetFrame &) = default; protected: QStyleOptionTabWidgetFrame(int version); @@ -197,7 +197,7 @@ public: QStyleOptionTabBarBase(); QStyleOptionTabBarBase(const QStyleOptionTabBarBase &other) : QStyleOption(Version, Type) { *this = other; } - QStyleOptionTabBarBase &operator=(const QStyleOptionTabBarBase &other) = default; + QStyleOptionTabBarBase &operator=(const QStyleOptionTabBarBase &) = default; protected: QStyleOptionTabBarBase(int version); @@ -229,7 +229,7 @@ public: QStyleOptionHeader(); QStyleOptionHeader(const QStyleOptionHeader &other) : QStyleOption(Version, Type) { *this = other; } - QStyleOptionHeader &operator=(const QStyleOptionHeader &other) = default; + QStyleOptionHeader &operator=(const QStyleOptionHeader &) = default; protected: QStyleOptionHeader(int version); @@ -252,7 +252,7 @@ public: QStyleOptionButton(); QStyleOptionButton(const QStyleOptionButton &other) : QStyleOption(Version, Type) { *this = other; } - QStyleOptionButton &operator=(const QStyleOptionButton &other) = default; + QStyleOptionButton &operator=(const QStyleOptionButton &) = default; protected: QStyleOptionButton(int version); @@ -290,7 +290,7 @@ public: QStyleOptionTab(); QStyleOptionTab(const QStyleOptionTab &other) : QStyleOption(Version, Type) { *this = other; } - QStyleOptionTab &operator=(const QStyleOptionTab &other) = default; + QStyleOptionTab &operator=(const QStyleOptionTab &) = default; protected: QStyleOptionTab(int version); @@ -321,7 +321,7 @@ public: int midLineWidth; QStyleOptionToolBar(); QStyleOptionToolBar(const QStyleOptionToolBar &other) : QStyleOption(Version, Type) { *this = other; } - QStyleOptionToolBar &operator=(const QStyleOptionToolBar &other) = default; + QStyleOptionToolBar &operator=(const QStyleOptionToolBar &) = default; protected: QStyleOptionToolBar(int version); @@ -349,7 +349,7 @@ public: QStyleOptionProgressBar(); QStyleOptionProgressBar(const QStyleOptionProgressBar &other) : QStyleOption(Version, Type) { *this = other; } - QStyleOptionProgressBar &operator=(const QStyleOptionProgressBar &other) = default; + QStyleOptionProgressBar &operator=(const QStyleOptionProgressBar &) = default; protected: QStyleOptionProgressBar(int version); @@ -380,7 +380,7 @@ public: QStyleOptionMenuItem(); QStyleOptionMenuItem(const QStyleOptionMenuItem &other) : QStyleOption(Version, Type) { *this = other; } - QStyleOptionMenuItem &operator=(const QStyleOptionMenuItem &other) = default; + QStyleOptionMenuItem &operator=(const QStyleOptionMenuItem &) = default; protected: QStyleOptionMenuItem(int version); @@ -400,7 +400,7 @@ public: QStyleOptionDockWidget(); QStyleOptionDockWidget(const QStyleOptionDockWidget &other) : QStyleOption(Version, Type) { *this = other; } - QStyleOptionDockWidget &operator=(const QStyleOptionDockWidget &other) = default; + QStyleOptionDockWidget &operator=(const QStyleOptionDockWidget &) = default; protected: QStyleOptionDockWidget(int version); @@ -452,7 +452,7 @@ public: QStyleOptionViewItem(); QStyleOptionViewItem(const QStyleOptionViewItem &other) : QStyleOption(Version, Type) { *this = other; } - QStyleOptionViewItem &operator=(const QStyleOptionViewItem &other) = default; + QStyleOptionViewItem &operator=(const QStyleOptionViewItem &) = default; protected: QStyleOptionViewItem(int version); @@ -483,7 +483,7 @@ public: QStyleOptionToolBox(); QStyleOptionToolBox(const QStyleOptionToolBox &other) : QStyleOption(Version, Type) { *this = other; } - QStyleOptionToolBox &operator=(const QStyleOptionToolBox &other) = default; + QStyleOptionToolBox &operator=(const QStyleOptionToolBox &) = default; protected: QStyleOptionToolBox(int version); @@ -503,7 +503,7 @@ public: QStyleOptionRubberBand(); QStyleOptionRubberBand(const QStyleOptionRubberBand &other) : QStyleOption(Version, Type) { *this = other; } - QStyleOptionRubberBand &operator=(const QStyleOptionRubberBand &other) = default; + QStyleOptionRubberBand &operator=(const QStyleOptionRubberBand &) = default; protected: QStyleOptionRubberBand(int version); @@ -522,7 +522,7 @@ public: QStyleOptionComplex(int version = QStyleOptionComplex::Version, int type = SO_Complex); QStyleOptionComplex(const QStyleOptionComplex &other) : QStyleOption(Version, Type) { *this = other; } - QStyleOptionComplex &operator=(const QStyleOptionComplex &other) = default; + QStyleOptionComplex &operator=(const QStyleOptionComplex &) = default; }; #if QT_CONFIG(slider) @@ -547,7 +547,7 @@ public: QStyleOptionSlider(); QStyleOptionSlider(const QStyleOptionSlider &other) : QStyleOptionComplex(Version, Type) { *this = other; } - QStyleOptionSlider &operator=(const QStyleOptionSlider &other) = default; + QStyleOptionSlider &operator=(const QStyleOptionSlider &) = default; protected: QStyleOptionSlider(int version); @@ -567,7 +567,7 @@ public: QStyleOptionSpinBox(); QStyleOptionSpinBox(const QStyleOptionSpinBox &other) : QStyleOptionComplex(Version, Type) { *this = other; } - QStyleOptionSpinBox &operator=(const QStyleOptionSpinBox &other) = default; + QStyleOptionSpinBox &operator=(const QStyleOptionSpinBox &) = default; protected: QStyleOptionSpinBox(int version); @@ -595,7 +595,7 @@ public: QStyleOptionToolButton(); QStyleOptionToolButton(const QStyleOptionToolButton &other) : QStyleOptionComplex(Version, Type) { *this = other; } - QStyleOptionToolButton &operator=(const QStyleOptionToolButton &other) = default; + QStyleOptionToolButton &operator=(const QStyleOptionToolButton &) = default; protected: QStyleOptionToolButton(int version); @@ -618,7 +618,7 @@ public: QStyleOptionComboBox(); QStyleOptionComboBox(const QStyleOptionComboBox &other) : QStyleOptionComplex(Version, Type) { *this = other; } - QStyleOptionComboBox &operator=(const QStyleOptionComboBox &other) = default; + QStyleOptionComboBox &operator=(const QStyleOptionComboBox &) = default; protected: QStyleOptionComboBox(int version); @@ -637,7 +637,7 @@ public: QStyleOptionTitleBar(); QStyleOptionTitleBar(const QStyleOptionTitleBar &other) : QStyleOptionComplex(Version, Type) { *this = other; } - QStyleOptionTitleBar &operator=(const QStyleOptionTitleBar &other) = default; + QStyleOptionTitleBar &operator=(const QStyleOptionTitleBar &) = default; protected: QStyleOptionTitleBar(int version); @@ -658,7 +658,7 @@ public: QStyleOptionGroupBox(); QStyleOptionGroupBox(const QStyleOptionGroupBox &other) : QStyleOptionComplex(Version, Type) { *this = other; } - QStyleOptionGroupBox &operator=(const QStyleOptionGroupBox &other) = default; + QStyleOptionGroupBox &operator=(const QStyleOptionGroupBox &) = default; protected: QStyleOptionGroupBox(int version); }; @@ -673,7 +673,7 @@ public: QStyleOptionSizeGrip(); QStyleOptionSizeGrip(const QStyleOptionSizeGrip &other) : QStyleOptionComplex(Version, Type) { *this = other; } - QStyleOptionSizeGrip &operator=(const QStyleOptionSizeGrip &other) = default; + QStyleOptionSizeGrip &operator=(const QStyleOptionSizeGrip &) = default; protected: QStyleOptionSizeGrip(int version); }; @@ -690,7 +690,7 @@ public: QStyleOptionGraphicsItem(); QStyleOptionGraphicsItem(const QStyleOptionGraphicsItem &other) : QStyleOption(Version, Type) { *this = other; } - QStyleOptionGraphicsItem &operator=(const QStyleOptionGraphicsItem &other) = default; + QStyleOptionGraphicsItem &operator=(const QStyleOptionGraphicsItem &) = default; static qreal levelOfDetailFromTransform(const QTransform &worldTransform); protected: QStyleOptionGraphicsItem(int version); -- cgit v1.2.3 From fccb519809d8e64db0e9cc54852c8612fe59b6c7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Arne=20Vestb=C3=B8?= Date: Tue, 6 Aug 2019 17:48:15 +0200 Subject: Don't rely on QWidget::internalWinId in QWidgetBackingStore QWidget does not handle QWindow and QPlatformWindow being destroyed behind its back, and the QWidget state for internalWinId and the Qt::WA_WState_Created attribute can easily get out of sync with reality. To avoid QWidgetBackingStore mistakenly thinking that a widget does not have a platform window it can operate on we use the QWindow and QPlatformWindow handles directly, instead of relying on the winId. This is a stop gap until we can teach QWidget to deal with dynamic changes to its underlying window handles. Change-Id: Ib09bea2ad62c42e9667a20ca6b5faf0f957288da Fixes: QTBUG-74559 Reviewed-by: Lars Knoll --- src/widgets/kernel/qwidgetbackingstore.cpp | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) (limited to 'src/widgets') diff --git a/src/widgets/kernel/qwidgetbackingstore.cpp b/src/widgets/kernel/qwidgetbackingstore.cpp index a32eb2a03b..24b8665013 100644 --- a/src/widgets/kernel/qwidgetbackingstore.cpp +++ b/src/widgets/kernel/qwidgetbackingstore.cpp @@ -76,6 +76,11 @@ extern QRegion qt_dirtyRegion(QWidget *); Q_GLOBAL_STATIC(QPlatformTextureList, qt_dummy_platformTextureList) #endif +static bool hasPlatformWindow(QWidget *widget) +{ + return widget && widget->windowHandle() && widget->windowHandle()->handle(); +} + /** * Flushes the contents of the \a backingStore into the screen area of \a widget. * \a region is the region to be updated in \a widget coordinates. @@ -198,7 +203,7 @@ void QWidgetBackingStore::showYellowThing(QWidget *widget, const QRegion &toBePa QRegion paintRegion = toBePainted; QRect widgetRect = widget->rect(); - if (!widget->internalWinId()) { + if (!hasPlatformWindow(widget)) { QWidget *nativeParent = widget->nativeParentWidget(); const QPoint offset = widget->mapTo(nativeParent, QPoint(0, 0)); paintRegion.translate(offset); @@ -715,7 +720,7 @@ void QWidgetBackingStore::markDirtyOnScreen(const QRegion ®ion, QWidget *widg } // Alien widgets. - if (!widget->internalWinId() && !widget->isWindow()) { + if (!hasPlatformWindow(widget) && !widget->isWindow()) { QWidget *nativeParent = widget->nativeParentWidget(); // Alien widgets with the top-level as the native parent (common case). if (nativeParent == tlw) { if (!widget->testAttribute(Qt::WA_WState_InPaintEvent)) @@ -845,7 +850,7 @@ void QWidgetPrivate::moveRect(const QRect &rect, int dx, int dy) destRect = destRect.translated(dx, dy).intersected(clipR); const QRect sourceRect(destRect.translated(-dx, -dy)); const QRect parentRect(rect & clipR); - const bool nativeWithTextureChild = textureChildSeen && q->internalWinId(); + const bool nativeWithTextureChild = textureChildSeen && hasPlatformWindow(q); const bool accelerateMove = accelEnv && isOpaque && !nativeWithTextureChild #if QT_CONFIG(graphicsview) @@ -1013,9 +1018,9 @@ static void findTextureWidgetsRecursively(QWidget *tlw, QWidget *widget, QPlatfo for (int i = 0; i < wd->children.size(); ++i) { QWidget *w = qobject_cast(wd->children.at(i)); // Stop at native widgets but store them. Stop at hidden widgets too. - if (w && !w->isWindow() && w->internalWinId()) + if (w && !w->isWindow() && hasPlatformWindow(w)) nativeChildren->append(w); - if (w && !w->isWindow() && !w->internalWinId() && !w->isHidden() && QWidgetPrivate::get(w)->textureChildSeen) + if (w && !w->isWindow() && !hasPlatformWindow(w) && !w->isHidden() && QWidgetPrivate::get(w)->textureChildSeen) findTextureWidgetsRecursively(tlw, w, widgetTextures, nativeChildren); } } @@ -1046,7 +1051,7 @@ static QPlatformTextureList *widgetTexturesFor(QWidget *tlw, QWidget *widget) Q_ASSERT(!tl->isEmpty()); for (int i = 0; i < tl->count(); ++i) { QWidget *w = static_cast(tl->source(i)); - if ((w->internalWinId() && w == widget) || (!w->internalWinId() && w->nativeParentWidget() == widget)) + if ((hasPlatformWindow(w) && w == widget) || (!hasPlatformWindow(w) && w->nativeParentWidget() == widget)) return tl; } } @@ -1157,7 +1162,8 @@ void QWidgetBackingStore::sync(QWidget *exposedWidget, const QRegion &exposedReg if (!tlw->isVisible() || !tlwExtra || tlwExtra->inTopLevelResize) return; - if (!exposedWidget || !exposedWidget->internalWinId() || !exposedWidget->isVisible() || !exposedWidget->testAttribute(Qt::WA_Mapped) + if (!exposedWidget || !hasPlatformWindow(exposedWidget) + || !exposedWidget->isVisible() || !exposedWidget->testAttribute(Qt::WA_Mapped) || !exposedWidget->updatesEnabled() || exposedRegion.isEmpty()) { return; } @@ -1330,8 +1336,8 @@ void QWidgetBackingStore::doSync() w->d_func()->sendPaintEvent(w->rect()); if (w != tlw) { QWidget *npw = w->nativeParentWidget(); - if (w->internalWinId() || (npw && npw != tlw)) { - if (!w->internalWinId()) + if (hasPlatformWindow(w) || (npw && npw != tlw)) { + if (!hasPlatformWindow(w)) w = npw; QWidgetPrivate *wPrivate = w->d_func(); if (!wPrivate->needsFlush) -- cgit v1.2.3 From 9bcbba36c73b8d03e8e58898629259489a24e040 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Morten=20Johan=20S=C3=B8rvig?= Date: Wed, 12 Jun 2019 15:29:31 +0200 Subject: QWizard: Account for missing background image on macOS 10.14+ MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit We were loading “Background.png” from the KeyboardSetupAssistant app bundle. As of macOS 10.14 that image is no longer there. Adjust auto tests and document the behavior. Change-Id: Icb4dd73b3fa88927e87bb86db2bc9f7b4a8094f7 Reviewed-by: Tor Arne Vestbø --- src/widgets/dialogs/qwizard.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/widgets') diff --git a/src/widgets/dialogs/qwizard.cpp b/src/widgets/dialogs/qwizard.cpp index 21e1ff2778..f19a4e99af 100644 --- a/src/widgets/dialogs/qwizard.cpp +++ b/src/widgets/dialogs/qwizard.cpp @@ -2890,7 +2890,7 @@ void QWizard::setPixmap(WizardPixmap which, const QPixmap &pixmap) Returns the pixmap set for role \a which. By default, the only pixmap that is set is the BackgroundPixmap on - \macos. + \macos version 10.13 and earlier. \sa QWizardPage::pixmap(), {Elements of a Wizard Page} */ -- cgit v1.2.3 From fb703aea697b12de4810deec9f8605fd062208bd Mon Sep 17 00:00:00 2001 From: Alessandro Portale Date: Tue, 23 Jul 2019 14:47:07 +0200 Subject: Docs: Fix the snippet lookup for QFileDialog::getOpenFileContent MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit src_gui_dialogs_qfiledialog.cpp had two snippets labeled "14". This change bumps one of them to "15" and fixes the the snippet lookup for QFileDialog::getOpenFileContent accordingly. Also, fix two typos: "QSting" -> "QString" and "contents has" -> "contents have". Change-Id: Ic018c23b6ca585f30c116b8a6eb29293560c7a35 Reviewed-by: Morten Johan Sørvig --- src/widgets/dialogs/qfiledialog.cpp | 4 ++-- src/widgets/doc/snippets/code/src_gui_dialogs_qfiledialog.cpp | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) (limited to 'src/widgets') diff --git a/src/widgets/dialogs/qfiledialog.cpp b/src/widgets/dialogs/qfiledialog.cpp index f772eb1241..2c2d209226 100644 --- a/src/widgets/dialogs/qfiledialog.cpp +++ b/src/widgets/dialogs/qfiledialog.cpp @@ -2376,10 +2376,10 @@ QList QFileDialog::getOpenFileUrls(QWidget *parent, It can also be used on other platforms, where it will fall back to using QFileDialog. The function is asynchronous and returns immediately. The \a fileOpenCompleted - callback will be called when a file has been selected and its contents has been + callback will be called when a file has been selected and its contents have been read into memory. - \snippet code/src_gui_dialogs_qfiledialog.cpp 14 + \snippet code/src_gui_dialogs_qfiledialog.cpp 15 \since 5.13 */ void QFileDialog::getOpenFileContent(const QString &nameFilter, const std::function &fileOpenCompleted) diff --git a/src/widgets/doc/snippets/code/src_gui_dialogs_qfiledialog.cpp b/src/widgets/doc/snippets/code/src_gui_dialogs_qfiledialog.cpp index 1e9daf824b..39aca459db 100644 --- a/src/widgets/doc/snippets/code/src_gui_dialogs_qfiledialog.cpp +++ b/src/widgets/doc/snippets/code/src_gui_dialogs_qfiledialog.cpp @@ -145,8 +145,8 @@ dialog.exec(); "Images (*.png *.xpm *.jpg);;Text files (*.txt);;XML files (*.xml)" //! [14] -//! [14] -auto fileOpenCompleted = [](const QSting &fileName, const QByteArray &fileContent) { +//! [15] +auto fileOpenCompleted = [](const QString &fileName, const QByteArray &fileContent) { if (fileName.isEmpty()) { // No file was selected } else { @@ -154,4 +154,4 @@ auto fileOpenCompleted = [](const QSting &fileName, const QByteArray &fileConten } } QFileDialog::getOpenFileContent("Images (*.png *.xpm *.jpg)", fileContentReady); -//! [14] +//! [15] -- cgit v1.2.3