diff options
Diffstat (limited to 'src/widgets')
-rw-r--r-- | src/widgets/kernel/qgesturemanager.cpp | 5 | ||||
-rw-r--r-- | src/widgets/kernel/qgesturerecognizer.cpp | 6 | ||||
-rw-r--r-- | src/widgets/styles/qstyle.cpp | 4 | ||||
-rw-r--r-- | src/widgets/widgets/qsplashscreen.cpp | 13 | ||||
-rw-r--r-- | src/widgets/widgets/qsplitter.cpp | 8 |
5 files changed, 22 insertions, 14 deletions
diff --git a/src/widgets/kernel/qgesturemanager.cpp b/src/widgets/kernel/qgesturemanager.cpp index 57d6994c88..cd27c9c5be 100644 --- a/src/widgets/kernel/qgesturemanager.cpp +++ b/src/widgets/kernel/qgesturemanager.cpp @@ -143,11 +143,6 @@ Qt::GestureType QGestureManager::registerGestureRecognizer(QGestureRecognizer *r void QGestureManager::unregisterGestureRecognizer(Qt::GestureType type) { QList<QGestureRecognizer *> list = m_recognizers.values(type); - while (QGestureRecognizer *recognizer = m_recognizers.take(type)) { - // ensuring an entry exists causes the recognizer to be deleted on destruction of the manager - auto &gestures = m_obsoleteGestures[recognizer]; - Q_UNUSED(gestures); - } foreach (QGesture *g, m_gestureToRecognizer.keys()) { QGestureRecognizer *recognizer = m_gestureToRecognizer.value(g); if (list.contains(recognizer)) { diff --git a/src/widgets/kernel/qgesturerecognizer.cpp b/src/widgets/kernel/qgesturerecognizer.cpp index 65c46a5e56..75d091ce4e 100644 --- a/src/widgets/kernel/qgesturerecognizer.cpp +++ b/src/widgets/kernel/qgesturerecognizer.cpp @@ -41,6 +41,7 @@ #include "private/qgesture_p.h" #include "private/qgesturemanager_p.h" +#include "private/qapplication_p.h" #ifndef QT_NO_GESTURES @@ -231,6 +232,11 @@ Qt::GestureType QGestureRecognizer::registerRecognizer(QGestureRecognizer *recog */ void QGestureRecognizer::unregisterRecognizer(Qt::GestureType type) { + auto qAppPriv = QApplicationPrivate::instance(); + if (!qAppPriv) + return; + if (!qAppPriv->gestureManager) + return; QGestureManager::instance()->unregisterGestureRecognizer(type); } diff --git a/src/widgets/styles/qstyle.cpp b/src/widgets/styles/qstyle.cpp index ac4fb7fbd1..97ec1d3f19 100644 --- a/src/widgets/styles/qstyle.cpp +++ b/src/widgets/styles/qstyle.cpp @@ -1971,8 +1971,8 @@ void QStyle::drawItemPixmap(QPainter *painter, const QRect &rect, int alignment, \value SH_Widget_Animate Deprecated. Use \l{SH_Widget_Animation_Duration} instead. - \value SH_Splitter_OpaqueResize Determines if resizing is opaque - This enum value has been introduced in Qt 5.2 + \value SH_Splitter_OpaqueResize Determines if widgets are resized dynamically (opaquely) while + interactively moving the splitter. This enum value was introduced in Qt 5.2. \value SH_TabBar_ChangeCurrentDelay Determines the delay before the current tab is changed while dragging over the tabbar, in milliseconds. This diff --git a/src/widgets/widgets/qsplashscreen.cpp b/src/widgets/widgets/qsplashscreen.cpp index 4af4f90119..bf6bf1c7c9 100644 --- a/src/widgets/widgets/qsplashscreen.cpp +++ b/src/widgets/widgets/qsplashscreen.cpp @@ -289,8 +289,7 @@ void QSplashScreen::setPixmap(const QPixmap &pixmap) // 1) If a QDesktopScreenWidget is found in the parent hierarchy, use that (see docs on // QSplashScreen(QWidget *, QPixmap). // 2) If a widget with associated QWindow is found, use that -// 3) When nothing can be found, do not position the widget, allowing for -// QPlatformWindow::initialGeometry() to center it over the cursor +// 3) When nothing can be found, try to center it over the cursor static inline int screenNumberOf(const QDesktopScreenWidget *dsw) { @@ -307,7 +306,15 @@ const QScreen *QSplashScreenPrivate::screenFor(const QWidget *w) if (QWindow *window = p->windowHandle()) return window->screen(); } - return nullptr; +#if QT_CONFIG(cursor) + // Note: We could rely on QPlatformWindow::initialGeometry() to center it + // over the cursor, but not all platforms (namely Android) use that. + if (QGuiApplication::screens().size() > 1) { + if (auto screenAtCursor = QGuiApplication::screenAt(QCursor::pos())) + return screenAtCursor; + } +#endif // cursor + return QGuiApplication::primaryScreen(); } void QSplashScreenPrivate::setPixmap(const QPixmap &p, const QScreen *screen) diff --git a/src/widgets/widgets/qsplitter.cpp b/src/widgets/widgets/qsplitter.cpp index 98bb23caad..de838a8f93 100644 --- a/src/widgets/widgets/qsplitter.cpp +++ b/src/widgets/widgets/qsplitter.cpp @@ -161,11 +161,10 @@ Qt::Orientation QSplitterHandle::orientation() const /*! - Returns \c true if widgets are resized dynamically (opaquely), otherwise - returns \c false. This value is controlled by the QSplitter. + Returns \c true if widgets are resized dynamically (opaquely) while interactively moving the + splitter. Otherwise returns \c false. This value is controlled by the QSplitter. \sa QSplitter::opaqueResize() - */ bool QSplitterHandle::opaqueResize() const { @@ -1483,7 +1482,8 @@ int QSplitter::closestLegalPosition(int pos, int index) /*! \property QSplitter::opaqueResize - \brief whether resizing is opaque + Returns \c true if widgets are resized dynamically (opaquely) while interactively moving the + splitter. Otherwise returns \c false. The default resize behavior is style dependent (determined by the SH_Splitter_OpaqueResize style hint). However, you can override it |