summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/3rdparty/angle/id/commit.h4
-rw-r--r--src/corelib/io/qsettings.cpp9
-rw-r--r--src/corelib/thread/qthread.cpp24
-rw-r--r--src/gui/configure.json15
-rw-r--r--src/gui/image/qiconengine.h1
-rw-r--r--src/network/access/qnetworkreplyhttpimpl.cpp10
-rw-r--r--src/platformsupport/input/libinput/qlibinputkeyboard_p.h6
-rw-r--r--src/plugins/imageformats/jpeg/qjpeghandler.cpp11
-rw-r--r--src/plugins/platforms/windows/qwindowspointerhandler.cpp18
-rw-r--r--src/testlib/qtest.h7
-rw-r--r--src/widgets/graphicsview/qgraphicsitem.cpp13
-rw-r--r--src/widgets/util/qscroller.cpp8
-rw-r--r--src/widgets/widgets/qwidgetlinecontrol_p.h7
13 files changed, 89 insertions, 44 deletions
diff --git a/src/3rdparty/angle/id/commit.h b/src/3rdparty/angle/id/commit.h
index 4c89a657c5..d5446432f7 100644
--- a/src/3rdparty/angle/id/commit.h
+++ b/src/3rdparty/angle/id/commit.h
@@ -7,8 +7,8 @@
// This is a default commit hash header, when git is not available.
//
-#define ANGLE_COMMIT_HASH "unknown hash"
+#define ANGLE_COMMIT_HASH "57ea533f79a7"
#define ANGLE_COMMIT_HASH_SIZE 12
-#define ANGLE_COMMIT_DATE "unknown date"
+#define ANGLE_COMMIT_DATE "2017-11-22 14:04:48 -0800"
#define ANGLE_DISABLE_PROGRAM_BINARY_LOAD
diff --git a/src/corelib/io/qsettings.cpp b/src/corelib/io/qsettings.cpp
index a0de5ac2b1..0d2bd72d75 100644
--- a/src/corelib/io/qsettings.cpp
+++ b/src/corelib/io/qsettings.cpp
@@ -1599,12 +1599,14 @@ bool QConfFileSettingsPrivate::readIniLine(const QByteArray &data, int &dataPos,
int i = lineStart;
while (i < dataLen) {
- while (!(charTraits[uint(uchar(data.at(i)))] & Special)) {
+ char ch = data.at(i);
+ while (!(charTraits[uchar(ch)] & Special)) {
if (++i == dataLen)
goto break_out_of_outer_loop;
+ ch = data.at(i);
}
- char ch = data.at(i++);
+ ++i;
if (ch == '=') {
if (!inQuotes && equalsPos == -1)
equalsPos = i - 1;
@@ -1631,9 +1633,10 @@ bool QConfFileSettingsPrivate::readIniLine(const QByteArray &data, int &dataPos,
Q_ASSERT(ch == ';');
if (i == lineStart + 1) {
- char ch;
while (i < dataLen && (((ch = data.at(i)) != '\n') && ch != '\r'))
++i;
+ while (i < dataLen && charTraits[uchar(data.at(i))] & Space)
+ ++i;
lineStart = i;
} else if (!inQuotes) {
--i;
diff --git a/src/corelib/thread/qthread.cpp b/src/corelib/thread/qthread.cpp
index d3f60eea4f..05bc064005 100644
--- a/src/corelib/thread/qthread.cpp
+++ b/src/corelib/thread/qthread.cpp
@@ -650,6 +650,13 @@ QThread::Priority QThread::priority() const
Forces the current thread to sleep for \a secs seconds.
+ Avoid using this function if you need to wait for a given condition to
+ change. Instead, connect a slot to the signal that indicates the change or
+ use an event handler (see \l QObject::event()).
+
+ \note This function does not guarantee accuracy. The application may sleep
+ longer than \a secs under heavy load conditions.
+
\sa msleep(), usleep()
*/
@@ -658,6 +665,14 @@ QThread::Priority QThread::priority() const
Forces the current thread to sleep for \a msecs milliseconds.
+ Avoid using this function if you need to wait for a given condition to
+ change. Instead, connect a slot to the signal that indicates the change or
+ use an event handler (see \l QObject::event()).
+
+ \note This function does not guarantee accuracy. The application may sleep
+ longer than \a msecs under heavy load conditions. Some OSes might round \a
+ msecs up to 10 ms or 15 ms.
+
\sa sleep(), usleep()
*/
@@ -666,6 +681,15 @@ QThread::Priority QThread::priority() const
Forces the current thread to sleep for \a usecs microseconds.
+ Avoid using this function if you need to wait for a given condition to
+ change. Instead, connect a slot to the signal that indicates the change or
+ use an event handler (see \l QObject::event()).
+
+ \note This function does not guarantee accuracy. The application may sleep
+ longer than \a usecs under heavy load conditions. Some OSes might round \a
+ usecs up to 10 ms or 15 ms; on Windows, it will be rounded up to a multiple
+ of 1 ms.
+
\sa sleep(), msleep()
*/
diff --git a/src/gui/configure.json b/src/gui/configure.json
index 25ff553876..6a2f1fe434 100644
--- a/src/gui/configure.json
+++ b/src/gui/configure.json
@@ -618,16 +618,6 @@
{ "type": "pkgConfig", "args": "xkbcommon-x11" }
]
},
- "xkbcommon_evdev": {
- "label": "xkbcommon_evdev TRANSITION HACK",
- "test": {
- "include": [ "xkbcommon/xkbcommon.h" ],
- "main": "xkb_context_new(XKB_CONTEXT_NO_FLAGS);"
- },
- "sources": [
- { "type": "pkgConfig", "args": "xkbcommon >= 0.5.0" }
- ]
- },
"xrender": {
"label": "XRender for native painting",
"test": "x11/xrender",
@@ -1378,11 +1368,6 @@
"condition": "libs.xkbcommon",
"output": [ "privateFeature" ]
},
- "xkbcommon-evdev": {
- "label": "xkbcommon-evdev TRANSITION HACK",
- "condition": "libs.xkbcommon_evdev",
- "output": [ "privateFeature" ]
- },
"xlib": {
"label": "XLib",
"autoDetect": "!config.darwin || features.xcb",
diff --git a/src/gui/image/qiconengine.h b/src/gui/image/qiconengine.h
index 0c67ef2686..0c5b51dc71 100644
--- a/src/gui/image/qiconengine.h
+++ b/src/gui/image/qiconengine.h
@@ -90,6 +90,7 @@ public:
QPixmap pixmap;
};
+ // ### Qt6: move content to proper virtual functions
virtual void virtual_hook(int id, void *data);
private:
diff --git a/src/network/access/qnetworkreplyhttpimpl.cpp b/src/network/access/qnetworkreplyhttpimpl.cpp
index 8750a841f6..ed2235ad28 100644
--- a/src/network/access/qnetworkreplyhttpimpl.cpp
+++ b/src/network/access/qnetworkreplyhttpimpl.cpp
@@ -1676,13 +1676,13 @@ QNetworkCacheMetaData QNetworkReplyHttpImplPrivate::fetchCacheMetaData(const QNe
|| header == "content-range"
|| header == "content-type")
continue;
-
- // For MS servers that send "Content-Length: 0" on 304 responses
- // ignore this too
- if (header == "content-length")
- continue;
}
+ // IIS has been known to send "Content-Length: 0" on 304 responses, so
+ // ignore this too
+ if (header == "content-length" && statusCode == 304)
+ continue;
+
#if defined(QNETWORKACCESSHTTPBACKEND_DEBUG)
QByteArray n = q->rawHeader(header);
QByteArray o;
diff --git a/src/platformsupport/input/libinput/qlibinputkeyboard_p.h b/src/platformsupport/input/libinput/qlibinputkeyboard_p.h
index 9e09bccd79..14ae71b545 100644
--- a/src/platformsupport/input/libinput/qlibinputkeyboard_p.h
+++ b/src/platformsupport/input/libinput/qlibinputkeyboard_p.h
@@ -43,7 +43,9 @@
#include <QtCore/QPoint>
#include <QtCore/QTimer>
-#ifndef QT_NO_XKBCOMMON_EVDEV
+#include <QtGui/private/qtguiglobal_p.h>
+
+#if QT_CONFIG(xkbcommon)
#include <xkbcommon/xkbcommon.h>
#endif
@@ -70,7 +72,7 @@ public:
void processKey(libinput_event_keyboard *e);
-#ifndef QT_NO_XKBCOMMON_EVDEV
+#if QT_CONFIG(xkbcommon)
void handleRepeat();
private:
diff --git a/src/plugins/imageformats/jpeg/qjpeghandler.cpp b/src/plugins/imageformats/jpeg/qjpeghandler.cpp
index e52a19703c..54fe857908 100644
--- a/src/plugins/imageformats/jpeg/qjpeghandler.cpp
+++ b/src/plugins/imageformats/jpeg/qjpeghandler.cpp
@@ -56,13 +56,12 @@
// including jpeglib.h seems to be a little messy
extern "C" {
-// mingw includes rpcndr.h but does not define boolean
-#if defined(Q_OS_WIN) && defined(Q_CC_GNU)
-# if defined(__RPCNDR_H__) && !defined(boolean)
- typedef unsigned char boolean;
-# define HAVE_BOOLEAN
-# endif
+// jpeglib.h->jmorecfg.h tries to typedef int boolean; but this conflicts with
+// some Windows headers that may or may not have been included
+#ifdef HAVE_BOOLEAN
+# undef HAVE_BOOLEAN
#endif
+#define boolean jboolean
#define XMD_H // shut JPEGlib up
#include <jpeglib.h>
diff --git a/src/plugins/platforms/windows/qwindowspointerhandler.cpp b/src/plugins/platforms/windows/qwindowspointerhandler.cpp
index c94dc2d3df..7935d0c36f 100644
--- a/src/plugins/platforms/windows/qwindowspointerhandler.cpp
+++ b/src/plugins/platforms/windows/qwindowspointerhandler.cpp
@@ -187,6 +187,12 @@ static bool draggingActive()
bool QWindowsPointerHandler::translatePointerEvent(QWindow *window, HWND hwnd, QtWindows::WindowsEventType et, MSG msg, LRESULT *result)
{
*result = 0;
+
+ // If we are inside the move/resize modal loop, let DefWindowProc() handle it (but process NC button release).
+ QWindowsWindow *platformWindow = static_cast<QWindowsWindow *>(window->handle());
+ if (msg.message != WM_NCPOINTERUP && platformWindow->testFlag(QWindowsWindow::ResizeMoveActive))
+ return false;
+
const quint32 pointerId = GET_POINTERID_WPARAM(msg.wParam);
POINTER_INPUT_TYPE pointerType;
@@ -195,6 +201,18 @@ bool QWindowsPointerHandler::translatePointerEvent(QWindow *window, HWND hwnd, Q
return false;
}
+ // Handle non-client pen/touch as generic mouse events for compatibility with QDockWindow.
+ if ((pointerType == QT_PT_TOUCH || pointerType == QT_PT_PEN) && (et & QtWindows::NonClientEventFlag)) {
+ POINTER_INFO pointerInfo;
+ if (!QWindowsContext::user32dll.getPointerInfo(pointerId, &pointerInfo)) {
+ qWarning() << "GetPointerInfo() failed:" << qt_error_string();
+ return false;
+ }
+ if (pointerInfo.pointerFlags & (POINTER_FLAG_UP | POINTER_FLAG_DOWN))
+ return translateMouseTouchPadEvent(window, hwnd, et, msg, &pointerInfo);
+ return false;
+ }
+
switch (pointerType) {
case QT_PT_POINTER:
case QT_PT_MOUSE:
diff --git a/src/testlib/qtest.h b/src/testlib/qtest.h
index 2578037946..28b62129b6 100644
--- a/src/testlib/qtest.h
+++ b/src/testlib/qtest.h
@@ -49,6 +49,7 @@
#include <QtCore/qbytearray.h>
#include <QtCore/qstring.h>
#include <QtCore/qstringlist.h>
+#include <QtCore/qcborcommon.h>
#include <QtCore/qdatetime.h>
#include <QtCore/qobject.h>
#include <QtCore/qvariant.h>
@@ -110,6 +111,12 @@ template<> inline char *toString(const QDateTime &dateTime)
}
#endif // datestring
+template<> inline char *toString(const QCborError &c)
+{
+ // use the Q_ENUM formatting
+ return toString(c.c);
+}
+
template<> inline char *toString(const QChar &c)
{
const ushort uc = c.unicode();
diff --git a/src/widgets/graphicsview/qgraphicsitem.cpp b/src/widgets/graphicsview/qgraphicsitem.cpp
index e81eab4c46..3a9bfab298 100644
--- a/src/widgets/graphicsview/qgraphicsitem.cpp
+++ b/src/widgets/graphicsview/qgraphicsitem.cpp
@@ -10569,14 +10569,11 @@ void QGraphicsTextItemPrivate::_q_update(QRectF rect)
*/
void QGraphicsTextItemPrivate::_q_updateBoundingRect(const QSizeF &size)
{
- if (!control) return; // can't happen
- const QSizeF pageSize = control->document()->pageSize();
- // paged items have a constant (page) size
- if (size == boundingRect.size() || pageSize.height() != -1)
- return;
- qq->prepareGeometryChange();
- boundingRect.setSize(size);
- qq->update();
+ if (size != boundingRect.size()) {
+ qq->prepareGeometryChange();
+ boundingRect.setSize(size);
+ qq->update();
+ }
}
/*!
diff --git a/src/widgets/util/qscroller.cpp b/src/widgets/util/qscroller.cpp
index e229a885a8..abb203b8cc 100644
--- a/src/widgets/util/qscroller.cpp
+++ b/src/widgets/util/qscroller.cpp
@@ -1725,10 +1725,12 @@ void QScrollerPrivate::setState(QScroller::State newstate)
sendEvent(target, &se);
firstScroll = true;
}
- if (state == QScroller::Dragging || state == QScroller::Scrolling)
- qt_activeScrollers()->push_back(q);
- else
+ if (state == QScroller::Dragging || state == QScroller::Scrolling) {
+ if (!qt_activeScrollers()->contains(q))
+ qt_activeScrollers()->push_back(q);
+ } else {
qt_activeScrollers()->removeOne(q);
+ }
emit q->stateChanged(state);
}
diff --git a/src/widgets/widgets/qwidgetlinecontrol_p.h b/src/widgets/widgets/qwidgetlinecontrol_p.h
index b730b415f0..f4df95865d 100644
--- a/src/widgets/widgets/qwidgetlinecontrol_p.h
+++ b/src/widgets/widgets/qwidgetlinecontrol_p.h
@@ -280,6 +280,13 @@ public:
cancelPasswordEchoTimer();
m_echoMode = mode;
m_passwordEchoEditing = false;
+
+ // If this control is used for password input, we want to minimize
+ // the possibility of string reallocation not to leak (parts of)
+ // the password.
+ if (m_echoMode != QLineEdit::Normal)
+ m_text.reserve(30);
+
updateDisplayText();
}