diff options
author | Qt Forward Merge Bot <qt_forward_merge_bot@qt-project.org> | 2020-04-21 21:40:01 +0200 |
---|---|---|
committer | Qt Forward Merge Bot <qt_forward_merge_bot@qt-project.org> | 2020-04-21 21:40:01 +0200 |
commit | a15c7260cc83707dcdd05d7d9c23317536601fdc (patch) | |
tree | 3f60e05467b1a9f38a692e37a4e44675baf71732 /src | |
parent | 47eba459905ef884931aa1247c847f7a98a77b28 (diff) | |
parent | e10e5318bc02a48a866b76b6f0b7f268d16af642 (diff) |
Merge remote-tracking branch 'origin/5.15' into 5.15.0
Change-Id: I9d9f9e0955144241fcee6148fc78c4501e2ffcea
Diffstat (limited to 'src')
32 files changed, 398 insertions, 80 deletions
diff --git a/src/3rdparty/sqlite/patches/0002-sqlite-Fix-CVE-2020-11655.patch b/src/3rdparty/sqlite/patches/0002-sqlite-Fix-CVE-2020-11655.patch new file mode 100644 index 0000000000..c47e68c4a9 --- /dev/null +++ b/src/3rdparty/sqlite/patches/0002-sqlite-Fix-CVE-2020-11655.patch @@ -0,0 +1,30 @@ +From fa3ea2350c0367aa7cfd796b31214e2dcf574360 Mon Sep 17 00:00:00 2001 +From: Andy Shaw <andy.shaw@qt.io> +Date: Mon, 20 Apr 2020 10:43:29 +0200 +Subject: [PATCH] sqlite: Fix CVE-2020-11655 + +This was taken from 4a302b42c7bf5e11 in SQLite, ref: +https://www3.sqlite.org/cgi/src/info/4a302b42c7bf5e11 + +[ChangeLog][QtSQL][sqlite] Fixed CVE-2020-11655 + +Change-Id: I5ead78d9ee63aa0f12f1c1014c79373728569f30 +--- + src/3rdparty/sqlite/sqlite3.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/src/3rdparty/sqlite/sqlite3.c b/src/3rdparty/sqlite/sqlite3.c +index dfe5323a59..054be43d95 100644 +--- a/src/3rdparty/sqlite/sqlite3.c ++++ b/src/3rdparty/sqlite/sqlite3.c +@@ -133226,6 +133226,7 @@ static void resetAccumulator(Parse *pParse, AggInfo *pAggInfo){ + struct AggInfo_func *pFunc; + int nReg = pAggInfo->nFunc + pAggInfo->nColumn; + if( nReg==0 ) return; ++ if( pParse->nErr ) return; + #ifdef SQLITE_DEBUG + /* Verify that all AggInfo registers are within the range specified by + ** AggInfo.mnReg..AggInfo.mxReg */ +-- +2.24.2 (Apple Git-127) + diff --git a/src/3rdparty/sqlite/patches/0003-sqlite-Fix-CVE-2020-11656.patch b/src/3rdparty/sqlite/patches/0003-sqlite-Fix-CVE-2020-11656.patch new file mode 100644 index 0000000000..c5ceb0a00c --- /dev/null +++ b/src/3rdparty/sqlite/patches/0003-sqlite-Fix-CVE-2020-11656.patch @@ -0,0 +1,63 @@ +From 99cdbed3bb5368ae2ec80d15635a2dd57961310c Mon Sep 17 00:00:00 2001 +From: Andy Shaw <andy.shaw@qt.io> +Date: Mon, 20 Apr 2020 10:49:57 +0200 +Subject: [PATCH] sqlite: Fix CVE-2020-11656 + +This was taken from d09f8c3621d5f7f8 and b64674919f673602 in SQLite, +ref: https://www3.sqlite.org/cgi/src/info/d09f8c3621d5f7f8 +https://www.sqlite.org/cgi/src/info/b64674919f673602 + +[ChangeLog][QtSQL][sqlite] Fixed CVE-2020-11656 + +Fixes: QTBUG-83652 +Change-Id: I99bd59dc10b753ff19822c902dff1fc339d330a8 +--- + src/3rdparty/sqlite/sqlite3.c | 18 +++++++++++++++++- + 1 file changed, 17 insertions(+), 1 deletion(-) + +diff --git a/src/3rdparty/sqlite/sqlite3.c b/src/3rdparty/sqlite/sqlite3.c +index 054be43d95..6ff9ba42aa 100644 +--- a/src/3rdparty/sqlite/sqlite3.c ++++ b/src/3rdparty/sqlite/sqlite3.c +@@ -97945,7 +97945,7 @@ static int resolveOrderByTermToExprList( + nc.nErr = 0; + db = pParse->db; + savedSuppErr = db->suppressErr; +- db->suppressErr = 1; ++ if( IN_RENAME_OBJECT==0 ) db->suppressErr = 1; + rc = sqlite3ResolveExprNames(&nc, pE); + db->suppressErr = savedSuppErr; + if( rc ) return 0; +@@ -105383,6 +105383,21 @@ static void renameWalkWith(Walker *pWalker, Select *pSelect){ + } + } + ++/* ++** Unmap all tokens in the IdList object passed as the second argument. ++*/ ++static void unmapColumnIdlistNames( ++ Parse *pParse, ++ IdList *pIdList ++){ ++ if( pIdList ){ ++ int ii; ++ for(ii=0; ii<pIdList->nId; ii++){ ++ sqlite3RenameTokenRemap(pParse, 0, (void*)pIdList->a[ii].zName); ++ } ++ } ++} ++ + /* + ** Walker callback used by sqlite3RenameExprUnmap(). + */ +@@ -105404,6 +105419,7 @@ static int renameUnmapSelectCb(Walker *pWalker, Select *p){ + for(i=0; i<pSrc->nSrc; i++){ + sqlite3RenameTokenRemap(pParse, 0, (void*)pSrc->a[i].zName); + if( sqlite3WalkExpr(pWalker, pSrc->a[i].pOn) ) return WRC_Abort; ++ unmapColumnIdlistNames(pParse, pSrc->a[i].pUsing); + } + } + +-- +2.24.2 (Apple Git-127) + diff --git a/src/3rdparty/sqlite/sqlite3.c b/src/3rdparty/sqlite/sqlite3.c index dfe5323a59..6ff9ba42aa 100644 --- a/src/3rdparty/sqlite/sqlite3.c +++ b/src/3rdparty/sqlite/sqlite3.c @@ -97945,7 +97945,7 @@ static int resolveOrderByTermToExprList( nc.nErr = 0; db = pParse->db; savedSuppErr = db->suppressErr; - db->suppressErr = 1; + if( IN_RENAME_OBJECT==0 ) db->suppressErr = 1; rc = sqlite3ResolveExprNames(&nc, pE); db->suppressErr = savedSuppErr; if( rc ) return 0; @@ -105384,6 +105384,21 @@ static void renameWalkWith(Walker *pWalker, Select *pSelect){ } /* +** Unmap all tokens in the IdList object passed as the second argument. +*/ +static void unmapColumnIdlistNames( + Parse *pParse, + IdList *pIdList +){ + if( pIdList ){ + int ii; + for(ii=0; ii<pIdList->nId; ii++){ + sqlite3RenameTokenRemap(pParse, 0, (void*)pIdList->a[ii].zName); + } + } +} + +/* ** Walker callback used by sqlite3RenameExprUnmap(). */ static int renameUnmapSelectCb(Walker *pWalker, Select *p){ @@ -105404,6 +105419,7 @@ static int renameUnmapSelectCb(Walker *pWalker, Select *p){ for(i=0; i<pSrc->nSrc; i++){ sqlite3RenameTokenRemap(pParse, 0, (void*)pSrc->a[i].zName); if( sqlite3WalkExpr(pWalker, pSrc->a[i].pOn) ) return WRC_Abort; + unmapColumnIdlistNames(pParse, pSrc->a[i].pUsing); } } @@ -133226,6 +133242,7 @@ static void resetAccumulator(Parse *pParse, AggInfo *pAggInfo){ struct AggInfo_func *pFunc; int nReg = pAggInfo->nFunc + pAggInfo->nColumn; if( nReg==0 ) return; + if( pParse->nErr ) return; #ifdef SQLITE_DEBUG /* Verify that all AggInfo registers are within the range specified by ** AggInfo.mnReg..AggInfo.mxReg */ diff --git a/src/corelib/doc/snippets/code/src_corelib_kernel_qobject.cpp b/src/corelib/doc/snippets/code/src_corelib_kernel_qobject.cpp index 43bcc22720..fddda64b19 100644 --- a/src/corelib/doc/snippets/code/src_corelib_kernel_qobject.cpp +++ b/src/corelib/doc/snippets/code/src_corelib_kernel_qobject.cpp @@ -403,20 +403,28 @@ public: //! [39] -class QLibrary : public QObject +class QItemSelectionModel : public QObject { Q_OBJECT public: ... - - enum LoadHint { - ResolveAllSymbolsHint = 0x01, - ExportExternalSymbolsHint = 0x02, - LoadArchiveMemberHint = 0x04 + enum SelectionFlag { + NoUpdate = 0x0000, + Clear = 0x0001, + Select = 0x0002, + Deselect = 0x0004, + Toggle = 0x0008, + Current = 0x0010, + Rows = 0x0020, + Columns = 0x0040, + SelectCurrent = Select | Current, + ToggleCurrent = Toggle | Current, + ClearAndSelect = Clear | Select }; - Q_DECLARE_FLAGS(LoadHints, LoadHint) - Q_FLAG(LoadHint) + + Q_DECLARE_FLAGS(SelectionFlags, SelectionFlag) + Q_FLAG(SelectionFlags) ... } //! [39] diff --git a/src/corelib/global/qnamespace.qdoc b/src/corelib/global/qnamespace.qdoc index 3e22c9e661..2fe019f372 100644 --- a/src/corelib/global/qnamespace.qdoc +++ b/src/corelib/global/qnamespace.qdoc @@ -291,7 +291,7 @@ application on supported platforms, use of a session manager may be redundant for system services. This attribute must be set before QGuiApplication is constructed. - This value was added in 5.13 + This value was added in 5.14 \value AA_DisableNativeVirtualKeyboard When this attribute is set, the native on-screen virtual keyboard will not be shown automatically when a diff --git a/src/corelib/global/qsystemdetection.h b/src/corelib/global/qsystemdetection.h index a020788b11..fe7d7d880b 100644 --- a/src/corelib/global/qsystemdetection.h +++ b/src/corelib/global/qsystemdetection.h @@ -76,6 +76,8 @@ The following operating systems have variants: LINUX - both Q_OS_LINUX and Q_OS_ANDROID are defined when building for Android - only Q_OS_LINUX is defined if building for other Linux systems + MACOS - both Q_OS_BSD4 and Q_OS_IOS are defined when building for iOS + - both Q_OS_BSD4 and Q_OS_MACOS are defined when building for macOS FREEBSD - Q_OS_FREEBSD is defined only when building for FreeBSD with a BSD userland - Q_OS_FREEBSD_KERNEL is always defined on FreeBSD, even if the userland is from GNU */ diff --git a/src/corelib/io/qfilesystemwatcher_inotify.cpp b/src/corelib/io/qfilesystemwatcher_inotify.cpp index 888af998a5..94d9d06bcb 100644 --- a/src/corelib/io/qfilesystemwatcher_inotify.cpp +++ b/src/corelib/io/qfilesystemwatcher_inotify.cpp @@ -253,7 +253,7 @@ QInotifyFileSystemWatcherEngine::QInotifyFileSystemWatcherEngine(int fd, QObject notifier(fd, QSocketNotifier::Read, this) { fcntl(inotifyFd, F_SETFD, FD_CLOEXEC); - connect(¬ifier, SIGNAL(activated(int)), SLOT(readFromInotify())); + connect(¬ifier, SIGNAL(activated(QSocketDescriptor)), SLOT(readFromInotify())); } QInotifyFileSystemWatcherEngine::~QInotifyFileSystemWatcherEngine() diff --git a/src/corelib/io/qfilesystemwatcher_kqueue.cpp b/src/corelib/io/qfilesystemwatcher_kqueue.cpp index c2028e3641..06383a103a 100644 --- a/src/corelib/io/qfilesystemwatcher_kqueue.cpp +++ b/src/corelib/io/qfilesystemwatcher_kqueue.cpp @@ -77,7 +77,7 @@ QKqueueFileSystemWatcherEngine::QKqueueFileSystemWatcherEngine(int kqfd, QObject kqfd(kqfd), notifier(kqfd, QSocketNotifier::Read, this) { - connect(¬ifier, SIGNAL(activated(int)), SLOT(readFromKqueue())); + connect(¬ifier, SIGNAL(activated(QSocketDescriptor)), SLOT(readFromKqueue())); fcntl(kqfd, F_SETFD, FD_CLOEXEC); } diff --git a/src/corelib/io/qprocess_unix.cpp b/src/corelib/io/qprocess_unix.cpp index 930007ff04..e8efe6481f 100644 --- a/src/corelib/io/qprocess_unix.cpp +++ b/src/corelib/io/qprocess_unix.cpp @@ -251,7 +251,7 @@ bool QProcessPrivate::openChannel(Channel &channel) channel.notifier = new QSocketNotifier(channel.pipe[1], QSocketNotifier::Write, q); channel.notifier->setEnabled(false); - QObject::connect(channel.notifier, SIGNAL(activated(int)), + QObject::connect(channel.notifier, SIGNAL(activated(QSocketDescriptor)), q, SLOT(_q_canWrite())); } else { channel.notifier = new QSocketNotifier(channel.pipe[0], @@ -261,7 +261,7 @@ bool QProcessPrivate::openChannel(Channel &channel) receiver = SLOT(_q_canReadStandardOutput()); else receiver = SLOT(_q_canReadStandardError()); - QObject::connect(channel.notifier, SIGNAL(activated(int)), + QObject::connect(channel.notifier, SIGNAL(activated(QSocketDescriptor)), q, receiver); } } @@ -380,7 +380,7 @@ void QProcessPrivate::startProcess() if (threadData.loadRelaxed()->hasEventDispatcher()) { startupSocketNotifier = new QSocketNotifier(childStartedPipe[0], QSocketNotifier::Read, q); - QObject::connect(startupSocketNotifier, SIGNAL(activated(int)), + QObject::connect(startupSocketNotifier, SIGNAL(activated(QSocketDescriptor)), q, SLOT(_q_startupNotification())); } @@ -531,7 +531,7 @@ void QProcessPrivate::startProcess() if (threadData.loadRelaxed()->eventDispatcher.loadAcquire()) { deathNotifier = new QSocketNotifier(forkfd, QSocketNotifier::Read, q); - QObject::connect(deathNotifier, SIGNAL(activated(int)), + QObject::connect(deathNotifier, SIGNAL(activated(QSocketDescriptor)), q, SLOT(_q_processDied())); } } diff --git a/src/corelib/itemmodels/qsortfilterproxymodel.cpp b/src/corelib/itemmodels/qsortfilterproxymodel.cpp index 35c97da532..4f5593e0a0 100644 --- a/src/corelib/itemmodels/qsortfilterproxymodel.cpp +++ b/src/corelib/itemmodels/qsortfilterproxymodel.cpp @@ -2937,7 +2937,7 @@ void QSortFilterProxyModel::setFilterRole(int role) /*! \since 5.15 - \fn void QSortFilterProxyModel::recursiveFilteringEnabledChanged(int recursiveFilteringEnabled) + \fn void QSortFilterProxyModel::recursiveFilteringEnabledChanged(bool recursiveFilteringEnabled) \brief This signal is emitted when the recursive filter setting is changed to \a recursiveFilteringEnabled. */ diff --git a/src/corelib/kernel/qobject.cpp b/src/corelib/kernel/qobject.cpp index 8be10ed601..23e4e1163c 100644 --- a/src/corelib/kernel/qobject.cpp +++ b/src/corelib/kernel/qobject.cpp @@ -4493,16 +4493,15 @@ QDebug operator<<(QDebug dbg, const QObject *o) that values of a given enum can be used as flags and combined using the bitwise OR operator. For namespaces use \l Q_FLAG_NS() instead. - The macro must be placed after the enum declaration. + The macro must be placed after the enum declaration. The declaration of + the flags type is done using the \l Q_DECLARE_FLAGS() macro. - For example, in QLibrary, the \l{QLibrary::LoadHints}{LoadHints} flag is + For example, in QItemSelectionModel, the + \l{QItemSelectionModel::SelectionFlags}{SelectionFlags} flag is declared in the following way: \snippet code/src_corelib_kernel_qobject.cpp 39 - The declaration of the flags themselves is performed in the public section - of the QLibrary class itself, using the \l Q_DECLARE_FLAGS() macro. - \note The Q_FLAG macro takes care of registering individual flag values with the meta-object system, so it is unnecessary to use Q_ENUM() in addition to this macro. diff --git a/src/corelib/kernel/qsocketnotifier.cpp b/src/corelib/kernel/qsocketnotifier.cpp index 78269ee605..6e1d2103bd 100644 --- a/src/corelib/kernel/qsocketnotifier.cpp +++ b/src/corelib/kernel/qsocketnotifier.cpp @@ -37,23 +37,32 @@ ** ****************************************************************************/ +#define BUILDING_QSOCKETNOTIFIER #include "qsocketnotifier.h" +#undef BUILDING_QSOCKETNOTIFIER #include "qplatformdefs.h" #include "qabstracteventdispatcher.h" #include "qcoreapplication.h" +#include "qmetatype.h" + #include "qobject_p.h" #include <private/qthread_p.h> +#include <QtCore/QLoggingCategory> + QT_BEGIN_NAMESPACE +Q_DECLARE_LOGGING_CATEGORY(lcSocketNotifierDeprecation) +Q_LOGGING_CATEGORY(lcSocketNotifierDeprecation, "qt.core.socketnotifier_deprecation"); + class QSocketNotifierPrivate : public QObjectPrivate { Q_DECLARE_PUBLIC(QSocketNotifier) public: - qintptr sockfd; + QSocketDescriptor sockfd; QSocketNotifier::Type sntype; bool snenabled; }; @@ -143,13 +152,17 @@ QSocketNotifier::QSocketNotifier(qintptr socket, Type type, QObject *parent) : QObject(*new QSocketNotifierPrivate, parent) { Q_D(QSocketNotifier); + + qRegisterMetaType<QSocketDescriptor>(); + qRegisterMetaType<QSocketNotifier::Type>(); + d->sockfd = socket; d->sntype = type; d->snenabled = true; auto thisThreadData = d->threadData.loadRelaxed(); - if (socket < 0) + if (!d->sockfd.isValid()) qWarning("QSocketNotifier: Invalid socket specified"); else if (!thisThreadData->hasEventDispatcher()) qWarning("QSocketNotifier: Can only be used with threads started with QThread"); @@ -169,6 +182,11 @@ QSocketNotifier::~QSocketNotifier() /*! \fn void QSocketNotifier::activated(int socket) + \obsolete To avoid unintended truncation of the descriptor, use + the QSocketDescriptor overload of this function. If you need + compatibility with versions older than 5.15 you need to change + the slot to accept qintptr if it currently accepts an int, and + then connect using Functor-Based Connection. This signal is emitted whenever the socket notifier is enabled and a socket event corresponding to its \l {Type}{type} occurs. @@ -178,6 +196,18 @@ QSocketNotifier::~QSocketNotifier() \sa type(), socket() */ +/*! + \fn void QSocketNotifier::activated(QSocketDescriptor socket, QSocketNotifier::Type type) + \since 5.15 + + This signal is emitted whenever the socket notifier is enabled and + a socket event corresponding to its \a type occurs. + + The socket identifier is passed in the \a socket parameter. + + \sa type(), socket() +*/ + /*! Returns the socket identifier specified to the constructor. @@ -187,7 +217,7 @@ QSocketNotifier::~QSocketNotifier() qintptr QSocketNotifier::socket() const { Q_D(const QSocketNotifier); - return d->sockfd; + return qintptr(d->sockfd); } /*! @@ -230,7 +260,7 @@ bool QSocketNotifier::isEnabled() const void QSocketNotifier::setEnabled(bool enable) { Q_D(QSocketNotifier); - if (d->sockfd < 0) + if (!d->sockfd.isValid()) return; if (d->snenabled == enable) // no change return; @@ -268,12 +298,61 @@ bool QSocketNotifier::event(QEvent *e) } QObject::event(e); // will activate filters if ((e->type() == QEvent::SockAct) || (e->type() == QEvent::SockClose)) { - emit activated(d->sockfd, QPrivateSignal()); + QPointer<QSocketNotifier> alive(this); + emit activated(d->sockfd, d->sntype, QPrivateSignal()); + // ### Qt7: Remove emission if the activated(int) signal is removed + if (alive) + emit activated(int(qintptr(d->sockfd)), QPrivateSignal()); + return true; } return false; } +/*! + \class QSocketDescriptor + \inmodule QtCore + \brief A class which holds a native socket descriptor. + \internal + + \ingroup network + \ingroup io + + \since 5.15 + + QSocketDescriptor makes it easier to handle native socket + descriptors in cross-platform code. + + On Windows it holds a \c {Qt::HANDLE} and on Unix it holds an \c int. + The class will implicitly convert between the class and the + native descriptor type. +*/ + +/*! + \fn QSocketDescriptor::QSocketDescriptor(DescriptorType descriptor) + \internal + + Construct a QSocketDescriptor from a native socket \a descriptor. +*/ + +/*! + \fn QSocketDescriptor::QSocketDescriptor(qintptr descriptor) + \internal + + Construct a QSocketDescriptor from a native socket \a descriptor. + + \note This constructor is only available on Windows. +*/ + +/*! + \fn Qt::HANDLE QSocketDescriptor::winHandle() const noexcept + \internal + + Returns the internal handle. + + \note This function is only available on Windows. +*/ + QT_END_NAMESPACE #include "moc_qsocketnotifier.cpp" diff --git a/src/corelib/kernel/qsocketnotifier.h b/src/corelib/kernel/qsocketnotifier.h index 38e5f27247..528f58a1e1 100644 --- a/src/corelib/kernel/qsocketnotifier.h +++ b/src/corelib/kernel/qsocketnotifier.h @@ -44,6 +44,7 @@ QT_BEGIN_NAMESPACE +class QSocketDescriptor; class QSocketNotifierPrivate; class Q_CORE_EXPORT QSocketNotifier : public QObject { @@ -65,7 +66,23 @@ public Q_SLOTS: void setEnabled(bool); Q_SIGNALS: +#if defined(Q_MOC_RUN) + // Add default arguments during Q_MOC_RUN which makes moc generate "signals" which takes less + // parameters, but we won't actually allow emitting without all 3. This lets users use the + // string-based connect without specifying QSocketNotifier::Type as one of the parameters. + void activated(QSocketDescriptor socket, QSocketNotifier::Type activationEvent = Read, + QPrivateSignal = {}); +#else + void activated(QSocketDescriptor socket, QSocketNotifier::Type activationEvent, QPrivateSignal); +#endif + + // ### Qt7: consider removing it. + // The old signal is compiled internally, but hidden outside of this class. + // This means the PMF-based connect(..) will automatically, on recompile, pick up the new + // version while the old-style connect(..) can query the metaobject system for this version. +#if defined(Q_MOC_RUN) || defined(BUILDING_QSOCKETNOTIFIER) || defined(Q_QDOC) void activated(int socket, QPrivateSignal); +#endif protected: bool event(QEvent *) override; @@ -74,6 +91,50 @@ private: Q_DISABLE_COPY(QSocketNotifier) }; +class QSocketDescriptor +{ +public: +#if defined(Q_OS_WIN) || defined(Q_QDOC) + using DescriptorType = Qt::HANDLE; +#define Q_DECL_CONSTEXPR_NOT_WIN +#else + using DescriptorType = int; +#define Q_DECL_CONSTEXPR_NOT_WIN Q_DECL_CONSTEXPR +#endif + + /* implicit */ Q_DECL_CONSTEXPR_NOT_WIN + QSocketDescriptor(DescriptorType descriptor = DescriptorType(-1)) noexcept : sockfd(descriptor) + { + } + +#if defined(Q_OS_WIN) || defined(Q_QDOC) + /* implicit */ QSocketDescriptor(qintptr desc) noexcept : sockfd(DescriptorType(desc)) {} + operator qintptr() const noexcept { return qintptr(sockfd); } + Q_DECL_CONSTEXPR Qt::HANDLE winHandle() const noexcept { return sockfd; } +#endif + Q_DECL_CONSTEXPR operator DescriptorType() const noexcept { return sockfd; } + + Q_DECL_CONSTEXPR_NOT_WIN bool isValid() const noexcept { return *this != QSocketDescriptor(); } + + friend Q_DECL_CONSTEXPR_NOT_WIN bool operator==(QSocketDescriptor lhs, + QSocketDescriptor rhs) noexcept + { + return lhs.sockfd == rhs.sockfd; + } + friend Q_DECL_CONSTEXPR_NOT_WIN bool operator!=(QSocketDescriptor lhs, + QSocketDescriptor rhs) noexcept + { + return lhs.sockfd != rhs.sockfd; + } + +#undef Q_DECL_CONSTEXPR_NOT_WIN + +private: + DescriptorType sockfd; +}; + QT_END_NAMESPACE +Q_DECLARE_METATYPE(QSocketNotifier::Type) +Q_DECLARE_METATYPE(QSocketDescriptor) #endif // QSOCKETNOTIFIER_H diff --git a/src/corelib/time/qtimezoneprivate_android.cpp b/src/corelib/time/qtimezoneprivate_android.cpp index fc3653752a..ba87cf79fe 100644 --- a/src/corelib/time/qtimezoneprivate_android.cpp +++ b/src/corelib/time/qtimezoneprivate_android.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2019 The Qt Company Ltd. +** Copyright (C) 2020 The Qt Company Ltd. ** Copyright (C) 2014 Drew Parsons <dparsons@emerall.com> ** Contact: https://www.qt.io/licensing/ ** @@ -78,6 +78,26 @@ QAndroidTimeZonePrivate::~QAndroidTimeZonePrivate() { } +static QJNIObjectPrivate getDisplayName(QJNIObjectPrivate zone, jint style, jboolean dst, + const QLocale &locale) +{ + QJNIObjectPrivate jlanguage + = QJNIObjectPrivate::fromString(QLocale::languageToString(locale.language())); + QJNIObjectPrivate jcountry + = QJNIObjectPrivate::fromString(QLocale::countryToString(locale.country())); + QJNIObjectPrivate + jvariant = QJNIObjectPrivate::fromString(QLocale::scriptToString(locale.script())); + QJNIObjectPrivate jlocale("java.util.Locale", + "(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V", + static_cast<jstring>(jlanguage.object()), + static_cast<jstring>(jcountry.object()), + static_cast<jstring>(jvariant.object())); + + return zone.callObjectMethod("getDisplayName", + "(ZILjava/util/Locale;)Ljava/lang/String;", + dst, style, jlocale.object()); +} + void QAndroidTimeZonePrivate::init(const QByteArray &ianaId) { const QString iana = QString::fromUtf8(ianaId); @@ -99,10 +119,13 @@ void QAndroidTimeZonePrivate::init(const QByteArray &ianaId) // the zone object we got and ignore the zone if not. // Try checking ianaId against getID(), getDisplayName(): m_id = match(androidTimeZone.callObjectMethod("getID", "()Ljava/lang/String;")); - for (int style = 1; m_id.isEmpty() && style-- > 0;) { - for (int dst = 1; m_id.isEmpty() && dst-- > 0;) { - m_id = match(androidTimeZone.callObjectMethod( - "getDisplayName", "(ZI)Ljava/lang/String;", bool(dst), style)); + for (int style = 1; m_id.isEmpty() && style >= 0; --style) { + for (int dst = 1; m_id.isEmpty() && dst >= 0; --dst) { + for (int pick = 2; m_id.isEmpty() && pick >= 0; --pick) { + QLocale locale = (pick == 0 ? QLocale::system() + : pick == 1 ? QLocale() : QLocale::c()); + m_id = match(getDisplayName(androidTimeZone, style, jboolean(dst), locale)); + } } } } @@ -124,14 +147,7 @@ QString QAndroidTimeZonePrivate::displayName(QTimeZone::TimeType timeType, QTime // treat all NameTypes as java TimeZone style LONG (value 1), except of course QTimeZone::ShortName which is style SHORT (value 0); jint style = (nameType == QTimeZone::ShortName ? 0 : 1); - QJNIObjectPrivate jlanguage = QJNIObjectPrivate::fromString(QLocale::languageToString(locale.language())); - QJNIObjectPrivate jcountry = QJNIObjectPrivate::fromString(QLocale::countryToString(locale.country())); - QJNIObjectPrivate jvariant = QJNIObjectPrivate::fromString(QLocale::scriptToString(locale.script())); - QJNIObjectPrivate jlocale("java.util.Locale", "(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V", static_cast<jstring>(jlanguage.object()), static_cast<jstring>(jcountry.object()), static_cast<jstring>(jvariant.object())); - - QJNIObjectPrivate jname = androidTimeZone.callObjectMethod("getDisplayName", "(ZILjava/util/Locale;)Ljava/lang/String;", daylightTime, style, jlocale.object()); - - name = jname.toString(); + name = getDisplayName(androidTimeZone, style, daylightTime, locale).toString(); } return name; diff --git a/src/corelib/tools/qline.cpp b/src/corelib/tools/qline.cpp index 3afd23d76b..40a69173c4 100644 --- a/src/corelib/tools/qline.cpp +++ b/src/corelib/tools/qline.cpp @@ -370,11 +370,18 @@ QDataStream &operator>>(QDataStream &stream, QLine &line) /*! \enum QLineF::IntersectType - \obsolete Use QLineF::IntersectionType instead + \obsolete Use QLineF::IntersectionType instead. + + \value NoIntersection + Lines do not intersect. + \value UnboundedIntersection + Lines intersect, but not within the range defined by their lengths. + \value BoundedIntersection + Lnes intersect within the range defined by their lengths. */ /*! - \enum QLineF::IntersectionType + \typealias QLineF::IntersectionType Describes the intersection between two lines. diff --git a/src/dbus/qdbusconnection_p.h b/src/dbus/qdbusconnection_p.h index da67a6c5d4..9bedbcc3a5 100644 --- a/src/dbus/qdbusconnection_p.h +++ b/src/dbus/qdbusconnection_p.h @@ -173,7 +173,7 @@ public: public: // typedefs - typedef QMultiHash<int, Watcher> WatcherHash; + typedef QMultiHash<qintptr, Watcher> WatcherHash; typedef QHash<int, DBusTimeout *> TimeoutHash; typedef QVector<QDBusMessage> PendingMessageList; @@ -283,8 +283,8 @@ public slots: // public slots void setDispatchEnabled(bool enable); void doDispatch(); - void socketRead(int); - void socketWrite(int); + void socketRead(qintptr); + void socketWrite(qintptr); void objectDestroyed(QObject *o); void relaySignal(QObject *obj, const QMetaObject *, int signalId, const QVariantList &args); bool addSignalHook(const QString &key, const SignalHook &hook); diff --git a/src/dbus/qdbusintegrator.cpp b/src/dbus/qdbusintegrator.cpp index 669b330f1d..b0a9342515 100644 --- a/src/dbus/qdbusintegrator.cpp +++ b/src/dbus/qdbusintegrator.cpp @@ -1205,7 +1205,7 @@ void QDBusConnectionPrivate::doDispatch() } } -void QDBusConnectionPrivate::socketRead(int fd) +void QDBusConnectionPrivate::socketRead(qintptr fd) { WatcherHash::ConstIterator it = watchers.constFind(fd); while (it != watchers.constEnd() && it.key() == fd) { @@ -1219,7 +1219,7 @@ void QDBusConnectionPrivate::socketRead(int fd) doDispatch(); } -void QDBusConnectionPrivate::socketWrite(int fd) +void QDBusConnectionPrivate::socketWrite(qintptr fd) { WatcherHash::ConstIterator it = watchers.constFind(fd); while (it != watchers.constEnd() && it.key() == fd) { diff --git a/src/gui/text/qtextmarkdownwriter.cpp b/src/gui/text/qtextmarkdownwriter.cpp index 7bd321becc..ae63fcb4dd 100644 --- a/src/gui/text/qtextmarkdownwriter.cpp +++ b/src/gui/text/qtextmarkdownwriter.cpp @@ -367,6 +367,14 @@ int QTextMarkdownWriter::writeBlock(const QTextBlock &block, bool wrap, bool ign const int ColumnLimit = 80; QTextBlockFormat blockFmt = block.blockFormat(); bool missedBlankCodeBlockLine = false; + const bool codeBlock = blockFmt.hasProperty(QTextFormat::BlockCodeFence) || + blockFmt.stringProperty(QTextFormat::BlockCodeLanguage).length() > 0; + if (m_fencedCodeBlock && !codeBlock) { + m_stream << m_linePrefix << QString(m_wrappedLineIndent, Space) + << m_codeBlockFence << Newline; + m_fencedCodeBlock = false; + m_codeBlockFence.clear(); + } if (block.textList()) { // it's a list-item auto fmt = block.textList()->format(); const int listLevel = fmt.indent(); @@ -427,7 +435,7 @@ int QTextMarkdownWriter::writeBlock(const QTextBlock &block, bool wrap, bool ign } else if (blockFmt.hasProperty(QTextFormat::BlockTrailingHorizontalRulerWidth)) { m_stream << "- - -\n"; // unambiguous horizontal rule, not an underline under a heading return 0; - } else if (blockFmt.hasProperty(QTextFormat::BlockCodeFence) || blockFmt.stringProperty(QTextFormat::BlockCodeLanguage).length() > 0) { + } else if (codeBlock) { // It's important to preserve blank lines in code blocks. But blank lines in code blocks // inside block quotes are getting preserved anyway (along with the "> " prefix). if (!blockFmt.hasProperty(QTextFormat::BlockQuoteLevel)) @@ -439,16 +447,11 @@ int QTextMarkdownWriter::writeBlock(const QTextBlock &block, bool wrap, bool ign m_codeBlockFence = QString(3, fenceChar.at(0)); // A block quote can contain an indented code block, but not vice-versa. m_stream << m_linePrefix << QString(m_wrappedLineIndent, Space) << m_codeBlockFence - << Space << blockFmt.stringProperty(QTextFormat::BlockCodeLanguage) << Newline; + << blockFmt.stringProperty(QTextFormat::BlockCodeLanguage) << Newline; m_fencedCodeBlock = true; } + wrap = false; } else if (!blockFmt.indent()) { - if (m_fencedCodeBlock) { - m_stream << m_linePrefix << QString(m_wrappedLineIndent, Space) - << m_codeBlockFence << Newline; - m_fencedCodeBlock = false; - m_codeBlockFence.clear(); - } m_wrappedLineIndent = 0; m_linePrefix.clear(); if (blockFmt.hasProperty(QTextFormat::BlockQuoteLevel)) { diff --git a/src/network/socket/qlocalserver_unix.cpp b/src/network/socket/qlocalserver_unix.cpp index 88367d680d..c4085b440e 100644 --- a/src/network/socket/qlocalserver_unix.cpp +++ b/src/network/socket/qlocalserver_unix.cpp @@ -185,7 +185,7 @@ bool QLocalServerPrivate::listen(const QString &requestedServerName) Q_ASSERT(!socketNotifier); socketNotifier = new QSocketNotifier(listenSocket, QSocketNotifier::Read, q); - q->connect(socketNotifier, SIGNAL(activated(int)), + q->connect(socketNotifier, SIGNAL(activated(QSocketDescriptor)), q, SLOT(_q_onNewConnection())); socketNotifier->setEnabled(maxPendingConnections > 0); return true; @@ -227,7 +227,7 @@ bool QLocalServerPrivate::listen(qintptr socketDescriptor) Q_ASSERT(!socketNotifier); socketNotifier = new QSocketNotifier(listenSocket, QSocketNotifier::Read, q); - q->connect(socketNotifier, SIGNAL(activated(int)), + q->connect(socketNotifier, SIGNAL(activated(QSocketDescriptor)), q, SLOT(_q_onNewConnection())); socketNotifier->setEnabled(maxPendingConnections > 0); return true; diff --git a/src/network/socket/qlocalsocket_unix.cpp b/src/network/socket/qlocalsocket_unix.cpp index d9b39a7752..52067a265c 100644 --- a/src/network/socket/qlocalsocket_unix.cpp +++ b/src/network/socket/qlocalsocket_unix.cpp @@ -308,7 +308,7 @@ void QLocalSocketPrivate::_q_connectToSocket() // Try again later, all of the sockets listening are full if (!delayConnect) { delayConnect = new QSocketNotifier(connectingSocket, QSocketNotifier::Write, q); - q->connect(delayConnect, SIGNAL(activated(int)), q, SLOT(_q_connectToSocket())); + q->connect(delayConnect, SIGNAL(activated(QSocketDescriptor)), q, SLOT(_q_connectToSocket())); } if (!connectTimer) { connectTimer = new QTimer(q); diff --git a/src/platformsupport/devicediscovery/qdevicediscovery_udev.cpp b/src/platformsupport/devicediscovery/qdevicediscovery_udev.cpp index 9cf5c9096e..118940c634 100644 --- a/src/platformsupport/devicediscovery/qdevicediscovery_udev.cpp +++ b/src/platformsupport/devicediscovery/qdevicediscovery_udev.cpp @@ -92,7 +92,7 @@ QDeviceDiscoveryUDev::QDeviceDiscoveryUDev(QDeviceTypes types, struct udev *udev m_udevMonitorFileDescriptor = udev_monitor_get_fd(m_udevMonitor); m_udevSocketNotifier = new QSocketNotifier(m_udevMonitorFileDescriptor, QSocketNotifier::Read, this); - connect(m_udevSocketNotifier, SIGNAL(activated(int)), this, SLOT(handleUDevNotification())); + connect(m_udevSocketNotifier, SIGNAL(activated(QSocketDescriptor)), this, SLOT(handleUDevNotification())); } QDeviceDiscoveryUDev::~QDeviceDiscoveryUDev() diff --git a/src/platformsupport/input/evdevmouse/qevdevmousehandler.cpp b/src/platformsupport/input/evdevmouse/qevdevmousehandler.cpp index a729eeb851..0b1c5548c7 100644 --- a/src/platformsupport/input/evdevmouse/qevdevmousehandler.cpp +++ b/src/platformsupport/input/evdevmouse/qevdevmousehandler.cpp @@ -113,6 +113,8 @@ QEvdevMouseHandler::QEvdevMouseHandler(const QString &device, int fd, bool abs, if (m_abs) m_abs = getHardwareMaximum(); + detectHiResWheelSupport(); + // socket notifier for events on the mouse device m_notify = new QSocketNotifier(m_fd, QSocketNotifier::Read, this); connect(m_notify, &QSocketNotifier::activated, @@ -125,6 +127,25 @@ QEvdevMouseHandler::~QEvdevMouseHandler() qt_safe_close(m_fd); } +void QEvdevMouseHandler::detectHiResWheelSupport() +{ +#if defined(REL_WHEEL_HI_RES) || defined(REL_HWHEEL_HI_RES) + // Check if we can expect hires events as we will get both + // legacy and hires event and needs to know if we should + // ignore the legacy events. + unsigned char relFeatures[(REL_MAX / 8) + 1]{}; + if (ioctl(m_fd, EVIOCGBIT(EV_REL, sizeof (relFeatures)), relFeatures) == -1) + return; + +#if defined(REL_WHEEL_HI_RES) + m_hiResWheel = TEST_BIT(relFeatures, REL_WHEEL_HI_RES); +#endif +#if defined(REL_HWHEEL_HI_RES) + m_hiResHWheel = TEST_BIT(relFeatures, REL_HWHEEL_HI_RES); +#endif +#endif +} + // Ask touch screen hardware for information on coordinate maximums // If any ioctls fail, revert to non abs mode bool QEvdevMouseHandler::getHardwareMaximum() @@ -243,14 +264,24 @@ void QEvdevMouseHandler::readMouseData() } else if (data->code == REL_Y) { m_y += data->value; posChanged = true; - } else if (data->code == ABS_WHEEL) { // vertical scroll + } else if (!m_hiResWheel && data->code == REL_WHEEL) { // data->value: positive == up, negative == down delta.setY(120 * data->value); emit handleWheelEvent(delta); - } else if (data->code == ABS_THROTTLE) { // horizontal scroll +#ifdef REL_WHEEL_HI_RES + } else if (data->code == REL_WHEEL_HI_RES) { + delta.setY(data->value); + emit handleWheelEvent(delta); +#endif + } else if (!m_hiResHWheel && data->code == REL_HWHEEL) { // data->value: positive == right, negative == left delta.setX(-120 * data->value); emit handleWheelEvent(delta); +#ifdef REL_HWHEEL_HI_RES + } else if (data->code == REL_HWHEEL_HI_RES) { + delta.setX(-data->value); + emit handleWheelEvent(delta); +#endif } } else if (data->type == EV_KEY && data->code == BTN_TOUCH) { // We care about touchpads only, not touchscreens -> don't map to button press. diff --git a/src/platformsupport/input/evdevmouse/qevdevmousehandler_p.h b/src/platformsupport/input/evdevmouse/qevdevmousehandler_p.h index 93314e885f..8fcf49200b 100644 --- a/src/platformsupport/input/evdevmouse/qevdevmousehandler_p.h +++ b/src/platformsupport/input/evdevmouse/qevdevmousehandler_p.h @@ -81,6 +81,7 @@ private: void sendMouseEvent(); bool getHardwareMaximum(); + void detectHiResWheelSupport(); QString m_device; int m_fd; @@ -89,6 +90,8 @@ private: int m_prevx = 0, m_prevy = 0; bool m_abs; bool m_compression; + bool m_hiResWheel = false; + bool m_hiResHWheel = false; Qt::MouseButtons m_buttons; Qt::MouseButton m_button; QEvent::Type m_eventType; diff --git a/src/plugins/platforms/openwfd/qopenwfddevice.cpp b/src/plugins/platforms/openwfd/qopenwfddevice.cpp index 7a9d22e74d..99896151b2 100644 --- a/src/plugins/platforms/openwfd/qopenwfddevice.cpp +++ b/src/plugins/platforms/openwfd/qopenwfddevice.cpp @@ -83,7 +83,7 @@ QOpenWFDDevice::QOpenWFDDevice(QOpenWFDIntegration *integration, WFDint device_e int fd = wfdDeviceEventGetFD(mDevice,mEvent); mEventSocketNotifier = new QSocketNotifier(fd,QSocketNotifier::Read,this); - connect(mEventSocketNotifier,SIGNAL(activated(int)),SLOT(readEvents())); + connect(mEventSocketNotifier,SIGNAL(activated(QSocketDescriptor)),SLOT(readEvents())); mCommitedDevice = true; commit(WFD_COMMIT_ENTIRE_DEVICE, handle()); diff --git a/src/plugins/platforms/qnx/qqnxbuttoneventnotifier.cpp b/src/plugins/platforms/qnx/qqnxbuttoneventnotifier.cpp index a6236f2376..f0c4c385ef 100644 --- a/src/plugins/platforms/qnx/qqnxbuttoneventnotifier.cpp +++ b/src/plugins/platforms/qnx/qqnxbuttoneventnotifier.cpp @@ -96,7 +96,7 @@ void QQnxButtonEventNotifier::start() } m_readNotifier = new QSocketNotifier(m_fd, QSocketNotifier::Read); - QObject::connect(m_readNotifier, SIGNAL(activated(int)), this, SLOT(updateButtonStates())); + QObject::connect(m_readNotifier, SIGNAL(activated(QSocketDescriptor)), this, SLOT(updateButtonStates())); qButtonDebug("successfully connected to Navigator. fd = %d", m_fd); } diff --git a/src/plugins/platforms/qnx/qqnxnavigatoreventnotifier.cpp b/src/plugins/platforms/qnx/qqnxnavigatoreventnotifier.cpp index 1f630863b7..f7e8e7966c 100644 --- a/src/plugins/platforms/qnx/qqnxnavigatoreventnotifier.cpp +++ b/src/plugins/platforms/qnx/qqnxnavigatoreventnotifier.cpp @@ -96,7 +96,7 @@ void QQnxNavigatorEventNotifier::start() } m_readNotifier = new QSocketNotifier(m_fd, QSocketNotifier::Read); - connect(m_readNotifier, SIGNAL(activated(int)), this, SLOT(readData())); + connect(m_readNotifier, SIGNAL(activated(QSocketDescriptor)), this, SLOT(readData())); } void QQnxNavigatorEventNotifier::parsePPS(const QByteArray &ppsData, QByteArray &msg, QByteArray &dat, QByteArray &id) diff --git a/src/plugins/platforms/qnx/qqnxvirtualkeyboardpps.cpp b/src/plugins/platforms/qnx/qqnxvirtualkeyboardpps.cpp index 025c03c058..6f496571fa 100644 --- a/src/plugins/platforms/qnx/qqnxvirtualkeyboardpps.cpp +++ b/src/plugins/platforms/qnx/qqnxvirtualkeyboardpps.cpp @@ -143,7 +143,7 @@ bool QQnxVirtualKeyboardPps::connect() return false; m_readNotifier = new QSocketNotifier(m_fd, QSocketNotifier::Read); - QObject::connect(m_readNotifier, SIGNAL(activated(int)), this, SLOT(ppsDataReady())); + QObject::connect(m_readNotifier, SIGNAL(activated(QSocketDescriptor)), this, SLOT(ppsDataReady())); return true; } diff --git a/src/plugins/platforms/wasm/qwasmeventdispatcher.cpp b/src/plugins/platforms/wasm/qwasmeventdispatcher.cpp index 09acd37abc..2e1b083557 100644 --- a/src/plugins/platforms/wasm/qwasmeventdispatcher.cpp +++ b/src/plugins/platforms/wasm/qwasmeventdispatcher.cpp @@ -195,7 +195,7 @@ void QWasmEventDispatcher::wakeUp() #ifdef EMSCRIPTEN_HAS_ASYNC_RUN_IN_MAIN_RUNTIME_THREAD if (!emscripten_is_main_runtime_thread()) if (m_hasMainLoop) - emscripten_async_run_in_main_runtime_thread_(EM_FUNC_SIG_VI, (void*)(&QWasmEventDispatcher::mainThreadWakeUp), this); + emscripten_async_run_in_main_runtime_thread_(EM_FUNC_SIG_VI, (void*)(&QWasmEventDispatcher::mainThreadWakeUp), this); #endif QEventDispatcherUNIX::wakeUp(); } diff --git a/src/plugins/platforms/xcb/qxcbsessionmanager.cpp b/src/plugins/platforms/xcb/qxcbsessionmanager.cpp index 2eb32c069e..e9697f505b 100644 --- a/src/plugins/platforms/xcb/qxcbsessionmanager.cpp +++ b/src/plugins/platforms/xcb/qxcbsessionmanager.cpp @@ -61,11 +61,11 @@ public: QSmSocketReceiver(int socket) { QSocketNotifier* sn = new QSocketNotifier(socket, QSocketNotifier::Read, this); - connect(sn, SIGNAL(activated(int)), this, SLOT(socketActivated(int))); + connect(sn, SIGNAL(activated(QSocketDescriptor)), this, SLOT(socketActivated())); } public Q_SLOTS: - void socketActivated(int); + void socketActivated(); }; @@ -327,7 +327,7 @@ static void sm_saveYourselfPhase2Callback(SmcConn smcConn, SmPointer clientData) } -void QSmSocketReceiver::socketActivated(int) +void QSmSocketReceiver::socketActivated() { IceProcessMessages(SmcGetIceConnection(smcConnection), nullptr, nullptr); } diff --git a/src/plugins/sqldrivers/psql/qsql_psql.cpp b/src/plugins/sqldrivers/psql/qsql_psql.cpp index 38bf355856..c5895f281d 100644 --- a/src/plugins/sqldrivers/psql/qsql_psql.cpp +++ b/src/plugins/sqldrivers/psql/qsql_psql.cpp @@ -279,7 +279,7 @@ void QPSQLDriverPrivate::checkPendingNotifications() const Q_Q(const QPSQLDriver); if (seid.size() && !pendingNotifyCheck) { pendingNotifyCheck = true; - QMetaObject::invokeMethod(const_cast<QPSQLDriver*>(q), "_q_handleNotification", Qt::QueuedConnection, Q_ARG(int,0)); + QMetaObject::invokeMethod(const_cast<QPSQLDriver*>(q), "_q_handleNotification", Qt::QueuedConnection); } } @@ -1246,7 +1246,7 @@ void QPSQLDriver::close() d->seid.clear(); if (d->sn) { - disconnect(d->sn, SIGNAL(activated(int)), this, SLOT(_q_handleNotification(int))); + disconnect(d->sn, SIGNAL(activated(QSocketDescriptor)), this, SLOT(_q_handleNotification())); delete d->sn; d->sn = nullptr; } @@ -1603,7 +1603,7 @@ bool QPSQLDriver::subscribeToNotification(const QString &name) if (!d->sn) { d->sn = new QSocketNotifier(socket, QSocketNotifier::Read); - connect(d->sn, SIGNAL(activated(int)), this, SLOT(_q_handleNotification(int))); + connect(d->sn, SIGNAL(activated(QSocketDescriptor)), this, SLOT(_q_handleNotification())); } } else { qWarning("QPSQLDriver::subscribeToNotificationImplementation: PQsocket didn't return a valid socket to listen on"); @@ -1639,7 +1639,7 @@ bool QPSQLDriver::unsubscribeFromNotification(const QString &name) d->seid.removeAll(name); if (d->seid.isEmpty()) { - disconnect(d->sn, SIGNAL(activated(int)), this, SLOT(_q_handleNotification(int))); + disconnect(d->sn, SIGNAL(activated(QSocketDescriptor)), this, SLOT(_q_handleNotification())); delete d->sn; d->sn = nullptr; } @@ -1653,7 +1653,7 @@ QStringList QPSQLDriver::subscribedToNotifications() const return d->seid; } -void QPSQLDriver::_q_handleNotification(int) +void QPSQLDriver::_q_handleNotification() { Q_D(QPSQLDriver); d->pendingNotifyCheck = false; diff --git a/src/plugins/sqldrivers/psql/qsql_psql_p.h b/src/plugins/sqldrivers/psql/qsql_psql_p.h index 9ac1fb50d7..22c0761667 100644 --- a/src/plugins/sqldrivers/psql/qsql_psql_p.h +++ b/src/plugins/sqldrivers/psql/qsql_psql_p.h @@ -130,7 +130,7 @@ protected: bool rollbackTransaction() override; private Q_SLOTS: - void _q_handleNotification(int); + void _q_handleNotification(); }; QT_END_NAMESPACE diff --git a/src/tools/rcc/main.cpp b/src/tools/rcc/main.cpp index ac87e48e39..d8e243daea 100644 --- a/src/tools/rcc/main.cpp +++ b/src/tools/rcc/main.cpp @@ -435,11 +435,10 @@ int main(int argc, char *argv[]) { // rcc uses a QHash to store files in the resource system. // we must force a certain hash order when testing or tst_rcc will fail, see QTBUG-25078 - if (Q_UNLIKELY(!qEnvironmentVariableIsEmpty("QT_RCC_TEST"))) { - qSetGlobalQHashSeed(0); - if (qGlobalQHashSeed() != 0) - qFatal("Cannot force QHash seed for testing as requested"); - } + // similar requirements exist for reproducibly builds. + qSetGlobalQHashSeed(0); + if (qGlobalQHashSeed() != 0) + qWarning("Cannot force QHash seed"); return QT_PREPEND_NAMESPACE(runRcc)(argc, argv); } |