From 9a189a096f134e80e0c11523db14c8580275b4ad Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Fri, 24 Jul 2020 11:45:50 +0200 Subject: Remove non-Qt6 compile time switches from QtCore We already manage to compile without this code, and none of it are full classes or separate functions suitable for qt5compat. Change-Id: I47facac7ec621cfc4b0b26214b7de37897443519 Reviewed-by: Friedemann Kleint --- src/corelib/global/qglobal.cpp | 5 ---- src/corelib/global/qoperatingsystemversion.h | 2 +- src/corelib/global/qsystemdetection.h | 4 +-- src/corelib/io/qfilesystemwatcher_win.cpp | 8 ----- src/corelib/kernel/qabstracteventdispatcher.cpp | 4 --- src/corelib/kernel/qabstracteventdispatcher.h | 6 +--- src/corelib/kernel/qabstractnativeeventfilter.h | 4 --- src/corelib/kernel/qcoreapplication_win.cpp | 22 -------------- src/corelib/kernel/qeventdispatcher_win.cpp | 4 --- src/corelib/kernel/qobject.h | 5 ---- src/corelib/plugin/qfactoryloader.cpp | 16 ---------- src/corelib/plugin/qlibrary.cpp | 7 ----- src/corelib/plugin/qplugin.h | 39 ------------------------- src/corelib/plugin/qpluginloader.cpp | 6 ---- src/corelib/serialization/qtextstream.cpp | 35 ---------------------- src/corelib/serialization/qxmlstream.h | 12 -------- src/corelib/text/qlocale.cpp | 24 --------------- src/corelib/text/qlocale.h | 12 -------- src/corelib/text/qstring.h | 18 ------------ src/corelib/text/qstringlist.cpp | 33 --------------------- src/corelib/text/qstringlist.h | 12 -------- src/corelib/tools/qshareddata.h | 6 +--- 22 files changed, 4 insertions(+), 280 deletions(-) (limited to 'src') diff --git a/src/corelib/global/qglobal.cpp b/src/corelib/global/qglobal.cpp index 5724ecd627..5655f77d3c 100644 --- a/src/corelib/global/qglobal.cpp +++ b/src/corelib/global/qglobal.cpp @@ -2621,12 +2621,7 @@ QString QSysInfo::productType() #elif defined(Q_OS_WATCHOS) return QStringLiteral("watchos"); #elif defined(Q_OS_MACOS) - // ### Qt6: remove fallback -# if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) return QStringLiteral("macos"); -# else - return QStringLiteral("osx"); -# endif #elif defined(Q_OS_DARWIN) return QStringLiteral("darwin"); diff --git a/src/corelib/global/qoperatingsystemversion.h b/src/corelib/global/qoperatingsystemversion.h index f22878de89..60243dd898 100644 --- a/src/corelib/global/qoperatingsystemversion.h +++ b/src/corelib/global/qoperatingsystemversion.h @@ -145,7 +145,7 @@ private: static int compare(const QOperatingSystemVersion &v1, const QOperatingSystemVersion &v2); }; -Q_DECLARE_TYPEINFO(QOperatingSystemVersion, QT_VERSION < QT_VERSION_CHECK(6, 0, 0) ? Q_RELOCATABLE_TYPE : Q_PRIMITIVE_TYPE); +Q_DECLARE_TYPEINFO(QOperatingSystemVersion, Q_PRIMITIVE_TYPE); #ifndef QT_NO_DEBUG_STREAM class QDebug; diff --git a/src/corelib/global/qsystemdetection.h b/src/corelib/global/qsystemdetection.h index 2afd84bcd3..11b3d8fbf0 100644 --- a/src/corelib/global/qsystemdetection.h +++ b/src/corelib/global/qsystemdetection.h @@ -173,12 +173,10 @@ #if defined(Q_OS_WIN32) || defined(Q_OS_WIN64) # define Q_OS_WINDOWS # define Q_OS_WIN -# if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) // On Windows, pointers to dllimport'ed variables are not constant expressions, // so to keep to certain initializations (like QMetaObject) constexpr, we need // to use functions instead. -# define QT_NO_DATA_RELOCATION -# endif +# define QT_NO_DATA_RELOCATION #endif #if defined(Q_OS_WIN) diff --git a/src/corelib/io/qfilesystemwatcher_win.cpp b/src/corelib/io/qfilesystemwatcher_win.cpp index 9544dd7a04..482360658f 100644 --- a/src/corelib/io/qfilesystemwatcher_win.cpp +++ b/src/corelib/io/qfilesystemwatcher_win.cpp @@ -107,11 +107,7 @@ public: // Call from QFileSystemWatcher::addPaths() to set up notifications on drives void addPath(const QString &path); -#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) bool nativeEventFilter(const QByteArray &, void *messageIn, qintptr *) override; -#else - bool nativeEventFilter(const QByteArray &, void *messageIn, long *) override; -#endif signals: void driveAdded(); @@ -258,11 +254,7 @@ inline void QWindowsRemovableDriveListener::handleDbtDriveArrivalRemoval(const M } } -#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) bool QWindowsRemovableDriveListener::nativeEventFilter(const QByteArray &, void *messageIn, qintptr *) -#else -bool QWindowsRemovableDriveListener::nativeEventFilter(const QByteArray &, void *messageIn, long *) -#endif { const MSG *msg = reinterpret_cast(messageIn); if (msg->message == WM_DEVICECHANGE) { diff --git a/src/corelib/kernel/qabstracteventdispatcher.cpp b/src/corelib/kernel/qabstracteventdispatcher.cpp index b2bc199c8c..e77e8d3865 100644 --- a/src/corelib/kernel/qabstracteventdispatcher.cpp +++ b/src/corelib/kernel/qabstracteventdispatcher.cpp @@ -477,11 +477,7 @@ void QAbstractEventDispatcher::removeNativeEventFilter(QAbstractNativeEventFilte \sa installNativeEventFilter(), QAbstractNativeEventFilter::nativeEventFilter() \since 5.0 */ -#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) bool QAbstractEventDispatcher::filterNativeEvent(const QByteArray &eventType, void *message, qintptr *result) -#else -bool QAbstractEventDispatcher::filterNativeEvent(const QByteArray &eventType, void *message, long *result) -#endif { Q_D(QAbstractEventDispatcher); if (!d->eventFilters.isEmpty()) { diff --git a/src/corelib/kernel/qabstracteventdispatcher.h b/src/corelib/kernel/qabstracteventdispatcher.h index 1268b2e04e..e3bc94a762 100644 --- a/src/corelib/kernel/qabstracteventdispatcher.h +++ b/src/corelib/kernel/qabstracteventdispatcher.h @@ -104,11 +104,7 @@ public: void installNativeEventFilter(QAbstractNativeEventFilter *filterObj); void removeNativeEventFilter(QAbstractNativeEventFilter *filterObj); -#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) bool filterNativeEvent(const QByteArray &eventType, void *message, qintptr *result); -#else - bool filterNativeEvent(const QByteArray &eventType, void *message, long *result); -#endif Q_SIGNALS: void aboutToBlock(); @@ -119,7 +115,7 @@ protected: QObject *parent); }; -Q_DECLARE_TYPEINFO(QAbstractEventDispatcher::TimerInfo, (QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) ? Q_PRIMITIVE_TYPE : Q_RELOCATABLE_TYPE)); +Q_DECLARE_TYPEINFO(QAbstractEventDispatcher::TimerInfo, Q_PRIMITIVE_TYPE); QT_END_NAMESPACE diff --git a/src/corelib/kernel/qabstractnativeeventfilter.h b/src/corelib/kernel/qabstractnativeeventfilter.h index a468bffd61..b9a8863bb5 100644 --- a/src/corelib/kernel/qabstractnativeeventfilter.h +++ b/src/corelib/kernel/qabstractnativeeventfilter.h @@ -52,11 +52,7 @@ public: QAbstractNativeEventFilter(); virtual ~QAbstractNativeEventFilter(); -#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) virtual bool nativeEventFilter(const QByteArray &eventType, void *message, qintptr *result) = 0; -#else - virtual bool nativeEventFilter(const QByteArray &eventType, void *message, long *result) = 0; -#endif private: Q_DISABLE_COPY(QAbstractNativeEventFilter) diff --git a/src/corelib/kernel/qcoreapplication_win.cpp b/src/corelib/kernel/qcoreapplication_win.cpp index 524dd5b25b..b3b3e6c4da 100644 --- a/src/corelib/kernel/qcoreapplication_win.cpp +++ b/src/corelib/kernel/qcoreapplication_win.cpp @@ -120,28 +120,6 @@ QString QCoreApplicationPrivate::appVersion() const return applicationVersion; } -#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) -Q_CORE_EXPORT HINSTANCE qWinAppInst() // get Windows app handle -{ - return GetModuleHandle(0); -} - -Q_CORE_EXPORT HINSTANCE qWinAppPrevInst() // get Windows prev app handle -{ - return 0; -} - -Q_CORE_EXPORT int qWinAppCmdShow() // get main window show command -{ - STARTUPINFO startupInfo; - GetStartupInfo(&startupInfo); - - return (startupInfo.dwFlags & STARTF_USESHOWWINDOW) - ? startupInfo.wShowWindow - : SW_SHOWDEFAULT; -} -#endif - #ifndef QT_NO_QOBJECT #if defined(Q_OS_WIN) && !defined(QT_NO_DEBUG_STREAM) diff --git a/src/corelib/kernel/qeventdispatcher_win.cpp b/src/corelib/kernel/qeventdispatcher_win.cpp index 43872fd027..743df3844c 100644 --- a/src/corelib/kernel/qeventdispatcher_win.cpp +++ b/src/corelib/kernel/qeventdispatcher_win.cpp @@ -150,11 +150,7 @@ LRESULT QT_WIN_CALLBACK qt_internal_proc(HWND hwnd, UINT message, WPARAM wp, LPA msg.wParam = wp; msg.lParam = lp; QAbstractEventDispatcher* dispatcher = QAbstractEventDispatcher::instance(); -#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) qintptr result; -#else - long result; -#endif if (!dispatcher) { if (message == WM_TIMER) KillTimer(hwnd, wp); diff --git a/src/corelib/kernel/qobject.h b/src/corelib/kernel/qobject.h index ea635ce6f1..46ed2fc6f3 100644 --- a/src/corelib/kernel/qobject.h +++ b/src/corelib/kernel/qobject.h @@ -368,11 +368,6 @@ public: } #endif //Q_CLANG_QDOC - -#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) - void dumpObjectTree(); // ### Qt 6: remove - void dumpObjectInfo(); // ### Qt 6: remove -#endif void dumpObjectTree() const; void dumpObjectInfo() const; diff --git a/src/corelib/plugin/qfactoryloader.cpp b/src/corelib/plugin/qfactoryloader.cpp index edadf7180a..259673b7d0 100644 --- a/src/corelib/plugin/qfactoryloader.cpp +++ b/src/corelib/plugin/qfactoryloader.cpp @@ -133,22 +133,6 @@ QJsonDocument qJsonFromRawLibraryMetaData(const char *raw, qsizetype sectionSize raw += metaDataSignatureLength(); sectionSize -= metaDataSignatureLength(); -#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) - if (Q_UNLIKELY(raw[-1] == ' ')) { - // the size of the embedded JSON object can be found 8 bytes into the data (see qjson_p.h) - uint size = qFromLittleEndian(raw + 8); - // but the maximum size of binary JSON is 128 MB - size = qMin(size, 128U * 1024 * 1024); - // and it doesn't include the size of the header (8 bytes) - size += 8; - // finally, it can't be bigger than the file or section size - size = qMin(sectionSize, qsizetype(size)); - - QByteArray json(raw, size); - return QJsonDocument::fromBinaryData(json); - } -#endif - return jsonFromCborMetaData(raw, sectionSize, errMsg); } QT_WARNING_POP diff --git a/src/corelib/plugin/qlibrary.cpp b/src/corelib/plugin/qlibrary.cpp index 9ea8e2793c..cd9f9e2546 100644 --- a/src/corelib/plugin/qlibrary.cpp +++ b/src/corelib/plugin/qlibrary.cpp @@ -714,17 +714,10 @@ bool QLibrary::isLibrary(const QString &fileName) static bool qt_get_metadata(QLibraryPrivate *priv, QString *errMsg) { -#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) - auto getMetaData = [](QFunctionPointer fptr) { - auto f = reinterpret_cast(fptr); - return qMakePair(f(), INT_MAX); - }; -#else auto getMetaData = [](QFunctionPointer fptr) { auto f = reinterpret_cast(fptr); return f(); }; -#endif QFunctionPointer pfn = priv->resolve("qt_plugin_query_metadata"); if (!pfn) diff --git a/src/corelib/plugin/qplugin.h b/src/corelib/plugin/qplugin.h index 1b121f35e9..c03eb57f1d 100644 --- a/src/corelib/plugin/qplugin.h +++ b/src/corelib/plugin/qplugin.h @@ -72,21 +72,16 @@ inline constexpr unsigned char qPluginArchRequirements() } typedef QObject *(*QtPluginInstanceFunction)(); -#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) -typedef const char *(*QtPluginMetaDataFunction)(); -#else struct QPluginMetaData { const uchar *data; size_t size; }; typedef QPluginMetaData (*QtPluginMetaDataFunction)(); -#endif struct Q_CORE_EXPORT QStaticPlugin { -#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) public: constexpr QStaticPlugin(QtPluginInstanceFunction i, QtPluginMetaDataFunction m) : instance(i), rawMetaData(m().data), rawMetaDataSize(m().size) @@ -97,17 +92,6 @@ private: const void *rawMetaData; qsizetype rawMetaDataSize; public: -#elif !defined(Q_QDOC) - // Note: This struct is initialized using an initializer list. - // As such, it cannot have any new constructors or variables. - QtPluginInstanceFunction instance; - QtPluginMetaDataFunction rawMetaData; -#else - // Since qdoc gets confused by the use of function - // pointers, we add these dummes for it to parse instead: - QObject *instance(); - const char *rawMetaData(); -#endif QJsonObject metaData() const; }; Q_DECLARE_TYPEINFO(QStaticPlugin, Q_PRIMITIVE_TYPE); @@ -161,7 +145,6 @@ void Q_CORE_EXPORT qRegisterStaticPluginFunction(QStaticPlugin staticPlugin); #if defined(QT_STATICPLUGIN) -#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) # define QT_MOC_EXPORT_PLUGIN(PLUGINCLASS, PLUGINCLASSNAME) \ static QT_PREPEND_NAMESPACE(QObject) *qt_plugin_instance_##PLUGINCLASSNAME() \ Q_PLUGIN_INSTANCE(PLUGINCLASS) \ @@ -170,19 +153,8 @@ void Q_CORE_EXPORT qRegisterStaticPluginFunction(QStaticPlugin staticPlugin); const QT_PREPEND_NAMESPACE(QStaticPlugin) qt_static_plugin_##PLUGINCLASSNAME() { \ return { qt_plugin_instance_##PLUGINCLASSNAME, qt_plugin_query_metadata_##PLUGINCLASSNAME}; \ } -#else -# define QT_MOC_EXPORT_PLUGIN(PLUGINCLASS, PLUGINCLASSNAME) \ - static QT_PREPEND_NAMESPACE(QObject) *qt_plugin_instance_##PLUGINCLASSNAME() \ - Q_PLUGIN_INSTANCE(PLUGINCLASS) \ - static const char *qt_plugin_query_metadata_##PLUGINCLASSNAME() { return reinterpret_cast(qt_pluginMetaData_##PLUGINCLASSNAME); } \ - const QT_PREPEND_NAMESPACE(QStaticPlugin) qt_static_plugin_##PLUGINCLASSNAME() { \ - QT_PREPEND_NAMESPACE(QStaticPlugin) plugin = { qt_plugin_instance_##PLUGINCLASSNAME, qt_plugin_query_metadata_##PLUGINCLASSNAME}; \ - return plugin; \ - } -#endif #else -#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) # define QT_MOC_EXPORT_PLUGIN(PLUGINCLASS, PLUGINCLASSNAME) \ Q_EXTERN_C Q_DECL_EXPORT \ @@ -191,17 +163,6 @@ void Q_CORE_EXPORT qRegisterStaticPluginFunction(QStaticPlugin staticPlugin); Q_EXTERN_C Q_DECL_EXPORT QT_PREPEND_NAMESPACE(QObject) *qt_plugin_instance() \ Q_PLUGIN_INSTANCE(PLUGINCLASS) -#else - -# define QT_MOC_EXPORT_PLUGIN(PLUGINCLASS, PLUGINCLASSNAME) \ - Q_EXTERN_C Q_DECL_EXPORT \ - const char *qt_plugin_query_metadata() \ - { return reinterpret_cast(qt_pluginMetaData_##PLUGINCLASSNAME); } \ - Q_EXTERN_C Q_DECL_EXPORT QT_PREPEND_NAMESPACE(QObject) *qt_plugin_instance() \ - Q_PLUGIN_INSTANCE(PLUGINCLASS) - -#endif - #endif #define Q_EXPORT_PLUGIN(PLUGIN) \ diff --git a/src/corelib/plugin/qpluginloader.cpp b/src/corelib/plugin/qpluginloader.cpp index b8de3690d9..ef8ad108cb 100644 --- a/src/corelib/plugin/qpluginloader.cpp +++ b/src/corelib/plugin/qpluginloader.cpp @@ -482,13 +482,7 @@ QList QPluginLoader::staticPlugins() */ QJsonObject QStaticPlugin::metaData() const { -#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) - // the data is already loaded, so this doesn't matter - qsizetype rawMetaDataSize = INT_MAX; - const char *ptr = rawMetaData(); -#else auto ptr = static_cast(rawMetaData); -#endif QString errMsg; QJsonDocument doc = qJsonFromRawLibraryMetaData(ptr, rawMetaDataSize, &errMsg); diff --git a/src/corelib/serialization/qtextstream.cpp b/src/corelib/serialization/qtextstream.cpp index 57d4e18ae6..c834f22834 100644 --- a/src/corelib/serialization/qtextstream.cpp +++ b/src/corelib/serialization/qtextstream.cpp @@ -3142,41 +3142,6 @@ QTextStream &bom(QTextStream &s) { return Qt::bom(s); } } // namespace QTextStreamFunctions #endif -#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) && !defined(Q_QDOC) -// Binary compatible definitions for Qt<5.14 -Q_CORE_EXPORT QTextStream &bin(QTextStream &s) { return Qt::bin(s); } -Q_CORE_EXPORT QTextStream &oct(QTextStream &s) { return Qt::oct(s); } -Q_CORE_EXPORT QTextStream &dec(QTextStream &s) { return Qt::dec(s); } -Q_CORE_EXPORT QTextStream &hex(QTextStream &s) { return Qt::hex(s); } - -Q_CORE_EXPORT QTextStream &showbase(QTextStream &s) { return Qt::showbase(s); } -Q_CORE_EXPORT QTextStream &forcesign(QTextStream &s) { return Qt::forcesign(s); } -Q_CORE_EXPORT QTextStream &forcepoint(QTextStream &s) { return Qt::forcepoint(s); } -Q_CORE_EXPORT QTextStream &noshowbase(QTextStream &s) { return Qt::noshowbase(s); } -Q_CORE_EXPORT QTextStream &noforcesign(QTextStream &s) { return Qt::noforcesign(s); } -Q_CORE_EXPORT QTextStream &noforcepoint(QTextStream &s) { return Qt::noforcepoint(s); } - -Q_CORE_EXPORT QTextStream &uppercasebase(QTextStream &s) { return Qt::uppercasebase(s); } -Q_CORE_EXPORT QTextStream &uppercasedigits(QTextStream &s) { return Qt::uppercasedigits(s); } -Q_CORE_EXPORT QTextStream &lowercasebase(QTextStream &s) { return Qt::lowercasebase(s); } -Q_CORE_EXPORT QTextStream &lowercasedigits(QTextStream &s) { return Qt::lowercasedigits(s); } - -Q_CORE_EXPORT QTextStream &fixed(QTextStream &s) { return Qt::fixed(s); } -Q_CORE_EXPORT QTextStream &scientific(QTextStream &s) { return Qt::scientific(s); } - -Q_CORE_EXPORT QTextStream &left(QTextStream &s) { return Qt::left(s); } -Q_CORE_EXPORT QTextStream &right(QTextStream &s) { return Qt::right(s); } -Q_CORE_EXPORT QTextStream ¢er(QTextStream &s) { return Qt::center(s); } - -Q_CORE_EXPORT QTextStream &endl(QTextStream &s) { return Qt::endl(s); } -Q_CORE_EXPORT QTextStream &flush(QTextStream &s) { return Qt::flush(s); } -Q_CORE_EXPORT QTextStream &reset(QTextStream &s) { return Qt::reset(s); } - -Q_CORE_EXPORT QTextStream &ws(QTextStream &s) { return Qt::ws(s); } - -Q_CORE_EXPORT QTextStream &bom(QTextStream &s) { return Qt::bom(s); } -#endif - QT_END_NAMESPACE #ifndef QT_NO_QOBJECT diff --git a/src/corelib/serialization/qxmlstream.h b/src/corelib/serialization/qxmlstream.h index 44f33b111b..e197a0f999 100644 --- a/src/corelib/serialization/qxmlstream.h +++ b/src/corelib/serialization/qxmlstream.h @@ -81,9 +81,6 @@ class QXmlStreamReaderPrivate; class QXmlStreamAttributes; class Q_CORE_EXPORT QXmlStreamAttribute { QXmlStreamStringRef m_name, m_namespaceUri, m_qualifiedName, m_value; -#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) - void *reserved; -#endif uint m_isDefault : 1; friend class QXmlStreamReaderPrivate; friend class QXmlStreamAttributes; @@ -145,9 +142,6 @@ public: class Q_CORE_EXPORT QXmlStreamNamespaceDeclaration { QXmlStreamStringRef m_prefix, m_namespaceUri; -#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) - void *reserved; -#endif friend class QXmlStreamReaderPrivate; public: @@ -168,9 +162,6 @@ typedef QList QXmlStreamNamespaceDeclarations; class Q_CORE_EXPORT QXmlStreamNotationDeclaration { QXmlStreamStringRef m_name, m_systemId, m_publicId; -#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) - void *reserved; -#endif friend class QXmlStreamReaderPrivate; public: @@ -192,9 +183,6 @@ typedef QList QXmlStreamNotationDeclarations; class Q_CORE_EXPORT QXmlStreamEntityDeclaration { QXmlStreamStringRef m_name, m_notationName, m_systemId, m_publicId, m_value; -#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) - void *reserved; -#endif friend class QXmlStreamReaderPrivate; public: diff --git a/src/corelib/text/qlocale.cpp b/src/corelib/text/qlocale.cpp index 41d6157bdf..430991b83b 100644 --- a/src/corelib/text/qlocale.cpp +++ b/src/corelib/text/qlocale.cpp @@ -4065,17 +4065,6 @@ QString QLocale::toCurrencyString(qulonglong value, const QString &symbol) const return d->m_data->currencyFormat().getData(currency_format_data).arg(str, sym); } -#if QT_VERSION < QT_VERSION_CHECK(6,0,0) -/*! - \since 4.8 - \overload -*/ -QString QLocale::toCurrencyString(double value, const QString &symbol) const -{ - return toCurrencyString(value, symbol, d->m_data->m_currency_digits); -} -#endif - /*! \since 5.7 \overload toCurrencyString() @@ -4130,19 +4119,6 @@ QString QLocale::toCurrencyString(double value, const QString &symbol, int preci \sa formattedDataSize() */ -#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) -/*! - \obsolete - - Use the const version instead. -*/ -QString QLocale::formattedDataSize(qint64 bytes, int precision, DataSizeFormats format) -{ - const auto *that = this; - return that->formattedDataSize(bytes, precision, format); -} -#endif - /*! \since 5.10 diff --git a/src/corelib/text/qlocale.h b/src/corelib/text/qlocale.h index f4a36123b6..b0dab638ac 100644 --- a/src/corelib/text/qlocale.h +++ b/src/corelib/text/qlocale.h @@ -1065,22 +1065,10 @@ public: inline QString toCurrencyString(ushort, const QString &symbol = QString()) const; inline QString toCurrencyString(int, const QString &symbol = QString()) const; inline QString toCurrencyString(uint, const QString &symbol = QString()) const; -#if QT_VERSION >= QT_VERSION_CHECK(6,0,0) QString toCurrencyString(double, const QString &symbol = QString(), int precision = -1) const; inline QString toCurrencyString(float i, const QString &symbol = QString(), int precision = -1) const { return toCurrencyString(double(i), symbol, precision); } -#else - QString toCurrencyString(double, const QString &symbol = QString()) const; - QString toCurrencyString(double, const QString &symbol, int precision) const; - inline QString toCurrencyString(float i, const QString &symbol = QString()) const - { return toCurrencyString(double(i), symbol); } - inline QString toCurrencyString(float i, const QString &symbol, int precision) const - { return toCurrencyString(double(i), symbol, precision); } -#endif -#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) - QString formattedDataSize(qint64 bytes, int precision = 2, DataSizeFormats format = DataSizeIecFormat); -#endif QString formattedDataSize(qint64 bytes, int precision = 2, DataSizeFormats format = DataSizeIecFormat) const; QStringList uiLanguages() const; diff --git a/src/corelib/text/qstring.h b/src/corelib/text/qstring.h index 45578debd6..ba21aba618 100644 --- a/src/corelib/text/qstring.h +++ b/src/corelib/text/qstring.h @@ -928,9 +928,6 @@ private: friend inline bool operator> (QChar, QLatin1String) noexcept; void reallocData(size_t alloc, bool grow = false); -#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) - void expand(int i); -#endif static int compare_helper(const QChar *data1, qsizetype length1, const QChar *data2, qsizetype length2, Qt::CaseSensitivity cs = Qt::CaseSensitive) noexcept; @@ -1370,21 +1367,6 @@ public: inline QStringRef(const QString *string, int position, int size); inline QStringRef(const QString *string); -#if QT_VERSION < QT_VERSION_CHECK(6,0,0) - // ### Qt 6: remove all of these, the implicit ones are fine - QStringRef(const QStringRef &other) noexcept - :m_string(other.m_string), m_position(other.m_position), m_size(other.m_size) - {} - QStringRef(QStringRef &&other) noexcept : m_string(other.m_string), m_position(other.m_position), m_size(other.m_size) {} - QStringRef &operator=(QStringRef &&other) noexcept { return *this = other; } - QStringRef &operator=(const QStringRef &other) noexcept - { - m_string = other.m_string; m_position = other.m_position; - m_size = other.m_size; return *this; - } - inline ~QStringRef(){} -#endif // Qt < 6.0.0 - inline const QString *string() const { return m_string; } inline int position() const { return m_position; } inline int size() const { return m_size; } diff --git a/src/corelib/text/qstringlist.cpp b/src/corelib/text/qstringlist.cpp index 6d5228ce6b..33b49d26b6 100644 --- a/src/corelib/text/qstringlist.cpp +++ b/src/corelib/text/qstringlist.cpp @@ -320,20 +320,6 @@ QStringList QtPrivate::QStringList_filter(const QStringList *that, QStringView s return res; } -#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) -/// Not really needed anymore, but kept for binary compatibility -QStringList QtPrivate::QStringList_filter(const QStringList *that, const QString &str, - Qt::CaseSensitivity cs) -{ - QStringMatcher matcher(str, cs); - QStringList res; - for (qsizetype i = 0; i < that->size(); ++i) - if (matcher.indexIn(that->at(i)) != -1) - res << that->at(i); - return res; -} -#endif - template static bool stringList_contains(const QStringList &stringList, const T &str, Qt::CaseSensitivity cs) { @@ -357,15 +343,6 @@ static bool stringList_contains(const QStringList &stringList, const T &str, Qt: */ #endif -#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) -/// Not really needed anymore, but kept for binary compatibility -bool QtPrivate::QStringList_contains(const QStringList *that, const QString &str, - Qt::CaseSensitivity cs) -{ - return stringList_contains(*that, str, cs); -} -#endif - /*! \fn bool QStringList::contains(QStringView str, Qt::CaseSensitivity cs) const \overload @@ -510,16 +487,6 @@ void QtPrivate::QStringList_replaceInStrings(QStringList *that, QStringView befo (*that)[i].replace(before.data(), before.length(), after.data(), after.length(), cs); } -#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) -/// Not really needed anymore, but kept for binary compatibility -void QtPrivate::QStringList_replaceInStrings(QStringList *that, const QString &before, - const QString &after, Qt::CaseSensitivity cs) -{ - for (qsizetype i = 0; i < that->size(); ++i) - (*that)[i].replace(before, after, cs); -} -#endif - #if QT_CONFIG(regularexpression) /*! \fn QStringList &QStringList::replaceInStrings(const QRegularExpression &re, const QString &after) diff --git a/src/corelib/text/qstringlist.h b/src/corelib/text/qstringlist.h index bee76ba67d..8e5672b139 100644 --- a/src/corelib/text/qstringlist.h +++ b/src/corelib/text/qstringlist.h @@ -165,22 +165,10 @@ namespace QtPrivate { Q_CORE_EXPORT QString QStringList_join(const QStringList &list, QLatin1String sep); QStringList Q_CORE_EXPORT QStringList_filter(const QStringList *that, QStringView str, Qt::CaseSensitivity cs); -#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) - QStringList Q_CORE_EXPORT QStringList_filter(const QStringList *that, const QString &str, - Qt::CaseSensitivity cs); -#endif - -#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) - bool Q_CORE_EXPORT QStringList_contains(const QStringList *that, const QString &str, Qt::CaseSensitivity cs); -#endif bool Q_CORE_EXPORT QStringList_contains(const QStringList *that, QStringView str, Qt::CaseSensitivity cs); bool Q_CORE_EXPORT QStringList_contains(const QStringList *that, QLatin1String str, Qt::CaseSensitivity cs); void Q_CORE_EXPORT QStringList_replaceInStrings(QStringList *that, QStringView before, QStringView after, Qt::CaseSensitivity cs); -#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) - void Q_CORE_EXPORT QStringList_replaceInStrings(QStringList *that, const QString &before, const QString &after, - Qt::CaseSensitivity cs); -#endif #if QT_CONFIG(regularexpression) void Q_CORE_EXPORT QStringList_replaceInStrings(QStringList *that, const QRegularExpression &rx, const QString &after); diff --git a/src/corelib/tools/qshareddata.h b/src/corelib/tools/qshareddata.h index 38b6d61efa..088e9a2d37 100644 --- a/src/corelib/tools/qshareddata.h +++ b/src/corelib/tools/qshareddata.h @@ -52,11 +52,7 @@ QT_BEGIN_NAMESPACE template class QSharedDataPointer; -class -#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) -Q_CORE_EXPORT -#endif -QSharedData +class QSharedData { public: mutable QAtomicInt ref; -- cgit v1.2.3