summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/corelib/doc/src/qt6-changes.qdoc18
-rw-r--r--src/corelib/kernel/qjni.cpp4
-rw-r--r--src/corelib/kernel/qjniobject.cpp4
-rw-r--r--src/corelib/tools/qpoint.h4
-rw-r--r--src/gui/math3d/qquaternion.h2
-rw-r--r--src/widgets/widgets/qmenu.cpp3
-rw-r--r--tests/auto/corelib/kernel/qmetatype/tst_qmetatype.cpp11
7 files changed, 25 insertions, 21 deletions
diff --git a/src/corelib/doc/src/qt6-changes.qdoc b/src/corelib/doc/src/qt6-changes.qdoc
index 570dc45e93..7e048ead78 100644
--- a/src/corelib/doc/src/qt6-changes.qdoc
+++ b/src/corelib/doc/src/qt6-changes.qdoc
@@ -307,7 +307,7 @@
\section1 String related classes
- \section2 QStringView
+ \section2 The QStringView class
Starting with Qt6 it is generally recommended to use \l QStringView over
\c QStringRef. \l QStringView references a contiguous portion of a UTF-16
@@ -332,7 +332,7 @@
string += ...;
\endcode
- \section2 QStringRef
+ \section2 The QStringRef class
In Qt6 \l QStringRef got removed from Qt Core. To ease porting of existing
applications without touching the whole code-base, the \c QStringRef class
@@ -403,7 +403,7 @@
\section1 QFuture and Related Classes
- \section2 QFuture
+ \section2 The QFuture class
To avoid unintended usage of QFuture, there were some changes to
QFuture API in Qt 6, which may introduce source compatibility breaks.
@@ -470,14 +470,14 @@
\endlist
- \section2 QPromise
+ \section2 The QPromise class
In Qt 6, the new QPromise class should be used instead of unofficial
QFutureInterface as a "setter" counterpart of QFuture.
\section1 IO Classes
- \section2 QProcess
+ \section2 The QProcess class
In Qt 6, the QProcess::start() overload that interprets a single command string
by splitting it into program name and arguments is renamed to QProcess::startCommand().
@@ -508,7 +508,7 @@
\section1 Meta-Type system
- \section2 QVariant
+ \section2 The QVariant class
\c QVariant has been rewritten to use \c QMetaType for all of its operations. This implies
behavior changes in a few methods:
@@ -529,7 +529,7 @@
\endlist
- \section2 QMetaType
+ \section2 The QMetaType class
In Qt 6, registration of comparators, and \cQDebug and \QDataStream streaming operators is
done automatically. Consequently, \c QMetaType::registerEqualsComparator(),
@@ -555,7 +555,7 @@
\section1 Regular expression classes
- \section2 QRegularExpression
+ \section2 The QRegularExpression class
In Qt6, all methods taking the \c QRegExp got removed from our code-base.
Therefore it is very likely that you will have to port your application or
@@ -786,7 +786,7 @@
{QRegularExpression::UseUnicodePropertiesOption}
pattern option.
- \section2 QRegExp
+ \section2 The QRegExp class
In Qt6 \l QRegExp got removed from Qt Core. If your application cannot be
ported right now, \c QRegExp still exists in Qt5Compat to keep these
diff --git a/src/corelib/kernel/qjni.cpp b/src/corelib/kernel/qjni.cpp
index b593483e59..3750fdb9bc 100644
--- a/src/corelib/kernel/qjni.cpp
+++ b/src/corelib/kernel/qjni.cpp
@@ -280,9 +280,7 @@ jclass QJNIEnvironmentPrivate::findClass(const char *className, JNIEnv *env)
bool isCached = false;
jclass clazz = getCachedClass(classDotEnc, &isCached);
- const bool found = (clazz != 0) || (clazz == 0 && isCached);
-
- if (found)
+ if (clazz || isCached)
return clazz;
const QLatin1String key(classDotEnc);
diff --git a/src/corelib/kernel/qjniobject.cpp b/src/corelib/kernel/qjniobject.cpp
index 43840052ae..f141c2d84e 100644
--- a/src/corelib/kernel/qjniobject.cpp
+++ b/src/corelib/kernel/qjniobject.cpp
@@ -467,9 +467,7 @@ jclass QtAndroidPrivate::findClass(const char *className, JNIEnv *env)
bool isCached = false;
jclass clazz = getCachedClass(classDotEnc, &isCached);
- const bool found = clazz || (!clazz && isCached);
-
- if (found)
+ if (clazz || isCached)
return clazz;
const QLatin1String key(classDotEnc);
diff --git a/src/corelib/tools/qpoint.h b/src/corelib/tools/qpoint.h
index 8fff462487..f2c562393a 100644
--- a/src/corelib/tools/qpoint.h
+++ b/src/corelib/tools/qpoint.h
@@ -129,7 +129,7 @@ private:
}
};
-Q_DECLARE_TYPEINFO(QPoint, Q_RELOCATABLE_TYPE);
+Q_DECLARE_TYPEINFO(QPoint, Q_PRIMITIVE_TYPE);
/*****************************************************************************
QPoint stream functions
@@ -326,7 +326,7 @@ private:
}
};
-Q_DECLARE_TYPEINFO(QPointF, Q_RELOCATABLE_TYPE);
+Q_DECLARE_TYPEINFO(QPointF, Q_PRIMITIVE_TYPE);
size_t qHash(QPointF, size_t seed = 0) = delete;
diff --git a/src/gui/math3d/qquaternion.h b/src/gui/math3d/qquaternion.h
index 76fa237afd..4d04ac6ad9 100644
--- a/src/gui/math3d/qquaternion.h
+++ b/src/gui/math3d/qquaternion.h
@@ -169,7 +169,7 @@ private:
float wp, xp, yp, zp;
};
-Q_DECLARE_TYPEINFO(QQuaternion, Q_RELOCATABLE_TYPE);
+Q_DECLARE_TYPEINFO(QQuaternion, Q_PRIMITIVE_TYPE);
inline QQuaternion::QQuaternion() : wp(1.0f), xp(0.0f), yp(0.0f), zp(0.0f) {}
diff --git a/src/widgets/widgets/qmenu.cpp b/src/widgets/widgets/qmenu.cpp
index c6a130195c..3f349cf8a0 100644
--- a/src/widgets/widgets/qmenu.cpp
+++ b/src/widgets/widgets/qmenu.cpp
@@ -3003,8 +3003,7 @@ void QMenu::changeEvent(QEvent *e)
/*!
\reimp
*/
-bool
-QMenu::event(QEvent *e)
+bool QMenu::event(QEvent *e)
{
Q_D(QMenu);
switch (e->type()) {
diff --git a/tests/auto/corelib/kernel/qmetatype/tst_qmetatype.cpp b/tests/auto/corelib/kernel/qmetatype/tst_qmetatype.cpp
index 81a67f1b78..df9beabe73 100644
--- a/tests/auto/corelib/kernel/qmetatype/tst_qmetatype.cpp
+++ b/tests/auto/corelib/kernel/qmetatype/tst_qmetatype.cpp
@@ -1092,9 +1092,18 @@ void tst_QMetaType::flagsBinaryCompatibility6_0()
QFETCH(quint32, id);
QFETCH(quint32, flags);
+ const auto currentFlags = QMetaType::typeFlags(id);
+ auto expectedFlags = QMetaType::TypeFlags(flags);
+ if (!(currentFlags.testFlag(QMetaType::NeedsConstruction) && currentFlags.testFlag(QMetaType::NeedsDestruction))) {
+ if (expectedFlags.testFlag(QMetaType::NeedsConstruction) && expectedFlags.testFlag(QMetaType::NeedsDestruction)) {
+ // If type changed from RELOCATABLE to trivial, that's fine
+ expectedFlags.setFlag(QMetaType::NeedsConstruction, false);
+ expectedFlags.setFlag(QMetaType::NeedsDestruction, false);
+ }
+ }
quint32 mask_5_0 = 0x1fb; // Only compare the values that were already defined in 5.0
- QCOMPARE(quint32(QMetaType::typeFlags(id)) & mask_5_0, flags & mask_5_0);
+ QCOMPARE(quint32(currentFlags) & mask_5_0, quint32(expectedFlags) & mask_5_0);
}
void tst_QMetaType::construct_data()