summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/android/jar/src/org/qtproject/qt5/android/QtNative.java16
-rw-r--r--src/corelib/animation/qabstractanimation.cpp1
-rw-r--r--src/corelib/doc/snippets/code/src_corelib_io_qdiriterator.cpp9
-rw-r--r--src/corelib/global/qglobal.cpp6
-rw-r--r--src/corelib/global/qnamespace.qdoc2
-rw-r--r--src/corelib/io/qdiriterator.cpp6
-rw-r--r--src/corelib/io/qfile.cpp4
-rw-r--r--src/corelib/io/qfiledevice.cpp4
-rw-r--r--src/corelib/io/qfilesystemwatcher.cpp1
-rw-r--r--src/corelib/io/qfilesystemwatcher_inotify.cpp2
-rw-r--r--src/corelib/io/qfilesystemwatcher_polling.cpp3
-rw-r--r--src/corelib/io/qiodevice.cpp4
-rw-r--r--src/corelib/io/qnoncontiguousbytedevice.cpp1
-rw-r--r--src/corelib/io/qsavefile.cpp4
-rw-r--r--src/corelib/io/qsettings.cpp4
-rw-r--r--src/corelib/io/qstandardpaths.cpp4
-rw-r--r--src/corelib/io/qtemporarydir.cpp10
-rw-r--r--src/corelib/io/qtemporaryfile.cpp4
-rw-r--r--src/corelib/io/qtextstream.cpp3
-rw-r--r--src/corelib/itemmodels/qabstractitemmodel.cpp2
-rw-r--r--src/corelib/itemmodels/qitemselectionmodel.cpp3
-rw-r--r--src/corelib/itemmodels/qstringlistmodel.cpp2
-rw-r--r--src/corelib/kernel/qabstracteventdispatcher.cpp2
-rw-r--r--src/corelib/kernel/qcoreapplication.cpp4
-rw-r--r--src/corelib/kernel/qcoreevent.cpp2
-rw-r--r--src/corelib/kernel/qeventdispatcher_glib.cpp2
-rw-r--r--src/corelib/kernel/qeventdispatcher_unix.cpp2
-rw-r--r--src/corelib/kernel/qeventdispatcher_win.cpp4
-rw-r--r--src/corelib/kernel/qeventloop.cpp2
-rw-r--r--src/corelib/kernel/qmimedata.cpp2
-rw-r--r--src/corelib/kernel/qobjectcleanuphandler.cpp2
-rw-r--r--src/corelib/kernel/qobjectdefs_impl.h4
-rw-r--r--src/corelib/kernel/qsharedmemory.cpp2
-rw-r--r--src/corelib/kernel/qsocketnotifier.cpp2
-rw-r--r--src/corelib/kernel/qtimer.cpp1
-rw-r--r--src/corelib/kernel/qtranslator.cpp2
-rw-r--r--src/corelib/plugin/qfactoryloader.cpp2
-rw-r--r--src/corelib/plugin/qlibrary.cpp2
-rw-r--r--src/corelib/plugin/qpluginloader.cpp1
-rw-r--r--src/corelib/statemachine/qabstractstate.cpp2
-rw-r--r--src/corelib/statemachine/qabstracttransition.cpp2
-rw-r--r--src/corelib/statemachine/qeventtransition.cpp2
-rw-r--r--src/corelib/statemachine/qfinalstate.cpp2
-rw-r--r--src/corelib/statemachine/qhistorystate.cpp3
-rw-r--r--src/corelib/statemachine/qsignaltransition.cpp2
-rw-r--r--src/corelib/statemachine/qstate.cpp2
-rw-r--r--src/corelib/thread/qfuturewatcher.cpp2
-rw-r--r--src/corelib/thread/qthread.cpp2
-rw-r--r--src/corelib/thread/qthreadpool.cpp2
-rw-r--r--src/corelib/tools/qcryptographichash.cpp4
-rw-r--r--src/corelib/tools/qeasingcurve.cpp2
-rw-r--r--src/corelib/tools/qhash.h28
-rw-r--r--src/corelib/tools/qlocale.cpp13
-rw-r--r--src/corelib/tools/qtimeline.cpp2
-rw-r--r--src/gui/painting/qpainterpath.cpp33
-rw-r--r--src/network/access/qhttp2protocolhandler.cpp8
-rw-r--r--src/network/doc/src/bearermanagement.qdoc29
-rw-r--r--src/platformsupport/fontdatabases/mac/coretext.pri14
-rw-r--r--src/plugins/platforms/android/androidjniclipboard.cpp23
-rw-r--r--src/plugins/platforms/android/androidjniclipboard.h5
-rw-r--r--src/plugins/platforms/android/qandroidplatformclipboard.cpp2
-rw-r--r--src/plugins/platforms/cocoa/qcocoawindow.mm12
-rw-r--r--src/plugins/platforms/cocoa/qnsview.mm60
-rw-r--r--src/plugins/platforms/ios/qiostextresponder.mm11
-rw-r--r--src/plugins/platforms/windows/qwindowswindow.cpp27
-rw-r--r--src/tools/qdbusxml2cpp/qdbusxml2cpp.pro7
66 files changed, 316 insertions, 118 deletions
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 c74e38d997..ccd8ec410e 100644
--- a/src/android/jar/src/org/qtproject/qt5/android/QtNative.java
+++ b/src/android/jar/src/org/qtproject/qt5/android/QtNative.java
@@ -52,7 +52,8 @@ import android.content.pm.PackageManager;
import android.net.Uri;
import android.os.Handler;
import android.os.Looper;
-import android.text.ClipboardManager;
+import android.content.ClipboardManager;
+import android.content.ClipboardManager.OnPrimaryClipChangedListener;
import android.os.Build;
import android.util.Log;
import android.view.ContextMenu;
@@ -584,7 +585,14 @@ public class QtNative
@Override
public void run() {
if (m_activity != null)
- m_clipboardManager = (android.text.ClipboardManager) m_activity.getSystemService(Context.CLIPBOARD_SERVICE);
+ m_clipboardManager = (android.content.ClipboardManager) m_activity.getSystemService(Context.CLIPBOARD_SERVICE);
+ if (m_clipboardManager != null) {
+ m_clipboardManager.addPrimaryClipChangedListener(new ClipboardManager.OnPrimaryClipChangedListener() {
+ public void onPrimaryClipChanged() {
+ onClipboardDataChanged();
+ }
+ });
+ }
semaphore.release();
}
});
@@ -844,6 +852,10 @@ public class QtNative
public static native void onContextMenuClosed(Menu menu);
// menu methods
+ // clipboard methods
+ public static native void onClipboardDataChanged();
+ // clipboard methods
+
// activity methods
public static native void onActivityResult(int requestCode, int resultCode, Intent data);
public static native void onNewIntent(Intent data);
diff --git a/src/corelib/animation/qabstractanimation.cpp b/src/corelib/animation/qabstractanimation.cpp
index 8c189e9288..2041b8816e 100644
--- a/src/corelib/animation/qabstractanimation.cpp
+++ b/src/corelib/animation/qabstractanimation.cpp
@@ -1484,5 +1484,6 @@ void QAbstractAnimation::updateDirection(QAbstractAnimation::Direction direction
QT_END_NAMESPACE
#include "moc_qabstractanimation.cpp"
+#include "moc_qabstractanimation_p.cpp"
#endif //QT_NO_ANIMATION
diff --git a/src/corelib/doc/snippets/code/src_corelib_io_qdiriterator.cpp b/src/corelib/doc/snippets/code/src_corelib_io_qdiriterator.cpp
index 7a6ffeae06..31442a5516 100644
--- a/src/corelib/doc/snippets/code/src_corelib_io_qdiriterator.cpp
+++ b/src/corelib/doc/snippets/code/src_corelib_io_qdiriterator.cpp
@@ -60,3 +60,12 @@ while (it.hasNext()) {
// ...
}
//! [0]
+
+//! [1]
+QDirIterator it("/sys", QStringList() << "scaling_cur_freq", QDir::NoFilter, QDirIterator::Subdirectories);
+while (it.hasNext()) {
+ QFile f(it.next());
+ f.open(QIODevice::ReadOnly);
+ qDebug() << f.fileName() << f.readAll().trimmed().toDouble() / 1000 << "MHz";
+}
+//! [1]
diff --git a/src/corelib/global/qglobal.cpp b/src/corelib/global/qglobal.cpp
index c37503f3db..22fc20d47e 100644
--- a/src/corelib/global/qglobal.cpp
+++ b/src/corelib/global/qglobal.cpp
@@ -3988,8 +3988,10 @@ bool QInternal::registerCallback(Callback cb, qInternalCallback callback)
bool QInternal::unregisterCallback(Callback cb, qInternalCallback callback)
{
if (cb >= 0 && cb < QInternal::LastCallback) {
- QInternal_CallBackTable *cbt = global_callback_table();
- return (bool) cbt->callbacks[cb].removeAll(callback);
+ if (global_callback_table.exists()) {
+ QInternal_CallBackTable *cbt = global_callback_table();
+ return (bool) cbt->callbacks[cb].removeAll(callback);
+ }
}
return false;
}
diff --git a/src/corelib/global/qnamespace.qdoc b/src/corelib/global/qnamespace.qdoc
index 404bbfe65a..463a9936f6 100644
--- a/src/corelib/global/qnamespace.qdoc
+++ b/src/corelib/global/qnamespace.qdoc
@@ -203,7 +203,7 @@
\value AA_SetPalette Indicates whether a palette was explicitly set on the
QApplication/QGuiApplication. This value has been added in Qt 5.5.
- \value AA_EnableHighDpiScaling. Enables high-DPI scaling in Qt on supported
+ \value AA_EnableHighDpiScaling Enables high-DPI scaling in Qt on supported
platforms (see also \l{High DPI Displays}). Supported platforms are
X11, Windows and Android. Enabling makes Qt scale the main (device
independent) coordinate system according to display scale factors
diff --git a/src/corelib/io/qdiriterator.cpp b/src/corelib/io/qdiriterator.cpp
index 5fd9edc552..648593b020 100644
--- a/src/corelib/io/qdiriterator.cpp
+++ b/src/corelib/io/qdiriterator.cpp
@@ -56,6 +56,10 @@
\snippet code/src_corelib_io_qdiriterator.cpp 0
+ Here's how to find and read all files filtered by name, recursively:
+
+ \snippet code/src_corelib_io_qdiriterator.cpp 1
+
The next() function returns the path to the next directory entry and
advances the iterator. You can also call filePath() to get the current
file path without advancing the iterator. The fileName() function returns
@@ -204,6 +208,8 @@ void QDirIteratorPrivate::pushDirectory(const QFileInfo &fileInfo)
QFileSystemIterator *it = new QFileSystemIterator(fileInfo.d_ptr->fileEntry,
filters, nameFilters, iteratorFlags);
nativeIterators << it;
+#else
+ qWarning("Qt was built with -no-feature-filesystemiterator: no files/plugins will be found!");
#endif
}
}
diff --git a/src/corelib/io/qfile.cpp b/src/corelib/io/qfile.cpp
index 41fae69bb2..06d706b915 100644
--- a/src/corelib/io/qfile.cpp
+++ b/src/corelib/io/qfile.cpp
@@ -1106,3 +1106,7 @@ qint64 QFile::size() const
}
QT_END_NAMESPACE
+
+#ifndef QT_NO_QOBJECT
+#include "moc_qfile.cpp"
+#endif
diff --git a/src/corelib/io/qfiledevice.cpp b/src/corelib/io/qfiledevice.cpp
index ce9c8275ce..715dc7293a 100644
--- a/src/corelib/io/qfiledevice.cpp
+++ b/src/corelib/io/qfiledevice.cpp
@@ -739,3 +739,7 @@ bool QFileDevice::unmap(uchar *address)
}
QT_END_NAMESPACE
+
+#ifndef QT_NO_QOBJECT
+#include "moc_qfiledevice.cpp"
+#endif
diff --git a/src/corelib/io/qfilesystemwatcher.cpp b/src/corelib/io/qfilesystemwatcher.cpp
index 612b3fa57c..ed597c415b 100644
--- a/src/corelib/io/qfilesystemwatcher.cpp
+++ b/src/corelib/io/qfilesystemwatcher.cpp
@@ -497,6 +497,7 @@ QStringList QFileSystemWatcher::files() const
QT_END_NAMESPACE
#include "moc_qfilesystemwatcher.cpp"
+#include "moc_qfilesystemwatcher_p.cpp"
#endif // QT_NO_FILESYSTEMWATCHER
diff --git a/src/corelib/io/qfilesystemwatcher_inotify.cpp b/src/corelib/io/qfilesystemwatcher_inotify.cpp
index 5564bc7dca..3cfc6a254f 100644
--- a/src/corelib/io/qfilesystemwatcher_inotify.cpp
+++ b/src/corelib/io/qfilesystemwatcher_inotify.cpp
@@ -417,4 +417,6 @@ QString QInotifyFileSystemWatcherEngine::getPathFromID(int id) const
QT_END_NAMESPACE
+#include "moc_qfilesystemwatcher_inotify_p.cpp"
+
#endif // QT_NO_FILESYSTEMWATCHER
diff --git a/src/corelib/io/qfilesystemwatcher_polling.cpp b/src/corelib/io/qfilesystemwatcher_polling.cpp
index cbcb68e7d2..5bef8127f7 100644
--- a/src/corelib/io/qfilesystemwatcher_polling.cpp
+++ b/src/corelib/io/qfilesystemwatcher_polling.cpp
@@ -151,4 +151,7 @@ void QPollingFileSystemWatcherEngine::timeout()
}
QT_END_NAMESPACE
+
+#include "moc_qfilesystemwatcher_polling_p.cpp"
+
#endif // !QT_NO_FILESYSTEMWATCHER
diff --git a/src/corelib/io/qiodevice.cpp b/src/corelib/io/qiodevice.cpp
index 41a4d7a1ba..80122eac5e 100644
--- a/src/corelib/io/qiodevice.cpp
+++ b/src/corelib/io/qiodevice.cpp
@@ -2059,3 +2059,7 @@ QDebug operator<<(QDebug debug, QIODevice::OpenMode modes)
#endif
QT_END_NAMESPACE
+
+#ifndef QT_NO_QOBJECT
+#include "moc_qiodevice.cpp"
+#endif
diff --git a/src/corelib/io/qnoncontiguousbytedevice.cpp b/src/corelib/io/qnoncontiguousbytedevice.cpp
index 61299b8aa8..beca6ccbf7 100644
--- a/src/corelib/io/qnoncontiguousbytedevice.cpp
+++ b/src/corelib/io/qnoncontiguousbytedevice.cpp
@@ -578,3 +578,4 @@ QIODevice* QNonContiguousByteDeviceFactory::wrap(QNonContiguousByteDevice* byteD
QT_END_NAMESPACE
+#include "moc_qnoncontiguousbytedevice_p.cpp"
diff --git a/src/corelib/io/qsavefile.cpp b/src/corelib/io/qsavefile.cpp
index d8166014db..0283c5f31f 100644
--- a/src/corelib/io/qsavefile.cpp
+++ b/src/corelib/io/qsavefile.cpp
@@ -412,4 +412,8 @@ bool QSaveFile::directWriteFallback() const
QT_END_NAMESPACE
+#ifndef QT_NO_QOBJECT
+#include "moc_qsavefile.cpp"
+#endif
+
#endif // QT_NO_TEMPORARYFILE
diff --git a/src/corelib/io/qsettings.cpp b/src/corelib/io/qsettings.cpp
index 16dab38a60..d5460238ec 100644
--- a/src/corelib/io/qsettings.cpp
+++ b/src/corelib/io/qsettings.cpp
@@ -3513,4 +3513,8 @@ QSettings::Format QSettings::registerFormat(const QString &extension, ReadFunc r
QT_END_NAMESPACE
+#ifndef QT_BOOTSTRAPPED
+#include "moc_qsettings.cpp"
+#endif
+
#endif // QT_NO_SETTINGS
diff --git a/src/corelib/io/qstandardpaths.cpp b/src/corelib/io/qstandardpaths.cpp
index 4cf3a3e9bd..f2368c3b23 100644
--- a/src/corelib/io/qstandardpaths.cpp
+++ b/src/corelib/io/qstandardpaths.cpp
@@ -645,4 +645,8 @@ bool QStandardPaths::isTestModeEnabled()
QT_END_NAMESPACE
+#ifndef QT_NO_QOBJECT
+#include "moc_qstandardpaths.cpp"
+#endif
+
#endif // QT_NO_STANDARDPATHS
diff --git a/src/corelib/io/qtemporarydir.cpp b/src/corelib/io/qtemporarydir.cpp
index b2bf9fce97..ffaee9c683 100644
--- a/src/corelib/io/qtemporarydir.cpp
+++ b/src/corelib/io/qtemporarydir.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2016 The Qt Company Ltd.
+** Copyright (C) 2017 The Qt Company Ltd.
** Copyright (C) 2016 Intel Corporation.
** Contact: https://www.qt.io/licensing/
**
@@ -198,10 +198,10 @@ void QTemporaryDirPrivate::create(const QString &templateName)
\ingroup io
- QTemporaryDir is used to create unique temporary dirs safely.
- The dir itself is created by the constructor. The name of the
+ QTemporaryDir is used to create unique temporary directories safely.
+ The directory itself is created by the constructor. The name of the
temporary directory is guaranteed to be unique (i.e., you are
- guaranteed to not overwrite an existing dir), and the directory will
+ guaranteed to not overwrite an existing directory), and the directory will
subsequently be removed upon destruction of the QTemporaryDir
object. The directory name is either auto-generated, or created based
on a template, which is passed to QTemporaryDir's constructor.
@@ -214,7 +214,7 @@ void QTemporaryDirPrivate::create(const QString &templateName)
created, using isValid(). Do not use \l {QDir::exists()}{exists()}, since a default-constructed
QDir represents the current directory, which exists.
- The path to the temporary dir can be found by calling path().
+ The path to the temporary directory can be found by calling path().
A temporary directory will have some static part of the name and some
part that is calculated to be unique. The default path will be
diff --git a/src/corelib/io/qtemporaryfile.cpp b/src/corelib/io/qtemporaryfile.cpp
index 7aae128796..8a99873fee 100644
--- a/src/corelib/io/qtemporaryfile.cpp
+++ b/src/corelib/io/qtemporaryfile.cpp
@@ -796,4 +796,6 @@ QT_END_NAMESPACE
#endif // QT_NO_TEMPORARYFILE
-
+#ifndef QT_NO_QOBJECT
+#include "moc_qtemporaryfile.cpp"
+#endif
diff --git a/src/corelib/io/qtextstream.cpp b/src/corelib/io/qtextstream.cpp
index 9b565bff9d..5144ac0ec9 100644
--- a/src/corelib/io/qtextstream.cpp
+++ b/src/corelib/io/qtextstream.cpp
@@ -3188,3 +3188,6 @@ QLocale QTextStream::locale() const
QT_END_NAMESPACE
+#ifndef QT_NO_QOBJECT
+#include "moc_qtextstream_p.cpp"
+#endif
diff --git a/src/corelib/itemmodels/qabstractitemmodel.cpp b/src/corelib/itemmodels/qabstractitemmodel.cpp
index 0c87dd5659..c0737ffb36 100644
--- a/src/corelib/itemmodels/qabstractitemmodel.cpp
+++ b/src/corelib/itemmodels/qabstractitemmodel.cpp
@@ -3804,3 +3804,5 @@ void QAbstractItemModelPrivate::Persistent::insertMultiAtEnd(const QModelIndex&
}
QT_END_NAMESPACE
+
+#include "moc_qabstractitemmodel.cpp"
diff --git a/src/corelib/itemmodels/qitemselectionmodel.cpp b/src/corelib/itemmodels/qitemselectionmodel.cpp
index 74bd7abfcb..2ff311bc5a 100644
--- a/src/corelib/itemmodels/qitemselectionmodel.cpp
+++ b/src/corelib/itemmodels/qitemselectionmodel.cpp
@@ -945,13 +945,14 @@ static QItemSelection mergeRowLengths(const QVector<QPair<QPersistentModelIndex,
const uint nextLength = rowLengths.at(i).second;
if ((nextLength == length)
&& (next.row() == br.row() + 1)
+ && (next.column() == br.column())
&& (next.parent() == br.parent())) {
br = next;
} else {
break;
}
}
- result.append(QItemSelectionRange(tl, br.sibling(br.row(), length - 1)));
+ result.append(QItemSelectionRange(tl, br.sibling(br.row(), br.column() + length - 1)));
}
return result;
}
diff --git a/src/corelib/itemmodels/qstringlistmodel.cpp b/src/corelib/itemmodels/qstringlistmodel.cpp
index 0f7472aa5a..2b47d43469 100644
--- a/src/corelib/itemmodels/qstringlistmodel.cpp
+++ b/src/corelib/itemmodels/qstringlistmodel.cpp
@@ -328,4 +328,6 @@ Qt::DropActions QStringListModel::supportedDropActions() const
QT_END_NAMESPACE
+#include "moc_qstringlistmodel.cpp"
+
#endif // QT_NO_STRINGLISTMODEL
diff --git a/src/corelib/kernel/qabstracteventdispatcher.cpp b/src/corelib/kernel/qabstracteventdispatcher.cpp
index e94faa4587..d234949d14 100644
--- a/src/corelib/kernel/qabstracteventdispatcher.cpp
+++ b/src/corelib/kernel/qabstracteventdispatcher.cpp
@@ -521,3 +521,5 @@ bool QAbstractEventDispatcher::filterNativeEvent(const QByteArray &eventType, vo
*/
QT_END_NAMESPACE
+
+#include "moc_qabstracteventdispatcher.cpp"
diff --git a/src/corelib/kernel/qcoreapplication.cpp b/src/corelib/kernel/qcoreapplication.cpp
index 0104ba0101..39e7c71a9c 100644
--- a/src/corelib/kernel/qcoreapplication.cpp
+++ b/src/corelib/kernel/qcoreapplication.cpp
@@ -2914,3 +2914,7 @@ void QCoreApplication::setEventDispatcher(QAbstractEventDispatcher *eventDispatc
*/
QT_END_NAMESPACE
+
+#ifndef QT_NO_QOBJECT
+#include "moc_qcoreapplication.cpp"
+#endif
diff --git a/src/corelib/kernel/qcoreevent.cpp b/src/corelib/kernel/qcoreevent.cpp
index 4efc38ac89..e90cd842ab 100644
--- a/src/corelib/kernel/qcoreevent.cpp
+++ b/src/corelib/kernel/qcoreevent.cpp
@@ -652,3 +652,5 @@ QDeferredDeleteEvent::~QDeferredDeleteEvent()
*/
QT_END_NAMESPACE
+
+#include "moc_qcoreevent.cpp"
diff --git a/src/corelib/kernel/qeventdispatcher_glib.cpp b/src/corelib/kernel/qeventdispatcher_glib.cpp
index 8ca2ac1c39..8cefa7a118 100644
--- a/src/corelib/kernel/qeventdispatcher_glib.cpp
+++ b/src/corelib/kernel/qeventdispatcher_glib.cpp
@@ -611,3 +611,5 @@ QEventDispatcherGlib::QEventDispatcherGlib(QEventDispatcherGlibPrivate &dd, QObj
}
QT_END_NAMESPACE
+
+#include "moc_qeventdispatcher_glib_p.cpp"
diff --git a/src/corelib/kernel/qeventdispatcher_unix.cpp b/src/corelib/kernel/qeventdispatcher_unix.cpp
index 802962d77d..a28f2e3f0a 100644
--- a/src/corelib/kernel/qeventdispatcher_unix.cpp
+++ b/src/corelib/kernel/qeventdispatcher_unix.cpp
@@ -553,3 +553,5 @@ void QEventDispatcherUNIX::flush()
{ }
QT_END_NAMESPACE
+
+#include "moc_qeventdispatcher_unix_p.cpp"
diff --git a/src/corelib/kernel/qeventdispatcher_win.cpp b/src/corelib/kernel/qeventdispatcher_win.cpp
index 40db5020ab..0952464f53 100644
--- a/src/corelib/kernel/qeventdispatcher_win.cpp
+++ b/src/corelib/kernel/qeventdispatcher_win.cpp
@@ -860,7 +860,7 @@ bool QEventDispatcherWin32::unregisterTimers(QObject *object)
Q_D(QEventDispatcherWin32);
if (d->timerVec.isEmpty())
return false;
- register WinTimerInfo *t;
+ WinTimerInfo *t;
for (int i=0; i<d->timerVec.size(); i++) {
t = d->timerVec.at(i);
if (t && t->obj == object) { // object found
@@ -957,7 +957,7 @@ int QEventDispatcherWin32::remainingTime(int timerId)
quint64 currentTime = qt_msectime();
- register WinTimerInfo *t;
+ WinTimerInfo *t;
for (int i=0; i<d->timerVec.size(); i++) {
t = d->timerVec.at(i);
if (t && t->timerId == timerId) { // timer found
diff --git a/src/corelib/kernel/qeventloop.cpp b/src/corelib/kernel/qeventloop.cpp
index e4b819d9d2..8974ff7709 100644
--- a/src/corelib/kernel/qeventloop.cpp
+++ b/src/corelib/kernel/qeventloop.cpp
@@ -441,3 +441,5 @@ QEventLoopLocker::~QEventLoopLocker()
}
QT_END_NAMESPACE
+
+#include "moc_qeventloop.cpp"
diff --git a/src/corelib/kernel/qmimedata.cpp b/src/corelib/kernel/qmimedata.cpp
index a550ca6ca1..73307e925a 100644
--- a/src/corelib/kernel/qmimedata.cpp
+++ b/src/corelib/kernel/qmimedata.cpp
@@ -678,3 +678,5 @@ void QMimeData::removeFormat(const QString &mimeType)
}
QT_END_NAMESPACE
+
+#include "moc_qmimedata.cpp"
diff --git a/src/corelib/kernel/qobjectcleanuphandler.cpp b/src/corelib/kernel/qobjectcleanuphandler.cpp
index f3d23c4b44..b6c62af4b3 100644
--- a/src/corelib/kernel/qobjectcleanuphandler.cpp
+++ b/src/corelib/kernel/qobjectcleanuphandler.cpp
@@ -145,3 +145,5 @@ void QObjectCleanupHandler::objectDestroyed(QObject *object)
}
QT_END_NAMESPACE
+
+#include "moc_qobjectcleanuphandler.cpp"
diff --git a/src/corelib/kernel/qobjectdefs_impl.h b/src/corelib/kernel/qobjectdefs_impl.h
index 3f5f2e78bb..29ab77b269 100644
--- a/src/corelib/kernel/qobjectdefs_impl.h
+++ b/src/corelib/kernel/qobjectdefs_impl.h
@@ -201,7 +201,6 @@ namespace QtPrivate {
typedef List<Args...> Arguments;
typedef Ret ReturnType;
typedef Ret (Obj::*Function) (Args...) noexcept;
- template <class Base> struct ChangeClass { typedef Ret (Base:: *Type)(Args...) noexcept; };
enum {ArgumentCount = sizeof...(Args), IsPointerToMemberFunction = true};
template <typename SignalArgs, typename R>
static void call(Function f, Obj *o, void **arg) {
@@ -214,7 +213,6 @@ namespace QtPrivate {
typedef List<Args...> Arguments;
typedef Ret ReturnType;
typedef Ret (Obj::*Function) (Args...) const noexcept;
- template <class Base> struct ChangeClass { typedef Ret (Base:: *Type)(Args...) const noexcept; };
enum {ArgumentCount = sizeof...(Args), IsPointerToMemberFunction = true};
template <typename SignalArgs, typename R>
static void call(Function f, Obj *o, void **arg) {
@@ -300,7 +298,7 @@ namespace QtPrivate {
static const typename RemoveRef<A1>::Type &dummy();
enum { value = sizeof(test(dummy())) == sizeof(int) };
#ifdef QT_NO_NARROWING_CONVERSIONS_IN_CONNECT
- struct AreArgumentsNarrowed : AreArgumentsNarrowedBase<typename RemoveRef<A1>::Type, typename RemoveRef<A2>::Type> {};
+ using AreArgumentsNarrowed = AreArgumentsNarrowedBase<typename RemoveRef<A1>::Type, typename RemoveRef<A2>::Type>;
Q_STATIC_ASSERT_X(!AreArgumentsNarrowed::value, "Signal and slot arguments are not compatible (narrowing)");
#endif
};
diff --git a/src/corelib/kernel/qsharedmemory.cpp b/src/corelib/kernel/qsharedmemory.cpp
index 29b3e87076..7f185ee9dc 100644
--- a/src/corelib/kernel/qsharedmemory.cpp
+++ b/src/corelib/kernel/qsharedmemory.cpp
@@ -598,3 +598,5 @@ QString QSharedMemory::errorString() const
#endif // QT_NO_SHAREDMEMORY
QT_END_NAMESPACE
+
+#include "moc_qsharedmemory.cpp"
diff --git a/src/corelib/kernel/qsocketnotifier.cpp b/src/corelib/kernel/qsocketnotifier.cpp
index 933eac19ab..2268cb83bb 100644
--- a/src/corelib/kernel/qsocketnotifier.cpp
+++ b/src/corelib/kernel/qsocketnotifier.cpp
@@ -270,3 +270,5 @@ bool QSocketNotifier::event(QEvent *e)
}
QT_END_NAMESPACE
+
+#include "moc_qsocketnotifier.cpp"
diff --git a/src/corelib/kernel/qtimer.cpp b/src/corelib/kernel/qtimer.cpp
index 0c314526cb..55f75ab17e 100644
--- a/src/corelib/kernel/qtimer.cpp
+++ b/src/corelib/kernel/qtimer.cpp
@@ -670,3 +670,4 @@ int QTimer::remainingTime() const
QT_END_NAMESPACE
#include "qtimer.moc"
+#include "moc_qtimer.cpp"
diff --git a/src/corelib/kernel/qtranslator.cpp b/src/corelib/kernel/qtranslator.cpp
index 04a5e7ed7a..2232e24a25 100644
--- a/src/corelib/kernel/qtranslator.cpp
+++ b/src/corelib/kernel/qtranslator.cpp
@@ -1143,4 +1143,6 @@ bool QTranslator::isEmpty() const
QT_END_NAMESPACE
+#include "moc_qtranslator.cpp"
+
#endif // QT_NO_TRANSLATION
diff --git a/src/corelib/plugin/qfactoryloader.cpp b/src/corelib/plugin/qfactoryloader.cpp
index 21f1007d5b..40000e7b24 100644
--- a/src/corelib/plugin/qfactoryloader.cpp
+++ b/src/corelib/plugin/qfactoryloader.cpp
@@ -346,4 +346,6 @@ int QFactoryLoader::indexOf(const QString &needle) const
QT_END_NAMESPACE
+#include "moc_qfactoryloader_p.cpp"
+
#endif // QT_NO_QOBJECT
diff --git a/src/corelib/plugin/qlibrary.cpp b/src/corelib/plugin/qlibrary.cpp
index 6421e7c5d8..3d04d0802d 100644
--- a/src/corelib/plugin/qlibrary.cpp
+++ b/src/corelib/plugin/qlibrary.cpp
@@ -1129,3 +1129,5 @@ bool qt_debug_component()
}
QT_END_NAMESPACE
+
+#include "moc_qlibrary.cpp"
diff --git a/src/corelib/plugin/qpluginloader.cpp b/src/corelib/plugin/qpluginloader.cpp
index dbd3bee556..aab00cc7eb 100644
--- a/src/corelib/plugin/qpluginloader.cpp
+++ b/src/corelib/plugin/qpluginloader.cpp
@@ -479,3 +479,4 @@ QJsonObject QStaticPlugin::metaData() const
QT_END_NAMESPACE
+#include "moc_qpluginloader.cpp"
diff --git a/src/corelib/statemachine/qabstractstate.cpp b/src/corelib/statemachine/qabstractstate.cpp
index 13bf41faa9..1a9ad4601d 100644
--- a/src/corelib/statemachine/qabstractstate.cpp
+++ b/src/corelib/statemachine/qabstractstate.cpp
@@ -234,3 +234,5 @@ bool QAbstractState::event(QEvent *e)
}
QT_END_NAMESPACE
+
+#include "moc_qabstractstate.cpp"
diff --git a/src/corelib/statemachine/qabstracttransition.cpp b/src/corelib/statemachine/qabstracttransition.cpp
index 8c30d5f11c..53c713d6a8 100644
--- a/src/corelib/statemachine/qabstracttransition.cpp
+++ b/src/corelib/statemachine/qabstracttransition.cpp
@@ -431,3 +431,5 @@ bool QAbstractTransition::event(QEvent *e)
}
QT_END_NAMESPACE
+
+#include "moc_qabstracttransition.cpp"
diff --git a/src/corelib/statemachine/qeventtransition.cpp b/src/corelib/statemachine/qeventtransition.cpp
index cd0cfe2f85..a90f147773 100644
--- a/src/corelib/statemachine/qeventtransition.cpp
+++ b/src/corelib/statemachine/qeventtransition.cpp
@@ -252,3 +252,5 @@ bool QEventTransition::event(QEvent *e)
}
QT_END_NAMESPACE
+
+#include "moc_qeventtransition.cpp"
diff --git a/src/corelib/statemachine/qfinalstate.cpp b/src/corelib/statemachine/qfinalstate.cpp
index bef9fc4239..d8bfd30974 100644
--- a/src/corelib/statemachine/qfinalstate.cpp
+++ b/src/corelib/statemachine/qfinalstate.cpp
@@ -137,3 +137,5 @@ bool QFinalState::event(QEvent *e)
}
QT_END_NAMESPACE
+
+#include "moc_qfinalstate.cpp"
diff --git a/src/corelib/statemachine/qhistorystate.cpp b/src/corelib/statemachine/qhistorystate.cpp
index b1c5a92d00..a179d7c75b 100644
--- a/src/corelib/statemachine/qhistorystate.cpp
+++ b/src/corelib/statemachine/qhistorystate.cpp
@@ -310,3 +310,6 @@ bool QHistoryState::event(QEvent *e)
*/
QT_END_NAMESPACE
+
+#include "moc_qhistorystate.cpp"
+#include "moc_qhistorystate_p.cpp"
diff --git a/src/corelib/statemachine/qsignaltransition.cpp b/src/corelib/statemachine/qsignaltransition.cpp
index 3b219bda53..c05b4617b2 100644
--- a/src/corelib/statemachine/qsignaltransition.cpp
+++ b/src/corelib/statemachine/qsignaltransition.cpp
@@ -284,3 +284,5 @@ void QSignalTransitionPrivate::callOnTransition(QEvent *e)
QT_END_NAMESPACE
+
+#include "moc_qsignaltransition.cpp"
diff --git a/src/corelib/statemachine/qstate.cpp b/src/corelib/statemachine/qstate.cpp
index 48456424cf..76dcbf784b 100644
--- a/src/corelib/statemachine/qstate.cpp
+++ b/src/corelib/statemachine/qstate.cpp
@@ -599,3 +599,5 @@ bool QState::event(QEvent *e)
*/
QT_END_NAMESPACE
+
+#include "moc_qstate.cpp"
diff --git a/src/corelib/thread/qfuturewatcher.cpp b/src/corelib/thread/qfuturewatcher.cpp
index aa6f00c317..d2ec18850f 100644
--- a/src/corelib/thread/qfuturewatcher.cpp
+++ b/src/corelib/thread/qfuturewatcher.cpp
@@ -592,4 +592,6 @@ void QFutureWatcherBasePrivate::sendCallOutEvent(QFutureCallOutEvent *event)
QT_END_NAMESPACE
+#include "moc_qfuturewatcher.cpp"
+
#endif // QT_NO_QFUTURE
diff --git a/src/corelib/thread/qthread.cpp b/src/corelib/thread/qthread.cpp
index 0828400733..996a1df9a0 100644
--- a/src/corelib/thread/qthread.cpp
+++ b/src/corelib/thread/qthread.cpp
@@ -901,3 +901,5 @@ QDaemonThread::~QDaemonThread()
}
QT_END_NAMESPACE
+
+#include "moc_qthread.cpp"
diff --git a/src/corelib/thread/qthreadpool.cpp b/src/corelib/thread/qthreadpool.cpp
index e45aaec103..f3ce1f258f 100644
--- a/src/corelib/thread/qthreadpool.cpp
+++ b/src/corelib/thread/qthreadpool.cpp
@@ -679,4 +679,6 @@ void QThreadPool::cancel(QRunnable *runnable)
QT_END_NAMESPACE
+#include "moc_qthreadpool.cpp"
+
#endif
diff --git a/src/corelib/tools/qcryptographichash.cpp b/src/corelib/tools/qcryptographichash.cpp
index 963a91b9a9..5410adc737 100644
--- a/src/corelib/tools/qcryptographichash.cpp
+++ b/src/corelib/tools/qcryptographichash.cpp
@@ -494,3 +494,7 @@ QByteArray QCryptographicHash::hash(const QByteArray &data, Algorithm method)
}
QT_END_NAMESPACE
+
+#ifndef QT_NO_QOBJECT
+#include "moc_qcryptographichash.cpp"
+#endif
diff --git a/src/corelib/tools/qeasingcurve.cpp b/src/corelib/tools/qeasingcurve.cpp
index 4b5f5e7830..03bb1a1411 100644
--- a/src/corelib/tools/qeasingcurve.cpp
+++ b/src/corelib/tools/qeasingcurve.cpp
@@ -1501,3 +1501,5 @@ QDataStream &operator>>(QDataStream &stream, QEasingCurve &easing)
#endif // QT_NO_DATASTREAM
QT_END_NAMESPACE
+
+#include "moc_qeasingcurve.cpp"
diff --git a/src/corelib/tools/qhash.h b/src/corelib/tools/qhash.h
index c59f789cb2..b2c3cf574d 100644
--- a/src/corelib/tools/qhash.h
+++ b/src/corelib/tools/qhash.h
@@ -51,6 +51,8 @@
#include <initializer_list>
#endif
+#include <algorithm>
+
#if defined(Q_CC_MSVC)
#pragma warning( push )
#pragma warning( disable : 4311 ) // disable pointer truncation warning
@@ -936,18 +938,24 @@ Q_OUTOFLINE_TEMPLATE bool QHash<Key, T>::operator==(const QHash &other) const
const_iterator it = begin();
while (it != end()) {
- const Key &akey = it.key();
+ // Build two equal ranges for i.key(); one for *this and one for other.
+ // For *this we can avoid a lookup via equal_range, as we know the beginning of the range.
+ auto thisEqualRangeEnd = it;
+ while (thisEqualRangeEnd != end() && it.key() == thisEqualRangeEnd.key())
+ ++thisEqualRangeEnd;
- const_iterator it2 = other.find(akey);
- do {
- if (it2 == other.end() || !(it2.key() == akey))
- return false;
- if (!(it.value() == it2.value()))
- return false;
- ++it;
- ++it2;
- } while (it != end() && it.key() == akey);
+ const auto otherEqualRange = other.equal_range(it.key());
+
+ if (std::distance(it, thisEqualRangeEnd) != std::distance(otherEqualRange.first, otherEqualRange.second))
+ return false;
+
+ // Keys in the ranges are equal by construction; this checks only the values.
+ if (!std::is_permutation(it, thisEqualRangeEnd, otherEqualRange.first))
+ return false;
+
+ it = thisEqualRangeEnd;
}
+
return true;
}
diff --git a/src/corelib/tools/qlocale.cpp b/src/corelib/tools/qlocale.cpp
index 697e0062dd..dcdf6b5ed7 100644
--- a/src/corelib/tools/qlocale.cpp
+++ b/src/corelib/tools/qlocale.cpp
@@ -3005,14 +3005,18 @@ QString QLocaleData::unsLongLongToString(const QChar zero, const QChar group,
int base, int width,
unsigned flags)
{
+ const QChar resultZero = base == 10 ? zero : QChar(QLatin1Char('0'));
+ QString num_str = l ? qulltoa(l, base, zero) : QString(resultZero);
+
bool precision_not_specified = false;
if (precision == -1) {
+ if (flags == NoFlags)
+ return num_str; // fast-path: nothing below applies, so we're done.
+
precision_not_specified = true;
precision = 1;
}
- QString num_str = qulltoa(l, base, zero);
-
uint cnt_thousand_sep = 0;
if (flags & ThousandsGroup && base == 10) {
for (int i = num_str.length() - 3; i > 0; i -=3) {
@@ -3021,7 +3025,6 @@ QString QLocaleData::unsLongLongToString(const QChar zero, const QChar group,
}
}
- const QChar resultZero = base == 10 ? zero : QChar(QLatin1Char('0'));
const int zeroPadding = precision - num_str.length()/* + cnt_thousand_sep*/;
if (zeroPadding > 0)
num_str.prepend(QString(zeroPadding, resultZero));
@@ -3665,3 +3668,7 @@ QDebug operator<<(QDebug dbg, const QLocale &l)
}
#endif
QT_END_NAMESPACE
+
+#ifndef QT_NO_QOBJECT
+#include "moc_qlocale.cpp"
+#endif
diff --git a/src/corelib/tools/qtimeline.cpp b/src/corelib/tools/qtimeline.cpp
index adbc2900e3..e70e7f8e16 100644
--- a/src/corelib/tools/qtimeline.cpp
+++ b/src/corelib/tools/qtimeline.cpp
@@ -784,3 +784,5 @@ void QTimeLine::timerEvent(QTimerEvent *event)
}
QT_END_NAMESPACE
+
+#include "moc_qtimeline.cpp"
diff --git a/src/gui/painting/qpainterpath.cpp b/src/gui/painting/qpainterpath.cpp
index 7dbc83b338..27bd2e59e6 100644
--- a/src/gui/painting/qpainterpath.cpp
+++ b/src/gui/painting/qpainterpath.cpp
@@ -1981,6 +1981,17 @@ static bool qt_isect_curve_vertical(const QBezier &bezier, qreal x, qreal y1, qr
return false;
}
+static bool pointOnEdge(const QRectF &rect, const QPointF &point)
+{
+ if ((point.x() == rect.left() || point.x() == rect.right()) &&
+ (point.y() >= rect.top() && point.y() <= rect.bottom()))
+ return true;
+ if ((point.y() == rect.top() || point.y() == rect.bottom()) &&
+ (point.x() >= rect.left() && point.x() <= rect.right()))
+ return true;
+ return false;
+}
+
/*
Returns \c true if any lines or curves cross the four edges in of rect
*/
@@ -1988,6 +1999,7 @@ static bool qt_painterpath_check_crossing(const QPainterPath *path, const QRectF
{
QPointF last_pt;
QPointF last_start;
+ enum { OnRect, InsideRect, OutsideRect} edgeStatus = OnRect;
for (int i=0; i<path->elementCount(); ++i) {
const QPainterPath::Element &e = path->elementAt(i);
@@ -2026,6 +2038,27 @@ static bool qt_painterpath_check_crossing(const QPainterPath *path, const QRectF
default:
break;
}
+ // Handle crossing the edges of the rect at the end-points of individual sub-paths.
+ // A point on on the edge itself is considered neither inside nor outside for this purpose.
+ if (!pointOnEdge(rect, last_pt)) {
+ bool contained = rect.contains(last_pt);
+ switch (edgeStatus) {
+ case OutsideRect:
+ if (contained)
+ return true;
+ break;
+ case InsideRect:
+ if (!contained)
+ return true;
+ break;
+ case OnRect:
+ edgeStatus = contained ? InsideRect : OutsideRect;
+ break;
+ }
+ } else {
+ if (last_pt == last_start)
+ edgeStatus = OnRect;
+ }
}
// implicitly close last subpath
diff --git a/src/network/access/qhttp2protocolhandler.cpp b/src/network/access/qhttp2protocolhandler.cpp
index 555f1ba0ef..44ab637da8 100644
--- a/src/network/access/qhttp2protocolhandler.cpp
+++ b/src/network/access/qhttp2protocolhandler.cpp
@@ -528,7 +528,7 @@ void QHttp2ProtocolHandler::handleDATA()
auto &stream = activeStreams[streamID];
if (qint32(inboundFrame.payloadSize()) > stream.recvWindow) {
- finishStreamWithError(stream, QNetworkReply::ProtocolInvalidOperationError,
+ finishStreamWithError(stream, QNetworkReply::ProtocolFailure,
QLatin1String("flow control error"));
sendRST_STREAM(streamID, FLOW_CONTROL_ERROR);
markAsReset(streamID);
@@ -834,7 +834,7 @@ void QHttp2ProtocolHandler::handleWINDOW_UPDATE()
}
auto &stream = activeStreams[streamID];
if (!valid || sum_will_overflow(stream.sendWindow, delta)) {
- finishStreamWithError(stream, QNetworkReply::ProtocolInvalidOperationError,
+ finishStreamWithError(stream, QNetworkReply::ProtocolFailure,
QLatin1String("invalid WINDOW_UPDATE delta"));
sendRST_STREAM(streamID, PROTOCOL_ERROR);
markAsReset(streamID);
@@ -888,7 +888,7 @@ void QHttp2ProtocolHandler::handleContinuedHEADERS()
// We can receive HEADERS on streams initiated by our requests
// (these streams are in halfClosedLocal state) or remote-reserved
// streams from a server's PUSH_PROMISE.
- finishStreamWithError(stream, QNetworkReply::ProtocolInvalidOperationError,
+ finishStreamWithError(stream, QNetworkReply::ProtocolFailure,
QLatin1String("HEADERS on invalid stream"));
sendRST_STREAM(streamID, CANCEL);
markAsReset(streamID);
@@ -977,7 +977,7 @@ bool QHttp2ProtocolHandler::acceptSetting(Http2::Settings identifier, quint32 ne
for (auto id : brokenStreams) {
auto &stream = activeStreams[id];
- finishStreamWithError(stream, QNetworkReply::ProtocolInvalidOperationError,
+ finishStreamWithError(stream, QNetworkReply::ProtocolFailure,
QLatin1String("SETTINGS window overflow"));
sendRST_STREAM(id, PROTOCOL_ERROR);
markAsReset(id);
diff --git a/src/network/doc/src/bearermanagement.qdoc b/src/network/doc/src/bearermanagement.qdoc
index 52b5958996..f8d6a807d2 100644
--- a/src/network/doc/src/bearermanagement.qdoc
+++ b/src/network/doc/src/bearermanagement.qdoc
@@ -235,33 +235,6 @@ QNetworkSession is the central class for managing roaming related issues.
Some API features are not available on all platforms. The
\l QNetworkConfigurationManager::Capability should be used to detect
-platform features at runtime. The following table lists the various
-platform APIs being used by this API. This may assist in the process of
-determining the feature support:
-
-\table
- \header
- \li Platform
- \li Backend capabilities
- \row
- \li Linux\unicode{0xAE}
- \li Linux uses the \l {http://projects.gnome.org/NetworkManager}{NetworkManager}
- and \l {http://connman.net/}{ConnMan} / \l {http://ofono.org/}{oFono} APIs
- which support interface notifications and starting and stopping of network
- interfaces. Network Manager version 0.9 and above is supported.
- \row
- \li Windows\unicode{0xAE} XP
- \li This platform supports interface notifications without active polling.
- \row
- \li Windows XP SP2+Hotfixes, Windows XP SP3, Windows Vista, Windows 7
- \li In addition to standard Windows XP wifi access point monitoring has been improved which includes the ability to start and stop wifi interfaces. This requires Windows to manage the wifi interfaces.
- \row
- \li Mac OS\unicode{0xAE}
- \li This platform has full support by way of CoreWLAN offered in Mac OS 10.6. Previous
- versions of Mac OS - 10.5 and 10.4 have limited support.
- \row
- \li All other platforms (*nix, Windows Mobile)
- \li This backend is the fallback for all platforms supports network interface notifications via active polling only.
-\endtable
+platform features at runtime.
*/
diff --git a/src/platformsupport/fontdatabases/mac/coretext.pri b/src/platformsupport/fontdatabases/mac/coretext.pri
index a533234c26..2a9b32f65a 100644
--- a/src/platformsupport/fontdatabases/mac/coretext.pri
+++ b/src/platformsupport/fontdatabases/mac/coretext.pri
@@ -7,12 +7,16 @@ qtConfig(freetype) {
SOURCES += freetype/qfontengine_ft.cpp
}
-uikit: \
- # On iOS/tvOS/watchOS CoreText and CoreGraphics are stand-alone frameworks
- LIBS_PRIVATE += -framework CoreText -framework CoreGraphics
-else: \
- # On macOS they are re-exported by the AppKit framework
+LIBS_PRIVATE += \
+ -framework CoreFoundation \
+ -framework CoreGraphics \
+ -framework CoreText \
+ -framework Foundation
+
+macos: \
LIBS_PRIVATE += -framework AppKit
+else: \
+ LIBS_PRIVATE += -framework UIKit
# CoreText is documented to be available on watchOS, but the headers aren't present
# in the watchOS Simulator SDK like they are supposed to be. Work around the problem
diff --git a/src/plugins/platforms/android/androidjniclipboard.cpp b/src/plugins/platforms/android/androidjniclipboard.cpp
index 17ff0e0bbb..833996403c 100644
--- a/src/plugins/platforms/android/androidjniclipboard.cpp
+++ b/src/plugins/platforms/android/androidjniclipboard.cpp
@@ -38,7 +38,6 @@
****************************************************************************/
#include "androidjniclipboard.h"
-#include "androidjnimain.h"
#include <QtCore/private/qjni_p.h>
QT_BEGIN_NAMESPACE
@@ -46,10 +45,23 @@ QT_BEGIN_NAMESPACE
using namespace QtAndroid;
namespace QtAndroidClipboard
{
- void setClipboardListener(QAndroidPlatformClipboard *listener)
+ QAndroidPlatformClipboard *m_manager = nullptr;
+
+ static char const *const QtNativeClassName = "org/qtproject/qt5/android/QtNative";
+ static JNINativeMethod methods[] = {
+ {"onClipboardDataChanged", "()V", (void *)onClipboardDataChanged}
+ };
+
+ void setClipboardManager(QAndroidPlatformClipboard *manager)
{
- Q_UNUSED(listener);
+ m_manager = manager;
QJNIObjectPrivate::callStaticMethod<void>(applicationClass(), "registerClipboardManager");
+ jclass appClass = QtAndroid::applicationClass();
+ QJNIEnvironmentPrivate env;
+ if (env->RegisterNatives(appClass, methods, sizeof(methods) / sizeof(methods[0])) < 0) {
+ __android_log_print(ANDROID_LOG_FATAL,"Qt", "RegisterNatives failed");
+ return;
+ }
}
void setClipboardText(const QString &text)
@@ -73,6 +85,11 @@ namespace QtAndroidClipboard
"()Ljava/lang/String;");
return text.toString();
}
+
+ void onClipboardDataChanged(JNIEnv */*env*/, jobject /*thiz*/)
+ {
+ m_manager->emitChanged(QClipboard::Clipboard);
+ }
}
QT_END_NAMESPACE
diff --git a/src/plugins/platforms/android/androidjniclipboard.h b/src/plugins/platforms/android/androidjniclipboard.h
index 9de6dc1f44..2ec566e729 100644
--- a/src/plugins/platforms/android/androidjniclipboard.h
+++ b/src/plugins/platforms/android/androidjniclipboard.h
@@ -41,6 +41,8 @@
#define ANDROIDJNICLIPBOARD_H
#include <QString>
+#include "qandroidplatformclipboard.h"
+#include "androidjnimain.h"
QT_BEGIN_NAMESPACE
@@ -48,10 +50,11 @@ class QAndroidPlatformClipboard;
namespace QtAndroidClipboard
{
// Clipboard support
- void setClipboardListener(QAndroidPlatformClipboard *listener);
+ void setClipboardManager(QAndroidPlatformClipboard *manager);
void setClipboardText(const QString &text);
bool hasClipboardText();
QString clipboardText();
+ void onClipboardDataChanged(JNIEnv */*env*/, jobject /*thiz*/);
// Clipboard support
}
diff --git a/src/plugins/platforms/android/qandroidplatformclipboard.cpp b/src/plugins/platforms/android/qandroidplatformclipboard.cpp
index a2bc802680..dc5147b259 100644
--- a/src/plugins/platforms/android/qandroidplatformclipboard.cpp
+++ b/src/plugins/platforms/android/qandroidplatformclipboard.cpp
@@ -45,7 +45,7 @@ QT_BEGIN_NAMESPACE
QAndroidPlatformClipboard::QAndroidPlatformClipboard()
{
- QtAndroidClipboard::setClipboardListener(this);
+ QtAndroidClipboard::setClipboardManager(this);
}
QMimeData *QAndroidPlatformClipboard::mimeData(QClipboard::Mode mode)
diff --git a/src/plugins/platforms/cocoa/qcocoawindow.mm b/src/plugins/platforms/cocoa/qcocoawindow.mm
index b85fb97f67..5ff5d01a99 100644
--- a/src/plugins/platforms/cocoa/qcocoawindow.mm
+++ b/src/plugins/platforms/cocoa/qcocoawindow.mm
@@ -291,6 +291,8 @@ static void qt_closePopups()
- (void)closeAndRelease
{
+ qCDebug(lcQpaCocoaWindow) << "closeAndRelease" << self;
+
[self close];
if (self.helper.grabbingMouse) {
@@ -361,6 +363,8 @@ static void qt_closePopups()
- (void)closeAndRelease
{
+ qCDebug(lcQpaCocoaWindow) << "closeAndRelease" << self;
+
[self.helper detachFromPlatformWindow];
[self close];
[self release];
@@ -1584,7 +1588,7 @@ void QCocoaWindow::recreateWindowIfNeeded()
if (isChildNSWindow() != shouldBeChildNSWindow)
recreateReason |= ChildNSWindowChanged;
- const bool shouldBeContentView = !parentWindow || shouldBeChildNSWindow;
+ const bool shouldBeContentView = (!parentWindow && !m_viewIsEmbedded) || shouldBeChildNSWindow;
if (isContentView() != shouldBeContentView)
recreateReason |= ContentViewChanged;
@@ -1601,7 +1605,7 @@ void QCocoaWindow::recreateWindowIfNeeded()
return;
}
- qCDebug(lcQpaCocoaWindow) << "Recreating NSWindow due to" << recreateReason;
+ qCDebug(lcQpaCocoaWindow) << "Reconfiguring NSWindow due to" << recreateReason;
QCocoaWindow *parentCocoaWindow = static_cast<QCocoaWindow *>(parentWindow);
@@ -1616,6 +1620,7 @@ void QCocoaWindow::recreateWindowIfNeeded()
// Remove current window (if any)
if ((isContentView() && !shouldBeContentView) || (recreateReason & PanelChanged)) {
+ qCDebug(lcQpaCocoaWindow) << "Getting rid of existing window" << m_nsWindow;
[m_nsWindow closeAndRelease];
if (isChildNSWindow())
[m_view.window.parentWindow removeChildWindow:m_view.window];
@@ -1642,6 +1647,7 @@ void QCocoaWindow::recreateWindowIfNeeded()
// Move view to new NSWindow if needed
if (m_nsWindow.contentView != m_view) {
+ qCDebug(lcQpaCocoaWindow) << "Ensuring that view is content view for" << m_nsWindow;
[m_view setPostsFrameChangedNotifications:NO];
[m_view retain];
if (m_view.superview) // m_view comes from another NSWindow
@@ -1723,6 +1729,8 @@ void QCocoaWindow::requestActivateWindow()
QCocoaNSWindow *QCocoaWindow::createNSWindow(bool shouldBeChildNSWindow, bool shouldBePanel)
{
+ qCDebug(lcQpaCocoaWindow) << "createNSWindow" << shouldBeChildNSWindow << shouldBePanel;
+
QMacAutoReleasePool pool;
QRect rect = geometry();
diff --git a/src/plugins/platforms/cocoa/qnsview.mm b/src/plugins/platforms/cocoa/qnsview.mm
index 6494dd3386..72e90a5363 100644
--- a/src/plugins/platforms/cocoa/qnsview.mm
+++ b/src/plugins/platforms/cocoa/qnsview.mm
@@ -237,7 +237,7 @@ static bool _q_dontOverrideCtrlLMB = false;
- (void)viewDidMoveToSuperview
{
- if (m_platformWindow.isNull())
+ if (!m_platformWindow)
return;
if (!(m_platformWindow->m_viewIsToBeEmbedded))
@@ -260,7 +260,7 @@ static bool _q_dontOverrideCtrlLMB = false;
- (QWindow *)topLevelWindow
{
- if (m_platformWindow.isNull())
+ if (!m_platformWindow)
return nullptr;
QWindow *focusWindow = m_platformWindow->window();
@@ -278,7 +278,7 @@ static bool _q_dontOverrideCtrlLMB = false;
- (void)updateGeometry
{
- if (m_platformWindow.isNull())
+ if (!m_platformWindow)
return;
QRect geometry;
@@ -437,8 +437,11 @@ static bool _q_dontOverrideCtrlLMB = false;
}
}
-- (void) drawRect:(NSRect)dirtyRect
+- (void)drawRect:(NSRect)dirtyRect
{
+ if (!m_platformWindow)
+ return;
+
qCDebug(lcQpaCocoaWindow) << "[QNSView drawRect:]" << m_platformWindow->window() << QRectF::fromCGRect(NSRectToCGRect(dirtyRect));
#ifndef QT_NO_OPENGL
@@ -627,7 +630,7 @@ static bool _q_dontOverrideCtrlLMB = false;
- (void)handleMouseEvent:(NSEvent *)theEvent
{
- if (m_platformWindow.isNull())
+ if (!m_platformWindow)
return;
// Tablet events may come in via the mouse event handlers,
@@ -644,7 +647,7 @@ static bool _q_dontOverrideCtrlLMB = false;
else
m_platformWindow->m_forwardWindow.clear();
}
- if (targetView->m_platformWindow.isNull())
+ if (!targetView.platformWindow)
return;
// Popups implicitly grap mouse events; forward to the active popup if there is one
@@ -670,7 +673,7 @@ static bool _q_dontOverrideCtrlLMB = false;
- (void)handleFrameStrutMouseEvent:(NSEvent *)theEvent
{
- if (m_platformWindow.isNull())
+ if (!m_platformWindow)
return;
// get m_buttons in sync
@@ -955,7 +958,7 @@ static bool _q_dontOverrideCtrlLMB = false;
- (void)mouseMovedImpl:(NSEvent *)theEvent
{
- if (m_platformWindow.isNull())
+ if (!m_platformWindow)
return;
if ([self isTransparentForUserInput])
@@ -989,7 +992,7 @@ static bool _q_dontOverrideCtrlLMB = false;
- (void)mouseEnteredImpl:(NSEvent *)theEvent
{
Q_UNUSED(theEvent)
- if (m_platformWindow.isNull())
+ if (!m_platformWindow)
return;
m_platformWindow->m_windowUnderMouse = true;
@@ -1011,7 +1014,7 @@ static bool _q_dontOverrideCtrlLMB = false;
- (void)mouseExitedImpl:(NSEvent *)theEvent
{
Q_UNUSED(theEvent);
- if (m_platformWindow.isNull())
+ if (!m_platformWindow)
return;
m_platformWindow->m_windowUnderMouse = false;
@@ -1040,7 +1043,7 @@ Q_GLOBAL_STATIC(QCocoaTabletDeviceDataHash, tabletDeviceDataHash)
- (bool)handleTabletEvent: (NSEvent *)theEvent
{
- if (m_platformWindow.isNull())
+ if (!m_platformWindow)
return false;
NSEventType eventType = [theEvent type];
@@ -1200,7 +1203,7 @@ static QTabletEvent::TabletDevice wacomTabletDevice(NSEvent *theEvent)
- (bool)shouldSendSingleTouch
{
- if (m_platformWindow.isNull())
+ if (!m_platformWindow)
return true;
// QtWidgets expects single-point touch events, QtDeclarative does not.
@@ -1210,7 +1213,7 @@ static QTabletEvent::TabletDevice wacomTabletDevice(NSEvent *theEvent)
- (void)touchesBeganWithEvent:(NSEvent *)event
{
- if (m_platformWindow.isNull())
+ if (!m_platformWindow)
return;
const NSTimeInterval timestamp = [event timestamp];
@@ -1221,7 +1224,7 @@ static QTabletEvent::TabletDevice wacomTabletDevice(NSEvent *theEvent)
- (void)touchesMovedWithEvent:(NSEvent *)event
{
- if (m_platformWindow.isNull())
+ if (!m_platformWindow)
return;
const NSTimeInterval timestamp = [event timestamp];
@@ -1232,7 +1235,7 @@ static QTabletEvent::TabletDevice wacomTabletDevice(NSEvent *theEvent)
- (void)touchesEndedWithEvent:(NSEvent *)event
{
- if (m_platformWindow.isNull())
+ if (!m_platformWindow)
return;
const NSTimeInterval timestamp = [event timestamp];
@@ -1243,7 +1246,7 @@ static QTabletEvent::TabletDevice wacomTabletDevice(NSEvent *theEvent)
- (void)touchesCancelledWithEvent:(NSEvent *)event
{
- if (m_platformWindow.isNull())
+ if (!m_platformWindow)
return;
const NSTimeInterval timestamp = [event timestamp];
@@ -1273,7 +1276,7 @@ static QTabletEvent::TabletDevice wacomTabletDevice(NSEvent *theEvent)
}
- (void)magnifyWithEvent:(NSEvent *)event
{
- if (m_platformWindow.isNull())
+ if (!m_platformWindow)
return;
if ([self handleGestureAsBeginEnd:event])
@@ -1290,7 +1293,7 @@ static QTabletEvent::TabletDevice wacomTabletDevice(NSEvent *theEvent)
- (void)smartMagnifyWithEvent:(NSEvent *)event
{
- if (m_platformWindow.isNull())
+ if (!m_platformWindow)
return;
static bool zoomIn = true;
@@ -1306,7 +1309,7 @@ static QTabletEvent::TabletDevice wacomTabletDevice(NSEvent *theEvent)
- (void)rotateWithEvent:(NSEvent *)event
{
- if (m_platformWindow.isNull())
+ if (!m_platformWindow)
return;
if ([self handleGestureAsBeginEnd:event])
@@ -1322,7 +1325,7 @@ static QTabletEvent::TabletDevice wacomTabletDevice(NSEvent *theEvent)
- (void)swipeWithEvent:(NSEvent *)event
{
- if (m_platformWindow.isNull())
+ if (!m_platformWindow)
return;
qCDebug(lcQpaGestures) << "swipeWithEvent" << [event deltaX] << [event deltaY];
@@ -1347,7 +1350,7 @@ static QTabletEvent::TabletDevice wacomTabletDevice(NSEvent *theEvent)
- (void)beginGestureWithEvent:(NSEvent *)event
{
- if (m_platformWindow.isNull())
+ if (!m_platformWindow)
return;
const NSTimeInterval timestamp = [event timestamp];
@@ -1361,7 +1364,7 @@ static QTabletEvent::TabletDevice wacomTabletDevice(NSEvent *theEvent)
- (void)endGestureWithEvent:(NSEvent *)event
{
- if (m_platformWindow.isNull())
+ if (!m_platformWindow)
return;
qCDebug(lcQpaGestures) << "endGestureWithEvent";
@@ -1377,7 +1380,7 @@ static QTabletEvent::TabletDevice wacomTabletDevice(NSEvent *theEvent)
#ifndef QT_NO_WHEELEVENT
- (void)scrollWheel:(NSEvent *)theEvent
{
- if (m_platformWindow.isNull())
+ if (!m_platformWindow)
return;
if ([self isTransparentForUserInput])
@@ -1879,6 +1882,9 @@ static QTabletEvent::TabletDevice wacomTabletDevice(NSEvent *theEvent)
- (NSArray*)validAttributesForMarkedText
{
+ if (!m_platformWindow)
+ return nil;
+
if (m_platformWindow->window() != QGuiApplication::focusWindow())
return nil;
@@ -2050,7 +2056,7 @@ static QPoint mapWindowCoordinates(QWindow *source, QWindow *target, QPoint poin
// Sends drag update to Qt, return the action
- (NSDragOperation)handleDrag:(id <NSDraggingInfo>)sender
{
- if (m_platformWindow.isNull())
+ if (!m_platformWindow)
return NSDragOperationNone;
NSPoint windowPoint = [self convertPoint: [sender draggingLocation] fromView: nil];
@@ -2080,7 +2086,7 @@ static QPoint mapWindowCoordinates(QWindow *source, QWindow *target, QPoint poin
- (void)draggingExited:(id <NSDraggingInfo>)sender
{
- if (m_platformWindow.isNull())
+ if (!m_platformWindow)
return;
QWindow *target = findEventTargetWindow(m_platformWindow->window());
@@ -2097,7 +2103,7 @@ static QPoint mapWindowCoordinates(QWindow *source, QWindow *target, QPoint poin
// called on drop, send the drop to Qt and return if it was accepted.
- (BOOL)performDragOperation:(id <NSDraggingInfo>)sender
{
- if (m_platformWindow.isNull())
+ if (!m_platformWindow)
return false;
QWindow *target = findEventTargetWindow(m_platformWindow->window());
@@ -2131,7 +2137,7 @@ static QPoint mapWindowCoordinates(QWindow *source, QWindow *target, QPoint poin
Q_UNUSED(session);
Q_UNUSED(operation);
- if (m_platformWindow.isNull())
+ if (!m_platformWindow)
return;
QWindow *target = findEventTargetWindow(m_platformWindow->window());
diff --git a/src/plugins/platforms/ios/qiostextresponder.mm b/src/plugins/platforms/ios/qiostextresponder.mm
index eab6792266..001985a128 100644
--- a/src/plugins/platforms/ios/qiostextresponder.mm
+++ b/src/plugins/platforms/ios/qiostextresponder.mm
@@ -242,11 +242,12 @@
if (platformData.value(kImePlatformDataHideShortcutsBar).toBool()) {
// According to the docs, leadingBarButtonGroups/trailingBarButtonGroups should be set to nil to hide the shortcuts bar.
// However, starting with iOS 10, the API has been surrounded with NS_ASSUME_NONNULL, which contradicts this and causes
- // compiler warnings. And assigning just an empty array causes layout asserts. Hence, we assign empty button groups instead.
- UIBarButtonItemGroup *leading = [[[UIBarButtonItemGroup alloc] initWithBarButtonItems:@[] representativeItem:nil] autorelease];
- UIBarButtonItemGroup *trailing = [[[UIBarButtonItemGroup alloc] initWithBarButtonItems:@[] representativeItem:nil] autorelease];
- self.inputAssistantItem.leadingBarButtonGroups = @[leading];
- self.inputAssistantItem.trailingBarButtonGroups = @[trailing];
+ // compiler warnings. Still it is the way to go to really hide the space reserved for that.
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wnonnull"
+ self.inputAssistantItem.leadingBarButtonGroups = nil;
+ self.inputAssistantItem.trailingBarButtonGroups = nil;
+#pragma clang diagnostic pop
}
}
#endif
diff --git a/src/plugins/platforms/windows/qwindowswindow.cpp b/src/plugins/platforms/windows/qwindowswindow.cpp
index 2875463e62..077511d4e1 100644
--- a/src/plugins/platforms/windows/qwindowswindow.cpp
+++ b/src/plugins/platforms/windows/qwindowswindow.cpp
@@ -870,13 +870,15 @@ void QWindowsBaseWindow::hide_sys() // Normal hide, do not activate other window
void QWindowsBaseWindow::raise_sys()
{
qCDebug(lcQpaWindows) << __FUNCTION__ << this << window();
- SetWindowPos(handle(), HWND_TOP, 0, 0, 0, 0, SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOSIZE);
+ if ((window()->flags() & (Qt::WindowStaysOnTopHint | Qt::WindowStaysOnBottomHint)) == 0)
+ SetWindowPos(handle(), HWND_TOP, 0, 0, 0, 0, SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOSIZE);
}
void QWindowsBaseWindow::lower_sys()
{
qCDebug(lcQpaWindows) << __FUNCTION__ << this << window();
- SetWindowPos(handle(), HWND_BOTTOM, 0, 0, 0, 0, SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOSIZE);
+ if ((window()->flags() & (Qt::WindowStaysOnTopHint | Qt::WindowStaysOnBottomHint)) == 0)
+ SetWindowPos(handle(), HWND_BOTTOM, 0, 0, 0, 0, SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOSIZE);
}
void QWindowsBaseWindow::setWindowTitle_sys(const QString &title)
@@ -1616,6 +1618,16 @@ static inline bool dwmIsCompositionEnabled()
return SUCCEEDED(DwmIsCompositionEnabled(&dWmCompositionEnabled)) && dWmCompositionEnabled == TRUE;
}
+static inline bool isSoftwareGl()
+{
+#if QT_CONFIG(dynamicgl)
+ return QOpenGLStaticContext::opengl32.moduleIsNotOpengl32()
+ && QOpenGLContext::openGLModuleType() == QOpenGLContext::LibGL;
+#else
+ return false;
+#endif // dynamicgl
+}
+
bool QWindowsWindow::handleWmPaint(HWND hwnd, UINT message,
WPARAM, LPARAM)
{
@@ -1627,15 +1639,10 @@ bool QWindowsWindow::handleWmPaint(HWND hwnd, UINT message,
return false;
PAINTSTRUCT ps;
-#if QT_CONFIG(dynamicgl)
- // QTBUG-58178: GL software rendering needs InvalidateRect() to suppress
- // artifacts while resizing.
- if (testFlag(OpenGLSurface)
- && QOpenGLStaticContext::opengl32.moduleIsNotOpengl32()
- && QOpenGLContext::openGLModuleType() == QOpenGLContext::LibGL) {
+ // GL software rendering (QTBUG-58178) and Windows 7/Aero off with some AMD cards
+ // (QTBUG-60527) need InvalidateRect() to suppress artifacts while resizing.
+ if (testFlag(OpenGLSurface) && (isSoftwareGl() || !dwmIsCompositionEnabled()))
InvalidateRect(hwnd, 0, false);
- }
-#endif // dynamicgl
BeginPaint(hwnd, &ps);
diff --git a/src/tools/qdbusxml2cpp/qdbusxml2cpp.pro b/src/tools/qdbusxml2cpp/qdbusxml2cpp.pro
index d9ee5de0be..95fcbcbc50 100644
--- a/src/tools/qdbusxml2cpp/qdbusxml2cpp.pro
+++ b/src/tools/qdbusxml2cpp/qdbusxml2cpp.pro
@@ -1,6 +1,9 @@
option(host_build)
-!force_bootstrap:!qtConfig(commandlineparser): \
- CONFIG += force_bootstrap
+!force_bootstrap {
+ include($$OUT_PWD/../../corelib/qtcore-config.pri)
+ !qtConfig(commandlineparser): \
+ CONFIG += force_bootstrap
+}
QT = core-private
force_bootstrap: QT += bootstrap_dbus-private
else: QT += dbus-private