summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/3rdparty/forkfd/forkfd.c2
-rw-r--r--src/3rdparty/forkfd/forkfd.h4
-rw-r--r--src/corelib/doc/qtcore.qdocconf3
-rw-r--r--src/corelib/doc/src/statemachine.qdoc2
-rw-r--r--src/corelib/global/qnamespace.qdoc11
-rw-r--r--src/corelib/io/qtextstream.cpp2
-rw-r--r--src/corelib/kernel/qeventdispatcher_win.cpp112
-rw-r--r--src/corelib/kernel/qeventdispatcher_win_p.h11
-rw-r--r--src/corelib/kernel/qmetaobject.cpp5
-rw-r--r--src/corelib/kernel/qsocketnotifier.cpp36
-rw-r--r--src/corelib/mimetypes/qmimedatabase.cpp1
-rw-r--r--src/corelib/mimetypes/qmimedatabase.h1
-rw-r--r--src/corelib/mimetypes/qmimedatabase_p.h1
-rw-r--r--src/corelib/mimetypes/qmimemagicrule.cpp68
-rw-r--r--src/corelib/mimetypes/qmimemagicrule_p.h3
-rw-r--r--src/corelib/mimetypes/qmimeprovider.cpp1
-rw-r--r--src/corelib/mimetypes/qmimeprovider_p.h1
-rw-r--r--src/corelib/mimetypes/qmimetype.cpp1
-rw-r--r--src/corelib/mimetypes/qmimetype.h1
-rw-r--r--src/corelib/mimetypes/qmimetypeparser.cpp40
-rw-r--r--src/corelib/mimetypes/qmimetypeparser_p.h2
-rw-r--r--src/gui/doc/qtgui.qdocconf3
-rw-r--r--src/gui/image/qimage.cpp2
-rw-r--r--src/gui/image/qimagereader.cpp2
-rw-r--r--src/gui/kernel/qcursor.cpp10
-rw-r--r--src/gui/kernel/qcursor_p.h3
-rw-r--r--src/gui/math3d/qmatrix4x4.cpp2
-rw-r--r--src/network/access/qnetworkreplyhttpimpl.cpp19
-rw-r--r--src/network/access/qnetworkreplyhttpimpl_p.h2
-rw-r--r--src/network/access/qnetworkreplyimpl.cpp15
-rw-r--r--src/network/access/qnetworkreplyimpl_p.h2
-rw-r--r--src/network/doc/qtnetwork.qdocconf2
-rw-r--r--src/network/socket/qabstractsocket.cpp12
-rw-r--r--src/network/socket/qnativesocketengine_win.cpp37
-rw-r--r--src/network/ssl/qsslellipticcurve.cpp5
-rw-r--r--src/network/ssl/qsslpresharedkeyauthenticator.cpp2
-rw-r--r--src/opengl/doc/qtopengl.qdocconf2
-rw-r--r--src/platformsupport/eglconvenience/qeglplatformcontext.cpp12
-rw-r--r--src/plugins/platforms/cocoa/qcocoacursor.mm2
-rw-r--r--src/plugins/platforms/cocoa/qcocoaintegration.mm12
-rw-r--r--src/plugins/platforms/cocoa/qcocoamenu.mm41
-rw-r--r--src/plugins/platforms/ios/qiosmenu.mm2
-rw-r--r--src/plugins/platforms/ios/qiostextresponder.mm37
-rw-r--r--src/printsupport/dialogs/qprintdialog_unix.cpp2
-rw-r--r--src/printsupport/kernel/qpaintengine_alpha.cpp10
-rw-r--r--src/sql/doc/qtsql.qdocconf2
-rw-r--r--src/tools/qdoc/doc/examples/examples.qdoc5
-rw-r--r--src/widgets/accessible/accessible.pri12
-rw-r--r--src/widgets/accessible/complexwidgets.cpp2
-rw-r--r--src/widgets/accessible/complexwidgets_p.h (renamed from src/widgets/accessible/complexwidgets.h)11
-rw-r--r--src/widgets/accessible/itemviews.cpp2
-rw-r--r--src/widgets/accessible/itemviews_p.h (renamed from src/widgets/accessible/itemviews.h)11
-rw-r--r--src/widgets/accessible/qaccessiblemenu.cpp2
-rw-r--r--src/widgets/accessible/qaccessiblemenu_p.h (renamed from src/widgets/accessible/qaccessiblemenu.h)11
-rw-r--r--src/widgets/accessible/qaccessiblewidgetfactory.cpp12
-rw-r--r--src/widgets/accessible/qaccessiblewidgetfactory_p.h11
-rw-r--r--src/widgets/accessible/qaccessiblewidgets.cpp2
-rw-r--r--src/widgets/accessible/qaccessiblewidgets_p.h (renamed from src/widgets/accessible/qaccessiblewidgets.h)11
-rw-r--r--src/widgets/accessible/rangecontrols.cpp4
-rw-r--r--src/widgets/accessible/rangecontrols_p.h (renamed from src/widgets/accessible/rangecontrols.h)11
-rw-r--r--src/widgets/accessible/simplewidgets.cpp2
-rw-r--r--src/widgets/accessible/simplewidgets_p.h (renamed from src/widgets/accessible/simplewidgets.h)11
-rw-r--r--src/widgets/dialogs/qfiledialog.cpp3
-rw-r--r--src/widgets/doc/qtwidgets.qdocconf2
-rw-r--r--src/widgets/kernel/qwidget.cpp5
-rw-r--r--src/xml/doc/qtxml.qdocconf2
66 files changed, 451 insertions, 229 deletions
diff --git a/src/3rdparty/forkfd/forkfd.c b/src/3rdparty/forkfd/forkfd.c
index a61198a954..55dc92fe45 100644
--- a/src/3rdparty/forkfd/forkfd.c
+++ b/src/3rdparty/forkfd/forkfd.c
@@ -648,7 +648,7 @@ err_free:
}
#endif // FORKFD_NO_FORKFD
-#if defined(_POSIX_SPAWN) && !defined(FORKFD_NO_SPAWNFD)
+#if _POSIX_SPAWN > 0 && !defined(FORKFD_NO_SPAWNFD)
int spawnfd(int flags, pid_t *ppid, const char *path, const posix_spawn_file_actions_t *file_actions,
posix_spawnattr_t *attrp, char *const argv[], char *const envp[])
{
diff --git a/src/3rdparty/forkfd/forkfd.h b/src/3rdparty/forkfd/forkfd.h
index dcb36f9f33..38858c00fe 100644
--- a/src/3rdparty/forkfd/forkfd.h
+++ b/src/3rdparty/forkfd/forkfd.h
@@ -29,7 +29,7 @@
#include <stdint.h>
#include <unistd.h> // to get the POSIX flags
-#ifdef _POSIX_SPAWN
+#if _POSIX_SPAWN > 0
# include <spawn.h>
#endif
@@ -51,7 +51,7 @@ int forkfd(int flags, pid_t *ppid);
int forkfd_wait(int ffd, forkfd_info *info, struct rusage *rusage);
int forkfd_close(int ffd);
-#ifdef _POSIX_SPAWN
+#if _POSIX_SPAWN > 0
/* only for spawnfd: */
# define FFD_SPAWN_SEARCH_PATH O_RDWR
diff --git a/src/corelib/doc/qtcore.qdocconf b/src/corelib/doc/qtcore.qdocconf
index 502689e4c2..3d64708def 100644
--- a/src/corelib/doc/qtcore.qdocconf
+++ b/src/corelib/doc/qtcore.qdocconf
@@ -25,8 +25,7 @@ qhp.QtCore.subprojects.classes.sortPages = true
tagfile = ../../../doc/qtcore/qtcore.tags
-depends += activeqt qtdbus qtgui qtwidgets qtnetwork qtdoc qtmacextras qtquick qtlinguist qtdesigner qtconcurrent qtxml qmake qtwinextras
-# depends += qtqml # Qt namespace collides with QtQml::Qt, see QTBUG-38630
+depends += activeqt qtdbus qtgui qtwidgets qtnetwork qtdoc qtmacextras qtquick qtlinguist qtdesigner qtconcurrent qtxml qmake qtwinextras qtqml
headerdirs += ..
diff --git a/src/corelib/doc/src/statemachine.qdoc b/src/corelib/doc/src/statemachine.qdoc
index e44a603959..d50851d816 100644
--- a/src/corelib/doc/src/statemachine.qdoc
+++ b/src/corelib/doc/src/statemachine.qdoc
@@ -71,6 +71,8 @@
which are currently active. All the states in a valid configuration of the state machine will
have a common ancestor.
+ \sa {The Declarative State Machine Framework}
+
\section1 Classes in the State Machine Framework
These classes are provided by qt for creating event-driven state machines.
diff --git a/src/corelib/global/qnamespace.qdoc b/src/corelib/global/qnamespace.qdoc
index c6098007d1..2323ee2cb0 100644
--- a/src/corelib/global/qnamespace.qdoc
+++ b/src/corelib/global/qnamespace.qdoc
@@ -1695,6 +1695,17 @@
\value Key_Sleep
\value Key_Zoom
\value Key_Cancel
+ \value Key_MicVolumeUp
+ \value Key_Find
+ \value Key_Open
+ \value Key_MicVolumeDown
+ \value Key_New
+ \value Key_Settings
+ \value Key_Redo
+ \value Key_Exit
+ \value Key_Info
+ \value Key_Undo
+ \value Key_Guide
\sa QKeyEvent::key()
*/
diff --git a/src/corelib/io/qtextstream.cpp b/src/corelib/io/qtextstream.cpp
index 8ad1c2852c..aa14f545ec 100644
--- a/src/corelib/io/qtextstream.cpp
+++ b/src/corelib/io/qtextstream.cpp
@@ -2858,7 +2858,7 @@ QTextStream &endl(QTextStream &stream)
/*!
\relates QTextStream
- Calls \l{QTextStream::flush()}{flush()} on \a stream and returns \a stream.
+ Calls QTextStream::flush() on \a stream and returns \a stream.
\sa endl(), reset(), {QTextStream manipulators}
*/
diff --git a/src/corelib/kernel/qeventdispatcher_win.cpp b/src/corelib/kernel/qeventdispatcher_win.cpp
index 6da70cf0bd..695eb3d5d0 100644
--- a/src/corelib/kernel/qeventdispatcher_win.cpp
+++ b/src/corelib/kernel/qeventdispatcher_win.cpp
@@ -391,6 +391,8 @@ LRESULT QT_WIN_CALLBACK qt_internal_proc(HWND hwnd, UINT message, WPARAM wp, LPA
QSockNot *sn = dict ? dict->value(wp) : 0;
if (sn) {
+ d->doWsaAsyncSelect(sn->fd, 0);
+ d->active_fd[sn->fd].selected = false;
if (type < 3) {
QEvent event(QEvent::SockAct);
QCoreApplication::sendEvent(sn->obj, &event);
@@ -633,19 +635,12 @@ void QEventDispatcherWin32Private::sendTimerEvent(int timerId)
}
}
-void QEventDispatcherWin32Private::doWsaAsyncSelect(int socket)
+void QEventDispatcherWin32Private::doWsaAsyncSelect(int socket, long event)
{
Q_ASSERT(internalHwnd);
- int sn_event = 0;
- if (sn_read.contains(socket))
- sn_event |= FD_READ | FD_CLOSE | FD_ACCEPT;
- if (sn_write.contains(socket))
- sn_event |= FD_WRITE | FD_CONNECT;
- if (sn_except.contains(socket))
- sn_event |= FD_OOB;
- // BoundsChecker may emit a warning for WSAAsyncSelect when sn_event == 0
+ // BoundsChecker may emit a warning for WSAAsyncSelect when event == 0
// This is a BoundsChecker bug and not a Qt bug
- WSAAsyncSelect(socket, internalHwnd, sn_event ? int(WM_QT_SOCKETNOTIFIER) : 0, sn_event);
+ WSAAsyncSelect(socket, internalHwnd, event ? int(WM_QT_SOCKETNOTIFIER) : 0, event);
}
void QEventDispatcherWin32::createInternalHwnd()
@@ -658,13 +653,6 @@ void QEventDispatcherWin32::createInternalHwnd()
installMessageHook();
- // register all socket notifiers
- QList<int> sockets = (d->sn_read.keys().toSet()
- + d->sn_write.keys().toSet()
- + d->sn_except.keys().toSet()).toList();
- for (int i = 0; i < sockets.count(); ++i)
- d->doWsaAsyncSelect(sockets.at(i));
-
// start all normal timers
for (int i = 0; i < d->timerVec.count(); ++i)
d->registerTimer(d->timerVec.at(i));
@@ -749,28 +737,40 @@ bool QEventDispatcherWin32::processEvents(QEventLoop::ProcessEventsFlags flags)
msg = d->queuedSocketEvents.takeFirst();
} else {
haveMessage = PeekMessage(&msg, 0, 0, 0, PM_REMOVE);
- if (haveMessage && (flags & QEventLoop::ExcludeUserInputEvents)
- && ((msg.message >= WM_KEYFIRST
- && msg.message <= WM_KEYLAST)
- || (msg.message >= WM_MOUSEFIRST
- && msg.message <= WM_MOUSELAST)
- || msg.message == WM_MOUSEWHEEL
- || msg.message == WM_MOUSEHWHEEL
- || msg.message == WM_TOUCH
+ if (haveMessage) {
+ if ((flags & QEventLoop::ExcludeUserInputEvents)
+ && ((msg.message >= WM_KEYFIRST
+ && msg.message <= WM_KEYLAST)
+ || (msg.message >= WM_MOUSEFIRST
+ && msg.message <= WM_MOUSELAST)
+ || msg.message == WM_MOUSEWHEEL
+ || msg.message == WM_MOUSEHWHEEL
+ || msg.message == WM_TOUCH
#ifndef QT_NO_GESTURES
- || msg.message == WM_GESTURE
- || msg.message == WM_GESTURENOTIFY
+ || msg.message == WM_GESTURE
+ || msg.message == WM_GESTURENOTIFY
#endif
- || msg.message == WM_CLOSE)) {
- // queue user input events for later processing
- haveMessage = false;
- d->queuedUserInputEvents.append(msg);
- }
- if (haveMessage && (flags & QEventLoop::ExcludeSocketNotifiers)
- && (msg.message == WM_QT_SOCKETNOTIFIER && msg.hwnd == d->internalHwnd)) {
- // queue socket events for later processing
- haveMessage = false;
- d->queuedSocketEvents.append(msg);
+ || msg.message == WM_CLOSE)) {
+ // queue user input events for later processing
+ d->queuedUserInputEvents.append(msg);
+ continue;
+ }
+ if ((flags & QEventLoop::ExcludeSocketNotifiers)
+ && (msg.message == WM_QT_SOCKETNOTIFIER && msg.hwnd == d->internalHwnd)) {
+ // queue socket events for later processing
+ d->queuedSocketEvents.append(msg);
+ continue;
+ }
+ } else if (!(flags & QEventLoop::ExcludeSocketNotifiers)) {
+ // register all socket notifiers
+ for (QSFDict::iterator it = d->active_fd.begin(), end = d->active_fd.end();
+ it != end; ++it) {
+ QSockFd &sd = it.value();
+ if (!sd.selected) {
+ d->doWsaAsyncSelect(it.key(), sd.event);
+ sd.selected = true;
+ }
+ }
}
}
if (!haveMessage) {
@@ -896,8 +896,25 @@ void QEventDispatcherWin32::registerSocketNotifier(QSocketNotifier *notifier)
sn->fd = sockfd;
dict->insert(sn->fd, sn);
- if (d->internalHwnd)
- d->doWsaAsyncSelect(sockfd);
+ long event = 0;
+ if (d->sn_read.contains(sockfd))
+ event |= FD_READ | FD_CLOSE | FD_ACCEPT;
+ if (d->sn_write.contains(sockfd))
+ event |= FD_WRITE | FD_CONNECT;
+ if (d->sn_except.contains(sockfd))
+ event |= FD_OOB;
+
+ QSFDict::iterator it = d->active_fd.find(sockfd);
+ if (it != d->active_fd.end()) {
+ QSockFd &sd = it.value();
+ if (sd.selected) {
+ d->doWsaAsyncSelect(sockfd, 0);
+ sd.selected = false;
+ }
+ sd.event |= event;
+ } else {
+ d->active_fd.insert(sockfd, QSockFd(event));
+ }
}
void QEventDispatcherWin32::unregisterSocketNotifier(QSocketNotifier *notifier)
@@ -916,6 +933,19 @@ void QEventDispatcherWin32::unregisterSocketNotifier(QSocketNotifier *notifier)
#endif
Q_D(QEventDispatcherWin32);
+ QSFDict::iterator it = d->active_fd.find(sockfd);
+ if (it != d->active_fd.end()) {
+ QSockFd &sd = it.value();
+ if (sd.selected)
+ d->doWsaAsyncSelect(sockfd, 0);
+ const long event[3] = { FD_READ | FD_CLOSE | FD_ACCEPT, FD_WRITE | FD_CONNECT, FD_OOB };
+ sd.event ^= event[type];
+ if (sd.event == 0)
+ d->active_fd.erase(it);
+ else
+ sd.selected = false;
+ }
+
QSNDict *sn_vec[3] = { &d->sn_read, &d->sn_write, &d->sn_except };
QSNDict *dict = sn_vec[type];
QSockNot *sn = dict->value(sockfd);
@@ -924,9 +954,6 @@ void QEventDispatcherWin32::unregisterSocketNotifier(QSocketNotifier *notifier)
dict->remove(sockfd);
delete sn;
-
- if (d->internalHwnd)
- d->doWsaAsyncSelect(sockfd);
}
void QEventDispatcherWin32::registerTimer(int timerId, int interval, Qt::TimerType timerType, QObject *object)
@@ -1165,6 +1192,7 @@ void QEventDispatcherWin32::closingDown()
unregisterSocketNotifier((*(d->sn_write.begin()))->obj);
while (!d->sn_except.isEmpty())
unregisterSocketNotifier((*(d->sn_except.begin()))->obj);
+ Q_ASSERT(d->active_fd.isEmpty());
// clean up any timers
for (int i = 0; i < d->timerVec.count(); ++i)
diff --git a/src/corelib/kernel/qeventdispatcher_win_p.h b/src/corelib/kernel/qeventdispatcher_win_p.h
index e59e29f1ff..8578110ee4 100644
--- a/src/corelib/kernel/qeventdispatcher_win_p.h
+++ b/src/corelib/kernel/qeventdispatcher_win_p.h
@@ -115,6 +115,14 @@ struct QSockNot {
};
typedef QHash<int, QSockNot *> QSNDict;
+struct QSockFd {
+ long event;
+ bool selected;
+
+ explicit inline QSockFd(long ev = 0) : event(ev), selected(false) { }
+};
+typedef QHash<int, QSockFd> QSFDict;
+
struct WinTimerInfo { // internal timer info
QObject *dispatcher;
int timerId;
@@ -169,7 +177,8 @@ public:
QSNDict sn_read;
QSNDict sn_write;
QSNDict sn_except;
- void doWsaAsyncSelect(int socket);
+ QSFDict active_fd;
+ void doWsaAsyncSelect(int socket, long event);
QList<QWinEventNotifier *> winEventNotifierList;
void activateEventNotifier(QWinEventNotifier * wen);
diff --git a/src/corelib/kernel/qmetaobject.cpp b/src/corelib/kernel/qmetaobject.cpp
index 6858209b12..1ef5ee0547 100644
--- a/src/corelib/kernel/qmetaobject.cpp
+++ b/src/corelib/kernel/qmetaobject.cpp
@@ -1548,12 +1548,13 @@ bool QMetaObject::invokeMethod(QObject *obj,
/*!
\fn QMetaObject::Connection &QMetaObject::Connection::operator=(Connection &&other)
- Move-assigns \a other to this object.
+ Move-assigns \a other to this object, and returns a reference.
*/
/*!
\fn QMetaObject::Connection::Connection(Connection &&o)
- Move-constructs a Connection instance, making it point to the same object that \a o was pointing to.
+ Move-constructs a Connection instance, making it point to the same object
+ that \a o was pointing to.
*/
/*!
diff --git a/src/corelib/kernel/qsocketnotifier.cpp b/src/corelib/kernel/qsocketnotifier.cpp
index d789af2fd9..3a5eff0c19 100644
--- a/src/corelib/kernel/qsocketnotifier.cpp
+++ b/src/corelib/kernel/qsocketnotifier.cpp
@@ -98,42 +98,6 @@ public:
QTcpSocket and QUdpSocket provide notification through signals, so
there is normally no need to use a QSocketNotifier on them.
- \section1 Notes for Windows Users
-
- The socket passed to QSocketNotifier will become non-blocking, even if
- it was created as a blocking socket.
- The activated() signal is sometimes triggered by high general activity
- on the host, even if there is nothing to read. A subsequent read from
- the socket can then fail, the error indicating that there is no data
- available (e.g., \c{WSAEWOULDBLOCK}). This is an operating system
- limitation, and not a bug in QSocketNotifier.
-
- To ensure that the socket notifier handles read notifications correctly,
- follow these steps when you receive a notification:
-
- \list 1
- \li Disable the notifier.
- \li Read data from the socket.
- \li Re-enable the notifier if you are interested in more data (such as after
- having written a new command to a remote server).
- \endlist
-
- To ensure that the socket notifier handles write notifications correctly,
- follow these steps when you receive a notification:
-
- \list 1
- \li Disable the notifier.
- \li Write as much data as you can (before \c EWOULDBLOCK is returned).
- \li Re-enable notifier if you have more data to write.
- \endlist
-
- \b{Further information:}
- On Windows, Qt always disables the notifier after getting a notification,
- and only re-enables it if more data is expected. For example, if data is
- read from the socket and it can be used to read more, or if reading or
- writing is not possible because the socket would block, in which case
- it is necessary to wait before attempting to read or write again.
-
\sa QFile, QProcess, QTcpSocket, QUdpSocket
*/
diff --git a/src/corelib/mimetypes/qmimedatabase.cpp b/src/corelib/mimetypes/qmimedatabase.cpp
index bec7a79e8f..1ef890c46a 100644
--- a/src/corelib/mimetypes/qmimedatabase.cpp
+++ b/src/corelib/mimetypes/qmimedatabase.cpp
@@ -1,6 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2015 The Qt Company Ltd.
+** Copyright (C) 2015 Klaralvdalens Datakonsult AB, a KDAB Group company, info@kdab.com, author David Faure <david.faure@kdab.com>
** Contact: http://www.qt.io/licensing/
**
** This file is part of the QtCore module of the Qt Toolkit.
diff --git a/src/corelib/mimetypes/qmimedatabase.h b/src/corelib/mimetypes/qmimedatabase.h
index 912d9b8443..fd19636e27 100644
--- a/src/corelib/mimetypes/qmimedatabase.h
+++ b/src/corelib/mimetypes/qmimedatabase.h
@@ -1,6 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2015 The Qt Company Ltd.
+** Copyright (C) 2015 Klaralvdalens Datakonsult AB, a KDAB Group company, info@kdab.com, author David Faure <david.faure@kdab.com>
** Contact: http://www.qt.io/licensing/
**
** This file is part of the QtCore module of the Qt Toolkit.
diff --git a/src/corelib/mimetypes/qmimedatabase_p.h b/src/corelib/mimetypes/qmimedatabase_p.h
index e3cfe3443f..aa86f607c6 100644
--- a/src/corelib/mimetypes/qmimedatabase_p.h
+++ b/src/corelib/mimetypes/qmimedatabase_p.h
@@ -1,6 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2015 The Qt Company Ltd.
+** Copyright (C) 2015 Klaralvdalens Datakonsult AB, a KDAB Group company, info@kdab.com, author David Faure <david.faure@kdab.com>
** Contact: http://www.qt.io/licensing/
**
** This file is part of the QtCore module of the Qt Toolkit.
diff --git a/src/corelib/mimetypes/qmimemagicrule.cpp b/src/corelib/mimetypes/qmimemagicrule.cpp
index c8508ac0d2..6a3a429179 100644
--- a/src/corelib/mimetypes/qmimemagicrule.cpp
+++ b/src/corelib/mimetypes/qmimemagicrule.cpp
@@ -38,6 +38,7 @@
#ifndef QT_NO_MIMETYPE
+#include "qmimetypeparser_p.h"
#include <QtCore/QList>
#include <QtCore/QDebug>
#include <qendian.h>
@@ -231,26 +232,53 @@ static inline QByteArray makePattern(const QByteArray &value)
return pattern;
}
-QMimeMagicRule::QMimeMagicRule(QMimeMagicRule::Type theType,
+// Evaluate a magic match rule like
+// <match value="must be converted with BinHex" type="string" offset="11"/>
+// <match value="0x9501" type="big16" offset="0:64"/>
+
+QMimeMagicRule::QMimeMagicRule(const QString &typeStr,
const QByteArray &theValue,
- int theStartPos,
- int theEndPos,
- const QByteArray &theMask) :
+ const QString &offsets,
+ const QByteArray &theMask,
+ QString *errorString) :
d(new QMimeMagicRulePrivate)
{
- Q_ASSERT(!theValue.isEmpty());
-
- d->type = theType;
d->value = theValue;
- d->startPos = theStartPos;
- d->endPos = theEndPos;
d->mask = theMask;
d->matchFunction = 0;
+ d->type = QMimeMagicRule::type(typeStr.toLatin1());
+ if (d->type == Invalid) {
+ *errorString = QStringLiteral("Type %s is not supported").arg(typeStr);
+ }
+
+ // Parse for offset as "1" or "1:10"
+ const int colonIndex = offsets.indexOf(QLatin1Char(':'));
+ const QString startPosStr = colonIndex == -1 ? offsets : offsets.mid(0, colonIndex);
+ const QString endPosStr = colonIndex == -1 ? offsets : offsets.mid(colonIndex + 1);
+ if (!QMimeTypeParserBase::parseNumber(startPosStr, &d->startPos, errorString) ||
+ !QMimeTypeParserBase::parseNumber(endPosStr, &d->endPos, errorString)) {
+ d->type = Invalid;
+ return;
+ }
+
+ if (d->value.isEmpty()) {
+ d->type = Invalid;
+ if (errorString)
+ *errorString = QLatin1String("Invalid empty magic rule value");
+ return;
+ }
+
if (d->type >= Host16 && d->type <= Byte) {
bool ok;
d->number = d->value.toUInt(&ok, 0); // autodetect
- Q_ASSERT(ok);
+ if (!ok) {
+ d->type = Invalid;
+ if (errorString)
+ *errorString = QString::fromLatin1("Invalid magic rule value \"%1\"").arg(
+ QString::fromLatin1(d->value));
+ return;
+ }
d->numberMask = !d->mask.isEmpty() ? d->mask.toUInt(&ok, 0) : 0; // autodetect
}
@@ -259,9 +287,23 @@ QMimeMagicRule::QMimeMagicRule(QMimeMagicRule::Type theType,
d->pattern = makePattern(d->value);
d->pattern.squeeze();
if (!d->mask.isEmpty()) {
- Q_ASSERT(d->mask.size() >= 4 && d->mask.startsWith("0x"));
- d->mask = QByteArray::fromHex(QByteArray::fromRawData(d->mask.constData() + 2, d->mask.size() - 2));
- Q_ASSERT(d->mask.size() == d->pattern.size());
+ if (d->mask.size() < 4 || !d->mask.startsWith("0x")) {
+ d->type = Invalid;
+ if (errorString)
+ *errorString = QString::fromLatin1("Invalid magic rule mask \"%1\"").arg(
+ QString::fromLatin1(d->mask));
+ return;
+ }
+ const QByteArray &tempMask = QByteArray::fromHex(QByteArray::fromRawData(
+ d->mask.constData() + 2, d->mask.size() - 2));
+ if (tempMask.size() != d->pattern.size()) {
+ d->type = Invalid;
+ if (errorString)
+ *errorString = QString::fromLatin1("Invalid magic rule mask size \"%1\"").arg(
+ QString::fromLatin1(d->mask));
+ return;
+ }
+ d->mask = tempMask;
} else {
d->mask.fill(char(-1), d->pattern.size());
}
diff --git a/src/corelib/mimetypes/qmimemagicrule_p.h b/src/corelib/mimetypes/qmimemagicrule_p.h
index 03ac1d1de9..6b64bfcc10 100644
--- a/src/corelib/mimetypes/qmimemagicrule_p.h
+++ b/src/corelib/mimetypes/qmimemagicrule_p.h
@@ -61,7 +61,8 @@ class QMimeMagicRule
public:
enum Type { Invalid = 0, String, Host16, Host32, Big16, Big32, Little16, Little32, Byte };
- QMimeMagicRule(Type type, const QByteArray &value, int startPos, int endPos, const QByteArray &mask = QByteArray());
+ QMimeMagicRule(const QString &typeStr, const QByteArray &value, const QString &offsets,
+ const QByteArray &mask, QString *errorString);
QMimeMagicRule(const QMimeMagicRule &other);
~QMimeMagicRule();
diff --git a/src/corelib/mimetypes/qmimeprovider.cpp b/src/corelib/mimetypes/qmimeprovider.cpp
index 887db51e5c..d26bfd0848 100644
--- a/src/corelib/mimetypes/qmimeprovider.cpp
+++ b/src/corelib/mimetypes/qmimeprovider.cpp
@@ -1,6 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2015 The Qt Company Ltd.
+** Copyright (C) 2015 Klaralvdalens Datakonsult AB, a KDAB Group company, info@kdab.com, author David Faure <david.faure@kdab.com>
** Contact: http://www.qt.io/licensing/
**
** This file is part of the QtCore module of the Qt Toolkit.
diff --git a/src/corelib/mimetypes/qmimeprovider_p.h b/src/corelib/mimetypes/qmimeprovider_p.h
index eaf95942f7..c0517d69a4 100644
--- a/src/corelib/mimetypes/qmimeprovider_p.h
+++ b/src/corelib/mimetypes/qmimeprovider_p.h
@@ -1,6 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2015 The Qt Company Ltd.
+** Copyright (C) 2015 Klaralvdalens Datakonsult AB, a KDAB Group company, info@kdab.com, author David Faure <david.faure@kdab.com>
** Contact: http://www.qt.io/licensing/
**
** This file is part of the QtCore module of the Qt Toolkit.
diff --git a/src/corelib/mimetypes/qmimetype.cpp b/src/corelib/mimetypes/qmimetype.cpp
index a5f9cb70d5..5398f9358e 100644
--- a/src/corelib/mimetypes/qmimetype.cpp
+++ b/src/corelib/mimetypes/qmimetype.cpp
@@ -1,6 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2015 The Qt Company Ltd.
+** Copyright (C) 2015 Klaralvdalens Datakonsult AB, a KDAB Group company, info@kdab.com, author David Faure <david.faure@kdab.com>
** Contact: http://www.qt.io/licensing/
**
** This file is part of the QtCore module of the Qt Toolkit.
diff --git a/src/corelib/mimetypes/qmimetype.h b/src/corelib/mimetypes/qmimetype.h
index 4ba3c53470..13184905b8 100644
--- a/src/corelib/mimetypes/qmimetype.h
+++ b/src/corelib/mimetypes/qmimetype.h
@@ -1,6 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2015 The Qt Company Ltd.
+** Copyright (C) 2015 Klaralvdalens Datakonsult AB, a KDAB Group company, info@kdab.com, author David Faure <david.faure@kdab.com>
** Contact: http://www.qt.io/licensing/
**
** This file is part of the QtCore module of the Qt Toolkit.
diff --git a/src/corelib/mimetypes/qmimetypeparser.cpp b/src/corelib/mimetypes/qmimetypeparser.cpp
index 9610162c4f..8a8b97655a 100644
--- a/src/corelib/mimetypes/qmimetypeparser.cpp
+++ b/src/corelib/mimetypes/qmimetypeparser.cpp
@@ -153,8 +153,8 @@ QMimeTypeParserBase::ParseState QMimeTypeParserBase::nextState(ParseState curren
return ParseError;
}
-// Parse int number from an (attribute) string)
-static bool parseNumber(const QString &n, int *target, QString *errorMessage)
+// Parse int number from an (attribute) string
+bool QMimeTypeParserBase::parseNumber(const QString &n, int *target, QString *errorMessage)
{
bool ok;
*target = n.toInt(&ok);
@@ -165,37 +165,14 @@ static bool parseNumber(const QString &n, int *target, QString *errorMessage)
return true;
}
-// Evaluate a magic match rule like
-// <match value="must be converted with BinHex" type="string" offset="11"/>
-// <match value="0x9501" type="big16" offset="0:64"/>
#ifndef QT_NO_XMLSTREAMREADER
-static bool createMagicMatchRule(const QXmlStreamAttributes &atts,
- QString *errorMessage, QMimeMagicRule *&rule)
+static QMimeMagicRule *createMagicMatchRule(const QXmlStreamAttributes &atts, QString *errorMessage)
{
const QString type = atts.value(QLatin1String(matchTypeAttributeC)).toString();
- QMimeMagicRule::Type magicType = QMimeMagicRule::type(type.toLatin1());
- if (magicType == QMimeMagicRule::Invalid) {
- qWarning("%s: match type %s is not supported.", Q_FUNC_INFO, type.toUtf8().constData());
- return true;
- }
const QString value = atts.value(QLatin1String(matchValueAttributeC)).toString();
- if (value.isEmpty()) {
- *errorMessage = QString::fromLatin1("Empty match value detected.");
- return false;
- }
- // Parse for offset as "1" or "1:10"
- int startPos, endPos;
- const QString offsetS = atts.value(QLatin1String(matchOffsetAttributeC)).toString();
- const int colonIndex = offsetS.indexOf(QLatin1Char(':'));
- const QString startPosS = colonIndex == -1 ? offsetS : offsetS.mid(0, colonIndex);
- const QString endPosS = colonIndex == -1 ? offsetS : offsetS.mid(colonIndex + 1);
- if (!parseNumber(startPosS, &startPos, errorMessage) || !parseNumber(endPosS, &endPos, errorMessage))
- return false;
+ const QString offsets = atts.value(QLatin1String(matchOffsetAttributeC)).toString();
const QString mask = atts.value(QLatin1String(matchMaskAttributeC)).toString();
-
- rule = new QMimeMagicRule(magicType, value.toUtf8(), startPos, endPos, mask.toLatin1());
-
- return true;
+ return new QMimeMagicRule(type, value.toUtf8(), offsets, mask.toLatin1(), errorMessage);
}
#endif
@@ -283,9 +260,10 @@ bool QMimeTypeParserBase::parse(QIODevice *dev, const QString &fileName, QString
}
break;
case ParseMagicMatchRule: {
- QMimeMagicRule *rule = 0;
- if (!createMagicMatchRule(atts, errorMessage, rule))
- return false;
+ QString magicErrorMessage;
+ QMimeMagicRule *rule = createMagicMatchRule(atts, &magicErrorMessage);
+ if (!rule->isValid())
+ qWarning("QMimeDatabase: Error parsing %s\n%s", qPrintable(fileName), qPrintable(magicErrorMessage));
QList<QMimeMagicRule> *ruleList;
if (currentRules.isEmpty())
ruleList = &rules;
diff --git a/src/corelib/mimetypes/qmimetypeparser_p.h b/src/corelib/mimetypes/qmimetypeparser_p.h
index 2be4380cee..3a2e6b8a14 100644
--- a/src/corelib/mimetypes/qmimetypeparser_p.h
+++ b/src/corelib/mimetypes/qmimetypeparser_p.h
@@ -66,6 +66,8 @@ public:
bool parse(QIODevice *dev, const QString &fileName, QString *errorMessage);
+ static bool parseNumber(const QString &n, int *target, QString *errorMessage);
+
protected:
virtual bool process(const QMimeType &t, QString *errorMessage) = 0;
virtual bool process(const QMimeGlobPattern &t, QString *errorMessage) = 0;
diff --git a/src/gui/doc/qtgui.qdocconf b/src/gui/doc/qtgui.qdocconf
index e2194839d2..436e2e0b34 100644
--- a/src/gui/doc/qtgui.qdocconf
+++ b/src/gui/doc/qtgui.qdocconf
@@ -37,7 +37,8 @@ depends += \
qtqml \
qtquick \
qtwidgets \
- qtdoc
+ qtdoc \
+ qmake
headerdirs += ..
diff --git a/src/gui/image/qimage.cpp b/src/gui/image/qimage.cpp
index 176cdfe09f..c4691b5f5e 100644
--- a/src/gui/image/qimage.cpp
+++ b/src/gui/image/qimage.cpp
@@ -313,7 +313,7 @@ bool QImageData::checkForAlphaPixels() const
sharing}. QImage objects can also be streamed and compared.
\note If you would like to load QImage objects in a static build of Qt,
- refer to the \l{How To Create Qt Plugins}{Plugin HowTo}.
+ refer to the \l{How to Create Qt Plugins}{Plugin HowTo}.
\warning Painting on a QImage with the format
QImage::Format_Indexed8 is not supported.
diff --git a/src/gui/image/qimagereader.cpp b/src/gui/image/qimagereader.cpp
index ba79bf40e5..a35442308f 100644
--- a/src/gui/image/qimagereader.cpp
+++ b/src/gui/image/qimagereader.cpp
@@ -1170,7 +1170,7 @@ QImageIOHandler::Transformations QImageReader::transformation() const
Sets if images returned by read() should have transformation metadata automatically applied.
- \sa autoTransform(), transform(), read()
+ \sa autoTransform(), transformation(), read()
*/
void QImageReader::setAutoTransform(bool enabled)
{
diff --git a/src/gui/kernel/qcursor.cpp b/src/gui/kernel/qcursor.cpp
index 6ed750eda1..6b01952647 100644
--- a/src/gui/kernel/qcursor.cpp
+++ b/src/gui/kernel/qcursor.cpp
@@ -387,7 +387,7 @@ QCursor::QCursor(const QPixmap &pixmap, int hotX, int hotY)
bmm.fill(Qt::color1);
}
- d = QCursorData::setBitmap(bm, bmm, hotX, hotY);
+ d = QCursorData::setBitmap(bm, bmm, hotX, hotY, pixmap.devicePixelRatio());
d->pixmap = pixmap;
}
@@ -430,7 +430,7 @@ QCursor::QCursor(const QPixmap &pixmap, int hotX, int hotY)
QCursor::QCursor(const QBitmap &bitmap, const QBitmap &mask, int hotX, int hotY)
: d(0)
{
- d = QCursorData::setBitmap(bitmap, mask, hotX, hotY);
+ d = QCursorData::setBitmap(bitmap, mask, hotX, hotY, 1.0);
}
/*!
@@ -650,7 +650,7 @@ void QCursorData::initialize()
QCursorData::initialized = true;
}
-QCursorData *QCursorData::setBitmap(const QBitmap &bitmap, const QBitmap &mask, int hotX, int hotY)
+QCursorData *QCursorData::setBitmap(const QBitmap &bitmap, const QBitmap &mask, int hotX, int hotY, qreal devicePixelRatio)
{
if (!QCursorData::initialized)
QCursorData::initialize();
@@ -664,8 +664,8 @@ QCursorData *QCursorData::setBitmap(const QBitmap &bitmap, const QBitmap &mask,
d->bm = new QBitmap(bitmap);
d->bmm = new QBitmap(mask);
d->cshape = Qt::BitmapCursor;
- d->hx = hotX >= 0 ? hotX : bitmap.width() / 2;
- d->hy = hotY >= 0 ? hotY : bitmap.height() / 2;
+ d->hx = hotX >= 0 ? hotX : bitmap.width() / 2 / devicePixelRatio;
+ d->hy = hotY >= 0 ? hotY : bitmap.height() / 2 / devicePixelRatio;
return d;
}
diff --git a/src/gui/kernel/qcursor_p.h b/src/gui/kernel/qcursor_p.h
index 0aaa62b891..188ea387b3 100644
--- a/src/gui/kernel/qcursor_p.h
+++ b/src/gui/kernel/qcursor_p.h
@@ -70,7 +70,8 @@ public:
short hx, hy;
static bool initialized;
void update();
- static QCursorData *setBitmap(const QBitmap &bitmap, const QBitmap &mask, int hotX, int hotY);
+ static QCursorData *setBitmap(const QBitmap &bitmap, const QBitmap &mask, int hotX, int hotY,
+ qreal devicePixelRatio);
};
extern QCursorData *qt_cursorTable[Qt::LastCursor + 1]; // qcursor.cpp
diff --git a/src/gui/math3d/qmatrix4x4.cpp b/src/gui/math3d/qmatrix4x4.cpp
index eb7c7f4b7a..9d363dc895 100644
--- a/src/gui/math3d/qmatrix4x4.cpp
+++ b/src/gui/math3d/qmatrix4x4.cpp
@@ -148,8 +148,6 @@ QMatrix4x4::QMatrix4x4(const float *values)
top-most 4 rows of \a matrix. If \a matrix has less than 4 columns
or rows, the remaining elements are filled with elements from the
identity matrix.
-
- \sa QMatrix4x4(const QGenericMatrix &)
*/
/*!
diff --git a/src/network/access/qnetworkreplyhttpimpl.cpp b/src/network/access/qnetworkreplyhttpimpl.cpp
index c445677792..c1956ae99f 100644
--- a/src/network/access/qnetworkreplyhttpimpl.cpp
+++ b/src/network/access/qnetworkreplyhttpimpl.cpp
@@ -1152,7 +1152,7 @@ void QNetworkReplyHttpImplPrivate::replyDownloadMetaData
if (statusCode == 304) {
#if defined(QNETWORKACCESSHTTPBACKEND_DEBUG)
- qDebug() << "Received a 304 from" << url();
+ qDebug() << "Received a 304 from" << request.url();
#endif
QAbstractNetworkCache *nc = managerPrivate->networkCache;
if (nc) {
@@ -1457,7 +1457,7 @@ QNetworkCacheMetaData QNetworkReplyHttpImplPrivate::fetchCacheMetaData(const QNe
}
#if defined(QNETWORKACCESSHTTPBACKEND_DEBUG)
- QByteArray n = rawHeader(header);
+ QByteArray n = q->rawHeader(header);
QByteArray o;
if (it != cacheHeaders.rawHeaders.constEnd())
o = (*it).second;
@@ -1677,6 +1677,11 @@ void QNetworkReplyHttpImplPrivate::_q_startOperation()
QMetaObject::invokeMethod(q, "_q_finished", synchronous ? Qt::DirectConnection : Qt::QueuedConnection);
return;
#endif
+ } else {
+#ifndef QT_NO_BEARERMANAGEMENT
+ QObject::connect(session.data(), SIGNAL(stateChanged(QNetworkSession::State)),
+ q, SLOT(_q_networkSessionStateChanged(QNetworkSession::State)), Qt::QueuedConnection);
+#endif
}
if (synchronous) {
@@ -1844,6 +1849,16 @@ void QNetworkReplyHttpImplPrivate::_q_networkSessionConnected()
}
}
+void QNetworkReplyHttpImplPrivate::_q_networkSessionStateChanged(QNetworkSession::State sessionState)
+{
+ if (sessionState == QNetworkSession::Disconnected
+ && (state != Idle || state != Reconnecting)) {
+ error(QNetworkReplyImpl::NetworkSessionFailedError,
+ QCoreApplication::translate("QNetworkReply", "Network session error."));
+ finished();
+ }
+}
+
void QNetworkReplyHttpImplPrivate::_q_networkSessionFailed()
{
// Abort waiting and working replies.
diff --git a/src/network/access/qnetworkreplyhttpimpl_p.h b/src/network/access/qnetworkreplyhttpimpl_p.h
index b009092196..cfc05edbd8 100644
--- a/src/network/access/qnetworkreplyhttpimpl_p.h
+++ b/src/network/access/qnetworkreplyhttpimpl_p.h
@@ -95,6 +95,7 @@ public:
#ifndef QT_NO_BEARERMANAGEMENT
Q_PRIVATE_SLOT(d_func(), void _q_networkSessionConnected())
Q_PRIVATE_SLOT(d_func(), void _q_networkSessionFailed())
+ Q_PRIVATE_SLOT(d_func(), void _q_networkSessionStateChanged(QNetworkSession::State))
Q_PRIVATE_SLOT(d_func(), void _q_networkSessionUsagePoliciesChanged(QNetworkSession::UsagePolicies))
#endif
Q_PRIVATE_SLOT(d_func(), void _q_finished())
@@ -170,6 +171,7 @@ public:
#ifndef QT_NO_BEARERMANAGEMENT
void _q_networkSessionConnected();
void _q_networkSessionFailed();
+ void _q_networkSessionStateChanged(QNetworkSession::State);
void _q_networkSessionUsagePoliciesChanged(QNetworkSession::UsagePolicies);
#endif
void _q_finished();
diff --git a/src/network/access/qnetworkreplyimpl.cpp b/src/network/access/qnetworkreplyimpl.cpp
index f235adaee8..18f322f45d 100644
--- a/src/network/access/qnetworkreplyimpl.cpp
+++ b/src/network/access/qnetworkreplyimpl.cpp
@@ -126,6 +126,11 @@ void QNetworkReplyImplPrivate::_q_startOperation()
finished();
#endif
return;
+ } else {
+#ifndef QT_NO_BEARERMANAGEMENT
+ QObject::connect(session.data(), SIGNAL(stateChanged(QNetworkSession::State)),
+ q, SLOT(_q_networkSessionStateChanged(QNetworkSession::State)), Qt::QueuedConnection);
+#endif
}
#ifndef QT_NO_BEARERMANAGEMENT
@@ -310,6 +315,16 @@ void QNetworkReplyImplPrivate::_q_networkSessionConnected()
}
}
+void QNetworkReplyImplPrivate::_q_networkSessionStateChanged(QNetworkSession::State sessionState)
+{
+ if (sessionState == QNetworkSession::Disconnected
+ && (state != Idle || state != Reconnecting)) {
+ error(QNetworkReplyImpl::NetworkSessionFailedError,
+ QCoreApplication::translate("QNetworkReply", "Network session error."));
+ finished();
+ }
+}
+
void QNetworkReplyImplPrivate::_q_networkSessionFailed()
{
// Abort waiting and working replies.
diff --git a/src/network/access/qnetworkreplyimpl_p.h b/src/network/access/qnetworkreplyimpl_p.h
index d2e7d02408..5883c9d1c3 100644
--- a/src/network/access/qnetworkreplyimpl_p.h
+++ b/src/network/access/qnetworkreplyimpl_p.h
@@ -89,6 +89,7 @@ public:
#ifndef QT_NO_BEARERMANAGEMENT
Q_PRIVATE_SLOT(d_func(), void _q_networkSessionConnected())
Q_PRIVATE_SLOT(d_func(), void _q_networkSessionFailed())
+ Q_PRIVATE_SLOT(d_func(), void _q_networkSessionStateChanged(QNetworkSession::State))
Q_PRIVATE_SLOT(d_func(), void _q_networkSessionUsagePoliciesChanged(QNetworkSession::UsagePolicies))
#endif
@@ -124,6 +125,7 @@ public:
#ifndef QT_NO_BEARERMANAGEMENT
void _q_networkSessionConnected();
void _q_networkSessionFailed();
+ void _q_networkSessionStateChanged(QNetworkSession::State);
void _q_networkSessionUsagePoliciesChanged(QNetworkSession::UsagePolicies);
#endif
diff --git a/src/network/doc/qtnetwork.qdocconf b/src/network/doc/qtnetwork.qdocconf
index 522d71fd27..2a8e577dda 100644
--- a/src/network/doc/qtnetwork.qdocconf
+++ b/src/network/doc/qtnetwork.qdocconf
@@ -26,7 +26,7 @@ qhp.QtNetwork.subprojects.classes.sortPages = true
tagfile = ../../../doc/qtnetwork/qtnetwork.tags
-depends += qtcore qtgui qtdoc
+depends += qtcore qtgui qtdoc qmake
headerdirs += ..
diff --git a/src/network/socket/qabstractsocket.cpp b/src/network/socket/qabstractsocket.cpp
index c42b4f520c..d93150799c 100644
--- a/src/network/socket/qabstractsocket.cpp
+++ b/src/network/socket/qabstractsocket.cpp
@@ -739,15 +739,9 @@ bool QAbstractSocketPrivate::canReadNotification()
return true;
}
- if (socketEngine) {
- // turn the socket engine off if we've either:
- // - got pending datagrams
- // - reached the buffer size limit
- if (isBuffered)
- socketEngine->setReadNotificationEnabled(readBufferMaxSize == 0 || readBufferMaxSize > q->bytesAvailable());
- else if (socketType != QAbstractSocket::TcpSocket)
- socketEngine->setReadNotificationEnabled(!socketEngine->hasPendingDatagrams());
- }
+ // turn the socket engine off if we've reached the buffer size limit
+ if (socketEngine && isBuffered)
+ socketEngine->setReadNotificationEnabled(readBufferMaxSize == 0 || readBufferMaxSize > q->bytesAvailable());
// reset the read socket notifier state if we reentered inside the
// readyRead() connected slot.
diff --git a/src/network/socket/qnativesocketengine_win.cpp b/src/network/socket/qnativesocketengine_win.cpp
index 72f85c831f..708be2dea7 100644
--- a/src/network/socket/qnativesocketengine_win.cpp
+++ b/src/network/socket/qnativesocketengine_win.cpp
@@ -1090,8 +1090,11 @@ qint64 QNativeSocketEnginePrivate::nativeBytesAvailable() const
buf.buf = &c;
buf.len = sizeof(c);
DWORD flags = MSG_PEEK;
- if (::WSARecvFrom(socketDescriptor, &buf, 1, 0, &flags, 0,0,0,0) == SOCKET_ERROR)
- return 0;
+ if (::WSARecvFrom(socketDescriptor, &buf, 1, 0, &flags, 0,0,0,0) == SOCKET_ERROR) {
+ int err = WSAGetLastError();
+ if (err != WSAECONNRESET && err != WSAENETRESET)
+ return 0;
+ }
}
return nbytes;
}
@@ -1119,14 +1122,7 @@ bool QNativeSocketEnginePrivate::nativeHasPendingDatagrams() const
int err = WSAGetLastError();
if (ret == SOCKET_ERROR && err != WSAEMSGSIZE) {
WS_ERROR_DEBUG(err);
- if (err == WSAECONNRESET || err == WSAENETRESET) {
- // Discard error message to prevent QAbstractSocket from
- // getting this message repeatedly after reenabling the
- // notifiers.
- flags = 0;
- ::WSARecvFrom(socketDescriptor, &buf, 1, &available, &flags,
- &storage.a, &storageSize, 0, 0);
- }
+ result = (err == WSAECONNRESET || err == WSAENETRESET);
} else {
// If there's no error, or if our buffer was too small, there must be
// a pending datagram.
@@ -1179,12 +1175,21 @@ qint64 QNativeSocketEnginePrivate::nativePendingDatagramSize() const
if (recvResult != SOCKET_ERROR) {
ret = qint64(bytesRead);
break;
- } else if (recvResult == SOCKET_ERROR && err == WSAEMSGSIZE) {
- bufferCount += 5;
- delete[] buf;
- } else if (recvResult == SOCKET_ERROR) {
- WS_ERROR_DEBUG(err);
- ret = -1;
+ } else {
+ switch (err) {
+ case WSAEMSGSIZE:
+ bufferCount += 5;
+ delete[] buf;
+ continue;
+ case WSAECONNRESET:
+ case WSAENETRESET:
+ ret = 0;
+ break;
+ default:
+ WS_ERROR_DEBUG(err);
+ ret = -1;
+ break;
+ }
break;
}
}
diff --git a/src/network/ssl/qsslellipticcurve.cpp b/src/network/ssl/qsslellipticcurve.cpp
index a16f726429..b4396d567b 100644
--- a/src/network/ssl/qsslellipticcurve.cpp
+++ b/src/network/ssl/qsslellipticcurve.cpp
@@ -54,7 +54,7 @@ QT_BEGIN_NAMESPACE
elliptic-curve cipher algorithms.
Elliptic curves can be constructed from a "short name" (SN) (fromShortName()),
- and by a call to QSslSocket::supportedEllipticCurves().
+ and by a call to QSslConfiguration::supportedEllipticCurves().
QSslEllipticCurve instances can be compared for equality and can be used as keys
in QHash and QSet. They cannot be used as key in a QMap.
@@ -65,7 +65,7 @@ QT_BEGIN_NAMESPACE
Constructs an invalid elliptic curve.
- \sa isValid(), QSslSocket::supportedEllipticCurves()
+ \sa isValid(), QSslConfiguration::supportedEllipticCurves()
*/
/*!
@@ -136,7 +136,6 @@ QT_BEGIN_NAMESPACE
\relates QSslEllipticCurve
Returns true if the curve \a lhs represents the same curve of \a rhs;
- false otherwise.
*/
/*!
diff --git a/src/network/ssl/qsslpresharedkeyauthenticator.cpp b/src/network/ssl/qsslpresharedkeyauthenticator.cpp
index 4a3b1aa807..ab78aea1cd 100644
--- a/src/network/ssl/qsslpresharedkeyauthenticator.cpp
+++ b/src/network/ssl/qsslpresharedkeyauthenticator.cpp
@@ -257,7 +257,6 @@ int QSslPreSharedKeyAuthenticator::maximumPreSharedKeyLength() const
identity hint, identity, pre shared key, maximum length for the identity
and maximum length for the pre shared key.
- \sa operator!=(const QSslPreSharedKeyAuthenticator &lhs, const QSslPreSharedKeyAuthenticator &rhs)
*/
bool operator==(const QSslPreSharedKeyAuthenticator &lhs, const QSslPreSharedKeyAuthenticator &rhs)
{
@@ -277,7 +276,6 @@ bool operator==(const QSslPreSharedKeyAuthenticator &lhs, const QSslPreSharedKey
Returns true if the authenticator object \a lhs is different than \a rhs;
false otherwise.
- \sa operator==(const QSslPreSharedKeyAuthenticator &lhs, const QSslPreSharedKeyAuthenticator &rhs)
*/
QT_END_NAMESPACE
diff --git a/src/opengl/doc/qtopengl.qdocconf b/src/opengl/doc/qtopengl.qdocconf
index 5b6d09dfcd..6ff6cae2cb 100644
--- a/src/opengl/doc/qtopengl.qdocconf
+++ b/src/opengl/doc/qtopengl.qdocconf
@@ -19,7 +19,7 @@ exampledirs += ../../../examples/opengl \
imagedirs += images \
../../../examples/opengl/doc/images
-depends += qtdoc qtcore qtgui qtwidgets
+depends += qtdoc qtcore qtgui qtwidgets qmake
examplesinstallpath = opengl
diff --git a/src/platformsupport/eglconvenience/qeglplatformcontext.cpp b/src/platformsupport/eglconvenience/qeglplatformcontext.cpp
index 5bee29afef..bffb0eb4e8 100644
--- a/src/platformsupport/eglconvenience/qeglplatformcontext.cpp
+++ b/src/platformsupport/eglconvenience/qeglplatformcontext.cpp
@@ -39,6 +39,10 @@
#include <QtPlatformHeaders/QEGLNativeContext>
#include <QDebug>
+#ifdef Q_OS_ANDROID
+#include <QtCore/private/qjnihelpers_p.h>
+#endif
+
QT_BEGIN_NAMESPACE
/*!
@@ -294,6 +298,14 @@ void QEGLPlatformContext::updateFormatFromGL()
QByteArray version = QByteArray(reinterpret_cast<const char *>(s));
int major, minor;
if (QPlatformOpenGLContext::parseOpenGLVersion(version, major, minor)) {
+#ifdef Q_OS_ANDROID
+ // Some Android 4.2.2 devices report OpenGL ES 3.0 without the functions being available.
+ static int apiLevel = QtAndroidPrivate::androidSdkVersion();
+ if (apiLevel <= 17 && major >= 3) {
+ major = 2;
+ minor = 0;
+ }
+#endif
m_format.setMajorVersion(major);
m_format.setMinorVersion(minor);
}
diff --git a/src/plugins/platforms/cocoa/qcocoacursor.mm b/src/plugins/platforms/cocoa/qcocoacursor.mm
index 922809f90d..f08386d18e 100644
--- a/src/plugins/platforms/cocoa/qcocoacursor.mm
+++ b/src/plugins/platforms/cocoa/qcocoacursor.mm
@@ -304,7 +304,7 @@ NSCursor *QCocoaCursor::createCursorFromPixmap(const QPixmap pixmap, const QPoin
NSImage *nsimage;
if (pixmap.devicePixelRatio() > 1.0) {
QSize layoutSize = pixmap.size() / pixmap.devicePixelRatio();
- QPixmap scaledPixmap = pixmap.scaled(layoutSize);
+ QPixmap scaledPixmap = pixmap.scaled(layoutSize, Qt::IgnoreAspectRatio, Qt::SmoothTransformation);
nsimage = static_cast<NSImage *>(qt_mac_create_nsimage(scaledPixmap));
CGImageRef cgImage = qt_mac_toCGImage(pixmap.toImage());
NSBitmapImageRep *imageRep = [[NSBitmapImageRep alloc] initWithCGImage:cgImage];
diff --git a/src/plugins/platforms/cocoa/qcocoaintegration.mm b/src/plugins/platforms/cocoa/qcocoaintegration.mm
index c8f6dd05db..8f84539e04 100644
--- a/src/plugins/platforms/cocoa/qcocoaintegration.mm
+++ b/src/plugins/platforms/cocoa/qcocoaintegration.mm
@@ -86,9 +86,17 @@ void QCocoaScreen::updateGeometry()
NSRect frameRect = [nsScreen frame];
- if (m_screenIndex == 0) {
+ // Since Mavericks, there is a setting, System Preferences->Mission Control->
+ // Displays have separate Spaces.
+ BOOL spansDisplays = NO;
+#if QT_OSX_PLATFORM_SDK_EQUAL_OR_ABOVE(__MAC_10_9)
+ if (QSysInfo::MacintoshVersion >= QSysInfo::MV_10_9)
+ spansDisplays = [NSScreen screensHaveSeparateSpaces];
+#endif
+ if (spansDisplays || m_screenIndex == 0) {
m_geometry = QRect(frameRect.origin.x, frameRect.origin.y, frameRect.size.width, frameRect.size.height);
- // This is the primary screen, the one that contains the menubar. Its origin should be
+ // Displays have separate Spaces setting is on or this is the primary screen,
+ // the one that contains the menubar. Its origin should be
// (0, 0), and it's the only one whose available geometry differs from its full geometry.
NSRect visibleRect = [nsScreen visibleFrame];
m_availableGeometry = QRect(visibleRect.origin.x,
diff --git a/src/plugins/platforms/cocoa/qcocoamenu.mm b/src/plugins/platforms/cocoa/qcocoamenu.mm
index 6668080725..a6157bdc3a 100644
--- a/src/plugins/platforms/cocoa/qcocoamenu.mm
+++ b/src/plugins/platforms/cocoa/qcocoamenu.mm
@@ -464,6 +464,13 @@ void QCocoaMenu::showPopup(const QWindow *parentWindow, const QRect &targetRect,
NSView *view = cocoaWindow ? cocoaWindow->contentView() : nil;
NSMenuItem *nsItem = item ? ((QCocoaMenuItem *)item)->nsItem() : nil;
+ QScreen *screen = 0;
+ if (parentWindow)
+ screen = parentWindow->screen();
+ if (!screen && !QGuiApplication::screens().isEmpty())
+ screen = QGuiApplication::screens().at(0);
+ Q_ASSERT(screen);
+
// Ideally, we would call -popUpMenuPositioningItem:atLocation:inView:.
// However, this showed not to work with modal windows where the menu items
// would appear disabled. So, we resort to a more artisanal solution. Note
@@ -480,6 +487,21 @@ void QCocoaMenu::showPopup(const QWindow *parentWindow, const QRect &targetRect,
[popupCell setTransparent:YES];
[popupCell setMenu:m_nativeMenu];
[popupCell selectItem:nsItem];
+
+ int availableHeight = screen->availableSize().height();
+ const QPoint &globalPos = parentWindow->mapToGlobal(pos);
+ int menuHeight = m_nativeMenu.size.height;
+ if (globalPos.y() + menuHeight > availableHeight) {
+ // Maybe we need to fix the vertical popup position but we don't know the
+ // exact popup height at the moment (and Cocoa is just guessing) nor its
+ // position. So, instead of translating by the popup's full height, we need
+ // to estimate where the menu will show up and translate by the remaining height.
+ float idx = ([m_nativeMenu indexOfItem:nsItem] + 1.0f) / m_nativeMenu.numberOfItems;
+ float heightBelowPos = (1.0 - idx) * menuHeight;
+ if (globalPos.y() + heightBelowPos > availableHeight)
+ pos.setY(pos.y() - globalPos.y() + availableHeight - heightBelowPos);
+ }
+
NSRect cellFrame = NSMakeRect(pos.x(), pos.y(), m_nativeMenu.minimumWidth, 10);
[popupCell performClickWithFrame:cellFrame inView:view];
} else {
@@ -488,22 +510,21 @@ void QCocoaMenu::showPopup(const QWindow *parentWindow, const QRect &targetRect,
if (view) {
// convert coordinates from view to the view's window
nsPos = [view convertPoint:nsPos toView:nil];
- } else if (!QGuiApplication::screens().isEmpty()) {
- QScreen *screen = QGuiApplication::screens().at(0);
+ } else {
nsPos.y = screen->availableVirtualSize().height() - nsPos.y;
}
if (view) {
// Finally, we need to synthesize an event.
NSEvent *menuEvent = [NSEvent mouseEventWithType:NSRightMouseDown
- location:nsPos
- modifierFlags:0
- timestamp:0
- windowNumber:view ? view.window.windowNumber : 0
- context:nil
- eventNumber:0
- clickCount:1
- pressure:1.0];
+ location:nsPos
+ modifierFlags:0
+ timestamp:0
+ windowNumber:view ? view.window.windowNumber : 0
+ context:nil
+ eventNumber:0
+ clickCount:1
+ pressure:1.0];
[NSMenu popUpContextMenu:m_nativeMenu withEvent:menuEvent forView:view];
} else {
[m_nativeMenu popUpMenuPositioningItem:nsItem atLocation:nsPos inView:0];
diff --git a/src/plugins/platforms/ios/qiosmenu.mm b/src/plugins/platforms/ios/qiosmenu.mm
index de77097bf8..09395805bf 100644
--- a/src/plugins/platforms/ios/qiosmenu.mm
+++ b/src/plugins/platforms/ios/qiosmenu.mm
@@ -369,7 +369,7 @@ void QIOSMenu::syncMenuItem(QPlatformMenuItem *)
switch (m_effectiveMenuType) {
case EditMenu:
- [m_menuController setVisibleMenuItems:visibleMenuItems()];
+ [m_menuController setVisibleMenuItems:filterFirstResponderActions(visibleMenuItems())];
break;
default:
[m_pickerView setVisibleMenuItems:visibleMenuItems() selectItem:m_targetItem];
diff --git a/src/plugins/platforms/ios/qiostextresponder.mm b/src/plugins/platforms/ios/qiostextresponder.mm
index 685ff8ff47..c9120e848c 100644
--- a/src/plugins/platforms/ios/qiostextresponder.mm
+++ b/src/plugins/platforms/ios/qiostextresponder.mm
@@ -333,65 +333,73 @@
#ifndef QT_NO_SHORTCUT
+- (void)sendShortcut:(QKeySequence::StandardKey)standardKey
+{
+ const int keys = QKeySequence(standardKey)[0];
+ Qt::Key key = Qt::Key(keys & 0x0000FFFF);
+ Qt::KeyboardModifiers modifiers = Qt::KeyboardModifiers(keys & 0xFFFF0000);
+ [self sendKeyPressRelease:key modifiers:modifiers];
+}
+
- (void)cut:(id)sender
{
Q_UNUSED(sender);
- [self sendKeyPressRelease:Qt::Key_X modifiers:Qt::ControlModifier];
+ [self sendShortcut:QKeySequence::Cut];
}
- (void)copy:(id)sender
{
Q_UNUSED(sender);
- [self sendKeyPressRelease:Qt::Key_C modifiers:Qt::ControlModifier];
+ [self sendShortcut:QKeySequence::Copy];
}
- (void)paste:(id)sender
{
Q_UNUSED(sender);
- [self sendKeyPressRelease:Qt::Key_V modifiers:Qt::ControlModifier];
+ [self sendShortcut:QKeySequence::Paste];
}
- (void)selectAll:(id)sender
{
Q_UNUSED(sender);
- [self sendKeyPressRelease:Qt::Key_A modifiers:Qt::ControlModifier];
+ [self sendShortcut:QKeySequence::SelectAll];
}
- (void)delete:(id)sender
{
Q_UNUSED(sender);
- [self sendKeyPressRelease:Qt::Key_Delete modifiers:Qt::ControlModifier];
+ [self sendShortcut:QKeySequence::Delete];
}
- (void)toggleBoldface:(id)sender
{
Q_UNUSED(sender);
- [self sendKeyPressRelease:Qt::Key_B modifiers:Qt::ControlModifier];
+ [self sendShortcut:QKeySequence::Bold];
}
- (void)toggleItalics:(id)sender
{
Q_UNUSED(sender);
- [self sendKeyPressRelease:Qt::Key_I modifiers:Qt::ControlModifier];
+ [self sendShortcut:QKeySequence::Italic];
}
- (void)toggleUnderline:(id)sender
{
Q_UNUSED(sender);
- [self sendKeyPressRelease:Qt::Key_U modifiers:Qt::ControlModifier];
+ [self sendShortcut:QKeySequence::Underline];
}
// -------------------------------------------------------------------------
- (void)undo
{
- [self sendKeyPressRelease:Qt::Key_Z modifiers:Qt::ControlModifier];
+ [self sendShortcut:QKeySequence::Undo];
[self rebuildUndoStack];
}
- (void)redo
{
- [self sendKeyPressRelease:Qt::Key_Z modifiers:Qt::ControlModifier|Qt::ShiftModifier];
+ [self sendShortcut:QKeySequence::Redo];
[self rebuildUndoStack];
}
@@ -730,6 +738,15 @@
return toCGRect(startRect.united(endRect));
}
+- (NSArray *)selectionRectsForRange:(UITextRange *)range
+{
+ Q_UNUSED(range);
+ // This method is supposed to return a rectangle for each line with selection. Since we don't
+ // expose an API in Qt/IM for getting this information, and since we never seems to be getting
+ // a call from UIKit for this, we return an empty array until a need arise.
+ return [[NSArray new] autorelease];
+}
+
- (CGRect)caretRectForPosition:(UITextPosition *)position
{
Q_UNUSED(position);
diff --git a/src/printsupport/dialogs/qprintdialog_unix.cpp b/src/printsupport/dialogs/qprintdialog_unix.cpp
index 502ff7d98a..880b233aef 100644
--- a/src/printsupport/dialogs/qprintdialog_unix.cpp
+++ b/src/printsupport/dialogs/qprintdialog_unix.cpp
@@ -805,7 +805,7 @@ void QUnixPrintWidgetPrivate::applyPrinterProperties()
home += QLatin1Char('/');
if (!cur.isEmpty() && cur.at(cur.length()-1) != QLatin1Char('/'))
cur += QLatin1Char('/');
- if (cur.left(home.length()) != home)
+ if (!cur.startsWith(home))
cur = home;
if (QGuiApplication::platformName() == QLatin1String("xcb")) {
if (printer->docName().isEmpty()) {
diff --git a/src/printsupport/kernel/qpaintengine_alpha.cpp b/src/printsupport/kernel/qpaintengine_alpha.cpp
index 010a628e4f..a81f3eae43 100644
--- a/src/printsupport/kernel/qpaintengine_alpha.cpp
+++ b/src/printsupport/kernel/qpaintengine_alpha.cpp
@@ -146,8 +146,16 @@ void QAlphaPaintEngine::updateState(const QPaintEngineState &state)
d->m_hasalpha = d->m_alphaOpacity || d->m_alphaBrush || d->m_alphaPen;
- if (d->m_picengine)
+ if (d->m_picengine) {
+ const QPainter *p = painter();
+ d->m_picpainter->setPen(p->pen());
+ d->m_picpainter->setBrush(p->brush());
+ d->m_picpainter->setBrushOrigin(p->brushOrigin());
+ d->m_picpainter->setFont(p->font());
+ d->m_picpainter->setOpacity(p->opacity());
+ d->m_picpainter->setTransform(p->combinedTransform());
d->m_picengine->updateState(state);
+ }
}
void QAlphaPaintEngine::drawPath(const QPainterPath &path)
diff --git a/src/sql/doc/qtsql.qdocconf b/src/sql/doc/qtsql.qdocconf
index b8632c5260..5a224adeb9 100644
--- a/src/sql/doc/qtsql.qdocconf
+++ b/src/sql/doc/qtsql.qdocconf
@@ -25,7 +25,7 @@ qhp.QtSql.subprojects.classes.selectors = class fake:headerfile
qhp.QtSql.subprojects.classes.sortPages = true
tagfile = ../../../doc/qtsql/qtsql.tags
-depends += qtcore qtwidgets qtdoc
+depends += qtcore qtwidgets qtdoc qmake
headerdirs += ..
diff --git a/src/tools/qdoc/doc/examples/examples.qdoc b/src/tools/qdoc/doc/examples/examples.qdoc
index 777c869c65..28810e30da 100644
--- a/src/tools/qdoc/doc/examples/examples.qdoc
+++ b/src/tools/qdoc/doc/examples/examples.qdoc
@@ -90,9 +90,8 @@
\brief Basic set of UI components
This is a listing of a list of UI components implemented by QML types. These
-
- files are available for general import and they are based off the \l{Qt
- Quick Code Samples}.
+ files are available for general import and they are based on the
+ \l{Qt Quick Examples and Tutorials}{Qt Quick Code Samples}.
This module is part of the \l{componentset}{UIComponents} example.
*/
diff --git a/src/widgets/accessible/accessible.pri b/src/widgets/accessible/accessible.pri
index bcdfbd639c..ac8205b1e3 100644
--- a/src/widgets/accessible/accessible.pri
+++ b/src/widgets/accessible/accessible.pri
@@ -4,12 +4,12 @@ contains(QT_CONFIG, accessibility) {
HEADERS += \
accessible/qaccessiblewidget.h \
accessible/qaccessiblewidgetfactory_p.h \
- accessible/complexwidgets.h \
- accessible/itemviews.h \
- accessible/qaccessiblemenu.h \
- accessible/qaccessiblewidgets.h \
- accessible/rangecontrols.h \
- accessible/simplewidgets.h
+ accessible/complexwidgets_p.h \
+ accessible/itemviews_p.h \
+ accessible/qaccessiblemenu_p.h \
+ accessible/qaccessiblewidgets_p.h \
+ accessible/rangecontrols_p.h \
+ accessible/simplewidgets_p.h
SOURCES += \
accessible/qaccessiblewidget.cpp \
diff --git a/src/widgets/accessible/complexwidgets.cpp b/src/widgets/accessible/complexwidgets.cpp
index 60a1329d5e..6e985c86e8 100644
--- a/src/widgets/accessible/complexwidgets.cpp
+++ b/src/widgets/accessible/complexwidgets.cpp
@@ -31,7 +31,7 @@
**
****************************************************************************/
-#include "complexwidgets.h"
+#include "complexwidgets_p.h"
#include <qaccessible.h>
#include <qapplication.h>
diff --git a/src/widgets/accessible/complexwidgets.h b/src/widgets/accessible/complexwidgets_p.h
index bd063e7517..8edf996818 100644
--- a/src/widgets/accessible/complexwidgets.h
+++ b/src/widgets/accessible/complexwidgets_p.h
@@ -34,6 +34,17 @@
#ifndef COMPLEXWIDGETS_H
#define COMPLEXWIDGETS_H
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
#include <QtCore/qpointer.h>
#include <QtWidgets/qaccessiblewidget.h>
#include <QtWidgets/qabstractitemview.h>
diff --git a/src/widgets/accessible/itemviews.cpp b/src/widgets/accessible/itemviews.cpp
index 4f6cb56060..6534d51a45 100644
--- a/src/widgets/accessible/itemviews.cpp
+++ b/src/widgets/accessible/itemviews.cpp
@@ -31,7 +31,7 @@
**
****************************************************************************/
-#include "itemviews.h"
+#include "itemviews_p.h"
#include <qheaderview.h>
#include <qtableview.h>
diff --git a/src/widgets/accessible/itemviews.h b/src/widgets/accessible/itemviews_p.h
index c1bd70a390..a1b6a6db9f 100644
--- a/src/widgets/accessible/itemviews.h
+++ b/src/widgets/accessible/itemviews_p.h
@@ -34,6 +34,17 @@
#ifndef ACCESSIBLE_ITEMVIEWS_H
#define ACCESSIBLE_ITEMVIEWS_H
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
#include "QtCore/qpointer.h"
#include <QtGui/qaccessible.h>
#include <QtWidgets/qaccessiblewidget.h>
diff --git a/src/widgets/accessible/qaccessiblemenu.cpp b/src/widgets/accessible/qaccessiblemenu.cpp
index 72eb82b2b7..a0a7852851 100644
--- a/src/widgets/accessible/qaccessiblemenu.cpp
+++ b/src/widgets/accessible/qaccessiblemenu.cpp
@@ -31,7 +31,7 @@
**
****************************************************************************/
-#include "qaccessiblemenu.h"
+#include "qaccessiblemenu_p.h"
#include <qmenu.h>
#include <qmenubar.h>
diff --git a/src/widgets/accessible/qaccessiblemenu.h b/src/widgets/accessible/qaccessiblemenu_p.h
index 9c7671072d..b42c852ff1 100644
--- a/src/widgets/accessible/qaccessiblemenu.h
+++ b/src/widgets/accessible/qaccessiblemenu_p.h
@@ -34,6 +34,17 @@
#ifndef QACCESSIBLEMENU_H
#define QACCESSIBLEMENU_H
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
#include <QtWidgets/qaccessiblewidget.h>
#include <QtCore/qpointer.h>
diff --git a/src/widgets/accessible/qaccessiblewidgetfactory.cpp b/src/widgets/accessible/qaccessiblewidgetfactory.cpp
index e8b325b93f..4fa7c89482 100644
--- a/src/widgets/accessible/qaccessiblewidgetfactory.cpp
+++ b/src/widgets/accessible/qaccessiblewidgetfactory.cpp
@@ -31,12 +31,12 @@
**
****************************************************************************/
-#include "qaccessiblewidgets.h"
-#include "qaccessiblemenu.h"
-#include "simplewidgets.h"
-#include "rangecontrols.h"
-#include "complexwidgets.h"
-#include "itemviews.h"
+#include "qaccessiblewidgets_p.h"
+#include "qaccessiblemenu_p.h"
+#include "simplewidgets_p.h"
+#include "rangecontrols_p.h"
+#include "complexwidgets_p.h"
+#include "itemviews_p.h"
#include <qpushbutton.h>
#include <qtoolbutton.h>
diff --git a/src/widgets/accessible/qaccessiblewidgetfactory_p.h b/src/widgets/accessible/qaccessiblewidgetfactory_p.h
index b3f9d8a251..caa37dcf81 100644
--- a/src/widgets/accessible/qaccessiblewidgetfactory_p.h
+++ b/src/widgets/accessible/qaccessiblewidgetfactory_p.h
@@ -36,6 +36,17 @@
#ifndef QACCESSIBLEWIDGETFACTORY_H
#define QACCESSIBLEWIDGETFACTORY_H
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
QT_BEGIN_NAMESPACE
QAccessibleInterface *qAccessibleFactory(const QString &classname, QObject *object);
diff --git a/src/widgets/accessible/qaccessiblewidgets.cpp b/src/widgets/accessible/qaccessiblewidgets.cpp
index a2bf14b25b..604c754ea1 100644
--- a/src/widgets/accessible/qaccessiblewidgets.cpp
+++ b/src/widgets/accessible/qaccessiblewidgets.cpp
@@ -31,7 +31,7 @@
**
****************************************************************************/
-#include "qaccessiblewidgets.h"
+#include "qaccessiblewidgets_p.h"
#include "qabstracttextdocumentlayout.h"
#include "qapplication.h"
#include "qclipboard.h"
diff --git a/src/widgets/accessible/qaccessiblewidgets.h b/src/widgets/accessible/qaccessiblewidgets_p.h
index 53f8c2c603..4bdc229578 100644
--- a/src/widgets/accessible/qaccessiblewidgets.h
+++ b/src/widgets/accessible/qaccessiblewidgets_p.h
@@ -34,6 +34,17 @@
#ifndef QACCESSIBLEWIDGETS_H
#define QACCESSIBLEWIDGETS_H
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
#include <QtWidgets/qaccessiblewidget.h>
#ifndef QT_NO_ACCESSIBILITY
diff --git a/src/widgets/accessible/rangecontrols.cpp b/src/widgets/accessible/rangecontrols.cpp
index 002d4a9ef4..0607a35269 100644
--- a/src/widgets/accessible/rangecontrols.cpp
+++ b/src/widgets/accessible/rangecontrols.cpp
@@ -31,7 +31,7 @@
**
****************************************************************************/
-#include "rangecontrols.h"
+#include "rangecontrols_p.h"
#include <qslider.h>
#include <qdial.h>
@@ -47,7 +47,7 @@
#include <qmath.h>
#include <private/qmath_p.h>
-#include "simplewidgets.h" // let spinbox use line edit's interface
+#include "simplewidgets_p.h" // let spinbox use line edit's interface
QT_BEGIN_NAMESPACE
diff --git a/src/widgets/accessible/rangecontrols.h b/src/widgets/accessible/rangecontrols_p.h
index 11d4435e9d..32c6d6985f 100644
--- a/src/widgets/accessible/rangecontrols.h
+++ b/src/widgets/accessible/rangecontrols_p.h
@@ -34,6 +34,17 @@
#ifndef RANGECONTROLS_H
#define RANGECONTROLS_H
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
#include <QtWidgets/qaccessiblewidget.h>
QT_BEGIN_NAMESPACE
diff --git a/src/widgets/accessible/simplewidgets.cpp b/src/widgets/accessible/simplewidgets.cpp
index b08c21939a..065c618cf7 100644
--- a/src/widgets/accessible/simplewidgets.cpp
+++ b/src/widgets/accessible/simplewidgets.cpp
@@ -31,7 +31,7 @@
**
****************************************************************************/
-#include "simplewidgets.h"
+#include "simplewidgets_p.h"
#include <qabstractbutton.h>
#include <qcheckbox.h>
diff --git a/src/widgets/accessible/simplewidgets.h b/src/widgets/accessible/simplewidgets_p.h
index 0dfd9f79c8..c2e904273f 100644
--- a/src/widgets/accessible/simplewidgets.h
+++ b/src/widgets/accessible/simplewidgets_p.h
@@ -34,6 +34,17 @@
#ifndef SIMPLEWIDGETS_H
#define SIMPLEWIDGETS_H
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
#include <QtCore/qcoreapplication.h>
#include <QtWidgets/qaccessiblewidget.h>
diff --git a/src/widgets/dialogs/qfiledialog.cpp b/src/widgets/dialogs/qfiledialog.cpp
index 64e3f5069e..c9e6a199c4 100644
--- a/src/widgets/dialogs/qfiledialog.cpp
+++ b/src/widgets/dialogs/qfiledialog.cpp
@@ -2851,6 +2851,9 @@ void QFileDialogPrivate::createWidgets()
completer = new QFSCompleter(model, q);
qFileDialogUi->fileNameEdit->setCompleter(completer);
#endif // QT_NO_FSCOMPLETER
+
+ qFileDialogUi->fileNameEdit->setInputMethodHints(Qt::ImhNoPredictiveText);
+
QObject::connect(qFileDialogUi->fileNameEdit, SIGNAL(textChanged(QString)),
q, SLOT(_q_autoCompleteFileName(QString)));
QObject::connect(qFileDialogUi->fileNameEdit, SIGNAL(textChanged(QString)),
diff --git a/src/widgets/doc/qtwidgets.qdocconf b/src/widgets/doc/qtwidgets.qdocconf
index 1f79d144bf..f307e9d3e4 100644
--- a/src/widgets/doc/qtwidgets.qdocconf
+++ b/src/widgets/doc/qtwidgets.qdocconf
@@ -26,7 +26,7 @@ qhp.QtWidgets.subprojects.classes.sortPages = true
tagfile = ../../../doc/qtwidgets/qtwidgets.tags
-depends += qtcore qtgui qtdoc qtsql qtdesigner qtquick
+depends += qtcore qtgui qtdoc qtsql qtdesigner qtquick qmake qtsvg
headerdirs += ..
diff --git a/src/widgets/kernel/qwidget.cpp b/src/widgets/kernel/qwidget.cpp
index ba0fcf75d0..49da4d1faf 100644
--- a/src/widgets/kernel/qwidget.cpp
+++ b/src/widgets/kernel/qwidget.cpp
@@ -5828,7 +5828,10 @@ QPixmap QWidgetEffectSourcePrivate::pixmap(Qt::CoordinateSystem system, QPoint *
pixmapOffset -= effectRect.topLeft();
- QPixmap pixmap(effectRect.size());
+ const qreal dpr = context->painter->device()->devicePixelRatio();
+ QPixmap pixmap(effectRect.size() * dpr);
+ pixmap.setDevicePixelRatio(dpr);
+
pixmap.fill(Qt::transparent);
m_widget->render(&pixmap, pixmapOffset, QRegion(), QWidget::DrawChildren);
return pixmap;
diff --git a/src/xml/doc/qtxml.qdocconf b/src/xml/doc/qtxml.qdocconf
index 419859ac8b..a23915487f 100644
--- a/src/xml/doc/qtxml.qdocconf
+++ b/src/xml/doc/qtxml.qdocconf
@@ -26,7 +26,7 @@ qhp.QtXml.subprojects.classes.sortPages = true
tagfile = ../../../doc/qtxml/qtxml.tags
-depends += qtcore qtnetwork qtdoc qtwidgets
+depends += qtcore qtnetwork qtdoc qtwidgets qmake
headerdirs += ..