diff options
-rw-r--r-- | src/corelib/global/qglobal.h | 5 | ||||
-rw-r--r-- | src/widgets/graphicsview/qgraphicsscene.h | 6 | ||||
-rw-r--r-- | src/widgets/kernel/qlayout.h | 4 | ||||
-rw-r--r-- | src/xml/sax/qxml.h | 6 |
4 files changed, 10 insertions, 11 deletions
diff --git a/src/corelib/global/qglobal.h b/src/corelib/global/qglobal.h index 7764707de0..aa9446221b 100644 --- a/src/corelib/global/qglobal.h +++ b/src/corelib/global/qglobal.h @@ -88,6 +88,11 @@ #if QT_VERSION >= QT_VERSION_CHECK(6,0,0) # define QT_NO_UNSHARABLE_CONTAINERS +# define QT6_VIRTUAL virtual +# define QT6_NOT_VIRTUAL +#else +# define QT6_VIRTUAL +# define QT6_NOT_VIRTUAL virtual #endif /* These two macros makes it possible to turn the builtin line expander into a diff --git a/src/widgets/graphicsview/qgraphicsscene.h b/src/widgets/graphicsview/qgraphicsscene.h index 5ecd2baab8..8efbcd273e 100644 --- a/src/widgets/graphicsview/qgraphicsscene.h +++ b/src/widgets/graphicsview/qgraphicsscene.h @@ -288,11 +288,7 @@ protected: QWidget *widget = nullptr); protected Q_SLOTS: - // ### Qt 6: make unconditional -#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) - virtual -#endif - bool focusNextPrevChild(bool next); + QT6_VIRTUAL bool focusNextPrevChild(bool next); Q_SIGNALS: void changed(const QList<QRectF> ®ion); diff --git a/src/widgets/kernel/qlayout.h b/src/widgets/kernel/qlayout.h index abadf2e69d..bcc33a0811 100644 --- a/src/widgets/kernel/qlayout.h +++ b/src/widgets/kernel/qlayout.h @@ -126,8 +126,8 @@ public: bool isEmpty() const override; QSizePolicy::ControlTypes controlTypes() const override; - // ### Qt 6 make this function virtual - QLayoutItem *replaceWidget(QWidget *from, QWidget *to, Qt::FindChildOptions options = Qt::FindChildrenRecursively); + QT6_VIRTUAL QLayoutItem *replaceWidget(QWidget *from, QWidget *to, + Qt::FindChildOptions options = Qt::FindChildrenRecursively); int totalHeightForWidth(int w) const; QSize totalMinimumSize() const; diff --git a/src/xml/sax/qxml.h b/src/xml/sax/qxml.h index 7c5b5fe204..94dc8dfb8e 100644 --- a/src/xml/sax/qxml.h +++ b/src/xml/sax/qxml.h @@ -122,10 +122,8 @@ public: QXmlAttributes &operator=(const QXmlAttributes &) = default; QXmlAttributes &operator=(QXmlAttributes &&) Q_DECL_NOTHROW = default; #endif // default members -#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) - virtual // ### Qt 6: this value class don't need no virtual dtor -#endif - ~QXmlAttributes(); + + QT6_NOT_VIRTUAL ~QXmlAttributes(); void swap(QXmlAttributes &other) Q_DECL_NOTHROW { |