diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/corelib/doc/src/cmake/cmake-configure-variables.qdoc | 2 | ||||
| -rw-r--r-- | src/corelib/doc/src/cmake/cmake-properties.qdoc | 2 | ||||
| -rw-r--r-- | src/corelib/doc/src/cmake/qt_deploy_translations.qdoc | 1 | ||||
| -rw-r--r-- | src/corelib/doc/src/cmake/qt_extract_metatypes.qdoc | 1 | ||||
| -rw-r--r-- | src/corelib/doc/src/cmake/qt_finalize_project.qdoc | 1 | ||||
| -rw-r--r-- | src/corelib/kernel/qmetacontainer.h | 7 | ||||
| -rw-r--r-- | src/corelib/kernel/qmetasequence.cpp | 33 | ||||
| -rw-r--r-- | src/plugins/styles/modernwindows/qwindows11style.cpp | 9 | ||||
| -rw-r--r-- | src/plugins/styles/modernwindows/qwindows11style_p.h | 1 | ||||
| -rw-r--r-- | src/testlib/qtestlog.cpp | 6 | ||||
| -rw-r--r-- | src/widgets/widgets/qtabbar.cpp | 66 | ||||
| -rw-r--r-- | src/widgets/widgets/qtabbar_p.h | 3 |
12 files changed, 63 insertions, 69 deletions
diff --git a/src/corelib/doc/src/cmake/cmake-configure-variables.qdoc b/src/corelib/doc/src/cmake/cmake-configure-variables.qdoc index b8e5e038a33..7cd3f91b901 100644 --- a/src/corelib/doc/src/cmake/cmake-configure-variables.qdoc +++ b/src/corelib/doc/src/cmake/cmake-configure-variables.qdoc @@ -525,7 +525,6 @@ To prevent this, set \c QT_NO_SET_XCODE_BUNDLE_IDENTIFIER to \c TRUE. \summary {Enables verbose mode of deployment tools.} \cmakevariablesince 6.3 -\preliminarycmakevariable Enables verbose mode of the \l androiddeployqt deployment tool when it is called internally at build time, usually during target finalization. @@ -545,7 +544,6 @@ must be set before the first \c{find_package(Qt6)} call to have that effect. \summary {Name of the file to include for setting up deployment support.} \cmakevariablesince 6.3 -\preliminarycmakevariable \note The value of this variable should never be modified by project code. This configure-phase variable is set by the Core package. It is intended to be diff --git a/src/corelib/doc/src/cmake/cmake-properties.qdoc b/src/corelib/doc/src/cmake/cmake-properties.qdoc index 821862494a2..c7b1a27a4b4 100644 --- a/src/corelib/doc/src/cmake/cmake-properties.qdoc +++ b/src/corelib/doc/src/cmake/cmake-properties.qdoc @@ -665,7 +665,6 @@ UTF-8 input). Use the \l QT_NO_CAST_FROM_ASCII and \summary {Specifies the default Qt resource prefix.} \cmakepropertysince 6.0 -\preliminarycmakeproperty When using \l{qt6_add_resources}{qt_add_resources} without a \c PREFIX argument, then the value of this target property will be used as @@ -773,7 +772,6 @@ CMake properties: \brief Sets the FOLDER property for Qt-internal targets. \cmakepropertysince 6.5 -\preliminarycmakeproperty Name of the \l FOLDER for internal targets that are added by Qt's CMake commands. diff --git a/src/corelib/doc/src/cmake/qt_deploy_translations.qdoc b/src/corelib/doc/src/cmake/qt_deploy_translations.qdoc index 43ff23a35a1..e6d3edbbdc4 100644 --- a/src/corelib/doc/src/cmake/qt_deploy_translations.qdoc +++ b/src/corelib/doc/src/cmake/qt_deploy_translations.qdoc @@ -17,7 +17,6 @@ can only be called from a deployment script. It cannot be called directly by the project during the configure stage. \cmakecommandsince 6.5 -\preliminarycmakecommand \note This command does not usually need to be called directly. It is used internally by other higher level commands, but projects wishing to implement more customized deployment logic may find it useful. diff --git a/src/corelib/doc/src/cmake/qt_extract_metatypes.qdoc b/src/corelib/doc/src/cmake/qt_extract_metatypes.qdoc index 7ec8d90f9b1..24112b1cf87 100644 --- a/src/corelib/doc/src/cmake/qt_extract_metatypes.qdoc +++ b/src/corelib/doc/src/cmake/qt_extract_metatypes.qdoc @@ -11,7 +11,6 @@ \summary {Extracts metatypes from a Qt target and generates an associated metatypes.json file.} \cmakecommandsince 6.0 -\preliminarycmakecommand \section1 Synopsis diff --git a/src/corelib/doc/src/cmake/qt_finalize_project.qdoc b/src/corelib/doc/src/cmake/qt_finalize_project.qdoc index 5506712691e..f60b850fcdb 100644 --- a/src/corelib/doc/src/cmake/qt_finalize_project.qdoc +++ b/src/corelib/doc/src/cmake/qt_finalize_project.qdoc @@ -9,7 +9,6 @@ \keyword qt6_finalize_project \summary {Handles various common platform-specific tasks associated with a Qt project.} -\preliminarycmakecommand \include cmake-find-package-core.qdocinc diff --git a/src/corelib/kernel/qmetacontainer.h b/src/corelib/kernel/qmetacontainer.h index 41d5a77bf8f..66047afefd4 100644 --- a/src/corelib/kernel/qmetacontainer.h +++ b/src/corelib/kernel/qmetacontainer.h @@ -976,13 +976,6 @@ public: void prepend(const QVariant &value); void removeLast(); void removeFirst(); - -#if QT_DEPRECATED_SINCE(6, 11) - enum Position: quint8 { Unspecified, AtBegin, AtEnd }; - void addValue(const QVariant &value, Position position = Unspecified); - void removeValue(Position position = Unspecified); - QMetaType valueMetaType() const; -#endif // QT_DEPRECATED_SINCE(6, 11) }; #else using Iterable = QtMetaContainerPrivate::Sequence; diff --git a/src/corelib/kernel/qmetasequence.cpp b/src/corelib/kernel/qmetasequence.cpp index 8760384260a..018dd610146 100644 --- a/src/corelib/kernel/qmetasequence.cpp +++ b/src/corelib/kernel/qmetasequence.cpp @@ -531,39 +531,6 @@ void QMetaSequence::valueAtConstIterator(const void *iterator, void *result) con */ /*! - \enum QMetaSequence::Iterable::Position - \deprecated [6.11] Use append(), prepend(), removeFirst(), or removeLast() - - Specifies the position at which an element shall be added to or removed from - the iterable. - - \value AtBegin - Add or remove at the beginning of the iterable. - \value AtEnd - Add or remove at the end of the iterable. - \value Unspecified - Add or remove at an unspecified position in the iterable. - */ - -/*! - \fn void QMetaSequence::Iterable::addValue(const QVariant &value, Position position) - \deprecated [6.11] Use append() or prepend() - Adds \a value to the container, at \a position, if possible. - */ - -/*! - \deprecated [6.11] Use removeFirst() or removeLast() - \fn void QMetaSequence::Iterable::removeValue(Position position) - Removes a value from the container, at \a position, if possible. - */ - -/*! - \deprecated [6.11] Use QMetaSequence::valueMetaType() - \fn QMetaType QMetaSequence::Iterable::valueMetaType() const - Returns the meta type for values stored in the underlying container. - */ - -/*! \fn QVariant QMetaSequence::Iterable::at(qsizetype idx) const Returns the value at position \a idx in the container. diff --git a/src/plugins/styles/modernwindows/qwindows11style.cpp b/src/plugins/styles/modernwindows/qwindows11style.cpp index e9b90d787bc..98e51397c17 100644 --- a/src/plugins/styles/modernwindows/qwindows11style.cpp +++ b/src/plugins/styles/modernwindows/qwindows11style.cpp @@ -2622,6 +2622,7 @@ void QWindows11Style::polish(QPalette& result) d->m_titleBarNormalIcon = QIcon(); d->m_toolbarExtensionButton = QIcon(); d->m_lineEditClearButton = QIcon(); + d->m_tabCloseButton = QIcon(); } QPixmap QWindows11Style::standardPixmap(StandardPixmap standardPixmap, @@ -2662,6 +2663,14 @@ QIcon QWindows11Style::standardIcon(StandardPixmap standardIcon, } return d->m_toolbarExtensionButton; } + case SP_TabCloseButton: { + if (d->m_tabCloseButton.isNull()) { + auto e = new WinFontIconEngine(fluentIcon(Icon::ChromeClose), d->assetFont); + e->setScale(0.6); + d->m_tabCloseButton = QIcon(e); + } + return d->m_tabCloseButton; + } default: break; } diff --git a/src/plugins/styles/modernwindows/qwindows11style_p.h b/src/plugins/styles/modernwindows/qwindows11style_p.h index 9d0cdda3e33..43a344a6ac9 100644 --- a/src/plugins/styles/modernwindows/qwindows11style_p.h +++ b/src/plugins/styles/modernwindows/qwindows11style_p.h @@ -125,6 +125,7 @@ class QWindows11StylePrivate : public QWindowsVistaStylePrivate { protected: QIcon m_toolbarExtensionButton; QIcon m_lineEditClearButton; + QIcon m_tabCloseButton; }; QT_END_NAMESPACE diff --git a/src/testlib/qtestlog.cpp b/src/testlib/qtestlog.cpp index 29cafe9aea4..f3db4ece49e 100644 --- a/src/testlib/qtestlog.cpp +++ b/src/testlib/qtestlog.cpp @@ -305,9 +305,7 @@ namespace QTest { { static QBasicAtomicInt counter = Q_BASIC_ATOMIC_INITIALIZER(QTest::maxWarnings); - auto loggerCapture = loggers->allLoggers(); - - if (loggerCapture.isEmpty()) { + if (loggers.isDestroyed() || loggers->allLoggers().isEmpty()) { // the message handler may be called from a worker thread, after the main thread stopped // logging. Forwarding to original message handler to avoid swallowing the message Q_ASSERT(oldMessageHandler); @@ -326,6 +324,8 @@ namespace QTest { return; } + auto loggerCapture = loggers->allLoggers(); + if (type != QtFatalMsg) { if (counter.loadRelaxed() <= 0) return; diff --git a/src/widgets/widgets/qtabbar.cpp b/src/widgets/widgets/qtabbar.cpp index 0f0abb6e1d5..44218d41ded 100644 --- a/src/widgets/widgets/qtabbar.cpp +++ b/src/widgets/widgets/qtabbar.cpp @@ -52,6 +52,14 @@ public: void enterEvent(QEnterEvent *event) override; void leaveEvent(QEvent *event) override; void paintEvent(QPaintEvent *event) override; + + void setParentClipRect(const QRect &clipRect) + { + m_parentClipRect = clipRect; + } + +protected: + QRect m_parentClipRect; }; } @@ -598,10 +606,11 @@ QRect QTabBarPrivate::normalizedScrollRect(int index) q->initStyleOption(&opt, currentIndex); opt.rect = q->rect(); - QRect scrollButtonLeftRect = q->style()->subElementRect(QStyle::SE_TabBarScrollLeftButton, &opt, q); - QRect scrollButtonRightRect = q->style()->subElementRect(QStyle::SE_TabBarScrollRightButton, &opt, q); - QRect tearLeftRect = q->style()->subElementRect(QStyle::SE_TabBarTearIndicatorLeft, &opt, q); - QRect tearRightRect = q->style()->subElementRect(QStyle::SE_TabBarTearIndicatorRight, &opt, q); + const auto style = q->style(); + QRect scrollButtonLeftRect = style->subElementRect(QStyle::SE_TabBarScrollLeftButton, &opt, q); + QRect scrollButtonRightRect = style->subElementRect(QStyle::SE_TabBarScrollRightButton, &opt, q); + QRect tearLeftRect = style->subElementRect(QStyle::SE_TabBarTearIndicatorLeft, &opt, q); + QRect tearRightRect = style->subElementRect(QStyle::SE_TabBarTearIndicatorRight, &opt, q); if (verticalTabs(shape)) { int topEdge, bottomEdge; @@ -739,7 +748,7 @@ void QTabBarPrivate::layoutTab(int index) if (tab->leftWidget) { QRect rect = q->style()->subElementRect(QStyle::SE_TabBarTabLeftButton, &opt, q); QPoint p = rect.topLeft(); - if ((index == pressedIndex) || paintWithOffsets) { + if (index == pressedIndex) { if (vertical) p.setY(p.y() + tab->dragOffset); else @@ -750,7 +759,7 @@ void QTabBarPrivate::layoutTab(int index) if (tab->rightWidget) { QRect rect = q->style()->subElementRect(QStyle::SE_TabBarTabRightButton, &opt, q); QPoint p = rect.topLeft(); - if ((index == pressedIndex) || paintWithOffsets) { + if (index == pressedIndex) { if (vertical) p.setY(p.y() + tab->dragOffset); else @@ -1004,8 +1013,13 @@ int QTabBar::insertTab(int index, const QIcon& icon, const QString &text) } if (isVisible() && tabAt(d->mousePosition) == index) { - d->hoverIndex = index; - d->hoverRect = tabRect(index); + if (d->normalizedScrollRect(index).contains(d->mousePosition)) { + d->hoverIndex = index; + d->hoverRect = tabRect(index); + } else { + d->hoverIndex = -1; + d->hoverRect = QRect(); + } } tabInserted(index); @@ -1096,11 +1110,13 @@ void QTabBar::removeTab(int index) if (d->hoverRect.isValid()) { update(d->hoverRect); d->hoverIndex = tabAt(d->mousePosition); - if (d->validIndex(d->hoverIndex)) { + if (d->validIndex(d->hoverIndex) + && d->normalizedScrollRect(d->hoverIndex).contains(d->mousePosition)) { d->hoverRect = tabRect(d->hoverIndex); update(d->hoverRect); } else { d->hoverRect = QRect(); + d->hoverIndex = -1; } } tabRemoved(index); @@ -1692,15 +1708,18 @@ bool QTabBar::event(QEvent *event) case QEvent::HoverEnter: { QHoverEvent *he = static_cast<QHoverEvent *>(event); d->mousePosition = he->position().toPoint(); - if (!d->hoverRect.contains(d->mousePosition)) { + const auto sr = d->normalizedScrollRect(); + const auto oldHoverRect = d->hoverRect & sr; + if (!oldHoverRect.contains(d->mousePosition)) { if (d->hoverRect.isValid()) update(d->hoverRect); d->hoverIndex = tabAt(d->mousePosition); - if (d->validIndex(d->hoverIndex)) { + if (d->validIndex(d->hoverIndex) && sr.contains(d->mousePosition)) { d->hoverRect = tabRect(d->hoverIndex); update(d->hoverRect); } else { d->hoverRect = QRect(); + d->hoverIndex = -1; } } return true; @@ -1845,10 +1864,14 @@ void QTabBar::paintEvent(QPaintEvent *) QStyleOption opt; opt.initFrom(this); QRegion buttonRegion; - if (d->leftB->isVisible()) - buttonRegion |= style()->subElementRect(QStyle::SE_TabBarScrollLeftButton, &opt, this); - if (d->rightB->isVisible()) - buttonRegion |= style()->subElementRect(QStyle::SE_TabBarScrollRightButton, &opt, this); + if (d->leftB->isVisible()) { + const auto r = style()->subElementRect(QStyle::SE_TabBarScrollLeftButton, &opt, this); + buttonRegion |= r; + } + if (d->rightB->isVisible()) { + const auto r = style()->subElementRect(QStyle::SE_TabBarScrollRightButton, &opt, this); + buttonRegion |= r; + } if (!buttonRegion.isEmpty()) p.setClipRegion(QRegion(rect()) - buttonRegion); } @@ -1857,9 +1880,13 @@ void QTabBar::paintEvent(QPaintEvent *) const auto tab = d->tabList.at(i); if (!tab->visible) continue; + for (const auto side : { QTabBar::LeftSide, QTabBar::RightSide }) { + if (auto closeButton = qobject_cast<CloseButton *>(tabButton(i, side))) + closeButton->setParentClipRect(scrollRect); + } QStyleOptionTab tabOption; initStyleOption(&tabOption, i); - if (d->paintWithOffsets && tab->dragOffset != 0) { + if (tab->dragOffset != 0) { if (vertical) { tabOption.rect.moveTop(tabOption.rect.y() + tab->dragOffset); } else { @@ -1901,7 +1928,7 @@ void QTabBar::paintEvent(QPaintEvent *) const auto tab = d->tabList.at(selected); initStyleOption(&tabOption, selected); - if (d->paintWithOffsets && tab->dragOffset != 0) { + if (tab->dragOffset != 0) { // if the drag offset is != 0, a move is in progress (drag or animation) // => set the tab position to Moving to preserve the rect tabOption.position = QStyleOptionTab::TabPosition::Moving; @@ -2934,6 +2961,11 @@ void CloseButton::paintEvent(QPaintEvent *) opt.state |= QStyle::State_Selected; } + if (m_parentClipRect.isValid()) { + auto tl = mapFromParent(m_parentClipRect.topLeft()); + auto br = mapFromParent(m_parentClipRect.bottomRight()); + p.setClipRect(QRect(tl, br)); + } style()->drawPrimitive(QStyle::PE_IndicatorTabClose, &opt, &p, this); } diff --git a/src/widgets/widgets/qtabbar_p.h b/src/widgets/widgets/qtabbar_p.h index 38fbde76470..5b31926253f 100644 --- a/src/widgets/widgets/qtabbar_p.h +++ b/src/widgets/widgets/qtabbar_p.h @@ -56,7 +56,7 @@ public: QTabBarPrivate() : layoutDirty(false), drawBase(true), elideModeSetByUser(false), useScrollButtons(false), useScrollButtonsSetByUser(false), expanding(true), closeButtonOnTabs(false), - paintWithOffsets(true), movable(false), dragInProgress(false), documentMode(false), + movable(false), dragInProgress(false), documentMode(false), autoHide(false), changeCurrentOnDrag(false) {} ~QTabBarPrivate() @@ -95,7 +95,6 @@ public: bool useScrollButtonsSetByUser : 1; bool expanding : 1; bool closeButtonOnTabs : 1; - bool paintWithOffsets : 1; bool movable : 1; bool dragInProgress : 1; bool documentMode : 1; |
