diff options
Diffstat (limited to 'src/widgets/kernel')
-rw-r--r-- | src/widgets/kernel/qapplication.cpp | 8 | ||||
-rw-r--r-- | src/widgets/kernel/qapplication.h | 4 | ||||
-rw-r--r-- | src/widgets/kernel/qgesturemanager.cpp | 7 | ||||
-rw-r--r-- | src/widgets/kernel/qsizepolicy.cpp | 2 | ||||
-rw-r--r-- | src/widgets/kernel/qwidget.cpp | 4 | ||||
-rw-r--r-- | src/widgets/kernel/qwidgetsvariant.cpp | 12 |
6 files changed, 22 insertions, 15 deletions
diff --git a/src/widgets/kernel/qapplication.cpp b/src/widgets/kernel/qapplication.cpp index eea97b2c0b..129569a466 100644 --- a/src/widgets/kernel/qapplication.cpp +++ b/src/widgets/kernel/qapplication.cpp @@ -1224,6 +1224,7 @@ void QApplication::setColorSpec(int spec) \property QApplication::globalStrut \brief the minimum size that any GUI element that the user can interact with should have + \deprecated For example, no button should be resized to be smaller than the global strut size. The strut size should be considered when reimplementing GUI @@ -2123,7 +2124,8 @@ QWidget *QApplicationPrivate::focusNextPrevChild_helper(QWidget *toplevel, bool && !(!next && focusProxy && test->isAncestorOf(focusProxy)) && test->isVisibleTo(toplevel) && test->isEnabled() && !(w->windowType() == Qt::SubWindow && !w->isAncestorOf(test)) - && (toplevel->windowType() != Qt::SubWindow || toplevel->isAncestorOf(test))) { + && (toplevel->windowType() != Qt::SubWindow || toplevel->isAncestorOf(test)) + && f != focusProxy) { w = test; if (seenWindow) focusWidgetAfterWindow = true; @@ -3761,7 +3763,9 @@ void QApplicationPrivate::closePopup(QWidget *popup) if (QWidget *fw = aw->focusWidget()) fw->setFocus(Qt::PopupFocusReason); - if (QApplicationPrivate::popupWidgets->count() == 1) // grab mouse/keyboard + // can become nullptr due to setFocus() above + if (QApplicationPrivate::popupWidgets && + QApplicationPrivate::popupWidgets->count() == 1) // grab mouse/keyboard grabForPopup(aw); } diff --git a/src/widgets/kernel/qapplication.h b/src/widgets/kernel/qapplication.h index d7cc4489c4..4ecfe64b60 100644 --- a/src/widgets/kernel/qapplication.h +++ b/src/widgets/kernel/qapplication.h @@ -78,7 +78,9 @@ class Q_WIDGETS_EXPORT QApplication : public QGuiApplication #if QT_CONFIG(wheelevent) Q_PROPERTY(int wheelScrollLines READ wheelScrollLines WRITE setWheelScrollLines) #endif +#if QT_DEPRECATED_SINCE(5, 15) Q_PROPERTY(QSize globalStrut READ globalStrut WRITE setGlobalStrut) +#endif Q_PROPERTY(int startDragTime READ startDragTime WRITE setStartDragTime) Q_PROPERTY(int startDragDistance READ startDragDistance WRITE setStartDragDistance) #ifndef QT_NO_STYLE_STYLESHEET @@ -157,8 +159,10 @@ public: static void setWheelScrollLines(int); static int wheelScrollLines(); #endif +#if QT_DEPRECATED_SINCE(5, 15) static void setGlobalStrut(const QSize &); static QSize globalStrut(); +#endif static void setStartDragTime(int ms); static int startDragTime(); diff --git a/src/widgets/kernel/qgesturemanager.cpp b/src/widgets/kernel/qgesturemanager.cpp index 5604391059..541519245e 100644 --- a/src/widgets/kernel/qgesturemanager.cpp +++ b/src/widgets/kernel/qgesturemanager.cpp @@ -105,11 +105,10 @@ QGestureManager::QGestureManager(QObject *parent) QGestureManager::~QGestureManager() { qDeleteAll(m_recognizers); - foreach (QGestureRecognizer *recognizer, m_obsoleteGestures.keys()) { - qDeleteAll(m_obsoleteGestures.value(recognizer)); - delete recognizer; + for (auto it = m_obsoleteGestures.cbegin(), end = m_obsoleteGestures.cend(); it != end; ++it) { + qDeleteAll(it.value()); + delete it.key(); } - m_obsoleteGestures.clear(); } Qt::GestureType QGestureManager::registerGestureRecognizer(QGestureRecognizer *recognizer) diff --git a/src/widgets/kernel/qsizepolicy.cpp b/src/widgets/kernel/qsizepolicy.cpp index 54bf8fe0dc..c4372a9fbc 100644 --- a/src/widgets/kernel/qsizepolicy.cpp +++ b/src/widgets/kernel/qsizepolicy.cpp @@ -439,7 +439,7 @@ void QSizePolicy::setControlType(ControlType type) noexcept */ QSizePolicy::operator QVariant() const { - return QVariant(QVariant::SizePolicy, this); + return QVariant(QMetaType::QSizePolicy, this); } #ifndef QT_NO_DATASTREAM diff --git a/src/widgets/kernel/qwidget.cpp b/src/widgets/kernel/qwidget.cpp index db3c269949..25ca732c9e 100644 --- a/src/widgets/kernel/qwidget.cpp +++ b/src/widgets/kernel/qwidget.cpp @@ -5954,9 +5954,9 @@ void QWidget::setWindowTitle(const QString &title) \note On \macos, window icons represent the active document, and will not be displayed unless a file path has also been - set using setFilePath. + set using setWindowFilePath. - \sa windowTitle, setFilePath + \sa windowTitle, setWindowFilePath */ QIcon QWidget::windowIcon() const { diff --git a/src/widgets/kernel/qwidgetsvariant.cpp b/src/widgets/kernel/qwidgetsvariant.cpp index 41600d2143..edb166e8d5 100644 --- a/src/widgets/kernel/qwidgetsvariant.cpp +++ b/src/widgets/kernel/qwidgetsvariant.cpp @@ -51,12 +51,12 @@ namespace { static void construct(QVariant::Private *x, const void *copy) { switch (x->type) { - case QVariant::SizePolicy: + case QMetaType::QSizePolicy: v_construct<QSizePolicy>(x, copy); break; default: qWarning("Trying to construct an instance of an invalid type, type id: %i", x->type); - x->type = QVariant::Invalid; + x->type = QMetaType::UnknownType; return; } x->is_null = !copy; @@ -65,7 +65,7 @@ static void construct(QVariant::Private *x, const void *copy) static void clear(QVariant::Private *d) { switch (d->type) { - case QVariant::SizePolicy: + case QMetaType::QSizePolicy: v_clear<QSizePolicy>(d); break; default: @@ -73,7 +73,7 @@ static void clear(QVariant::Private *d) return; } - d->type = QVariant::Invalid; + d->type = QMetaType::UnknownType; d->is_null = true; d->is_shared = false; } @@ -88,7 +88,7 @@ static bool compare(const QVariant::Private *a, const QVariant::Private *b) { Q_ASSERT(a->type == b->type); switch(a->type) { - case QVariant::SizePolicy: + case QMetaType::QSizePolicy: return *v_cast<QSizePolicy>(a) == *v_cast<QSizePolicy>(b); default: Q_ASSERT(false); @@ -111,7 +111,7 @@ static void streamDebug(QDebug dbg, const QVariant &v) { QVariant::Private *d = const_cast<QVariant::Private *>(&v.data_ptr()); switch (d->type) { - case QVariant::SizePolicy: + case QMetaType::QSizePolicy: dbg.nospace() << *v_cast<QSizePolicy>(d); break; default: |