diff options
author | J-P Nurmi <jpnurmi@qt.io> | 2017-05-31 18:44:57 +0200 |
---|---|---|
committer | J-P Nurmi <jpnurmi@qt.io> | 2017-06-06 10:23:47 +0000 |
commit | 4339a686c190605121a327f703e96dae8b9451d5 (patch) | |
tree | 8050a5495ac8131a74a07e2cb73a5a6c5913498e /src/quicktemplates2/qquickpopup.cpp | |
parent | 1981ed233f4f78073bba6977edbc7ffdfbb6d2cc (diff) |
Add Popup::opened
[ChangeLog][Controls][Popup] Added an "opened" boolean property that
holds whether a popup is fully open. That is, the popup is visible and
neither the enter nor exit transitions are running.
Change-Id: I18a1403be381c113fdbcc4211e267f68632984b7
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Diffstat (limited to 'src/quicktemplates2/qquickpopup.cpp')
-rw-r--r-- | src/quicktemplates2/qquickpopup.cpp | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/src/quicktemplates2/qquickpopup.cpp b/src/quicktemplates2/qquickpopup.cpp index 90e09795..543a6f34 100644 --- a/src/quicktemplates2/qquickpopup.cpp +++ b/src/quicktemplates2/qquickpopup.cpp @@ -457,6 +457,7 @@ bool QQuickPopupPrivate::prepareExitTransition() } transitionState = ExitTransition; emit q->aboutToHide(); + emit q->openedChanged(); } return true; } @@ -467,6 +468,7 @@ void QQuickPopupPrivate::finalizeEnterTransition() if (focus) popupItem->setFocus(true); transitionState = NoTransition; + emit q->openedChanged(); emit q->opened(); } @@ -1698,7 +1700,7 @@ void QQuickPopup::resetDim() This property holds whether the popup is visible. The default value is \c false. - \sa open(), close() + \sa open(), close(), opened */ bool QQuickPopup::isVisible() const { @@ -1723,6 +1725,21 @@ void QQuickPopup::setVisible(bool visible) } /*! + \since QtQuick.Controls 2.3 (Qt 5.10) + \qmlproperty bool QtQuick.Controls::Popup::opened + + This property holds whether the popup is fully open. The popup is considered opened + when it's visible and neither the \l enter nor \l exit transitions are running. + + \sa open(), close(), visible +*/ +bool QQuickPopup::isOpened() const +{ + Q_D(const QQuickPopup); + return d->transitionState == QQuickPopupPrivate::NoTransition && isVisible(); +} + +/*! \qmlproperty real QtQuick.Controls::Popup::opacity This property holds the opacity of the popup. Opacity is specified as a number between |