summaryrefslogtreecommitdiffstats
path: root/src/corelib/global
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@qt.io>2020-01-04 15:32:34 +0100
committerLiang Qi <liang.qi@qt.io>2020-01-04 15:32:34 +0100
commita503bf54705d89204007e8f887b668fe5ef519fc (patch)
treeb2d1a452da39450eac78a1aeb1df116a73f64b23 /src/corelib/global
parente65c43fd0ffa57248e7d750570b7deae171a82f5 (diff)
parent1f87fb359fdff14e42662384a9c8a0bcb3837671 (diff)
Merge remote-tracking branch 'origin/5.15' into dev
Conflicts: src/corelib/tools/qvector.h Make QVector(DataPointer dd) public to be able to properly merge 5b4b437b30b320e2cd7c9a566999a39772e5d431 from 5.15 into dev. src/widgets/kernel/qapplication.cpp tests/auto/tools/moc/allmocs_baseline_in.json Done-With: Christian Ehrlicher <ch.ehrlicher@gmx.de> Change-Id: I929ba7c036d570382d0454c2c75f6f0d96ddbc01
Diffstat (limited to 'src/corelib/global')
-rw-r--r--src/corelib/global/qcompilerdetection.h13
-rw-r--r--src/corelib/global/qconfig-bootstrapped.h3
-rw-r--r--src/corelib/global/qendian.cpp6
-rw-r--r--src/corelib/global/qglobal.cpp30
-rw-r--r--src/corelib/global/qglobal.h12
-rw-r--r--src/corelib/global/qlibraryinfo.cpp36
-rw-r--r--src/corelib/global/qnamespace.h1
-rw-r--r--src/corelib/global/qnamespace.qdoc6
-rw-r--r--src/corelib/global/qoperatingsystemversion.cpp2
-rw-r--r--src/corelib/global/qrandom.cpp2
10 files changed, 65 insertions, 46 deletions
diff --git a/src/corelib/global/qcompilerdetection.h b/src/corelib/global/qcompilerdetection.h
index fedf08301f..e4c37451d2 100644
--- a/src/corelib/global/qcompilerdetection.h
+++ b/src/corelib/global/qcompilerdetection.h
@@ -815,13 +815,14 @@
# endif
# endif
-# if defined(__has_warning)
-# if __has_warning("-Wunused-private-field")
-# define Q_DECL_UNUSED_MEMBER Q_DECL_UNUSED
-# endif
-# endif
+#endif // Q_CC_CLANG && !Q_CC_INTEL && !Q_CC_MSVC
-#endif // Q_CC_CLANG
+#if defined(Q_CC_CLANG) && !defined(Q_CC_INTEL)
+# ifndef Q_DECL_UNUSED
+# define Q_DECL_UNUSED __attribute__((__unused__))
+# endif
+# define Q_DECL_UNUSED_MEMBER Q_DECL_UNUSED
+#endif
#if defined(Q_CC_GNU) && !defined(Q_CC_INTEL) && !defined(Q_CC_CLANG)
# define Q_COMPILER_RESTRICTED_VLA
diff --git a/src/corelib/global/qconfig-bootstrapped.h b/src/corelib/global/qconfig-bootstrapped.h
index 2e6c3fbb20..4a8a4598a0 100644
--- a/src/corelib/global/qconfig-bootstrapped.h
+++ b/src/corelib/global/qconfig-bootstrapped.h
@@ -75,7 +75,8 @@
# define QT_FEATURE_alloca_malloc_h -1
#endif
#define QT_FEATURE_binaryjson -1
-#define QT_FEATURE_cborstream -1
+#define QT_FEATURE_cborstreamreader -1
+#define QT_FEATURE_cborstreamwriter 1
#define QT_CRYPTOGRAPHICHASH_ONLY_SHA1
#define QT_FEATURE_cxx11_random (__has_include(<random>) ? 1 : -1)
#define QT_NO_DATASTREAM
diff --git a/src/corelib/global/qendian.cpp b/src/corelib/global/qendian.cpp
index c56a7ffbf7..f1c39f3c62 100644
--- a/src/corelib/global/qendian.cpp
+++ b/src/corelib/global/qendian.cpp
@@ -137,7 +137,7 @@ QT_BEGIN_NAMESPACE
\sa qToLittleEndian()
*/
/*!
- \fn template <typename T> T qFromLittleEndian(const void *src)
+ \fn template <typename T> inline T qFromLittleEndian(const void *src)
\since 4.3
\relates <QtEndian>
@@ -159,7 +159,7 @@ QT_BEGIN_NAMESPACE
\sa qToLittleEndian()
*/
/*!
- \fn template <typename T> T qFromLittleEndian(T src)
+ \fn template <typename T> inline T qFromLittleEndian(T src)
\since 4.3
\relates <QtEndian>
\overload
@@ -171,7 +171,7 @@ QT_BEGIN_NAMESPACE
unmodified.
*/
/*!
- \fn template <typename T> T qFromLittleEndian(const void *src, qsizetype count, void *dest)
+ \fn template <typename T> inline T qFromLittleEndian(const void *src, qsizetype count, void *dest)
\since 5.12
\relates <QtEndian>
diff --git a/src/corelib/global/qglobal.cpp b/src/corelib/global/qglobal.cpp
index c2c91df756..f9f005a83f 100644
--- a/src/corelib/global/qglobal.cpp
+++ b/src/corelib/global/qglobal.cpp
@@ -4161,36 +4161,6 @@ bool qunsetenv(const char *varName)
*/
/*!
- \macro QABS(n)
- \relates <QtGlobal>
- \obsolete
-
- Use qAbs(\a n) instead.
-
- \sa QMIN(), QMAX()
-*/
-
-/*!
- \macro QMIN(x, y)
- \relates <QtGlobal>
- \obsolete
-
- Use qMin(\a x, \a y) instead.
-
- \sa QMAX(), QABS()
-*/
-
-/*!
- \macro QMAX(x, y)
- \relates <QtGlobal>
- \obsolete
-
- Use qMax(\a x, \a y) instead.
-
- \sa QMIN(), QABS()
-*/
-
-/*!
\macro const char *qPrintable(const QString &str)
\relates <QtGlobal>
diff --git a/src/corelib/global/qglobal.h b/src/corelib/global/qglobal.h
index 80433ebeff..d508716024 100644
--- a/src/corelib/global/qglobal.h
+++ b/src/corelib/global/qglobal.h
@@ -892,6 +892,10 @@ QT_WARNING_POP
# define Q_DUMMY_COMPARISON_OPERATOR(C)
#endif
+QT_WARNING_PUSH
+// warning: noexcept-expression evaluates to ‘false’ because of a call to ‘void swap(..., ...)'
+QT_WARNING_DISABLE_GCC("-Wnoexcept")
+
namespace QtPrivate
{
namespace SwapExceptionTester { // insulate users from the "using std::swap" below
@@ -911,6 +915,8 @@ inline void qSwap(T &value1, T &value2)
swap(value1, value2);
}
+QT_WARNING_POP
+
#if QT_DEPRECATED_SINCE(5, 0)
Q_CORE_EXPORT QT_DEPRECATED void *qMalloc(size_t size) Q_ALLOC_SIZE(1);
Q_CORE_EXPORT QT_DEPRECATED void qFree(void *ptr);
@@ -1214,8 +1220,10 @@ inline int qIntCast(float f) { return int(f); }
/*
Reentrant versions of basic rand() functions for random number generation
*/
-Q_CORE_EXPORT void qsrand(uint seed);
-Q_CORE_EXPORT int qrand();
+#if QT_DEPRECATED_SINCE(5, 15)
+Q_CORE_EXPORT QT_DEPRECATED_VERSION_X_5_15("use QRandomGenerator instead") void qsrand(uint seed);
+Q_CORE_EXPORT QT_DEPRECATED_VERSION_X_5_15("use QRandomGenerator instead") int qrand();
+#endif
#define QT_MODULE(x)
diff --git a/src/corelib/global/qlibraryinfo.cpp b/src/corelib/global/qlibraryinfo.cpp
index aed224215c..9fab49a73e 100644
--- a/src/corelib/global/qlibraryinfo.cpp
+++ b/src/corelib/global/qlibraryinfo.cpp
@@ -561,9 +561,39 @@ static QString getRelocatablePrefix()
HMODULE hModule = getWindowsModuleHandle();
const int kBufferSize = 4096;
wchar_t buffer[kBufferSize];
- const int pathSize = GetModuleFileName(hModule, buffer, kBufferSize);
- if (pathSize > 0)
- prefixPath = prefixFromQtCoreLibraryHelper(QString::fromWCharArray(buffer, pathSize));
+ DWORD pathSize = GetModuleFileName(hModule, buffer, kBufferSize);
+ const QString qtCoreFilePath = QString::fromWCharArray(buffer, int(pathSize));
+ const QString qtCoreDirPath = QFileInfo(qtCoreFilePath).absolutePath();
+ pathSize = GetModuleFileName(NULL, buffer, kBufferSize);
+ const QString exeDirPath = QFileInfo(QString::fromWCharArray(buffer, int(pathSize))).absolutePath();
+ if (QFileInfo(exeDirPath) == QFileInfo(qtCoreDirPath)) {
+ // QtCore DLL is next to the executable. This is either a windeployqt'ed executable or an
+ // executable within the QT_HOST_BIN directory. We're detecting the latter case by checking
+ // whether there's an import library corresponding to our QtCore DLL in PREFIX/lib.
+ const QString libdir = QString::fromLatin1(
+ qt_configure_strs + qt_configure_str_offsets[QLibraryInfo::LibrariesPath - 1]);
+ const QLatin1Char slash('/');
+#if defined(Q_CC_MINGW)
+ const QString implibPrefix = QStringLiteral("lib");
+ const QString implibSuffix = QStringLiteral(".a");
+#else
+ const QString implibPrefix;
+ const QString implibSuffix = QStringLiteral(".lib");
+#endif
+ const QString qtCoreImpLibFileName = implibPrefix
+ + QFileInfo(qtCoreFilePath).completeBaseName() + implibSuffix;
+ const QString qtCoreImpLibPath = qtCoreDirPath
+ + slash + QLatin1String(QT_CONFIGURE_LIBLOCATION_TO_PREFIX_PATH)
+ + slash + libdir
+ + slash + qtCoreImpLibFileName;
+ if (!QFileInfo::exists(qtCoreImpLibPath)) {
+ // We did not find a corresponding import library and conclude that this is a
+ // windeployqt'ed executable.
+ return exeDirPath;
+ }
+ }
+ if (!qtCoreFilePath.isEmpty())
+ prefixPath = prefixFromQtCoreLibraryHelper(qtCoreFilePath);
#else
#error "The chosen platform / config does not support querying for a dynamic prefix."
#endif
diff --git a/src/corelib/global/qnamespace.h b/src/corelib/global/qnamespace.h
index 6ae04f0c7b..b9e981b4a6 100644
--- a/src/corelib/global/qnamespace.h
+++ b/src/corelib/global/qnamespace.h
@@ -505,6 +505,7 @@ namespace Qt {
AA_DontUseNativeMenuBar = 6,
AA_MacDontSwapCtrlAndMeta = 7,
AA_Use96Dpi = 8,
+ AA_MSWindowsDisableVirtualKeyboard = 9,
#if QT_DEPRECATED_SINCE(5, 14)
AA_X11InitThreads Q_DECL_ENUMERATOR_DEPRECATED = 10,
#endif
diff --git a/src/corelib/global/qnamespace.qdoc b/src/corelib/global/qnamespace.qdoc
index ef5f345e9c..6149281904 100644
--- a/src/corelib/global/qnamespace.qdoc
+++ b/src/corelib/global/qnamespace.qdoc
@@ -293,6 +293,12 @@
This attribute must be set before QGuiApplication is constructed.
This value was added in 5.13
+ \value AA_MSWindowsDisableVirtualKeyboard When this attribute is set,
+ Windows' native on-screen virtual keyboard will not be shown
+ automatically when a text input widget gains focus on a system
+ without a physical keyboard.
+ This value was added in 5.15
+
The following values are deprecated or obsolete:
\value AA_ImmediateWidgetCreation This attribute is no longer fully
diff --git a/src/corelib/global/qoperatingsystemversion.cpp b/src/corelib/global/qoperatingsystemversion.cpp
index 33793ca168..261f5c8795 100644
--- a/src/corelib/global/qoperatingsystemversion.cpp
+++ b/src/corelib/global/qoperatingsystemversion.cpp
@@ -299,6 +299,8 @@ int QOperatingSystemVersion::compare(const QOperatingSystemVersion &v1,
Returns the current OS type without constructing a QOperatingSystemVersion instance.
+ \since 5.10
+
\sa current()
*/
diff --git a/src/corelib/global/qrandom.cpp b/src/corelib/global/qrandom.cpp
index 563e5eb7ed..3dc024e301 100644
--- a/src/corelib/global/qrandom.cpp
+++ b/src/corelib/global/qrandom.cpp
@@ -1295,7 +1295,7 @@ void qsrand(uint seed)
\note This function is deprecated. In new applications, use
QRandomGenerator instead.
- \sa qrand(), QRandomGenerator
+ \sa qsrand(), QRandomGenerator
*/
int qrand()
{