diff options
author | Liang Qi <liang.qi@qt.io> | 2018-10-01 11:59:36 +0200 |
---|---|---|
committer | Liang Qi <liang.qi@qt.io> | 2018-10-01 11:59:36 +0200 |
commit | 87662fd1b71db11f0759e0be03d8a288ee11b775 (patch) | |
tree | 7e9659b6e581205c798844388cffcec88ecaa112 /src | |
parent | e8b01250fdbef269379df8c2481c9482317e8220 (diff) | |
parent | 777cd6e9b10c83f5826fde67ad00a85c978218c0 (diff) |
Merge remote-tracking branch 'origin/5.11' into 5.12
Conflicts:
src/quick/items/qquickevents_p_p.h
Change-Id: I8c699aeb46903e2ea80a97a346cb5af460859a98
Diffstat (limited to 'src')
-rw-r--r-- | src/3rdparty/masm/stubs/ExecutableAllocator.h | 4 | ||||
-rw-r--r-- | src/3rdparty/masm/wtf/OSAllocator.h | 2 | ||||
-rw-r--r-- | src/3rdparty/masm/wtf/OSAllocatorIntegrity.cpp | 12 | ||||
-rw-r--r-- | src/imports/folderlistmodel/fileinfothread_p.h | 2 | ||||
-rw-r--r-- | src/qml/qml/qqmllist.cpp | 2 | ||||
-rw-r--r-- | src/quick/items/qquickpathview.cpp | 2 | ||||
-rw-r--r-- | src/quick/items/qquickwindow.cpp | 21 |
7 files changed, 28 insertions, 17 deletions
diff --git a/src/3rdparty/masm/stubs/ExecutableAllocator.h b/src/3rdparty/masm/stubs/ExecutableAllocator.h index 471fe3c952..156b24b4e8 100644 --- a/src/3rdparty/masm/stubs/ExecutableAllocator.h +++ b/src/3rdparty/masm/stubs/ExecutableAllocator.h @@ -123,7 +123,7 @@ struct ExecutableAllocator { } # endif # elif OS(INTEGRITY) - OSAllocator::setMemoryAttributes(addr, /*writable*/ true, /*executable*/ false); + OSAllocator::setMemoryAttributes(addr, size, /*writable*/ true, /*executable*/ false); # else int mode = PROT_READ | PROT_WRITE; if (mprotect(addr, size, mode) != 0) { @@ -159,7 +159,7 @@ struct ExecutableAllocator { } # endif # elif OS(INTEGRITY) - OSAllocator::setMemoryAttributes(addr, /*writable*/ false, /*executable*/ true); + OSAllocator::setMemoryAttributes(addr, size, /*writable*/ false, /*executable*/ true); # else int mode = PROT_READ | PROT_EXEC; if (mprotect(addr, size, mode) != 0) { diff --git a/src/3rdparty/masm/wtf/OSAllocator.h b/src/3rdparty/masm/wtf/OSAllocator.h index 366dd73993..9648a4e08f 100644 --- a/src/3rdparty/masm/wtf/OSAllocator.h +++ b/src/3rdparty/masm/wtf/OSAllocator.h @@ -75,7 +75,7 @@ public: static bool canAllocateExecutableMemory(); #if defined(Q_OS_INTEGRITY) - static void setMemoryAttributes(void* addr, bool writable, bool executable); + static void setMemoryAttributes(void* addr, size_t size, bool writable, bool executable); #endif }; diff --git a/src/3rdparty/masm/wtf/OSAllocatorIntegrity.cpp b/src/3rdparty/masm/wtf/OSAllocatorIntegrity.cpp index 7addf9e5c2..27f72073c4 100644 --- a/src/3rdparty/masm/wtf/OSAllocatorIntegrity.cpp +++ b/src/3rdparty/masm/wtf/OSAllocatorIntegrity.cpp @@ -123,10 +123,14 @@ Error setAttributes(MemoryRegion mr, bool writable, bool executable) return SetMemoryRegionAttributes(mr, attributes); } -void OSAllocator::setMemoryAttributes(void* addr, bool writable, bool executable) +void OSAllocator::setMemoryAttributes(void* addr, size_t size, bool writable, bool executable) { - const MRPair* pair = memoryRegionsContainer.getMRPair((Address)addr); - CheckSuccess(setAttributes(pair->vmr, writable, executable)); + Address addressIterator = Address(addr); + for(int i=0; i<(size + ASP_PAGESIZE -1)/ASP_PAGESIZE; i++) { + const MRPair* pair = memoryRegionsContainer.getMRPair(addressIterator); + CheckSuccess(setAttributes(pair->vmr, writable, executable)); + addressIterator += ASP_PAGESIZE; + } } void* OSAllocator::reserveUncommitted(size_t bytes, Usage usage, bool writable, bool executable) @@ -140,9 +144,9 @@ void* OSAllocator::reserveUncommitted(size_t bytes, Usage usage, bool writable, Address addressIterator = virtualStart; for(int i=0; i<(bytes + ASP_PAGESIZE -1)/ASP_PAGESIZE; i++) { MRPair pair; + pair.start = addressIterator; CheckSuccess(SplitMemoryRegion(VMR, ASP_PAGESIZE, &pair.vmr)); CheckSuccess(setAttributes(pair.vmr, writable, executable)); - pair.start = addressIterator; memoryRegionsContainer.insertMRPair(&pair); addressIterator += ASP_PAGESIZE; diff --git a/src/imports/folderlistmodel/fileinfothread_p.h b/src/imports/folderlistmodel/fileinfothread_p.h index 67d2a1f5f7..438dea6faa 100644 --- a/src/imports/folderlistmodel/fileinfothread_p.h +++ b/src/imports/folderlistmodel/fileinfothread_p.h @@ -54,7 +54,9 @@ #include <QThread> #include <QMutex> #include <QWaitCondition> +#if QT_CONFIG(filesystemwatcher) #include <QFileSystemWatcher> +#endif #include <QFileInfo> #include <QDir> diff --git a/src/qml/qml/qqmllist.cpp b/src/qml/qml/qqmllist.cpp index edc767b2bb..656a8a470b 100644 --- a/src/qml/qml/qqmllist.cpp +++ b/src/qml/qml/qqmllist.cpp @@ -359,7 +359,7 @@ List properties should have no setter. In the example above, the Q_PROPERTY() declarative will look like this: \code -Q_PROPERTY(QQmlListProperty<Fruit> fruit READ fruit); +Q_PROPERTY(QQmlListProperty<Fruit> fruit READ fruit) \endcode QML list properties are type-safe - in this case \c {Fruit} is a QObject type that diff --git a/src/quick/items/qquickpathview.cpp b/src/quick/items/qquickpathview.cpp index 879db6284e..e7e19b041e 100644 --- a/src/quick/items/qquickpathview.cpp +++ b/src/quick/items/qquickpathview.cpp @@ -1632,6 +1632,7 @@ void QQuickPathView::mousePressEvent(QMouseEvent *event) void QQuickPathViewPrivate::handleMousePressEvent(QMouseEvent *event) { + Q_Q(QQuickPathView); if (!interactive || !items.count() || !model || !modelCount) return; velocityBuffer.clear(); @@ -1657,6 +1658,7 @@ void QQuickPathViewPrivate::handleMousePressEvent(QMouseEvent *event) stealMouse = true; // If we've been flicked then steal the click. else stealMouse = false; + q->setKeepMouseGrab(stealMouse); timer.start(); lastPosTime = computeCurrentTime(event); diff --git a/src/quick/items/qquickwindow.cpp b/src/quick/items/qquickwindow.cpp index 804d82a212..8caa568a6c 100644 --- a/src/quick/items/qquickwindow.cpp +++ b/src/quick/items/qquickwindow.cpp @@ -697,8 +697,8 @@ bool QQuickWindowPrivate::deliverTouchAsMouse(QQuickItem *item, QQuickPointerEve touchMouseId = p.id(); if (!q->mouseGrabberItem()) item->grabMouse(); - auto pointerEventPoint = pointerEvent->pointById(p.id()); - pointerEventPoint->setGrabberItem(item); + if (auto pointerEventPoint = pointerEvent->pointById(p.id())) + pointerEventPoint->setGrabberItem(item); if (checkIfDoubleClicked(event->timestamp())) { QScopedPointer<QMouseEvent> mouseDoubleClick(touchToMouseEvent(QEvent::MouseButtonDblClick, p, event.data(), item, false)); @@ -2637,19 +2637,22 @@ void QQuickWindowPrivate::deliverMatchingPointsToItem(QQuickItem *item, QQuickPo // update accepted new points. bool isPressOrRelease = pointerEvent->isPressEvent() || pointerEvent->isReleaseEvent(); for (auto point: qAsConst(touchEvent->touchPoints())) { - auto pointerEventPoint = ptEvent->pointById(point.id()); - pointerEventPoint->setAccepted(); - if (isPressOrRelease) - pointerEventPoint->setGrabberItem(item); + if (auto pointerEventPoint = ptEvent->pointById(point.id())) { + pointerEventPoint->setAccepted(); + if (isPressOrRelease) + pointerEventPoint->setGrabberItem(item); + } } } else { // But if the event was not accepted then we know this item // will not be interested in further updates for those touchpoint IDs either. for (auto point: qAsConst(touchEvent->touchPoints())) { if (point.state() == Qt::TouchPointPressed) { - if (ptEvent->pointById(point.id())->exclusiveGrabber() == item) { - qCDebug(DBG_TOUCH_TARGET) << "TP" << hex << point.id() << "disassociated"; - ptEvent->pointById(point.id())->setGrabberItem(nullptr); + if (auto *tp = ptEvent->pointById(point.id())) { + if (tp->exclusiveGrabber() == item) { + qCDebug(DBG_TOUCH_TARGET) << "TP" << hex << point.id() << "disassociated"; + tp->setGrabberItem(nullptr); + } } } } |