diff options
Diffstat (limited to 'src/quicktemplates2')
-rw-r--r-- | src/quicktemplates2/qquickabstractbutton.cpp | 12 | ||||
-rw-r--r-- | src/quicktemplates2/qquickbuttongroup.cpp | 8 | ||||
-rw-r--r-- | src/quicktemplates2/qquickpopup.cpp | 4 | ||||
-rw-r--r-- | src/quicktemplates2/qquickscrollview.cpp | 12 |
4 files changed, 19 insertions, 17 deletions
diff --git a/src/quicktemplates2/qquickabstractbutton.cpp b/src/quicktemplates2/qquickabstractbutton.cpp index 08a59dc0..2100dce2 100644 --- a/src/quicktemplates2/qquickabstractbutton.cpp +++ b/src/quicktemplates2/qquickabstractbutton.cpp @@ -124,13 +124,13 @@ static const int AUTO_REPEAT_INTERVAL = 100; /*! \qmlsignal QtQuick.Controls::AbstractButton::pressed() - This signal is emitted when the button is interactively pressed by the user. + This signal is emitted when the button is interactively pressed by the user via touch, mouse, or keyboard. */ /*! \qmlsignal QtQuick.Controls::AbstractButton::released() - This signal is emitted when the button is interactively released by the user. + This signal is emitted when the button is interactively released by the user via touch, mouse, or keyboard. */ /*! @@ -144,26 +144,26 @@ static const int AUTO_REPEAT_INTERVAL = 100; /*! \qmlsignal QtQuick.Controls::AbstractButton::clicked() - This signal is emitted when the button is interactively clicked by the user. + This signal is emitted when the button is interactively clicked by the user via touch, mouse, or keyboard. */ /*! \since QtQuick.Controls 2.2 (Qt 5.9) \qmlsignal QtQuick.Controls::AbstractButton::toggled() - This signal is emitted when a checkable button is interactively toggled by the user. + This signal is emitted when a checkable button is interactively toggled by the user via touch, mouse, or keyboard. */ /*! \qmlsignal QtQuick.Controls::AbstractButton::pressAndHold() - This signal is emitted when the button is interactively pressed and held down by the user. + This signal is emitted when the button is interactively pressed and held down by the user via touch or mouse. */ /*! \qmlsignal QtQuick.Controls::AbstractButton::doubleClicked() - This signal is emitted when the button is interactively double clicked by the user. + This signal is emitted when the button is interactively double clicked by the user via touch or mouse. */ QQuickAbstractButtonPrivate::QQuickAbstractButtonPrivate() diff --git a/src/quicktemplates2/qquickbuttongroup.cpp b/src/quicktemplates2/qquickbuttongroup.cpp index ef35440f..2a1e354c 100644 --- a/src/quicktemplates2/qquickbuttongroup.cpp +++ b/src/quicktemplates2/qquickbuttongroup.cpp @@ -154,11 +154,7 @@ class QQuickButtonGroupPrivate : public QObjectPrivate Q_DECLARE_PUBLIC(QQuickButtonGroup) public: - QQuickButtonGroupPrivate() - : exclusive(true), - checkedButton(nullptr) - { - } + QQuickButtonGroupPrivate() : exclusive(true) { } void clear(); void buttonClicked(); @@ -170,7 +166,7 @@ public: static void buttons_clear(QQmlListProperty<QQuickAbstractButton> *prop); bool exclusive; - QQuickAbstractButton *checkedButton; + QPointer<QQuickAbstractButton> checkedButton; QVector<QQuickAbstractButton*> buttons; }; diff --git a/src/quicktemplates2/qquickpopup.cpp b/src/quicktemplates2/qquickpopup.cpp index 4dba5893..95e3d553 100644 --- a/src/quicktemplates2/qquickpopup.cpp +++ b/src/quicktemplates2/qquickpopup.cpp @@ -612,8 +612,8 @@ static QQuickItem *createDimmer(QQmlComponent *component, QQuickPopup *popup, QQ if (component) { QQmlContext *creationContext = component->creationContext(); if (!creationContext) - creationContext = qmlContext(parent); - QQmlContext *context = new QQmlContext(creationContext, parent); + creationContext = qmlContext(popup); + QQmlContext *context = new QQmlContext(creationContext, popup); context->setContextObject(popup); item = qobject_cast<QQuickItem*>(component->beginCreate(context)); } diff --git a/src/quicktemplates2/qquickscrollview.cpp b/src/quicktemplates2/qquickscrollview.cpp index c05e4848..fa9a6c3b 100644 --- a/src/quicktemplates2/qquickscrollview.cpp +++ b/src/quicktemplates2/qquickscrollview.cpp @@ -205,7 +205,7 @@ bool QQuickScrollViewPrivate::setFlickable(QQuickFlickable *item, bool content) void QQuickScrollViewPrivate::updateContentWidth() { Q_Q(QQuickScrollView); - if (!flickable) + if (!flickable || !componentComplete) return; const qreal cw = flickable->contentWidth(); @@ -219,7 +219,7 @@ void QQuickScrollViewPrivate::updateContentWidth() void QQuickScrollViewPrivate::updateContentHeight() { Q_Q(QQuickScrollView); - if (!flickable) + if (!flickable || !componentComplete) return; const qreal ch = flickable->contentHeight(); @@ -551,8 +551,14 @@ void QQuickScrollView::componentComplete() { Q_D(QQuickScrollView); QQuickControl::componentComplete(); - if (!d->contentItem) + if (!d->contentItem) { d->ensureFlickable(true); + } else { + if (d->contentWidth <= 0) + d->updateContentWidth(); + if (d->contentHeight <= 0) + d->updateContentHeight(); + } } void QQuickScrollView::contentItemChange(QQuickItem *newItem, QQuickItem *oldItem) |