From cc692bb58c8a39f06eb30c04cfcb61fa466d18ae Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Tue, 29 Sep 2020 16:31:53 +0200 Subject: Get rid of some #ifdef qt6 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit None of this code is even compiled in qt6. Change-Id: I5891cc9459320083ad3908fcbf646f3ba75b8a4d Reviewed-by: Tor Arne Vestbø Reviewed-by: Sona Kurazyan Reviewed-by: Thiago Macieira --- src/corelib/global/qtypeinfo.h | 2 +- src/corelib/thread/qthreadpool.cpp | 8 -------- src/dbus/qdbusmessage.cpp | 4 ---- src/dbus/qdbusmessage.h | 4 ---- src/gui/image/qimage.cpp | 8 -------- src/gui/image/qimage.h | 5 ----- src/gui/kernel/qplatformtheme.h | 5 ----- src/gui/painting/qcolor.cpp | 14 -------------- src/gui/painting/qcolor.h | 2 +- src/gui/text/qtextformat.h | 2 +- src/gui/text/qtextobject.h | 4 ---- 11 files changed, 3 insertions(+), 55 deletions(-) diff --git a/src/corelib/global/qtypeinfo.h b/src/corelib/global/qtypeinfo.h index c0617a41f2..b9159a2e1a 100644 --- a/src/corelib/global/qtypeinfo.h +++ b/src/corelib/global/qtypeinfo.h @@ -218,7 +218,7 @@ inline void swap(TYPE &value1, TYPE &value2) \ { value1.swap(value2); } #define Q_DECLARE_SHARED(TYPE) Q_DECLARE_SHARED_IMPL(TYPE, Q_MOVABLE_TYPE) #define Q_DECLARE_SHARED_NOT_MOVABLE_UNTIL_QT6(TYPE) \ - Q_DECLARE_SHARED_IMPL(TYPE, QT_VERSION >= QT_VERSION_CHECK(6,0,0) ? Q_MOVABLE_TYPE : Q_RELOCATABLE_TYPE) + Q_DECLARE_SHARED_IMPL(TYPE, Q_MOVABLE_TYPE) namespace QTypeTraits { diff --git a/src/corelib/thread/qthreadpool.cpp b/src/corelib/thread/qthreadpool.cpp index 1478cfcb19..1b417aa8be 100644 --- a/src/corelib/thread/qthreadpool.cpp +++ b/src/corelib/thread/qthreadpool.cpp @@ -769,19 +769,11 @@ void QThreadPool::clear() d->clear(); } -#if QT_VERSION < QT_VERSION_CHECK(6,0,0) -/*! - \internal - - Returns \c true if \a thread is a thread managed by this thread pool. -*/ -#else /*! \since 6.0 Returns \c true if \a thread is a thread managed by this thread pool. */ -#endif bool QThreadPool::contains(const QThread *thread) const { Q_D(const QThreadPool); diff --git a/src/dbus/qdbusmessage.cpp b/src/dbus/qdbusmessage.cpp index eb3ca3a909..1ae6ea9c0c 100644 --- a/src/dbus/qdbusmessage.cpp +++ b/src/dbus/qdbusmessage.cpp @@ -496,11 +496,7 @@ QDBusMessage QDBusMessage::createReply(const QVariantList &arguments) const Constructs a new DBus message representing an error reply message, with the given \a name and \a msg. */ -#if QT_VERSION >= QT_VERSION_CHECK(6,0,0) QDBusMessage QDBusMessage::createErrorReply(const QString &name, const QString &msg) const -#else -QDBusMessage QDBusMessage::createErrorReply(const QString name, const QString &msg) const -#endif { QDBusMessage reply = QDBusMessage::createError(name, msg); if (d_ptr->msg) diff --git a/src/dbus/qdbusmessage.h b/src/dbus/qdbusmessage.h index 17ca8cf06d..31ce8169a2 100644 --- a/src/dbus/qdbusmessage.h +++ b/src/dbus/qdbusmessage.h @@ -89,11 +89,7 @@ public: inline QDBusMessage createReply(const QVariant &argument) const { return createReply(QList() << argument); } -#if QT_VERSION >= QT_VERSION_CHECK(6,0,0) QDBusMessage createErrorReply(const QString &name, const QString &msg) const; -#else - QDBusMessage createErrorReply(const QString name, const QString &msg) const; -#endif inline QDBusMessage createErrorReply(const QDBusError &err) const { return createErrorReply(err.name(), err.message()); } QDBusMessage createErrorReply(QDBusError::ErrorType type, const QString &msg) const; diff --git a/src/gui/image/qimage.cpp b/src/gui/image/qimage.cpp index b00b7bc588..2a16b2b845 100644 --- a/src/gui/image/qimage.cpp +++ b/src/gui/image/qimage.cpp @@ -903,11 +903,7 @@ QImage::QImage(const uchar* data, int width, int height, Format format, QImageCl setColorCount() or setColorTable() before the image is used. */ -#if QT_VERSION >= QT_VERSION_CHECK(6,0,0) QImage::QImage(uchar *data, int width, int height, qsizetype bytesPerLine, Format format, QImageCleanupFunction cleanupFunction, void *cleanupInfo) -#else -QImage::QImage(uchar *data, int width, int height, int bytesPerLine, Format format, QImageCleanupFunction cleanupFunction, void *cleanupInfo) -#endif :QPaintDevice() { d = QImageData::create(data, width, height, bytesPerLine, format, false, cleanupFunction, cleanupInfo); @@ -938,11 +934,7 @@ QImage::QImage(uchar *data, int width, int height, int bytesPerLine, Format form data being changed. */ -#if QT_VERSION >= QT_VERSION_CHECK(6,0,0) QImage::QImage(const uchar *data, int width, int height, qsizetype bytesPerLine, Format format, QImageCleanupFunction cleanupFunction, void *cleanupInfo) -#else -QImage::QImage(const uchar *data, int width, int height, int bytesPerLine, Format format, QImageCleanupFunction cleanupFunction, void *cleanupInfo) -#endif :QPaintDevice() { d = QImageData::create(const_cast(data), width, height, bytesPerLine, format, true, cleanupFunction, cleanupInfo); diff --git a/src/gui/image/qimage.h b/src/gui/image/qimage.h index d95055e35d..89a696d5d6 100644 --- a/src/gui/image/qimage.h +++ b/src/gui/image/qimage.h @@ -115,13 +115,8 @@ public: QImage(int width, int height, Format format); QImage(uchar *data, int width, int height, Format format, QImageCleanupFunction cleanupFunction = nullptr, void *cleanupInfo = nullptr); QImage(const uchar *data, int width, int height, Format format, QImageCleanupFunction cleanupFunction = nullptr, void *cleanupInfo = nullptr); -#if QT_VERSION >= QT_VERSION_CHECK(6,0,0) QImage(uchar *data, int width, int height, qsizetype bytesPerLine, Format format, QImageCleanupFunction cleanupFunction = nullptr, void *cleanupInfo = nullptr); QImage(const uchar *data, int width, int height, qsizetype bytesPerLine, Format format, QImageCleanupFunction cleanupFunction = nullptr, void *cleanupInfo = nullptr); -#else - QImage(uchar *data, int width, int height, int bytesPerLine, Format format, QImageCleanupFunction cleanupFunction = nullptr, void *cleanupInfo = nullptr); - QImage(const uchar *data, int width, int height, int bytesPerLine, Format format, QImageCleanupFunction cleanupFunction = nullptr, void *cleanupInfo = nullptr); -#endif #ifndef QT_NO_IMAGEFORMAT_XPM explicit QImage(const char * const xpm[]); diff --git a/src/gui/kernel/qplatformtheme.h b/src/gui/kernel/qplatformtheme.h index 6ed612b785..d736948969 100644 --- a/src/gui/kernel/qplatformtheme.h +++ b/src/gui/kernel/qplatformtheme.h @@ -106,12 +106,7 @@ public: KeyboardScheme, UiEffects, SpellCheckUnderlineStyle, -#if QT_VERSION >= QT_VERSION_CHECK(6,0,0) TabFocusBehavior, -#else - TabAllWidgets, - TabFocusBehavior = TabAllWidgets, -#endif IconPixmapSizes, PasswordMaskCharacter, DialogSnapToDefaultButton, diff --git a/src/gui/painting/qcolor.cpp b/src/gui/painting/qcolor.cpp index 54a0fcf011..46f212fa7a 100644 --- a/src/gui/painting/qcolor.cpp +++ b/src/gui/painting/qcolor.cpp @@ -841,20 +841,6 @@ QColor::QColor(Spec spec) noexcept \sa setNamedColor(), name(), isValid() */ -#if QT_VERSION < QT_VERSION_CHECK(6,0,0) -/*! -\if !defined(qt6) - \fn QColor::QColor(const QColor &color) - - Constructs a color that is a copy of \a color. - - \sa isValid() -\else - \nothing -\endif -*/ -#endif - /*! \fn bool QColor::isValid() const diff --git a/src/gui/painting/qcolor.h b/src/gui/painting/qcolor.h index 03129e8241..1899457b67 100644 --- a/src/gui/painting/qcolor.h +++ b/src/gui/painting/qcolor.h @@ -297,7 +297,7 @@ public: // can't give friendship to a namespace, so it needs to be public : cspec(spec), ct(a1, a2, a3, a4, a5) {} #endif // Q_COMPILER_UNIFORM_INIT }; -Q_DECLARE_TYPEINFO(QColor, QT_VERSION >= QT_VERSION_CHECK(6,0,0) ? Q_MOVABLE_TYPE : Q_RELOCATABLE_TYPE); +Q_DECLARE_TYPEINFO(QColor, Q_MOVABLE_TYPE); inline QColor::QColor(QLatin1String aname) { setNamedColor(aname); } diff --git a/src/gui/text/qtextformat.h b/src/gui/text/qtextformat.h index 9d422786f0..71ad97a635 100644 --- a/src/gui/text/qtextformat.h +++ b/src/gui/text/qtextformat.h @@ -118,7 +118,7 @@ private: friend Q_GUI_EXPORT QDataStream &operator<<(QDataStream &, const QTextLength &); friend Q_GUI_EXPORT QDataStream &operator>>(QDataStream &, QTextLength &); }; -Q_DECLARE_TYPEINFO(QTextLength, QT_VERSION >= QT_VERSION_CHECK(6,0,0) ? Q_PRIMITIVE_TYPE : Q_RELOCATABLE_TYPE); +Q_DECLARE_TYPEINFO(QTextLength, Q_PRIMITIVE_TYPE); inline QTextLength::QTextLength(Type atype, qreal avalue) : lengthType(atype), fixedValueOrPercentage(avalue) {} diff --git a/src/gui/text/qtextobject.h b/src/gui/text/qtextobject.h index 1d4448029d..fbe3e7b9e4 100644 --- a/src/gui/text/qtextobject.h +++ b/src/gui/text/qtextobject.h @@ -250,10 +250,6 @@ public: iterator(const QTextDocumentPrivate *priv, int begin, int end, int f) : p(priv), b(begin), e(end), n(f) {} public: iterator() : p(nullptr), b(0), e(0), n(0) {} -#if QT_VERSION < QT_VERSION_CHECK(6,0,0) - iterator(const iterator &o) : p(o.p), b(o.b), e(o.e), n(o.n) {} - iterator &operator=(const iterator &o) = default; -#endif QTextFragment fragment() const; -- cgit v1.2.3