summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorFrederik Gladhorn <frederik.gladhorn@qt.io>2017-05-11 09:55:44 +0000
committerThe Qt Project <gerrit-noreply@qt-project.org>2017-05-11 09:55:44 +0000
commit9eb00a3397627a36a46e7bca52444996d4e7b0c9 (patch)
tree8f78d28814f21957838041acd45a5f17aa5911c4 /src
parentd7a9e08f0ada36ad8ad44651f27a76c9c74e3428 (diff)
parent6881e1613af3e31ca3cd6b297e7756bb61d2f038 (diff)
Merge "Merge remote-tracking branch 'origin/5.9' into dev" into refs/staging/dev
Diffstat (limited to 'src')
-rw-r--r--src/corelib/io/qdiriterator.cpp2
-rw-r--r--src/corelib/itemmodels/qitemselectionmodel.cpp3
-rw-r--r--src/corelib/kernel/qeventdispatcher_win.cpp4
-rw-r--r--src/network/access/qhttp2protocolhandler.cpp8
-rw-r--r--src/plugins/platforms/cocoa/qnsview.mm60
-rw-r--r--src/plugins/platforms/windows/qwindowswindow.cpp21
6 files changed, 56 insertions, 42 deletions
diff --git a/src/corelib/io/qdiriterator.cpp b/src/corelib/io/qdiriterator.cpp
index 5fd9edc552..b1d920c6ee 100644
--- a/src/corelib/io/qdiriterator.cpp
+++ b/src/corelib/io/qdiriterator.cpp
@@ -204,6 +204,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/itemmodels/qitemselectionmodel.cpp b/src/corelib/itemmodels/qitemselectionmodel.cpp
index 6c7101d41f..7714aa5e46 100644
--- a/src/corelib/itemmodels/qitemselectionmodel.cpp
+++ b/src/corelib/itemmodels/qitemselectionmodel.cpp
@@ -942,13 +942,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/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/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/plugins/platforms/cocoa/qnsview.mm b/src/plugins/platforms/cocoa/qnsview.mm
index 08e4930584..bb30330dfd 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/windows/qwindowswindow.cpp b/src/plugins/platforms/windows/qwindowswindow.cpp
index 79ae4c004b..818bff2693 100644
--- a/src/plugins/platforms/windows/qwindowswindow.cpp
+++ b/src/plugins/platforms/windows/qwindowswindow.cpp
@@ -1695,6 +1695,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)
{
@@ -1706,15 +1716,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);