diff options
author | Frederik Gladhorn <frederik.gladhorn@qt.io> | 2019-11-21 11:32:01 +0100 |
---|---|---|
committer | Frederik Gladhorn <frederik.gladhorn@qt.io> | 2019-11-21 11:32:01 +0100 |
commit | 546539562f2aff985e78f3c2426cb711a865ad65 (patch) | |
tree | a4fac78b563b8b1d4bd40ee13bf5db3f4afdade8 /src | |
parent | 9c054dd5d2925adbb1ac9745013011a16f78023f (diff) | |
parent | 49b1e3ff2ac20d8aa8b3889fc76ab4e6907817fd (diff) |
Merge 5.14 into 5.14.0
Change-Id: I579dc498300e06d747bdc4dba12f7ecd617b6608
Diffstat (limited to 'src')
-rw-r--r-- | src/imports/controls/SwipeView.qml | 1 | ||||
-rw-r--r-- | src/imports/controls/ToolTip.qml | 2 | ||||
-rw-r--r-- | src/imports/controls/fusion/ToolTip.qml | 2 | ||||
-rw-r--r-- | src/imports/controls/imagine/SwipeView.qml | 1 | ||||
-rw-r--r-- | src/imports/controls/imagine/ToolTip.qml | 2 | ||||
-rw-r--r-- | src/imports/controls/material/SwipeView.qml | 1 | ||||
-rw-r--r-- | src/imports/controls/material/ToolTip.qml | 2 | ||||
-rw-r--r-- | src/imports/controls/universal/ToolTip.qml | 2 | ||||
-rw-r--r-- | src/quicktemplates2/qquicksplitview.cpp | 77 | ||||
-rw-r--r-- | src/quicktemplates2/qquicksplitview_p_p.h | 1 | ||||
-rw-r--r-- | src/quicktemplates2/qquicktheme.cpp | 3 | ||||
-rw-r--r-- | src/quicktemplates2/qquicktheme_p_p.h | 3 |
12 files changed, 46 insertions, 51 deletions
diff --git a/src/imports/controls/SwipeView.qml b/src/imports/controls/SwipeView.qml index ad242e1a..7722d258 100644 --- a/src/imports/controls/SwipeView.qml +++ b/src/imports/controls/SwipeView.qml @@ -50,6 +50,7 @@ T.SwipeView { model: control.contentModel interactive: control.interactive currentIndex: control.currentIndex + focus: control.focus spacing: control.spacing orientation: control.orientation diff --git a/src/imports/controls/ToolTip.qml b/src/imports/controls/ToolTip.qml index ae903e4c..e0389903 100644 --- a/src/imports/controls/ToolTip.qml +++ b/src/imports/controls/ToolTip.qml @@ -58,8 +58,8 @@ T.ToolTip { contentItem: Text { text: control.text font: control.font + wrapMode: Text.Wrap color: control.palette.toolTipText - // TODO: wrapMode: Label.Wrap } background: Rectangle { diff --git a/src/imports/controls/fusion/ToolTip.qml b/src/imports/controls/fusion/ToolTip.qml index 73f561e4..b505e2c9 100644 --- a/src/imports/controls/fusion/ToolTip.qml +++ b/src/imports/controls/fusion/ToolTip.qml @@ -60,8 +60,8 @@ T.ToolTip { contentItem: Text { text: control.text font: control.font + wrapMode: Text.Wrap color: control.palette.toolTipText - // TODO: wrapMode: Label.Wrap } background: Rectangle { diff --git a/src/imports/controls/imagine/SwipeView.qml b/src/imports/controls/imagine/SwipeView.qml index 4998edb7..70d65fef 100644 --- a/src/imports/controls/imagine/SwipeView.qml +++ b/src/imports/controls/imagine/SwipeView.qml @@ -61,6 +61,7 @@ T.SwipeView { model: control.contentModel interactive: control.interactive currentIndex: control.currentIndex + focus: control.focus spacing: control.spacing orientation: control.orientation diff --git a/src/imports/controls/imagine/ToolTip.qml b/src/imports/controls/imagine/ToolTip.qml index 250452d8..21d75ebc 100644 --- a/src/imports/controls/imagine/ToolTip.qml +++ b/src/imports/controls/imagine/ToolTip.qml @@ -70,7 +70,7 @@ T.ToolTip { contentItem: Text { text: control.text font: control.font - // TODO: wrapMode: Label.Wrap + wrapMode: Text.Wrap color: control.palette.toolTipText } diff --git a/src/imports/controls/material/SwipeView.qml b/src/imports/controls/material/SwipeView.qml index 12ea36ae..a84f16c5 100644 --- a/src/imports/controls/material/SwipeView.qml +++ b/src/imports/controls/material/SwipeView.qml @@ -50,6 +50,7 @@ T.SwipeView { model: control.contentModel interactive: control.interactive currentIndex: control.currentIndex + focus: control.focus spacing: control.spacing orientation: control.orientation diff --git a/src/imports/controls/material/ToolTip.qml b/src/imports/controls/material/ToolTip.qml index fb705367..83afe4b1 100644 --- a/src/imports/controls/material/ToolTip.qml +++ b/src/imports/controls/material/ToolTip.qml @@ -70,7 +70,7 @@ T.ToolTip { contentItem: Text { text: control.text font: control.font - // TODO: wrapMode: Label.Wrap + wrapMode: Text.Wrap color: control.Material.foreground } diff --git a/src/imports/controls/universal/ToolTip.qml b/src/imports/controls/universal/ToolTip.qml index cf7325b6..431cdf7c 100644 --- a/src/imports/controls/universal/ToolTip.qml +++ b/src/imports/controls/universal/ToolTip.qml @@ -59,7 +59,7 @@ T.ToolTip { contentItem: Text { text: control.text font: control.font - // TODO: wrapMode: Label.Wrap + wrapMode: Text.Wrap opacity: enabled ? 1.0 : 0.2 color: control.Universal.foreground } diff --git a/src/quicktemplates2/qquicksplitview.cpp b/src/quicktemplates2/qquicksplitview.cpp index 56392e9a..ba7644a1 100644 --- a/src/quicktemplates2/qquicksplitview.cpp +++ b/src/quicktemplates2/qquicksplitview.cpp @@ -909,6 +909,40 @@ void QQuickSplitViewPrivate::updateHandleVisibilities() } } +void QQuickSplitViewPrivate::updateHoveredHandle(QQuickItem *hoveredItem) +{ + Q_Q(QQuickSplitView); + const int oldHoveredHandleIndex = m_hoveredHandleIndex; + m_hoveredHandleIndex = m_handleItems.indexOf(hoveredItem); + if (m_hoveredHandleIndex == oldHoveredHandleIndex) + return; + + // First, clear the hovered flag of any previously-hovered handle. + if (oldHoveredHandleIndex != -1) { + QQuickItem *oldHoveredHandle = m_handleItems.at(oldHoveredHandleIndex); + QQuickSplitHandleAttached *oldHoveredHandleAttached = qobject_cast<QQuickSplitHandleAttached*>( + qmlAttachedPropertiesObject<QQuickSplitHandleAttached>(oldHoveredHandle, true)); + QQuickSplitHandleAttachedPrivate::get(oldHoveredHandleAttached)->setHovered(false); + qCDebug(qlcQQuickSplitViewMouse) << "handle item at index" << oldHoveredHandleIndex << "is no longer hovered"; + } + + if (m_hoveredHandleIndex != -1) { + QQuickSplitHandleAttached *handleAttached = qobject_cast<QQuickSplitHandleAttached*>( + qmlAttachedPropertiesObject<QQuickSplitHandleAttached>(hoveredItem, true)); + QQuickSplitHandleAttachedPrivate::get(handleAttached)->setHovered(true); + qCDebug(qlcQQuickSplitViewMouse) << "handle item at index" << m_hoveredHandleIndex << "is now hovered"; + } else { + qCDebug(qlcQQuickSplitViewMouse) << "either there is no hovered item or" << hoveredItem << "is not a handle"; + } + +#if QT_CONFIG(cursor) + if (m_hoveredHandleIndex != -1) + q->setCursor(m_orientation == Qt::Horizontal ? Qt::SplitHCursor : Qt::SplitVCursor); + else + q->setCursor(Qt::ArrowCursor); +#endif +} + void QQuickSplitViewPrivate::setResizing(bool resizing) { Q_Q(QQuickSplitView); @@ -1327,48 +1361,7 @@ void QQuickSplitView::hoverMoveEvent(QHoverEvent *event) QQuickContainer::hoverMoveEvent(event); QQuickItem *hoveredItem = childAt(event->pos().x(), event->pos().y()); - if (!hoveredItem) { - // No handle is hovered. - if (d->m_hoveredHandleIndex != -1) { - // The previously-hovered handle is no longer hovered. - QQuickItem *oldHoveredHandle = d->m_handleItems.at(d->m_hoveredHandleIndex); - QQuickSplitHandleAttached *handleAttached = qobject_cast<QQuickSplitHandleAttached*>( - qmlAttachedPropertiesObject<QQuickSplitHandleAttached>(oldHoveredHandle, true)); - QQuickSplitHandleAttachedPrivate::get(handleAttached)->setHovered(false); - } - - qCDebug(qlcQQuickSplitViewMouse) << "handle item at index" << d->m_hoveredHandleIndex << "is no longer hovered"; - - d->m_hoveredHandleIndex = -1; - } else { - // A child item of ours is hovered. - - // First, clear the hovered flag of any previously-hovered handle. - if (d->m_hoveredHandleIndex != -1) { - QQuickItem *oldHoveredHandle = d->m_handleItems.at(d->m_hoveredHandleIndex); - QQuickSplitHandleAttached *handleAttached = qobject_cast<QQuickSplitHandleAttached*>( - qmlAttachedPropertiesObject<QQuickSplitHandleAttached>(oldHoveredHandle, true)); - QQuickSplitHandleAttachedPrivate::get(handleAttached)->setHovered(false); - } - - // Now check if the newly hovered item is actually a handle. - d->m_hoveredHandleIndex = d->m_handleItems.indexOf(hoveredItem); - - if (d->m_hoveredHandleIndex != -1) { - QQuickSplitHandleAttached *handleAttached = qobject_cast<QQuickSplitHandleAttached*>( - qmlAttachedPropertiesObject<QQuickSplitHandleAttached>(hoveredItem, true)); - QQuickSplitHandleAttachedPrivate::get(handleAttached)->setHovered(true); - - qCDebug(qlcQQuickSplitViewMouse) << "handle item at index" << d->m_hoveredHandleIndex << "is now hovered"; - } - } - -#if QT_CONFIG(cursor) - if (d->m_hoveredHandleIndex != -1) - setCursor(d->m_orientation == Qt::Horizontal ? Qt::SplitHCursor : Qt::SplitVCursor); - else - setCursor(Qt::ArrowCursor); -#endif + d->updateHoveredHandle(hoveredItem); } void QQuickSplitView::geometryChanged(const QRectF &newGeometry, const QRectF &oldGeometry) diff --git a/src/quicktemplates2/qquicksplitview_p_p.h b/src/quicktemplates2/qquicksplitview_p_p.h index 5d71d461..ccefe5ec 100644 --- a/src/quicktemplates2/qquicksplitview_p_p.h +++ b/src/quicktemplates2/qquicksplitview_p_p.h @@ -74,6 +74,7 @@ public: void resizeHandle(QQuickItem *handleItem); void resizeHandles(); void updateHandleVisibilities(); + void updateHoveredHandle(QQuickItem *hoveredItem); void setResizing(bool resizing); bool isHorizontal() const; diff --git a/src/quicktemplates2/qquicktheme.cpp b/src/quicktemplates2/qquicktheme.cpp index af49ffc9..f8c4a251 100644 --- a/src/quicktemplates2/qquicktheme.cpp +++ b/src/quicktemplates2/qquicktheme.cpp @@ -109,7 +109,6 @@ static QPlatformTheme::Palette platformPalette(QQuickTheme::Scope scope) QQuickTheme::QQuickTheme() : d_ptr(new QQuickThemePrivate) { - d_ptr->q_ptr = this; } QQuickTheme::~QQuickTheme() @@ -167,6 +166,8 @@ void QQuickTheme::setFont(Scope scope, const QFont &font) { Q_D(QQuickTheme); d->fonts[scope] = QSharedPointer<QFont>::create(d->defaultFont ? d->defaultFont->resolve(font) : font); + // See comment in QQuickControlPrivate::inheritFont + d->fonts[scope]->setFamilies(QStringList()); } void QQuickTheme::setPalette(Scope scope, const QPalette &palette) diff --git a/src/quicktemplates2/qquicktheme_p_p.h b/src/quicktemplates2/qquicktheme_p_p.h index c7421677..29058bc8 100644 --- a/src/quicktemplates2/qquicktheme_p_p.h +++ b/src/quicktemplates2/qquicktheme_p_p.h @@ -54,8 +54,6 @@ QT_BEGIN_NAMESPACE class Q_QUICKTEMPLATES2_PRIVATE_EXPORT QQuickThemePrivate { - Q_DECLARE_PUBLIC(QQuickTheme) - public: static QQuickThemePrivate *get(QQuickTheme *theme) { @@ -70,7 +68,6 @@ public: QScopedPointer<const QPalette> defaultPalette; QSharedPointer<QFont> fonts[NScopes]; QSharedPointer<QPalette> palettes[NScopes]; - QQuickTheme *q_ptr = nullptr; }; QT_END_NAMESPACE |