Merge "Merge remote-tracking branch 'origin/5.11' into dev" into refs/staging/dev

This commit is contained in:
Qt Forward Merge Bot 2018-02-14 08:09:31 +00:00 committed by The Qt Project
commit 318f728283
77 changed files with 536 additions and 338 deletions

View File

@ -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

View File

@ -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]

View File

@ -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)

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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()}.

View File

@ -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

View File

@ -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);
}
}

View File

@ -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();

View File

@ -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)

View File

@ -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();
}
}
}

View File

@ -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("");

View File

@ -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;
}
}

View File

@ -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

View File

@ -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.

View File

@ -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

View File

@ -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

View File

@ -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.

View File

@ -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

View File

@ -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));

View File

@ -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.

View File

@ -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.

View File

@ -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();

View File

@ -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()
*/

View File

@ -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();

View File

@ -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

View File

@ -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().

View File

@ -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();
}
return res;
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();
}
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;
}

View File

@ -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)]];

View File

@ -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;

View File

@ -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

View File

@ -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];
}

View File

@ -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

View File

@ -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);

View File

@ -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) {

View File

@ -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); }

View File

@ -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);

View File

@ -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

View File

@ -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)

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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))

View File

@ -1,5 +1,3 @@
[multiplePauseAnimations]
osx-10.9
[pauseAndPropertyAnimations]
*
[multipleSequentialGroups]

View File

@ -1,3 +1,2 @@
[isWritable:native]
osx-10.10
osx-10.11

View File

@ -1,2 +0,0 @@
[storageList]
opensuse-42.1

View File

@ -1,3 +0,0 @@
[receiveUnknownType]
ubuntu-14.04
opensuse-13.1

View File

@ -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]

View File

@ -1,6 +1,2 @@
[exactMatch]
# QTBUG-46054
opensuse-13.1
opensuse-42.1
[defaultFamily]
b2qt

View File

@ -1,4 +0,0 @@
[correctFontData]
osx-10.8
[unsupportedWritingSystem]
osx-10.8

View File

@ -1,2 +0,0 @@
[thaiWithZWJ]
rhel-7.2

View File

@ -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]
*

View File

@ -2,10 +2,6 @@
osx
[authenticationCacheAfterCancel]
windows
[ioGetFromBuiltinHttp:http+limited]
ubuntu-14.04
[ioGetFromBuiltinHttp:https+limited]
ubuntu-14.04
[httpAbort]
*
[backgroundRequestInterruption:ftp, bg, nobg]

View File

@ -1,5 +1 @@
windows
[protocolServerSide:ssl3-any]
rhel-7.2
[protocolServerSide:tls1.0-any]
rhel-7.2

View File

@ -16,7 +16,6 @@ winrt
[clipTest]
windows
winrt
opensuse-13.1
[graphicsViewClipping]
windows
winrt

View File

@ -1,7 +1,2 @@
[]
rhel-7.1
rhel-7.2
rhel-7.3
rhel-7.4
[customGesture]
opensuse-13.1

View File

@ -1,5 +0,0 @@
[task256466_wrongStyle]
opensuse-13.1
opensuse-42.1
rhel-7.1
rhel-7.2

View File

@ -1,2 +0,0 @@
[ensureUpdateOnTextItem]
osx-10.10

View File

@ -1,6 +0,0 @@
[hoverEnterLeaveEvent]
ubuntu-14.04
rhel-7.1
rhel-7.2
[QTBUG_6986_sendMouseEventToAlienWidget]
rhel-7.1

View File

@ -1,4 +0,0 @@
[initialShow2]
ubuntu-14.04
rhel-7.1
rhel-7.2

View File

@ -1,4 +1,2 @@
[moveCursorBiggerJump]
osx
[resizeColumnsToContents]
ubuntu-14.04

View File

@ -1,2 +0,0 @@
[setStandardKeys]
linux

View File

@ -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;
}

View File

@ -1,2 +0,0 @@
[QTBUG_14292_filesystem]
linux

View File

@ -1,2 +0,0 @@
[quitOnLastWindowClosed]
osx-10.10

View File

@ -1,2 +0,0 @@
[quitOnLastWindowClosed]
osx-10.10

View File

@ -1,4 +0,0 @@
[whatsThis]
ubuntu-14.04
[task183679]
opensuse-13.1

View File

@ -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]

View File

@ -0,0 +1,4 @@
[tst_resize_count]
# QTBUG-66345
opensuse-42.3
ubuntu-16.04

View File

@ -1,7 +1,2 @@
[hoverColors]
ubuntu-14.04
opensuse-13.1
opensuse-42.1
[task232085_spinBoxLineEditBg]
osx

View File

@ -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

View File

@ -1,3 +1,2 @@
[check_menuPosition]
ubuntu-14.04
ubuntu-16.04

View File

@ -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

View File

@ -1,3 +0,0 @@
[editingFinished]
osx-10.8
osx-10.9

View File

@ -1,3 +1,2 @@
[sizeHints]
ubuntu-14.04
redhatenterpriselinuxworkstation-6.6