summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--examples/widgets/itemviews/spreadsheet/spreadsheetitem.cpp2
-rw-r--r--examples/widgets/tools/completer/fsmodel.h2
-rw-r--r--mkspecs/features/simd.prf29
-rw-r--r--mkspecs/macx-clang/qmake.conf2
-rw-r--r--mkspecs/macx-g++/qmake.conf2
-rw-r--r--mkspecs/macx-icc/qmake.conf2
-rw-r--r--qmake/doc/src/qmake-manual.qdoc12
-rw-r--r--src/android/jar/jar.pro3
-rw-r--r--src/android/jar/src/org/qtproject/qt5/android/QtActivityDelegate.java4
-rw-r--r--src/android/jar/src/org/qtproject/qt5/android/QtNative.java134
-rw-r--r--src/android/jar/src/org/qtproject/qt5/android/QtServiceDelegate.java4
-rw-r--r--src/android/jar/src/org/qtproject/qt5/android/QtThread.java112
-rw-r--r--src/android/java/src/org/qtproject/qt5/android/bindings/QtLoader.java4
-rw-r--r--src/corelib/doc/snippets/code/src_corelib_global_qglobal.cpp2
-rw-r--r--src/corelib/global/qlogging.cpp7
-rw-r--r--src/corelib/kernel/qabstracteventdispatcher.cpp2
-rw-r--r--src/corelib/kernel/qcore_mac.cpp95
-rw-r--r--src/corelib/kernel/qcore_mac_p.h31
-rw-r--r--src/corelib/kernel/qobject.cpp2
-rw-r--r--src/corelib/kernel/qtimer.cpp2
-rw-r--r--src/corelib/kernel/qvariant.cpp4
-rw-r--r--src/gui/kernel/qguiapplication.cpp2
-rw-r--r--src/gui/opengl/qopenglpaintdevice.cpp2
-rw-r--r--src/gui/painting/qtriangulatingstroker.cpp2
-rw-r--r--src/gui/text/qfontmetrics.cpp4
-rw-r--r--src/network/access/qhttpnetworkconnection.cpp4
-rw-r--r--src/platformsupport/fontdatabases/mac/qfontengine_coretext.mm16
-rw-r--r--src/platformsupport/input/evdevtouch/qevdevtouchhandler.cpp2
-rw-r--r--src/plugins/platforms/android/androidjnimain.cpp107
-rw-r--r--src/plugins/platforms/cocoa/qcocoafiledialoghelper.mm6
-rw-r--r--src/plugins/platforms/cocoa/qcocoahelpers.h2
-rw-r--r--src/plugins/platforms/cocoa/qcocoahelpers.mm2
-rw-r--r--src/plugins/platforms/cocoa/qcocoawindow.mm6
-rw-r--r--src/plugins/platforms/cocoa/qnsview.mm8
-rw-r--r--src/plugins/platforms/cocoa/qnswindowdelegate.mm16
-rw-r--r--src/plugins/platforms/windows/qwindowswindow.cpp10
-rw-r--r--src/plugins/platforms/windows/qwindowswindow.h1
-rw-r--r--src/plugins/platforms/winrt/qwinrtscreen.cpp45
-rw-r--r--src/sql/doc/src/sql-driver.qdoc2
-rw-r--r--src/testlib/qplaintestlogger.cpp47
-rw-r--r--src/testlib/qtestcase.qdoc2
-rw-r--r--src/widgets/itemviews/qitemdelegate.cpp2
-rw-r--r--src/widgets/itemviews/qstyleditemdelegate.cpp2
-rw-r--r--src/widgets/kernel/qopenglwidget.cpp2
-rw-r--r--src/widgets/styles/qcommonstyle.cpp2
-rw-r--r--tests/auto/corelib/animation/qpauseanimation/BLACKLIST2
-rw-r--r--tests/auto/corelib/io/qsettings/BLACKLIST1
-rw-r--r--tests/auto/corelib/io/qstorageinfo/BLACKLIST2
-rw-r--r--tests/auto/dbus/qdbusmarshall/BLACKLIST3
-rw-r--r--tests/auto/gui/kernel/qwindow/BLACKLIST5
-rw-r--r--tests/auto/gui/text/qfont/BLACKLIST4
-rw-r--r--tests/auto/gui/text/qrawfont/BLACKLIST4
-rw-r--r--tests/auto/gui/text/qtextscriptengine/BLACKLIST2
-rw-r--r--tests/auto/network/access/qftp/BLACKLIST4
-rw-r--r--tests/auto/network/access/qnetworkreply/BLACKLIST4
-rw-r--r--tests/auto/network/ssl/qsslsocket/BLACKLIST4
-rw-r--r--tests/auto/opengl/qgl/BLACKLIST1
-rw-r--r--tests/auto/other/gestures/BLACKLIST5
-rw-r--r--tests/auto/widgets/dialogs/qfontdialog/BLACKLIST5
-rw-r--r--tests/auto/widgets/graphicsview/qgraphicsitem/BLACKLIST2
-rw-r--r--tests/auto/widgets/graphicsview/qgraphicsproxywidget/BLACKLIST6
-rw-r--r--tests/auto/widgets/graphicsview/qgraphicswidget/BLACKLIST4
-rw-r--r--tests/auto/widgets/itemviews/qtableview/BLACKLIST2
-rw-r--r--tests/auto/widgets/kernel/qaction/BLACKLIST2
-rw-r--r--tests/auto/widgets/kernel/qaction/tst_qaction.cpp2
-rw-r--r--tests/auto/widgets/kernel/qactiongroup/BLACKLIST2
-rw-r--r--tests/auto/widgets/kernel/qapplication/BLACKLIST2
-rw-r--r--tests/auto/widgets/kernel/qapplication/test/BLACKLIST2
-rw-r--r--tests/auto/widgets/kernel/qtooltip/BLACKLIST4
-rw-r--r--tests/auto/widgets/kernel/qwidget/BLACKLIST18
-rw-r--r--tests/auto/widgets/kernel/qwidget_window/BLACKLIST4
-rw-r--r--tests/auto/widgets/styles/qstylesheetstyle/BLACKLIST5
-rw-r--r--tests/auto/widgets/widgets/qcombobox/BLACKLIST4
-rw-r--r--tests/auto/widgets/widgets/qmenubar/BLACKLIST1
-rw-r--r--tests/auto/widgets/widgets/qopenglwidget/BLACKLIST13
-rw-r--r--tests/auto/widgets/widgets/qspinbox/BLACKLIST3
-rw-r--r--tests/auto/widgets/widgets/qtabbar/BLACKLIST1
77 files changed, 536 insertions, 338 deletions
diff --git a/examples/widgets/itemviews/spreadsheet/spreadsheetitem.cpp b/examples/widgets/itemviews/spreadsheet/spreadsheetitem.cpp
index e9d5235ddc..4c18fa8251 100644
--- a/examples/widgets/itemviews/spreadsheet/spreadsheetitem.cpp
+++ b/examples/widgets/itemviews/spreadsheet/spreadsheetitem.cpp
@@ -117,7 +117,7 @@ QVariant SpreadSheetItem::computeFormula(const QString &formula,
const QTableWidget *widget,
const QTableWidgetItem *self)
{
- // check if the s tring is actually a formula or not
+ // check if the string is actually a formula or not
QStringList list = formula.split(' ');
if (list.isEmpty() || !widget)
return formula; // it is a normal string
diff --git a/examples/widgets/tools/completer/fsmodel.h b/examples/widgets/tools/completer/fsmodel.h
index a243c48b43..7b2e7b7dab 100644
--- a/examples/widgets/tools/completer/fsmodel.h
+++ b/examples/widgets/tools/completer/fsmodel.h
@@ -55,7 +55,7 @@
// With a QFileSystemModel, set on a view, you will see "Program Files" in the view
// But with this model, you will see "C:\Program Files" in the view.
-// We acheive this, by having the data() return the entire file path for
+// We achieve this, by having the data() return the entire file path for
// the display role. Note that the Qt::EditRole over which the QCompleter
// looks for matches is left unchanged
//! [0]
diff --git a/mkspecs/features/simd.prf b/mkspecs/features/simd.prf
index 8471ce7e7c..e4bee7107c 100644
--- a/mkspecs/features/simd.prf
+++ b/mkspecs/features/simd.prf
@@ -23,6 +23,7 @@ defineTest(addSimdCompiler) {
upname = $$upper($$name)
headers_var = $${upname}_HEADERS
sources_var = $${upname}_SOURCES
+ csources_var = $${upname}_C_SOURCES
asm_var = $${upname}_ASM
CONFIG($$1) {
@@ -34,6 +35,14 @@ defineTest(addSimdCompiler) {
export(SOURCES)
} else {
# We need special compiler flags
+
+ # Split C and C++ sources
+ $$csources_var = $$find($$sources_var, ".*\\.c$")
+ $$sources_var -= $$eval($$csources_var)
+ export($$csources_var)
+ export($$sources_var)
+
+ # Add C++ compiler
$${name}_compiler.commands = $$QMAKE_CXX -c $(CXXFLAGS) $$cflags $(INCPATH) ${QMAKE_FILE_IN}
msvc: $${name}_compiler.commands += -Fo${QMAKE_FILE_OUT}
else: $${name}_compiler.commands += -o ${QMAKE_FILE_OUT}
@@ -52,6 +61,26 @@ defineTest(addSimdCompiler) {
export($${name}_compiler.input)
export($${name}_compiler.variable_out)
export($${name}_compiler.name)
+
+ # Add a C compiler
+ $${name}_c_compiler.commands = $$QMAKE_CC -c $(CFLAGS) $$cflags $(INCPATH) ${QMAKE_FILE_IN}
+ msvc: $${name}_c_compiler.commands += -Fo${QMAKE_FILE_OUT}
+ else: $${name}_c_compiler.commands += -o ${QMAKE_FILE_OUT}
+
+ $${name}_c_compiler.dependency_type = TYPE_C
+ $${name}_c_compiler.output = ${QMAKE_VAR_OBJECTS_DIR}${QMAKE_FILE_BASE}$${first(QMAKE_EXT_OBJ)}
+ $${name}_c_compiler.input = $$csources_var
+ $${name}_c_compiler.variable_out = OBJECTS
+ $${name}_c_compiler.name = compiling[$${name}] ${QMAKE_FILE_IN}
+ silent: $${name}_c_compiler.commands = @echo compiling[$${name}] ${QMAKE_FILE_IN} && $$eval($${name}_c_compiler.commands)
+ QMAKE_EXTRA_COMPILERS += $${name}_c_compiler
+
+ export($${name}_c_compiler.commands)
+ export($${name}_c_compiler.dependency_type)
+ export($${name}_c_compiler.output)
+ export($${name}_c_compiler.input)
+ export($${name}_c_compiler.variable_out)
+ export($${name}_c_compiler.name)
}
# We always need an assembler (need to run the C compiler and without precompiled headers)
diff --git a/mkspecs/macx-clang/qmake.conf b/mkspecs/macx-clang/qmake.conf
index 259595221f..170464d08f 100644
--- a/mkspecs/macx-clang/qmake.conf
+++ b/mkspecs/macx-clang/qmake.conf
@@ -2,7 +2,7 @@
# qmake configuration for Clang on OS X
#
-QMAKE_MACOSX_DEPLOYMENT_TARGET = 10.10
+QMAKE_MACOSX_DEPLOYMENT_TARGET = 10.11
QMAKE_APPLE_DEVICE_ARCHS = x86_64
diff --git a/mkspecs/macx-g++/qmake.conf b/mkspecs/macx-g++/qmake.conf
index 4209c9a62c..5686610b17 100644
--- a/mkspecs/macx-g++/qmake.conf
+++ b/mkspecs/macx-g++/qmake.conf
@@ -10,7 +10,7 @@ MAKEFILE_GENERATOR = UNIX
CONFIG += app_bundle incremental global_init_link_order lib_version_first
QMAKE_INCREMENTAL_STYLE = sublib
-QMAKE_MACOSX_DEPLOYMENT_TARGET = 10.10
+QMAKE_MACOSX_DEPLOYMENT_TARGET = 10.11
QMAKE_APPLE_DEVICE_ARCHS = x86_64
diff --git a/mkspecs/macx-icc/qmake.conf b/mkspecs/macx-icc/qmake.conf
index 80cffbf9dc..fa3944f843 100644
--- a/mkspecs/macx-icc/qmake.conf
+++ b/mkspecs/macx-icc/qmake.conf
@@ -98,7 +98,7 @@ QMAKE_CXXFLAGS_PRECOMPILE = -c -pch-create ${QMAKE_PCH_OUTPUT} -include ${QMAKE_
QMAKE_CFLAGS_HIDESYMS += -fvisibility=hidden
QMAKE_CXXFLAGS_HIDESYMS += $$QMAKE_CFLAGS_HIDESYMS -fvisibility-inlines-hidden
-QMAKE_MACOSX_DEPLOYMENT_TARGET = 10.10
+QMAKE_MACOSX_DEPLOYMENT_TARGET = 10.11
QMAKE_APPLE_DEVICE_ARCHS = x86_64
diff --git a/qmake/doc/src/qmake-manual.qdoc b/qmake/doc/src/qmake-manual.qdoc
index 16b498d36e..8b7d1b0853 100644
--- a/qmake/doc/src/qmake-manual.qdoc
+++ b/qmake/doc/src/qmake-manual.qdoc
@@ -3168,11 +3168,6 @@
\snippet code/doc_src_qmake-manual.pro 70
- \section2 sprintf(string, arguments...)
-
- Replaces %1-%9 with the arguments passed in the comma-separated list
- of function \c arguments and returns the processed string.
-
\section2 resolve_depends(variablename, prefix)
This is an internal function that you will typically not need.
@@ -3239,6 +3234,11 @@
\snippet code/doc_src_qmake-manual.pro 168
+ \section2 sprintf(string, arguments...)
+
+ Replaces %1-%9 in \c string with the arguments passed in the comma-separated
+ list of function \c arguments and returns the processed string.
+
\target str_member()
\section2 str_member(arg [, start [, end]])
@@ -3306,7 +3306,7 @@
\section2 system_quote(arg)
- Quotes \c arg for the for the shell that is used by the \c{system()}
+ Quotes \c arg for the shell that is used by the \c{system()}
functions.
See also \l{shell_quote(arg)}{shell_quote()}.
diff --git a/src/android/jar/jar.pro b/src/android/jar/jar.pro
index 603e28aeee..683866a345 100644
--- a/src/android/jar/jar.pro
+++ b/src/android/jar/jar.pro
@@ -21,7 +21,8 @@ JAVASOURCES += \
$$PATHPREFIX/ExtractStyle.java \
$$PATHPREFIX/EditMenu.java \
$$PATHPREFIX/EditPopupMenu.java \
- $$PATHPREFIX/CursorHandle.java
+ $$PATHPREFIX/CursorHandle.java \
+ $$PATHPREFIX/QtThread.java
# install
target.path = $$[QT_INSTALL_PREFIX]/jar
diff --git a/src/android/jar/src/org/qtproject/qt5/android/QtActivityDelegate.java b/src/android/jar/src/org/qtproject/qt5/android/QtActivityDelegate.java
index 0e28b964e8..6b8577116e 100644
--- a/src/android/jar/src/org/qtproject/qt5/android/QtActivityDelegate.java
+++ b/src/android/jar/src/org/qtproject/qt5/android/QtActivityDelegate.java
@@ -921,6 +921,7 @@ public class QtActivityDelegate
public void onTerminate()
{
QtNative.terminateQt();
+ QtNative.m_qtThread.exit();
}
public void onCreate(Bundle savedInstanceState)
@@ -1076,7 +1077,8 @@ public class QtActivityDelegate
QtNative.setActivity(null, null);
if (m_debuggerProcess != null)
m_debuggerProcess.destroy();
- System.exit(0);// FIXME remove it or find a better way
+ QtNative.m_qtThread.exit();
+ System.exit(0);
}
}
diff --git a/src/android/jar/src/org/qtproject/qt5/android/QtNative.java b/src/android/jar/src/org/qtproject/qt5/android/QtNative.java
index 1cf3bca5f7..3db3453263 100644
--- a/src/android/jar/src/org/qtproject/qt5/android/QtNative.java
+++ b/src/android/jar/src/org/qtproject/qt5/android/QtNative.java
@@ -98,6 +98,7 @@ public class QtNative
private static ClipboardManager m_clipboardManager = null;
private static Method m_checkSelfPermissionMethod = null;
private static Boolean m_tabletEventSupported = null;
+ public static QtThread m_qtThread = new QtThread();
private static final Runnable runPendingCppRunnablesRunnable = new Runnable() {
@Override
public void run() {
@@ -164,55 +165,64 @@ public class QtNative
}
// this method loads full path libs
- public static void loadQtLibraries(ArrayList<String> libraries)
+ public static void loadQtLibraries(final ArrayList<String> libraries)
{
- if (libraries == null)
- return;
-
- for (String libName : libraries) {
- try {
- File f = new File(libName);
- if (f.exists())
- System.load(libName);
- } catch (SecurityException e) {
- Log.i(QtTAG, "Can't load '" + libName + "'", e);
- } catch (Exception e) {
- Log.i(QtTAG, "Can't load '" + libName + "'", e);
+ m_qtThread.run(new Runnable() {
+ @Override
+ public void run() {
+ if (libraries == null)
+ return;
+ for (String libName : libraries) {
+ try {
+ File f = new File(libName);
+ if (f.exists())
+ System.load(libName);
+ } catch (SecurityException e) {
+ Log.i(QtTAG, "Can't load '" + libName + "'", e);
+ } catch (Exception e) {
+ Log.i(QtTAG, "Can't load '" + libName + "'", e);
+ }
+ }
}
- }
+ });
}
// this method loads bundled libs by name.
- public static void loadBundledLibraries(ArrayList<String> libraries, String nativeLibraryDir)
+ public static void loadBundledLibraries(final ArrayList<String> libraries, final String nativeLibraryDir)
{
- if (libraries == null)
- return;
+ m_qtThread.run(new Runnable() {
+ @Override
+ public void run() {
+ if (libraries == null)
+ return;
- for (String libName : libraries) {
- try {
- String libNameTemplate = "lib" + libName + ".so";
- File f = new File(nativeLibraryDir + libNameTemplate);
- if (!f.exists()) {
- Log.i(QtTAG, "Can't find '" + f.getAbsolutePath());
+ for (String libName : libraries) {
try {
- ActivityInfo info = m_activity.getPackageManager().getActivityInfo(m_activity.getComponentName(),
- PackageManager.GET_META_DATA);
- String systemLibraryDir = QtNativeLibrariesDir.systemLibrariesDir;
- if (info.metaData.containsKey("android.app.system_libs_prefix"))
- systemLibraryDir = info.metaData.getString("android.app.system_libs_prefix");
- f = new File(systemLibraryDir + libNameTemplate);
- } catch (Exception e) {
+ String libNameTemplate = "lib" + libName + ".so";
+ File f = new File(nativeLibraryDir + libNameTemplate);
+ if (!f.exists()) {
+ Log.i(QtTAG, "Can't find '" + f.getAbsolutePath());
+ try {
+ ActivityInfo info = m_activity.getPackageManager().getActivityInfo(m_activity.getComponentName(),
+ PackageManager.GET_META_DATA);
+ String systemLibraryDir = QtNativeLibrariesDir.systemLibrariesDir;
+ if (info.metaData.containsKey("android.app.system_libs_prefix"))
+ systemLibraryDir = info.metaData.getString("android.app.system_libs_prefix");
+ f = new File(systemLibraryDir + libNameTemplate);
+ } catch (Exception e) {
+ }
+ }
+ if (f.exists())
+ System.load(f.getAbsolutePath());
+ else
+ Log.i(QtTAG, "Can't find '" + f.getAbsolutePath());
+ } catch (Exception e) {
+ Log.i(QtTAG, "Can't load '" + libName + "'", e);
}
}
- if (f.exists())
- System.load(f.getAbsolutePath());
- else
- Log.i(QtTAG, "Can't find '" + f.getAbsolutePath());
- } catch (Exception e) {
- Log.i(QtTAG, "Can't load '" + libName + "'", e);
}
- }
+ });
}
public static void setActivity(Activity qtMainActivity, QtActivityDelegate qtActivityDelegate)
@@ -293,7 +303,7 @@ public class QtNative
}
public static boolean startApplication(String params,
- String environment,
+ final String environment,
String mainLibrary,
String nativeLibraryDir) throws Exception
{
@@ -317,23 +327,42 @@ public class QtNative
if (params == null)
params = "-platform\tandroid";
- boolean res = false;
+ final String mainLibraryPath = f.getAbsolutePath();
+ final boolean[] res = new boolean[1];
+ res[0] = false;
synchronized (m_mainActivityMutex) {
- res = startQtAndroidPlugin();
- setDisplayMetrics(m_displayMetricsScreenWidthPixels,
- m_displayMetricsScreenHeightPixels,
- m_displayMetricsDesktopWidthPixels,
- m_displayMetricsDesktopHeightPixels,
- m_displayMetricsXDpi,
- m_displayMetricsYDpi,
- m_displayMetricsScaledDensity,
- m_displayMetricsDensity);
if (params.length() > 0 && !params.startsWith("\t"))
params = "\t" + params;
- startQtApplication(f.getAbsolutePath() + params, environment);
+ final String qtParams = f.getAbsolutePath() + params;
+ m_qtThread.run(new Runnable() {
+ @Override
+ public void run() {
+ try {
+ System.load(mainLibraryPath);
+ } catch (Exception e) {
+ Log.i(QtTAG, "Can't load '" + mainLibraryPath + "'", e);
+ }
+ res[0] = startQtAndroidPlugin(qtParams, environment);
+ setDisplayMetrics(m_displayMetricsScreenWidthPixels,
+ m_displayMetricsScreenHeightPixels,
+ m_displayMetricsDesktopWidthPixels,
+ m_displayMetricsDesktopHeightPixels,
+ m_displayMetricsXDpi,
+ m_displayMetricsYDpi,
+ m_displayMetricsScaledDensity,
+ m_displayMetricsDensity);
+ }
+ });
+ m_qtThread.post(new Runnable() {
+ @Override
+ public void run() {
+ startQtApplication();
+ }
+ });
+ waitForServiceSetup();
m_started = true;
}
- return res;
+ return res[0];
}
public static void setApplicationDisplayMetrics(int screenWidthPixels,
@@ -377,8 +406,9 @@ public class QtNative
// application methods
- public static native void startQtApplication(String params, String env);
- public static native boolean startQtAndroidPlugin();
+ public static native boolean startQtAndroidPlugin(String params, String env);
+ public static native void startQtApplication();
+ public static native void waitForServiceSetup();
public static native void quitQtCoreApplication();
public static native void quitQtAndroidPlugin();
public static native void terminateQt();
diff --git a/src/android/jar/src/org/qtproject/qt5/android/QtServiceDelegate.java b/src/android/jar/src/org/qtproject/qt5/android/QtServiceDelegate.java
index 195ec376c9..ae06fa6268 100644
--- a/src/android/jar/src/org/qtproject/qt5/android/QtServiceDelegate.java
+++ b/src/android/jar/src/org/qtproject/qt5/android/QtServiceDelegate.java
@@ -187,6 +187,10 @@ public class QtServiceDelegate
public void onDestroy()
{
QtNative.quitQtCoreApplication();
+ QtNative.terminateQt();
+ QtNative.setService(null, null);
+ QtNative.m_qtThread.exit();
+ System.exit(0);
}
public IBinder onBind(Intent intent)
diff --git a/src/android/jar/src/org/qtproject/qt5/android/QtThread.java b/src/android/jar/src/org/qtproject/qt5/android/QtThread.java
new file mode 100644
index 0000000000..975e787345
--- /dev/null
+++ b/src/android/jar/src/org/qtproject/qt5/android/QtThread.java
@@ -0,0 +1,112 @@
+/****************************************************************************
+**
+** Copyright (C) 2018 BogDan Vatra <bogdan@kdab.com>
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the Android port of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+package org.qtproject.qt5.android;
+
+import java.util.ArrayList;
+import java.util.concurrent.Semaphore;
+
+public class QtThread {
+ private ArrayList<Runnable> m_pendingRunnables = new ArrayList<Runnable>();
+ private boolean m_exit = false;
+ private Thread m_qtThread = new Thread(new Runnable() {
+ @Override
+ public void run() {
+ while (!m_exit) {
+ try {
+ ArrayList<Runnable> pendingRunnables;
+ synchronized (m_qtThread) {
+ if (m_pendingRunnables.size() == 0)
+ m_qtThread.wait();
+ pendingRunnables = new ArrayList<Runnable>(m_pendingRunnables);
+ m_pendingRunnables.clear();
+ }
+ for (Runnable runnable : pendingRunnables)
+ runnable.run();
+ } catch (InterruptedException e) {
+ e.printStackTrace();
+ }
+ }
+ }
+ });
+
+ QtThread() {
+ m_qtThread.setName("qtMainLoopThread");
+ m_qtThread.start();
+ }
+
+ public void post(final Runnable runnable) {
+ synchronized (m_qtThread) {
+ m_pendingRunnables.add(runnable);
+ m_qtThread.notify();
+ }
+ }
+
+ public void run(final Runnable runnable) {
+ final Semaphore sem = new Semaphore(0);
+ synchronized (m_qtThread) {
+ m_pendingRunnables.add(new Runnable() {
+ @Override
+ public void run() {
+ runnable.run();
+ sem.release();
+ }
+ });
+ m_qtThread.notify();
+ }
+ try {
+ sem.acquire();
+ } catch (InterruptedException e) {
+ e.printStackTrace();
+ }
+ }
+
+ public void exit()
+ {
+ m_exit = true;
+ synchronized (m_qtThread) {
+ m_qtThread.notify();
+ }
+ try {
+ m_qtThread.join();
+ } catch (InterruptedException e) {
+ e.printStackTrace();
+ }
+ }
+}
diff --git a/src/android/java/src/org/qtproject/qt5/android/bindings/QtLoader.java b/src/android/java/src/org/qtproject/qt5/android/bindings/QtLoader.java
index 6e92e64028..fb6f61e31e 100644
--- a/src/android/java/src/org/qtproject/qt5/android/bindings/QtLoader.java
+++ b/src/android/java/src/org/qtproject/qt5/android/bindings/QtLoader.java
@@ -243,10 +243,6 @@ public abstract class QtLoader {
QtApplication.setQtContextDelegate(m_delegateClass, qtLoader);
- // now load the application library so it's accessible from this class loader
- if (libName != null)
- System.loadLibrary(libName);
-
Method startAppMethod=qtLoader.getClass().getMethod("startApplication");
if (!(Boolean)startAppMethod.invoke(qtLoader))
throw new Exception("");
diff --git a/src/corelib/doc/snippets/code/src_corelib_global_qglobal.cpp b/src/corelib/doc/snippets/code/src_corelib_global_qglobal.cpp
index 8d4bd36beb..ceb3f8adf3 100644
--- a/src/corelib/doc/snippets/code/src_corelib_global_qglobal.cpp
+++ b/src/corelib/doc/snippets/code/src_corelib_global_qglobal.cpp
@@ -294,7 +294,7 @@ void myMessageOutput(QtMsgType type, const QMessageLogContext &context, const QS
break;
case QtFatalMsg:
fprintf(stderr, "Fatal: %s (%s:%u, %s)\n", localMsg.constData(), context.file, context.line, context.function);
- abort();
+ break;
}
}
diff --git a/src/corelib/global/qlogging.cpp b/src/corelib/global/qlogging.cpp
index ba0c105372..39a5bbf645 100644
--- a/src/corelib/global/qlogging.cpp
+++ b/src/corelib/global/qlogging.cpp
@@ -71,6 +71,10 @@
#include <android/log.h>
#endif
+#ifdef Q_OS_DARWIN
+#include <QtCore/private/qcore_mac_p.h>
+#endif
+
#if QT_CONFIG(journald)
# define SD_JOURNAL_SUPPRESS_LOCATION
# include <systemd/sd-journal.h>
@@ -1676,6 +1680,9 @@ static void qDefaultMessageHandler(QtMsgType type, const QMessageLogContext &con
handledStderr |= syslog_default_message_handler(type, context, message);
# elif defined(Q_OS_ANDROID)
handledStderr |= android_default_message_handler(type, context, message);
+# elif defined(QT_USE_APPLE_UNIFIED_LOGGING)
+ if (__builtin_available(macOS 10.12, iOS 10, tvOS 10, watchOS 3, *))
+ handledStderr |= AppleUnifiedLogger::messageHandler(type, context, message);
# endif
#endif
diff --git a/src/corelib/kernel/qabstracteventdispatcher.cpp b/src/corelib/kernel/qabstracteventdispatcher.cpp
index 67c15d2f2c..304a7bda08 100644
--- a/src/corelib/kernel/qabstracteventdispatcher.cpp
+++ b/src/corelib/kernel/qabstracteventdispatcher.cpp
@@ -484,7 +484,7 @@ bool QAbstractEventDispatcher::filterNativeEvent(const QByteArray &eventType, vo
This pure virtual method exists on windows only and has to be reimplemented by a Windows specific
event dispatcher implementation. \a notifier is the QWinEventNotifier instance to be registered.
- The method should return true if the registration of \a notifier was sucessful, otherwise false.
+ The method should return true if the registration of \a notifier was successful, otherwise false.
QWinEventNotifier calls this method in it's constructor and there should never be a need to call this
method directly.
diff --git a/src/corelib/kernel/qcore_mac.cpp b/src/corelib/kernel/qcore_mac.cpp
index bfb3b2ff07..b5df0db232 100644
--- a/src/corelib/kernel/qcore_mac.cpp
+++ b/src/corelib/kernel/qcore_mac.cpp
@@ -39,6 +39,9 @@
#include <private/qcore_mac_p.h>
#include <new>
+
+#include "qhash.h"
+#include "qpair.h"
#include "qvarlengtharray.h"
QT_BEGIN_NAMESPACE
@@ -57,4 +60,96 @@ QCFString::operator CFStringRef() const
return value;
}
+// --------------------------------------------------------------------------
+
+#if defined(QT_USE_APPLE_UNIFIED_LOGGING)
+
+bool AppleUnifiedLogger::messageHandler(QtMsgType msgType, const QMessageLogContext &context,
+ const QString &message, const QString &optionalSubsystem)
+{
+ QString subsystem = optionalSubsystem;
+ if (subsystem.isNull()) {
+ static QString bundleIdentifier = []() {
+ if (CFBundleRef bundle = CFBundleGetMainBundle()) {
+ if (CFStringRef identifier = CFBundleGetIdentifier(bundle))
+ return QString::fromCFString(identifier);
+ }
+ return QString();
+ }();
+ subsystem = bundleIdentifier;
+ }
+
+ const bool isDefault = !context.category || !strcmp(context.category, "default");
+ os_log_t log = isDefault ? OS_LOG_DEFAULT :
+ cachedLog(subsystem, QString::fromLatin1(context.category));
+ os_log_type_t logType = logTypeForMessageType(msgType);
+
+ if (!os_log_type_enabled(log, logType))
+ return false;
+
+ // Logging best practices says we should not include symbolication
+ // information or source file line numbers in messages, as the system
+ // will automatically captures this information. In our case, what
+ // the system captures is the call to os_log_with_type below, which
+ // isn't really useful, but we still don't want to include the context's
+ // info, as that would clutter the logging output. See rdar://35958308.
+
+ // The format must be a string constant, so we can't pass on the
+ // message. This means we won't be able to take advantage of the
+ // unified logging's custom format specifiers such as %{BOOL}d.
+ // We use the 'public' format specifier to prevent the logging
+ // system from redacting our log message.
+ os_log_with_type(log, logType, "%{public}s", qPrintable(message));
+
+ // When running under Xcode or LLDB, one or more of these variables will
+ // be set, which triggers libsystem_trace.dyld to log messages to stderr
+ // as well, via_os_log_impl_mirror_to_stderr. Un-setting these variables
+ // is not an option, as that would silence normal NSLog or os_log calls,
+ // so instead we skip our own stderr output. See rdar://36919139.
+ static bool mirroredToStderr = qEnvironmentVariableIsSet("OS_ACTIVITY_DT_MODE")
+ || qEnvironmentVariableIsSet("ACTIVITY_LOG_STDERR")
+ || qEnvironmentVariableIsSet("CFLOG_FORCE_STDERR");
+ return mirroredToStderr;
+}
+
+os_log_type_t AppleUnifiedLogger::logTypeForMessageType(QtMsgType msgType)
+{
+ switch (msgType) {
+ case QtDebugMsg: return OS_LOG_TYPE_DEBUG;
+ case QtInfoMsg: return OS_LOG_TYPE_INFO;
+ case QtWarningMsg: return OS_LOG_TYPE_DEFAULT;
+ case QtCriticalMsg: return OS_LOG_TYPE_ERROR;
+ case QtFatalMsg: return OS_LOG_TYPE_FAULT;
+ }
+
+ return OS_LOG_TYPE_DEFAULT;
+}
+
+os_log_t AppleUnifiedLogger::cachedLog(const QString &subsystem, const QString &category)
+{
+ static QBasicMutex mutex;
+ QMutexLocker locker(&mutex);
+
+ static QHash<QPair<QString, QString>, os_log_t> logs;
+ const auto cacheKey = qMakePair(subsystem, category);
+ os_log_t log = logs.value(cacheKey);
+
+ if (!log) {
+ log = os_log_create(subsystem.toLatin1().constData(),
+ category.toLatin1().constData());
+ logs.insert(cacheKey, log);
+
+ // Technically we should release the os_log_t resource when done
+ // with it, but since we don't know when a category is disabled
+ // we keep all cached os_log_t instances until shutdown, where
+ // the OS will clean them up for us.
+ }
+
+ return log;
+}
+
+#endif // QT_USE_APPLE_UNIFIED_LOGGING
+
+// --------------------------------------------------------------------------
+
QT_END_NAMESPACE
diff --git a/src/corelib/kernel/qcore_mac_p.h b/src/corelib/kernel/qcore_mac_p.h
index 13143a08bb..9c6cef68b2 100644
--- a/src/corelib/kernel/qcore_mac_p.h
+++ b/src/corelib/kernel/qcore_mac_p.h
@@ -159,6 +159,37 @@ QDebug operator<<(QDebug debug, const QMacAutoReleasePool *pool);
Q_CORE_EXPORT void qt_apple_check_os_version();
+// --------------------------------------------------------------------------
+
+#if !defined(QT_BOOTSTRAPPED) && (QT_MACOS_PLATFORM_SDK_EQUAL_OR_ABOVE(__MAC_10_12) || !defined(Q_OS_MACOS))
+#define QT_USE_APPLE_UNIFIED_LOGGING
+
+QT_END_NAMESPACE
+#include <os/log.h>
+
+// The compiler isn't smart enough to realize that we're calling these functions
+// guarded by __builtin_available, so we need to also tag each function with the
+// runtime requirements.
+#include <os/availability.h>
+#define OS_LOG_AVAILABILITY API_AVAILABLE(macos(10.12), ios(10.0), tvos(10.0), watchos(3.0))
+QT_BEGIN_NAMESPACE
+
+class Q_CORE_EXPORT AppleUnifiedLogger
+{
+public:
+ static bool messageHandler(QtMsgType msgType, const QMessageLogContext &context, const QString &message,
+ const QString &subsystem = QString()) OS_LOG_AVAILABILITY;
+private:
+ static os_log_type_t logTypeForMessageType(QtMsgType msgType) OS_LOG_AVAILABILITY;
+ static os_log_t cachedLog(const QString &subsystem, const QString &category) OS_LOG_AVAILABILITY;
+};
+
+#undef OS_LOG_AVAILABILITY
+
+#endif
+
+// --------------------------------------------------------------------------
+
QT_END_NAMESPACE
#endif // QCORE_MAC_P_H
diff --git a/src/corelib/kernel/qobject.cpp b/src/corelib/kernel/qobject.cpp
index 5b37945ae0..263c4019f7 100644
--- a/src/corelib/kernel/qobject.cpp
+++ b/src/corelib/kernel/qobject.cpp
@@ -516,7 +516,7 @@ void QMetaCallEvent::placeMetaCall(QObject *object)
\reentrant
- QSignalBlocker can be used whereever you would otherwise use a
+ QSignalBlocker can be used wherever you would otherwise use a
pair of calls to blockSignals(). It blocks signals in its
constructor and in the destructor it resets the state to what
it was before the constructor ran.
diff --git a/src/corelib/kernel/qtimer.cpp b/src/corelib/kernel/qtimer.cpp
index 27d94e47d3..c3504943c4 100644
--- a/src/corelib/kernel/qtimer.cpp
+++ b/src/corelib/kernel/qtimer.cpp
@@ -108,7 +108,7 @@ QT_BEGIN_NAMESPACE
in many real-world situations.
The accuracy also depends on the \l{Qt::TimerType}{timer type}. For
- Qt::PreciseTimer, QTimer will try to keep the accurance at 1 millisecond.
+ Qt::PreciseTimer, QTimer will try to keep the accuracy at 1 millisecond.
Precise timers will also never time out earlier than expected.
For Qt::CoarseTimer and Qt::VeryCoarseTimer types, QTimer may wake up
diff --git a/src/corelib/kernel/qvariant.cpp b/src/corelib/kernel/qvariant.cpp
index 7ccacd883f..96299b9eaf 100644
--- a/src/corelib/kernel/qvariant.cpp
+++ b/src/corelib/kernel/qvariant.cpp
@@ -256,6 +256,10 @@ static qreal qConvertToRealNumber(const QVariant::Private *d, bool *ok)
case QMetaType::UShort:
case QMetaType::ULong:
return qreal(qMetaTypeUNumber(d));
+#ifndef QT_BOOTSTRAPPED
+ case QMetaType::QJsonValue:
+ return v_cast<QJsonValue>(d)->toDouble();
+#endif
default:
// includes enum conversion as well as invalid types
return qreal(qConvertToNumber(d, ok));
diff --git a/src/gui/kernel/qguiapplication.cpp b/src/gui/kernel/qguiapplication.cpp
index 055347500b..36c9b1a964 100644
--- a/src/gui/kernel/qguiapplication.cpp
+++ b/src/gui/kernel/qguiapplication.cpp
@@ -3459,7 +3459,7 @@ void QGuiApplication::setFallbackSessionManagementEnabled(bool enabled)
You should never exit the application within this signal. Instead, the
session manager may or may not do this afterwards, depending on the
- context. Futhermore, most session managers will very likely request a saved
+ context. Furthermore, most session managers will very likely request a saved
state immediately after the application has been started. This permits the
session manager to learn about the application's restart policy.
diff --git a/src/gui/opengl/qopenglpaintdevice.cpp b/src/gui/opengl/qopenglpaintdevice.cpp
index e539ee0e31..3a0c02feb0 100644
--- a/src/gui/opengl/qopenglpaintdevice.cpp
+++ b/src/gui/opengl/qopenglpaintdevice.cpp
@@ -96,7 +96,7 @@ QT_BEGIN_NAMESPACE
When intermixing QPainter and OpenGL, it is important to notify
QPainter that the OpenGL state may have been cluttered so it can
- restore its internal state. This is acheived by calling \l
+ restore its internal state. This is achieved by calling \l
QPainter::beginNativePainting() before starting the OpenGL
rendering and calling \l QPainter::endNativePainting() after
finishing.
diff --git a/src/gui/painting/qtriangulatingstroker.cpp b/src/gui/painting/qtriangulatingstroker.cpp
index 3f7b01ddbe..b1b07f9699 100644
--- a/src/gui/painting/qtriangulatingstroker.cpp
+++ b/src/gui/painting/qtriangulatingstroker.cpp
@@ -261,7 +261,7 @@ void QTriangulatingStroker::moveTo(const qreal *pts)
normalVector(m_cx, m_cy, x2, y2, &m_nvx, &m_nvy);
- // To acheive jumps we insert zero-area tringles. This is done by
+ // To achieve jumps we insert zero-area tringles. This is done by
// adding two identical points in both the end of previous strip
// and beginning of next strip
bool invisibleJump = m_vertices.size();
diff --git a/src/gui/text/qfontmetrics.cpp b/src/gui/text/qfontmetrics.cpp
index 5ad57b064b..407559ad51 100644
--- a/src/gui/text/qfontmetrics.cpp
+++ b/src/gui/text/qfontmetrics.cpp
@@ -452,7 +452,7 @@ bool QFontMetrics::inFontUcs4(uint ucs4) const
value is negative if the pixels of the character extend to the
left of the logical origin.
- See width(QChar) for a graphical description of this metric.
+ See width() for a graphical description of this metric.
\sa rightBearing(), minLeftBearing(), width()
*/
@@ -1402,7 +1402,7 @@ bool QFontMetricsF::inFontUcs4(uint ucs4) const
value is negative if the pixels of the character extend to the
left of the logical origin.
- See width(QChar) for a graphical description of this metric.
+ See width() for a graphical description of this metric.
\sa rightBearing(), minLeftBearing(), width()
*/
diff --git a/src/network/access/qhttpnetworkconnection.cpp b/src/network/access/qhttpnetworkconnection.cpp
index d24927b922..517af326a8 100644
--- a/src/network/access/qhttpnetworkconnection.cpp
+++ b/src/network/access/qhttpnetworkconnection.cpp
@@ -646,8 +646,8 @@ QHttpNetworkReply* QHttpNetworkConnectionPrivate::queueRequest(const QHttpNetwor
#ifndef Q_OS_WINRT
// For Happy Eyeballs the networkLayerState is set to Unknown
- // untill we have started the first connection attempt. So no
- // request will be started untill we know if IPv4 or IPv6
+ // until we have started the first connection attempt. So no
+ // request will be started until we know if IPv4 or IPv6
// should be used.
if (networkLayerState == Unknown || networkLayerState == HostLookupPending) {
startHostInfoLookup();
diff --git a/src/platformsupport/fontdatabases/mac/qfontengine_coretext.mm b/src/platformsupport/fontdatabases/mac/qfontengine_coretext.mm
index d388e33dae..675f689ace 100644
--- a/src/platformsupport/fontdatabases/mac/qfontengine_coretext.mm
+++ b/src/platformsupport/fontdatabases/mac/qfontengine_coretext.mm
@@ -47,28 +47,18 @@
#include <cmath>
-#if defined(Q_OS_OSX) && !QT_OSX_DEPLOYMENT_TARGET_BELOW(__MAC_10_11)
+#if defined(Q_OS_MACOS)
#import <AppKit/AppKit.h>
#endif
-#if defined(QT_PLATFORM_UIKIT) && !QT_IOS_DEPLOYMENT_TARGET_BELOW(__IPHONE_8_2)
+#if defined(QT_PLATFORM_UIKIT)
#import <UIKit/UIKit.h>
#endif
// These are available cross platform, exported as kCTFontWeightXXX from CoreText.framework,
// but they are not documented and are not in public headers so are private API and exposed
// only through the NSFontWeightXXX and UIFontWeightXXX aliases in AppKit and UIKit (rdar://26109857)
-#if QT_MAC_DEPLOYMENT_TARGET_BELOW(__MAC_10_11, __IPHONE_8_2)
-#define kCTFontWeightUltraLight -0.8
-#define kCTFontWeightThin -0.6
-#define kCTFontWeightLight -0.4
-#define kCTFontWeightRegular 0
-#define kCTFontWeightMedium 0.23
-#define kCTFontWeightSemibold 0.3
-#define kCTFontWeightBold 0.4
-#define kCTFontWeightHeavy 0.56
-#define kCTFontWeightBlack 0.62
-#elif defined(Q_OS_OSX)
+#if defined(Q_OS_MACOS)
#define kCTFontWeightUltraLight NSFontWeightUltraLight
#define kCTFontWeightThin NSFontWeightThin
#define kCTFontWeightLight NSFontWeightLight
diff --git a/src/platformsupport/input/evdevtouch/qevdevtouchhandler.cpp b/src/platformsupport/input/evdevtouch/qevdevtouchhandler.cpp
index 0ab4c65c45..7b7649bc5c 100644
--- a/src/platformsupport/input/evdevtouch/qevdevtouchhandler.cpp
+++ b/src/platformsupport/input/evdevtouch/qevdevtouchhandler.cpp
@@ -148,7 +148,7 @@ public:
mutable QPointer<QScreen> m_screen;
// Touch filtering and prediction are part of the same thing. The default
- // prediction is 0ms, but sensible results can be acheived by setting it
+ // prediction is 0ms, but sensible results can be achieved by setting it
// to, for instance, 16ms.
// For filtering to work well, the QPA plugin should provide a dead-steady
// implementation of QPlatformWindow::requestUpdate().
diff --git a/src/plugins/platforms/android/androidjnimain.cpp b/src/plugins/platforms/android/androidjnimain.cpp
index 2bdd49dc50..13d41bea99 100644
--- a/src/plugins/platforms/android/androidjnimain.cpp
+++ b/src/plugins/platforms/android/androidjnimain.cpp
@@ -59,6 +59,7 @@
#include "qandroideventdispatcher.h"
#include <android/api-level.h>
+#include <QtCore/qthread.h>
#include <QtCore/private/qjnihelpers_p.h>
#include <QtCore/private/qjni_p.h>
#include <QtGui/private/qguiapplication_p.h>
@@ -99,7 +100,6 @@ extern "C" typedef int (*Main)(int, char **); //use the standard main method to
static Main m_main = nullptr;
static void *m_mainLibraryHnd = nullptr;
static QList<QByteArray> m_applicationParams;
-pthread_t m_qtAppThread = 0;
static sem_t m_exitSemaphore, m_terminateSemaphore;
QHash<int, AndroidSurfaceClient *> m_surfaces;
@@ -441,57 +441,10 @@ namespace QtAndroid
} // namespace QtAndroid
-static jboolean startQtAndroidPlugin(JNIEnv* /*env*/, jobject /*object*//*, jobject applicationAssetManager*/)
+static jboolean startQtAndroidPlugin(JNIEnv *env, jobject /*object*/, jstring paramsString, jstring environmentString)
{
m_androidPlatformIntegration = nullptr;
m_androidAssetsFileEngineHandler = new AndroidAssetsFileEngineHandler();
- return true;
-}
-
-static void *startMainMethod(void */*data*/)
-{
- {
- JNIEnv* env = nullptr;
- JavaVMAttachArgs args;
- args.version = JNI_VERSION_1_6;
- args.name = "QtMainThread";
- args.group = NULL;
- JavaVM *vm = QtAndroidPrivate::javaVM();
- if (vm != 0)
- vm->AttachCurrentThread(&env, &args);
- }
-
- QVarLengthArray<const char *> params(m_applicationParams.size());
- for (int i = 0; i < m_applicationParams.size(); i++)
- params[i] = static_cast<const char *>(m_applicationParams[i].constData());
-
- int ret = m_main(m_applicationParams.length(), const_cast<char **>(params.data()));
-
- if (m_mainLibraryHnd) {
- int res = dlclose(m_mainLibraryHnd);
- if (res < 0)
- qWarning() << "dlclose failed:" << dlerror();
- }
-
- if (m_applicationClass)
- QJNIObjectPrivate::callStaticMethod<void>(m_applicationClass, "quitApp", "()V");
-
- // All attached threads should be detached before returning from this function.
- JavaVM *vm = QtAndroidPrivate::javaVM();
- if (vm != 0)
- vm->DetachCurrentThread();
-
- sem_post(&m_terminateSemaphore);
- sem_wait(&m_exitSemaphore);
- sem_destroy(&m_exitSemaphore);
-
- // We must call exit() to ensure that all global objects will be destructed
- exit(ret);
- return 0;
-}
-
-static jboolean startQtApplication(JNIEnv *env, jobject /*object*/, jstring paramsString, jstring environmentString)
-{
m_mainLibraryHnd = nullptr;
{ // Set env. vars
const char *nativeString = env->GetStringUTFChars(environmentString, 0);
@@ -540,14 +493,54 @@ static jboolean startQtApplication(JNIEnv *env, jobject /*object*/, jstring para
if (sem_init(&m_terminateSemaphore, 0, 0) == -1)
return false;
- jboolean res = pthread_create(&m_qtAppThread, nullptr, startMainMethod, nullptr) == 0;
+ return true;
+}
+static void waitForServiceSetup(JNIEnv *env, jclass /*clazz*/)
+{
+ Q_UNUSED(env);
// The service must wait until the QCoreApplication starts otherwise onBind will be
// called too early
if (m_serviceObject)
QtAndroidPrivate::waitForServiceSetup();
+}
+
+static jboolean startQtApplication(JNIEnv */*env*/, jclass /*clazz*/)
+{
+ {
+ JNIEnv* env = nullptr;
+ JavaVMAttachArgs args;
+ args.version = JNI_VERSION_1_6;
+ args.name = "QtMainThread";
+ args.group = NULL;
+ JavaVM *vm = QtAndroidPrivate::javaVM();
+ if (vm != 0)
+ vm->AttachCurrentThread(&env, &args);
+ }
+
+ QVarLengthArray<const char *> params(m_applicationParams.size());
+ for (int i = 0; i < m_applicationParams.size(); i++)
+ params[i] = static_cast<const char *>(m_applicationParams[i].constData());
+
+ int ret = m_main(m_applicationParams.length(), const_cast<char **>(params.data()));
+
+ if (m_mainLibraryHnd) {
+ int res = dlclose(m_mainLibraryHnd);
+ if (res < 0)
+ qWarning() << "dlclose failed:" << dlerror();
+ }
- return res;
+ if (m_applicationClass) {
+ qWarning("exit app 0");
+ QJNIObjectPrivate::callStaticMethod<void>(m_applicationClass, "quitApp", "()V");
+ }
+
+ sem_post(&m_terminateSemaphore);
+ sem_wait(&m_exitSemaphore);
+ sem_destroy(&m_exitSemaphore);
+
+ // We must call exit() to ensure that all global objects will be destructed
+ exit(ret);
}
static void quitQtCoreApplication(JNIEnv *env, jclass /*clazz*/)
@@ -593,7 +586,6 @@ static void terminateQt(JNIEnv *env, jclass /*clazz*/)
if (!QAndroidEventDispatcherStopper::instance()->stopped()) {
sem_post(&m_exitSemaphore);
- pthread_join(m_qtAppThread, nullptr);
}
}
@@ -758,11 +750,12 @@ static jobject onBind(JNIEnv */*env*/, jclass /*cls*/, jobject intent)
}
static JNINativeMethod methods[] = {
- {"startQtAndroidPlugin", "()Z", (void *)startQtAndroidPlugin},
- {"startQtApplication", "(Ljava/lang/String;Ljava/lang/String;)V", (void *)startQtApplication},
+ {"startQtAndroidPlugin", "(Ljava/lang/String;Ljava/lang/String;)Z", (void *)startQtAndroidPlugin},
+ {"startQtApplication", "()V", (void *)startQtApplication},
{"quitQtAndroidPlugin", "()V", (void *)quitQtAndroidPlugin},
{"quitQtCoreApplication", "()V", (void *)quitQtCoreApplication},
{"terminateQt", "()V", (void *)terminateQt},
+ {"waitForServiceSetup", "()V", (void *)waitForServiceSetup},
{"setDisplayMetrics", "(IIIIDDDD)V", (void *)setDisplayMetrics},
{"setSurface", "(ILjava/lang/Object;II)V", (void *)setSurface},
{"updateWindow", "()V", (void *)updateWindow},
@@ -884,7 +877,6 @@ Q_DECL_EXPORT jint JNICALL JNI_OnLoad(JavaVM *vm, void */*reserved*/)
void *venv;
} UnionJNIEnvToVoid;
- __android_log_print(ANDROID_LOG_INFO, "Qt", "qt start");
UnionJNIEnvToVoid uenv;
uenv.venv = nullptr;
m_javaVM = nullptr;
@@ -906,5 +898,10 @@ Q_DECL_EXPORT jint JNICALL JNI_OnLoad(JavaVM *vm, void */*reserved*/)
QWindowSystemInterfacePrivate::TabletEvent::setPlatformSynthesizesMouse(false);
m_javaVM = vm;
+ // attach qt main thread data to this thread
+ QObject threadSetter;
+ if (threadSetter.thread())
+ threadSetter.thread()->setObjectName("QtMainLoopThread");
+ __android_log_print(ANDROID_LOG_INFO, "Qt", "qt started");
return JNI_VERSION_1_4;
}
diff --git a/src/plugins/platforms/cocoa/qcocoafiledialoghelper.mm b/src/plugins/platforms/cocoa/qcocoafiledialoghelper.mm
index 98b9f7c9ba..00bfc8bef5 100644
--- a/src/plugins/platforms/cocoa/qcocoafiledialoghelper.mm
+++ b/src/plugins/platforms/cocoa/qcocoafiledialoghelper.mm
@@ -162,11 +162,7 @@ QT_NAMESPACE_ALIAS_OBJC_CLASS(QNSOpenSavePanelDelegate);
// resetting our mCurrentDir, set the delegate
// here to make sure it gets the correct value.
[mSavePanel setDelegate:self];
-
-#if QT_OSX_PLATFORM_SDK_EQUAL_OR_ABOVE(__MAC_10_11)
- if (__builtin_available(macOS 10.11, *))
- mOpenPanel.accessoryViewDisclosed = YES;
-#endif
+ mOpenPanel.accessoryViewDisclosed = YES;
if (mOptions->isLabelExplicitlySet(QFileDialogOptions::Accept))
[mSavePanel setPrompt:[self strip:options->labelText(QFileDialogOptions::Accept)]];
diff --git a/src/plugins/platforms/cocoa/qcocoahelpers.h b/src/plugins/platforms/cocoa/qcocoahelpers.h
index 2c4783b1e3..84632c1487 100644
--- a/src/plugins/platforms/cocoa/qcocoahelpers.h
+++ b/src/plugins/platforms/cocoa/qcocoahelpers.h
@@ -63,6 +63,8 @@ Q_FORWARD_DECLARE_OBJC_CLASS(QT_MANGLE_NAMESPACE(QNSView));
QT_BEGIN_NAMESPACE
Q_DECLARE_LOGGING_CATEGORY(lcQpaCocoaWindow)
+Q_DECLARE_LOGGING_CATEGORY(lcQpaCocoaDrawing)
+Q_DECLARE_LOGGING_CATEGORY(lcQpaCocoaMouse)
class QPixmap;
class QString;
diff --git a/src/plugins/platforms/cocoa/qcocoahelpers.mm b/src/plugins/platforms/cocoa/qcocoahelpers.mm
index 677f92863b..3b45793944 100644
--- a/src/plugins/platforms/cocoa/qcocoahelpers.mm
+++ b/src/plugins/platforms/cocoa/qcocoahelpers.mm
@@ -58,6 +58,8 @@
QT_BEGIN_NAMESPACE
Q_LOGGING_CATEGORY(lcQpaCocoaWindow, "qt.qpa.cocoa.window");
+Q_LOGGING_CATEGORY(lcQpaCocoaDrawing, "qt.qpa.cocoa.drawing");
+Q_LOGGING_CATEGORY(lcQpaCocoaMouse, "qt.qpa.cocoa.mouse");
//
// Conversion Functions
diff --git a/src/plugins/platforms/cocoa/qcocoawindow.mm b/src/plugins/platforms/cocoa/qcocoawindow.mm
index 88851f7441..e4dd71f01b 100644
--- a/src/plugins/platforms/cocoa/qcocoawindow.mm
+++ b/src/plugins/platforms/cocoa/qcocoawindow.mm
@@ -1158,7 +1158,7 @@ void QCocoaWindow::handleExposeEvent(const QRegion &region)
// rect as a real expose event (including going from non-exposed to
// exposed). FIXME: Should this logic live in QGuiApplication?
if (isExposed() && m_exposedRect == previouslyExposedRect) {
- qCDebug(lcQpaCocoaWindow) << "QCocoaWindow::handleExposeEvent" << window() << region << "as update request";
+ qCDebug(lcQpaCocoaDrawing) << "QCocoaWindow::handleExposeEvent" << window() << region << "as update request";
windowPrivate->deliverUpdateRequest();
return;
} else {
@@ -1168,7 +1168,7 @@ void QCocoaWindow::handleExposeEvent(const QRegion &region)
}
}
- qCDebug(lcQpaCocoaWindow) << "QCocoaWindow::handleExposeEvent" << window() << region << "isExposed" << isExposed();
+ qCDebug(lcQpaCocoaDrawing) << "QCocoaWindow::handleExposeEvent" << window() << region << "isExposed" << isExposed();
QWindowSystemInterface::handleExposeEvent<QWindowSystemInterface::SynchronousDelivery>(window(), region);
}
@@ -1341,7 +1341,7 @@ void QCocoaWindow::recreateWindowIfNeeded()
void QCocoaWindow::requestUpdate()
{
- qCDebug(lcQpaCocoaWindow) << "QCocoaWindow::requestUpdate" << window();
+ qCDebug(lcQpaCocoaDrawing) << "QCocoaWindow::requestUpdate" << window();
[m_view setNeedsDisplay:YES];
}
diff --git a/src/plugins/platforms/cocoa/qnsview.mm b/src/plugins/platforms/cocoa/qnsview.mm
index af16ed103e..f9c28542a9 100644
--- a/src/plugins/platforms/cocoa/qnsview.mm
+++ b/src/plugins/platforms/cocoa/qnsview.mm
@@ -314,7 +314,7 @@ Q_LOGGING_CATEGORY(lcQpaTablet, "qt.qpa.input.tablet")
for (int i = 0; i < numDirtyRects; ++i)
exposedRegion += QRectF::fromCGRect(dirtyRects[i]).toRect();
- qCDebug(lcQpaCocoaWindow) << "[QNSView drawRect:]" << m_platformWindow->window() << exposedRegion;
+ qCDebug(lcQpaCocoaDrawing) << "[QNSView drawRect:]" << m_platformWindow->window() << exposedRegion;
#ifndef QT_NO_OPENGL
if (m_glContext && m_shouldSetGLContextinDrawRect) {
@@ -331,7 +331,7 @@ Q_LOGGING_CATEGORY(lcQpaTablet, "qt.qpa.input.tablet")
// But AppKit will reset the needsDisplay state of the view after completing
// the current display cycle, so we need to defer the request to redisplay.
// FIXME: Perhaps this should be a trigger to enable CADisplayLink?
- qCDebug(lcQpaCocoaWindow) << "[QNSView drawRect:] issuing deferred setNeedsDisplay due to pending update request";
+ qCDebug(lcQpaCocoaDrawing) << "[QNSView drawRect:] issuing deferred setNeedsDisplay due to pending update request";
dispatch_async(dispatch_get_main_queue (), ^{
[self setNeedsDisplay:YES];
});
@@ -348,7 +348,7 @@ Q_LOGGING_CATEGORY(lcQpaTablet, "qt.qpa.input.tablet")
if (!m_platformWindow)
return;
- qCDebug(lcQpaCocoaWindow) << "[QNSView updateLayer]" << m_platformWindow->window();
+ qCDebug(lcQpaCocoaDrawing) << "[QNSView updateLayer]" << m_platformWindow->window();
// FIXME: Find out if there's a way to resolve the dirty rect like in drawRect:
m_platformWindow->handleExposeEvent(QRectF::fromCGRect(self.bounds).toRect());
@@ -787,7 +787,7 @@ Q_LOGGING_CATEGORY(lcQpaTablet, "qt.qpa.input.tablet")
- (void)cursorUpdate:(NSEvent *)theEvent
{
- qCDebug(lcQpaCocoaWindow) << "[QNSView cursorUpdate:]" << self.cursor;
+ qCDebug(lcQpaCocoaMouse) << "[QNSView cursorUpdate:]" << self.cursor;
// Note: We do not get this callback when moving from a subview that
// uses the legacy cursorRect API, so the cursor is reset to the arrow
diff --git a/src/plugins/platforms/cocoa/qnswindowdelegate.mm b/src/plugins/platforms/cocoa/qnswindowdelegate.mm
index cdecd86dfb..6e5623d679 100644
--- a/src/plugins/platforms/cocoa/qnswindowdelegate.mm
+++ b/src/plugins/platforms/cocoa/qnswindowdelegate.mm
@@ -80,22 +80,6 @@ static QRegExp whitespaceRegex = QRegExp(QStringLiteral("\\s*"));
return NSRectFromCGRect(m_cocoaWindow->screen()->availableGeometry().toCGRect());
}
-#if QT_MACOS_DEPLOYMENT_TARGET_BELOW(__MAC_10_11)
-/*
- AppKit on OS X 10.10 wrongly calls windowWillUseStandardFrame:defaultFrame
- from -[NSWindow _frameForFullScreenMode] when going into fullscreen, resulting
- in black bars on top and bottom of the window. By implementing the following
- method, AppKit will choose that instead, and resolve the right fullscreen
- geometry.
-*/
-- (NSSize)window:(NSWindow *)window willUseFullScreenContentSize:(NSSize)proposedSize
-{
- Q_UNUSED(proposedSize);
- Q_ASSERT(window == m_cocoaWindow->nativeWindow());
- return NSSizeFromCGSize(m_cocoaWindow->screen()->geometry().size().toCGSize());
-}
-#endif
-
- (BOOL)window:(NSWindow *)window shouldPopUpDocumentPathMenu:(NSMenu *)menu
{
Q_UNUSED(window);
diff --git a/src/plugins/platforms/windows/qwindowswindow.cpp b/src/plugins/platforms/windows/qwindowswindow.cpp
index 854c19ccf8..ada124b5af 100644
--- a/src/plugins/platforms/windows/qwindowswindow.cpp
+++ b/src/plugins/platforms/windows/qwindowswindow.cpp
@@ -2277,6 +2277,16 @@ bool QWindowsWindow::startSystemResize(const QPoint &, Qt::Corner corner)
return true;
}
+bool QWindowsWindow::startSystemMove(const QPoint &)
+{
+ if (!GetSystemMenu(m_data.hwnd, FALSE))
+ return false;
+
+ ReleaseCapture();
+ PostMessage(m_data.hwnd, WM_SYSCOMMAND, 0xF012 /*SC_DRAGMOVE*/, 0);
+ return true;
+}
+
void QWindowsWindow::setFrameStrutEventsEnabled(bool enabled)
{
if (enabled) {
diff --git a/src/plugins/platforms/windows/qwindowswindow.h b/src/plugins/platforms/windows/qwindowswindow.h
index 414d4a92f8..3732255738 100644
--- a/src/plugins/platforms/windows/qwindowswindow.h
+++ b/src/plugins/platforms/windows/qwindowswindow.h
@@ -269,6 +269,7 @@ public:
inline bool hasMouseCapture() const { return GetCapture() == m_data.hwnd; }
bool startSystemResize(const QPoint &pos, Qt::Corner corner) override;
+ bool startSystemMove(const QPoint &pos) override;
void setFrameStrutEventsEnabled(bool enabled) override;
bool frameStrutEventsEnabled() const override { return testFlag(FrameStrutEventsEnabled); }
diff --git a/src/plugins/platforms/winrt/qwinrtscreen.cpp b/src/plugins/platforms/winrt/qwinrtscreen.cpp
index 7b9502f9ab..e37aeb0bc5 100644
--- a/src/plugins/platforms/winrt/qwinrtscreen.cpp
+++ b/src/plugins/platforms/winrt/qwinrtscreen.cpp
@@ -47,6 +47,7 @@
#endif
#include "qwinrtwindow.h"
#include <private/qeventdispatcher_winrt_p.h>
+#include <private/qhighdpiscaling_p.h>
#include <QtCore/QLoggingCategory>
#include <QtGui/QSurfaceFormat>
@@ -487,7 +488,8 @@ public:
#endif // WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_PHONE_APP)
QAtomicPointer<QWinRTWindow> mouseGrabWindow;
QAtomicPointer<QWinRTWindow> keyboardGrabWindow;
- QWindow *currentPressWindow = 0;
+ QWindow *currentPressWindow = nullptr;
+ QWindow *currentTargetWindow = nullptr;
};
// To be called from the XAML thread
@@ -1081,11 +1083,11 @@ HRESULT QWinRTScreen::onPointerEntered(ICoreWindow *, IPointerEventArgs *args)
pointerPoint->get_Position(&point);
QPoint pos(point.X * d->scaleFactor, point.Y * d->scaleFactor);
- QWindow *targetWindow = topWindow();
+ d->currentTargetWindow = topWindow();
if (d->mouseGrabWindow)
- targetWindow = d->mouseGrabWindow.load()->window();
+ d->currentTargetWindow = d->mouseGrabWindow.load()->window();
- QWindowSystemInterface::handleEnterEvent(targetWindow, pos, pos);
+ QWindowSystemInterface::handleEnterEvent(d->currentTargetWindow, pos, pos);
}
return S_OK;
}
@@ -1104,11 +1106,11 @@ HRESULT QWinRTScreen::onPointerExited(ICoreWindow *, IPointerEventArgs *args)
d->touchPoints.remove(id);
- QWindow *targetWindow = nullptr;
if (d->mouseGrabWindow)
- targetWindow = d->mouseGrabWindow.load()->window();
+ d->currentTargetWindow = d->mouseGrabWindow.load()->window();
- QWindowSystemInterface::handleLeaveEvent(targetWindow);
+ QWindowSystemInterface::handleLeaveEvent(d->currentTargetWindow);
+ d->currentTargetWindow = nullptr;
return S_OK;
}
@@ -1126,19 +1128,19 @@ HRESULT QWinRTScreen::onPointerUpdated(ICoreWindow *, IPointerEventArgs *args)
// Common traits - point, modifiers, properties
Point point;
pointerPoint->get_Position(&point);
- QPointF pos(point.X * d->scaleFactor, point.Y * d->scaleFactor);
+ const QPointF pos(point.X * d->scaleFactor, point.Y * d->scaleFactor);
QPointF localPos = pos;
const QPoint posPoint = pos.toPoint();
- QWindow *windowUnderPointer = windowAt(posPoint);
- QWindow *targetWindow = windowUnderPointer;
+ QWindow *windowUnderPointer = windowAt(QHighDpiScaling::mapPositionFromNative(posPoint, this));
+ d->currentTargetWindow = windowUnderPointer;
if (d->mouseGrabWindow)
- targetWindow = d->mouseGrabWindow.load()->window();
+ d->currentTargetWindow = d->mouseGrabWindow.load()->window();
- if (targetWindow) {
+ if (d->currentTargetWindow) {
const QPointF globalPosDelta = pos - posPoint;
- localPos = targetWindow->mapFromGlobal(posPoint) + globalPosDelta;
+ localPos = d->currentTargetWindow->mapFromGlobal(posPoint) + globalPosDelta;
}
VirtualKeyModifiers modifiers;
@@ -1173,7 +1175,7 @@ HRESULT QWinRTScreen::onPointerUpdated(ICoreWindow *, IPointerEventArgs *args)
boolean isHorizontal;
properties->get_IsHorizontalMouseWheel(&isHorizontal);
QPoint angleDelta(isHorizontal ? delta : 0, isHorizontal ? 0 : delta);
- QWindowSystemInterface::handleWheelEvent(targetWindow, localPos, pos, QPoint(), angleDelta, mods);
+ QWindowSystemInterface::handleWheelEvent(d->currentTargetWindow, localPos, pos, QPoint(), angleDelta, mods);
break;
}
@@ -1207,15 +1209,22 @@ HRESULT QWinRTScreen::onPointerUpdated(ICoreWindow *, IPointerEventArgs *args)
// menus.
if (buttons != Qt::NoButton && d->currentPressWindow == nullptr && !d->mouseGrabWindow)
d->currentPressWindow = windowUnderPointer;
- if (!isPressed && d->currentPressWindow && d->mouseGrabWindow) {
+ if (buttons == Qt::NoButton && d->currentPressWindow && d->mouseGrabWindow) {
const QPointF globalPosDelta = pos - posPoint;
const QPointF localPressPos = d->currentPressWindow->mapFromGlobal(posPoint) + globalPosDelta;
QWindowSystemInterface::handleMouseEvent(d->currentPressWindow, localPressPos, pos, buttons, mods);
d->currentPressWindow = nullptr;
}
+ // If the mouse button is released outside of a window, targetWindow is 0, but the event
+ // has to be delivered to the window, that initially received the mouse press. Do not reset
+ // d->currentTargetWindow though, as it is used (and reset) in onPointerExited.
+ if (buttons == Qt::NoButton && d->currentPressWindow && !d->currentTargetWindow) {
+ d->currentTargetWindow = d->currentPressWindow;
+ d->currentPressWindow = nullptr;
+ }
- QWindowSystemInterface::handleMouseEvent(targetWindow, localPos, pos, buttons, mods);
+ QWindowSystemInterface::handleMouseEvent(d->currentTargetWindow, localPos, pos, buttons, mods);
break;
}
@@ -1269,7 +1278,7 @@ HRESULT QWinRTScreen::onPointerUpdated(ICoreWindow *, IPointerEventArgs *args)
it.value().normalPosition = QPointF(point.X/d->logicalRect.width(), point.Y/d->logicalRect.height());
it.value().pressure = pressure;
- QWindowSystemInterface::handleTouchEvent(targetWindow, d->touchDevice, d->touchPoints.values(), mods);
+ QWindowSystemInterface::handleTouchEvent(d->currentTargetWindow, d->touchDevice, d->touchPoints.values(), mods);
// Fall-through for pen to generate tablet event
if (pointerDeviceType != PointerDeviceType_Pen)
@@ -1288,7 +1297,7 @@ HRESULT QWinRTScreen::onPointerUpdated(ICoreWindow *, IPointerEventArgs *args)
float rotation;
properties->get_Twist(&rotation);
- QWindowSystemInterface::handleTabletEvent(targetWindow, isPressed, pos, pos, 0,
+ QWindowSystemInterface::handleTabletEvent(d->currentTargetWindow, isPressed, pos, pos, 0,
pointerType, pressure, xTilt, yTilt,
0, rotation, 0, id, mods);
diff --git a/src/sql/doc/src/sql-driver.qdoc b/src/sql/doc/src/sql-driver.qdoc
index dc8d52b572..fd95e89812 100644
--- a/src/sql/doc/src/sql-driver.qdoc
+++ b/src/sql/doc/src/sql-driver.qdoc
@@ -449,7 +449,7 @@
\target QTDS
\section2 QTDS for Sybase Adaptive Server
- \note TDS is no longer used by MS Sql Server, and is superceded by
+ \note TDS is no longer used by MS Sql Server, and is superseded by
\l{QODBC}{ODBC}. QTDS is obsolete from Qt 4.7.
It is not possible to set the port with QSqlDatabase::setPort() due to limitations in the
diff --git a/src/testlib/qplaintestlogger.cpp b/src/testlib/qplaintestlogger.cpp
index 77959341cf..25c9655691 100644
--- a/src/testlib/qplaintestlogger.cpp
+++ b/src/testlib/qplaintestlogger.cpp
@@ -223,38 +223,47 @@ void QPlainTestLogger::outputMessage(const char *str)
outputString(str);
}
+static QTestCharBuffer testIdentifier()
+{
+ QTestCharBuffer identifier;
+
+ const char *testObject = QTestResult::currentTestObjectName();
+ const char *testFunction = QTestResult::currentTestFunction() ? QTestResult::currentTestFunction() : "UnknownTestFunc";
+
+ const char *dataTag = QTestResult::currentDataTag() ? QTestResult::currentDataTag() : "";
+ const char *globalDataTag = QTestResult::currentGlobalDataTag() ? QTestResult::currentGlobalDataTag() : "";
+ const char *tagFiller = (dataTag[0] && globalDataTag[0]) ? ":" : "";
+
+ QTest::qt_asprintf(&identifier, "%s::%s(%s%s%s)", testObject, testFunction, globalDataTag, tagFiller, dataTag);
+ return identifier;
+}
+
void QPlainTestLogger::printMessage(const char *type, const char *msg, const char *file, int line)
{
QTEST_ASSERT(type);
QTEST_ASSERT(msg);
- QTestCharBuffer buf;
+ QTestCharBuffer messagePrefix;
- const char *fn = QTestResult::currentTestFunction() ? QTestResult::currentTestFunction()
- : "UnknownTestFunc";
- const char *tag = QTestResult::currentDataTag() ? QTestResult::currentDataTag() : "";
- const char *gtag = QTestResult::currentGlobalDataTag()
- ? QTestResult::currentGlobalDataTag()
- : "";
- const char *filler = (tag[0] && gtag[0]) ? ":" : "";
+ QTestCharBuffer failureLocation;
if (file) {
- QTest::qt_asprintf(&buf, "%s: %s::%s(%s%s%s)%s%s\n"
#ifdef Q_OS_WIN
- "%s(%d) : failure location\n"
+#define FAILURE_LOCATION_STR "\n%s(%d) : failure location"
#else
- " Loc: [%s(%d)]\n"
+#define FAILURE_LOCATION_STR "\n Loc: [%s(%d)]"
#endif
- , type, QTestResult::currentTestObjectName(), fn, gtag, filler, tag,
- msg[0] ? " " : "", msg, file, line);
- } else {
- QTest::qt_asprintf(&buf, "%s: %s::%s(%s%s%s)%s%s\n",
- type, QTestResult::currentTestObjectName(), fn, gtag, filler, tag,
- msg[0] ? " " : "", msg);
+ QTest::qt_asprintf(&failureLocation, FAILURE_LOCATION_STR, file, line);
}
+
+ const char *msgFiller = msg[0] ? " " : "";
+ QTest::qt_asprintf(&messagePrefix, "%s: %s%s%s%s\n",
+ type, testIdentifier().data(), msgFiller, msg, failureLocation.data());
+
// In colored mode, printf above stripped our nonprintable control characters.
// Put them back.
- memcpy(buf.data(), type, strlen(type));
- outputMessage(buf.data());
+ memcpy(messagePrefix.data(), type, strlen(type));
+
+ outputMessage(messagePrefix.data());
}
void QPlainTestLogger::printBenchmarkResult(const QBenchmarkResult &result)
diff --git a/src/testlib/qtestcase.qdoc b/src/testlib/qtestcase.qdoc
index 0fb1cc6a8a..9a3c770e31 100644
--- a/src/testlib/qtestcase.qdoc
+++ b/src/testlib/qtestcase.qdoc
@@ -103,7 +103,7 @@
to catch an exception thrown from the \a expression. If the \a expression
throws an exception and its type is the same as \a exceptiontype
or \a exceptiontype is substitutable with the type of thrown exception
- (i.e. usually the type of thrown exception is publically derived
+ (i.e. usually the type of thrown exception is publicly derived
from \a exceptiontype) then execution will be continued. If not-substitutable
type of exception is thrown or the \a expression doesn't throw an exception
at all, then a failure will be recorded in the test log and
diff --git a/src/widgets/itemviews/qitemdelegate.cpp b/src/widgets/itemviews/qitemdelegate.cpp
index 1ff51f9be2..91122283a4 100644
--- a/src/widgets/itemviews/qitemdelegate.cpp
+++ b/src/widgets/itemviews/qitemdelegate.cpp
@@ -1090,7 +1090,7 @@ QRect QItemDelegate::textRectangle(QPainter * /*painter*/, const QRect &rect,
\endlist
In the case of \uicontrol Tab, \uicontrol Backtab, \uicontrol Enter and \uicontrol Return
- key press events, the \a editor's data is comitted to the model
+ key press events, the \a editor's data is committed to the model
and the editor is closed. If the \a event is a \uicontrol Tab key press
the view will open an editor on the next item in the
view. Likewise, if the \a event is a \uicontrol Backtab key press the
diff --git a/src/widgets/itemviews/qstyleditemdelegate.cpp b/src/widgets/itemviews/qstyleditemdelegate.cpp
index 43b640fd69..0f7566e8ec 100644
--- a/src/widgets/itemviews/qstyleditemdelegate.cpp
+++ b/src/widgets/itemviews/qstyleditemdelegate.cpp
@@ -571,7 +571,7 @@ void QStyledItemDelegate::setItemEditorFactory(QItemEditorFactory *factory)
\uicontrol Return keys are \e not handled.
In the case of \uicontrol Tab, \uicontrol Backtab, \uicontrol Enter and \uicontrol Return
- key press events, the \a editor's data is comitted to the model
+ key press events, the \a editor's data is committed to the model
and the editor is closed. If the \a event is a \uicontrol Tab key press
the view will open an editor on the next item in the
view. Likewise, if the \a event is a \uicontrol Backtab key press the
diff --git a/src/widgets/kernel/qopenglwidget.cpp b/src/widgets/kernel/qopenglwidget.cpp
index c95be2dfe1..c96b6812c4 100644
--- a/src/widgets/kernel/qopenglwidget.cpp
+++ b/src/widgets/kernel/qopenglwidget.cpp
@@ -381,7 +381,7 @@ QT_BEGIN_NAMESPACE
QOpenGLContext. By connecting a slot, using direct connection, to this signal,
it is possible to perform cleanup whenever the the underlying native context
handle, or the entire QOpenGLContext instance, is going to be released. The
- following snippet is in principal equivalent to the previous one:
+ following snippet is in principle equivalent to the previous one:
\snippet code/doc_gui_widgets_qopenglwidget.cpp 5
diff --git a/src/widgets/styles/qcommonstyle.cpp b/src/widgets/styles/qcommonstyle.cpp
index 14a18a13e9..06590afe72 100644
--- a/src/widgets/styles/qcommonstyle.cpp
+++ b/src/widgets/styles/qcommonstyle.cpp
@@ -6290,7 +6290,7 @@ QPixmap QCommonStyle::generatedIconPixmap(QIcon::Mode iconMode, const QPixmap &p
// High intensity colors needs dark shifting in the color table, while
// low intensity colors needs light shifting. This is to increase the
- // percieved contrast.
+ // perceived contrast.
if ((red - factor > green && red - factor > blue)
|| (green - factor > red && green - factor > blue)
|| (blue - factor > red && blue - factor > green))
diff --git a/tests/auto/corelib/animation/qpauseanimation/BLACKLIST b/tests/auto/corelib/animation/qpauseanimation/BLACKLIST
index a49ed2a617..e223ec82e2 100644
--- a/tests/auto/corelib/animation/qpauseanimation/BLACKLIST
+++ b/tests/auto/corelib/animation/qpauseanimation/BLACKLIST
@@ -1,5 +1,3 @@
-[multiplePauseAnimations]
-osx-10.9
[pauseAndPropertyAnimations]
*
[multipleSequentialGroups]
diff --git a/tests/auto/corelib/io/qsettings/BLACKLIST b/tests/auto/corelib/io/qsettings/BLACKLIST
index 317e97730e..36d68bd918 100644
--- a/tests/auto/corelib/io/qsettings/BLACKLIST
+++ b/tests/auto/corelib/io/qsettings/BLACKLIST
@@ -1,3 +1,2 @@
[isWritable:native]
-osx-10.10
osx-10.11
diff --git a/tests/auto/corelib/io/qstorageinfo/BLACKLIST b/tests/auto/corelib/io/qstorageinfo/BLACKLIST
deleted file mode 100644
index ab4f888dd9..0000000000
--- a/tests/auto/corelib/io/qstorageinfo/BLACKLIST
+++ /dev/null
@@ -1,2 +0,0 @@
-[storageList]
-opensuse-42.1
diff --git a/tests/auto/dbus/qdbusmarshall/BLACKLIST b/tests/auto/dbus/qdbusmarshall/BLACKLIST
deleted file mode 100644
index 036378d204..0000000000
--- a/tests/auto/dbus/qdbusmarshall/BLACKLIST
+++ /dev/null
@@ -1,3 +0,0 @@
-[receiveUnknownType]
-ubuntu-14.04
-opensuse-13.1
diff --git a/tests/auto/gui/kernel/qwindow/BLACKLIST b/tests/auto/gui/kernel/qwindow/BLACKLIST
index 9108cf2c1f..4469b98953 100644
--- a/tests/auto/gui/kernel/qwindow/BLACKLIST
+++ b/tests/auto/gui/kernel/qwindow/BLACKLIST
@@ -1,19 +1,14 @@
[positioning:default]
-ubuntu-14.04
ubuntu-16.04
osx-10.12 ci
[positioning:fake]
osx-10.12 ci
[modalWindowPosition]
-ubuntu-14.04
ubuntu-16.04
[modalWithChildWindow]
-ubuntu-14.04
ubuntu-16.04
[setVisible]
-ubuntu-14.04
[modalWindowEnterEventOnHide_QTBUG35109]
-ubuntu-14.04
ubuntu-16.04
osx ci
[modalDialogClosingOneOfTwoModal]
diff --git a/tests/auto/gui/text/qfont/BLACKLIST b/tests/auto/gui/text/qfont/BLACKLIST
index 295c61ff12..42cb8408f4 100644
--- a/tests/auto/gui/text/qfont/BLACKLIST
+++ b/tests/auto/gui/text/qfont/BLACKLIST
@@ -1,6 +1,2 @@
-[exactMatch]
-# QTBUG-46054
-opensuse-13.1
-opensuse-42.1
[defaultFamily]
b2qt
diff --git a/tests/auto/gui/text/qrawfont/BLACKLIST b/tests/auto/gui/text/qrawfont/BLACKLIST
deleted file mode 100644
index a614595689..0000000000
--- a/tests/auto/gui/text/qrawfont/BLACKLIST
+++ /dev/null
@@ -1,4 +0,0 @@
-[correctFontData]
-osx-10.8
-[unsupportedWritingSystem]
-osx-10.8
diff --git a/tests/auto/gui/text/qtextscriptengine/BLACKLIST b/tests/auto/gui/text/qtextscriptengine/BLACKLIST
deleted file mode 100644
index 52eb9086a9..0000000000
--- a/tests/auto/gui/text/qtextscriptengine/BLACKLIST
+++ /dev/null
@@ -1,2 +0,0 @@
-[thaiWithZWJ]
-rhel-7.2
diff --git a/tests/auto/network/access/qftp/BLACKLIST b/tests/auto/network/access/qftp/BLACKLIST
index 92ad1aee8f..96d9274653 100644
--- a/tests/auto/network/access/qftp/BLACKLIST
+++ b/tests/auto/network/access/qftp/BLACKLIST
@@ -1,14 +1,10 @@
# QTBUG-15111
[activeMode:WithoutProxy]
-opensuse-13.1 64bit
redhatenterpriselinuxworkstation-6.6
-osx-10.10
[activeMode:WithoutProxyWithSession]
-opensuse-13.1 64bit
redhatenterpriselinuxworkstation-6.6
-osx-10.10
[list:epsvNotSupported]
*
diff --git a/tests/auto/network/access/qnetworkreply/BLACKLIST b/tests/auto/network/access/qnetworkreply/BLACKLIST
index 1052239797..4410549f09 100644
--- a/tests/auto/network/access/qnetworkreply/BLACKLIST
+++ b/tests/auto/network/access/qnetworkreply/BLACKLIST
@@ -2,10 +2,6 @@
osx
[authenticationCacheAfterCancel]
windows
-[ioGetFromBuiltinHttp:http+limited]
-ubuntu-14.04
-[ioGetFromBuiltinHttp:https+limited]
-ubuntu-14.04
[httpAbort]
*
[backgroundRequestInterruption:ftp, bg, nobg]
diff --git a/tests/auto/network/ssl/qsslsocket/BLACKLIST b/tests/auto/network/ssl/qsslsocket/BLACKLIST
index a9ecc69f50..8e1a55995e 100644
--- a/tests/auto/network/ssl/qsslsocket/BLACKLIST
+++ b/tests/auto/network/ssl/qsslsocket/BLACKLIST
@@ -1,5 +1 @@
windows
-[protocolServerSide:ssl3-any]
-rhel-7.2
-[protocolServerSide:tls1.0-any]
-rhel-7.2
diff --git a/tests/auto/opengl/qgl/BLACKLIST b/tests/auto/opengl/qgl/BLACKLIST
index a83d1272a0..71be4bf19d 100644
--- a/tests/auto/opengl/qgl/BLACKLIST
+++ b/tests/auto/opengl/qgl/BLACKLIST
@@ -16,7 +16,6 @@ winrt
[clipTest]
windows
winrt
-opensuse-13.1
[graphicsViewClipping]
windows
winrt
diff --git a/tests/auto/other/gestures/BLACKLIST b/tests/auto/other/gestures/BLACKLIST
index bd43b99d39..1d89178fe5 100644
--- a/tests/auto/other/gestures/BLACKLIST
+++ b/tests/auto/other/gestures/BLACKLIST
@@ -1,7 +1,2 @@
[]
-rhel-7.1
-rhel-7.2
-rhel-7.3
rhel-7.4
-[customGesture]
-opensuse-13.1
diff --git a/tests/auto/widgets/dialogs/qfontdialog/BLACKLIST b/tests/auto/widgets/dialogs/qfontdialog/BLACKLIST
deleted file mode 100644
index 07f3a41df3..0000000000
--- a/tests/auto/widgets/dialogs/qfontdialog/BLACKLIST
+++ /dev/null
@@ -1,5 +0,0 @@
-[task256466_wrongStyle]
-opensuse-13.1
-opensuse-42.1
-rhel-7.1
-rhel-7.2
diff --git a/tests/auto/widgets/graphicsview/qgraphicsitem/BLACKLIST b/tests/auto/widgets/graphicsview/qgraphicsitem/BLACKLIST
deleted file mode 100644
index abfa7a3329..0000000000
--- a/tests/auto/widgets/graphicsview/qgraphicsitem/BLACKLIST
+++ /dev/null
@@ -1,2 +0,0 @@
-[ensureUpdateOnTextItem]
-osx-10.10
diff --git a/tests/auto/widgets/graphicsview/qgraphicsproxywidget/BLACKLIST b/tests/auto/widgets/graphicsview/qgraphicsproxywidget/BLACKLIST
deleted file mode 100644
index 16f3534921..0000000000
--- a/tests/auto/widgets/graphicsview/qgraphicsproxywidget/BLACKLIST
+++ /dev/null
@@ -1,6 +0,0 @@
-[hoverEnterLeaveEvent]
-ubuntu-14.04
-rhel-7.1
-rhel-7.2
-[QTBUG_6986_sendMouseEventToAlienWidget]
-rhel-7.1
diff --git a/tests/auto/widgets/graphicsview/qgraphicswidget/BLACKLIST b/tests/auto/widgets/graphicsview/qgraphicswidget/BLACKLIST
deleted file mode 100644
index 13ec840eff..0000000000
--- a/tests/auto/widgets/graphicsview/qgraphicswidget/BLACKLIST
+++ /dev/null
@@ -1,4 +0,0 @@
-[initialShow2]
-ubuntu-14.04
-rhel-7.1
-rhel-7.2
diff --git a/tests/auto/widgets/itemviews/qtableview/BLACKLIST b/tests/auto/widgets/itemviews/qtableview/BLACKLIST
index 329010a86e..fc231a4e30 100644
--- a/tests/auto/widgets/itemviews/qtableview/BLACKLIST
+++ b/tests/auto/widgets/itemviews/qtableview/BLACKLIST
@@ -1,4 +1,2 @@
[moveCursorBiggerJump]
osx
-[resizeColumnsToContents]
-ubuntu-14.04
diff --git a/tests/auto/widgets/kernel/qaction/BLACKLIST b/tests/auto/widgets/kernel/qaction/BLACKLIST
deleted file mode 100644
index 1ad524fdbf..0000000000
--- a/tests/auto/widgets/kernel/qaction/BLACKLIST
+++ /dev/null
@@ -1,2 +0,0 @@
-[setStandardKeys]
-linux
diff --git a/tests/auto/widgets/kernel/qaction/tst_qaction.cpp b/tests/auto/widgets/kernel/qaction/tst_qaction.cpp
index 272ec6d60b..ddf9ccb416 100644
--- a/tests/auto/widgets/kernel/qaction/tst_qaction.cpp
+++ b/tests/auto/widgets/kernel/qaction/tst_qaction.cpp
@@ -240,7 +240,7 @@ void tst_QAction::setStandardKeys()
expected << ctrlC << ctrlInsert;
break;
default: // X11
- expected << ctrlC << QKeySequence(QStringLiteral("F16")) << ctrlInsert;
+ expected << ctrlC << ctrlInsert << QKeySequence(QStringLiteral("F16"));
break;
}
diff --git a/tests/auto/widgets/kernel/qactiongroup/BLACKLIST b/tests/auto/widgets/kernel/qactiongroup/BLACKLIST
deleted file mode 100644
index fdc424b6ac..0000000000
--- a/tests/auto/widgets/kernel/qactiongroup/BLACKLIST
+++ /dev/null
@@ -1,2 +0,0 @@
-[QTBUG_14292_filesystem]
-linux
diff --git a/tests/auto/widgets/kernel/qapplication/BLACKLIST b/tests/auto/widgets/kernel/qapplication/BLACKLIST
deleted file mode 100644
index f4a9cb6166..0000000000
--- a/tests/auto/widgets/kernel/qapplication/BLACKLIST
+++ /dev/null
@@ -1,2 +0,0 @@
-[quitOnLastWindowClosed]
-osx-10.10
diff --git a/tests/auto/widgets/kernel/qapplication/test/BLACKLIST b/tests/auto/widgets/kernel/qapplication/test/BLACKLIST
deleted file mode 100644
index f4a9cb6166..0000000000
--- a/tests/auto/widgets/kernel/qapplication/test/BLACKLIST
+++ /dev/null
@@ -1,2 +0,0 @@
-[quitOnLastWindowClosed]
-osx-10.10
diff --git a/tests/auto/widgets/kernel/qtooltip/BLACKLIST b/tests/auto/widgets/kernel/qtooltip/BLACKLIST
deleted file mode 100644
index f8d062cc46..0000000000
--- a/tests/auto/widgets/kernel/qtooltip/BLACKLIST
+++ /dev/null
@@ -1,4 +0,0 @@
-[whatsThis]
-ubuntu-14.04
-[task183679]
-opensuse-13.1
diff --git a/tests/auto/widgets/kernel/qwidget/BLACKLIST b/tests/auto/widgets/kernel/qwidget/BLACKLIST
index 4cef2d57a4..c822539966 100644
--- a/tests/auto/widgets/kernel/qwidget/BLACKLIST
+++ b/tests/auto/widgets/kernel/qwidget/BLACKLIST
@@ -1,30 +1,18 @@
# OSX QTBUG-25300 QTBUG-45502
[normalGeometry]
-ubuntu-14.04
ubuntu-16.04
[saveRestoreGeometry]
-ubuntu-14.04
ubuntu-16.04
b2qt
[restoreVersion1Geometry]
xcb
osx
[updateWhileMinimized]
-ubuntu-14.04
ubuntu-16.04
-rhel-7.1
-rhel-7.2
-rhel-7.3
rhel-7.4
osx
[focusProxyAndInputMethods]
linux
-[touchEventSynthesizedMouseEvent]
-ubuntu-14.04
-[grabMouse]
-ubuntu-14.04
-[largerThanScreen_QTBUG30142]
-ubuntu-14.04
[showMaximized]
osx
[setGeometry]
@@ -48,7 +36,6 @@ osx
[render_systemClip]
osx
[showMinimizedKeepsFocus]
-osx-10.10
osx-10.11 ci
osx-10.12 ci
[moveWindowInShowEvent:1]
@@ -61,10 +48,7 @@ osx
osx
[maskedUpdate]
osx
-opensuse-42.1
opensuse-42.3
-[hideWhenFocusWidgetIsChild]
-osx-10.10
[hideOpaqueChildWhileHidden]
osx
[resizeStaticContentsChildWidget_QTBUG35282]
@@ -75,8 +59,6 @@ osx
osx
[setToolTip]
osx
-[moveInResizeEvent]
-ubuntu-14.04
[moveChild:right]
osx
[activateWindow]
diff --git a/tests/auto/widgets/kernel/qwidget_window/BLACKLIST b/tests/auto/widgets/kernel/qwidget_window/BLACKLIST
new file mode 100644
index 0000000000..d3bfaba433
--- /dev/null
+++ b/tests/auto/widgets/kernel/qwidget_window/BLACKLIST
@@ -0,0 +1,4 @@
+[tst_resize_count]
+# QTBUG-66345
+opensuse-42.3
+ubuntu-16.04
diff --git a/tests/auto/widgets/styles/qstylesheetstyle/BLACKLIST b/tests/auto/widgets/styles/qstylesheetstyle/BLACKLIST
index 43c5ca3b05..6b2e4f3fb2 100644
--- a/tests/auto/widgets/styles/qstylesheetstyle/BLACKLIST
+++ b/tests/auto/widgets/styles/qstylesheetstyle/BLACKLIST
@@ -1,7 +1,2 @@
-[hoverColors]
-ubuntu-14.04
-opensuse-13.1
-opensuse-42.1
-
[task232085_spinBoxLineEditBg]
osx
diff --git a/tests/auto/widgets/widgets/qcombobox/BLACKLIST b/tests/auto/widgets/widgets/qcombobox/BLACKLIST
index c04351e5ca..2d6228075a 100644
--- a/tests/auto/widgets/widgets/qcombobox/BLACKLIST
+++ b/tests/auto/widgets/widgets/qcombobox/BLACKLIST
@@ -1,7 +1,3 @@
-QTBUG-45531
-[task260974_menuItemRectangleForComboBoxPopup]
-osx-10.10
-
[task_QTBUG_56693_itemFontFromModel]
# Counts draw calls, but we could have multiple expose events QTBUG-62080
osx
diff --git a/tests/auto/widgets/widgets/qmenubar/BLACKLIST b/tests/auto/widgets/widgets/qmenubar/BLACKLIST
index e2194e69ca..b3bf606a08 100644
--- a/tests/auto/widgets/widgets/qmenubar/BLACKLIST
+++ b/tests/auto/widgets/widgets/qmenubar/BLACKLIST
@@ -1,3 +1,2 @@
[check_menuPosition]
-ubuntu-14.04
ubuntu-16.04
diff --git a/tests/auto/widgets/widgets/qopenglwidget/BLACKLIST b/tests/auto/widgets/widgets/qopenglwidget/BLACKLIST
index 7825c33a0a..b67c8354e8 100644
--- a/tests/auto/widgets/widgets/qopenglwidget/BLACKLIST
+++ b/tests/auto/widgets/widgets/qopenglwidget/BLACKLIST
@@ -1,18 +1,5 @@
[clearAndGrab]
-opensuse-13.1
ubuntu
-#QTBUG-31611
-[painter]
-windows msvc-2010 32bit developer-build
-
-#QTBUG-31611
-[reparentToAlreadyCreated]
-windows msvc-2010 32bit developer-build
-
-#QTBUG-31611
-[reparentToNotYetCreated]
-windows msvc-2010 32bit developer-build
-
[stackWidgetOpaqueChildIsVisible]
windows
diff --git a/tests/auto/widgets/widgets/qspinbox/BLACKLIST b/tests/auto/widgets/widgets/qspinbox/BLACKLIST
deleted file mode 100644
index 5bf6c3beed..0000000000
--- a/tests/auto/widgets/widgets/qspinbox/BLACKLIST
+++ /dev/null
@@ -1,3 +0,0 @@
-[editingFinished]
-osx-10.8
-osx-10.9
diff --git a/tests/auto/widgets/widgets/qtabbar/BLACKLIST b/tests/auto/widgets/widgets/qtabbar/BLACKLIST
index 5a3f33e3e4..735b044d8b 100644
--- a/tests/auto/widgets/widgets/qtabbar/BLACKLIST
+++ b/tests/auto/widgets/widgets/qtabbar/BLACKLIST
@@ -1,3 +1,2 @@
[sizeHints]
-ubuntu-14.04
redhatenterpriselinuxworkstation-6.6