aboutsummaryrefslogtreecommitdiffstats
path: root/src/templates/qquickpopup.cpp
diff options
context:
space:
mode:
authorJ-P Nurmi <jpnurmi@theqtcompany.com>2016-02-07 01:35:46 +0100
committerJ-P Nurmi <jpnurmi@theqtcompany.com>2016-02-07 01:35:46 +0100
commitf0cd88c0d7af9a477bf90545975d289915e89033 (patch)
tree40d16da8a9d35a92b72d7612156a606b83dd7a12 /src/templates/qquickpopup.cpp
parent66487fec4c558d8b77dd0573e524a61d11e33c2a (diff)
parent4d0294352f975c3916dfbba48f21e5b76da432c0 (diff)
Merge remote-tracking branch 'origin/5.6' into dev
Conflicts: src/imports/controls/universal/ToolButton.qml Change-Id: Ib9f1e7d83fb824d9e6a13a2bc429d1a5642fe4f6
Diffstat (limited to 'src/templates/qquickpopup.cpp')
-rw-r--r--src/templates/qquickpopup.cpp112
1 files changed, 105 insertions, 7 deletions
diff --git a/src/templates/qquickpopup.cpp b/src/templates/qquickpopup.cpp
index 8f9a04cb..3cdf3bd2 100644
--- a/src/templates/qquickpopup.cpp
+++ b/src/templates/qquickpopup.cpp
@@ -396,6 +396,12 @@ void QQuickPopupItem::itemChange(ItemChange change, const ItemChangeData &data)
case ItemVisibleHasChanged:
emit d->popup->visibleChanged();
break;
+ case ItemActiveFocusHasChanged:
+ emit d->popup->activeFocusChanged();
+ break;
+ case ItemOpacityHasChanged:
+ emit d->popup->opacityChanged();
+ break;
default:
break;
}
@@ -727,6 +733,27 @@ void QQuickPopup::setY(qreal y)
}
/*!
+ \qmlproperty real Qt.labs.controls::Popup::z
+
+ This property holds the z-value of the popup. Z-value determines
+ the stacking order of popups. The default z-value is \c 0.
+*/
+qreal QQuickPopup::z() const
+{
+ Q_D(const QQuickPopup);
+ return d->popupItem->z();
+}
+
+void QQuickPopup::setZ(qreal z)
+{
+ Q_D(QQuickPopup);
+ if (qFuzzyCompare(z, d->popupItem->z()))
+ return;
+ d->popupItem->setZ(z);
+ emit zChanged();
+}
+
+/*!
\qmlproperty real Qt.labs.controls::Popup::width
This property holds the width of the popup.
@@ -856,6 +883,7 @@ void QQuickPopup::setContentHeight(qreal height)
/*!
\qmlproperty real Qt.labs.controls::Popup::availableWidth
+ \readonly
This property holds the width available after deducting horizontal padding.
@@ -868,6 +896,7 @@ qreal QQuickPopup::availableWidth() const
/*!
\qmlproperty real Qt.labs.controls::Popup::availableHeight
+ \readonly
This property holds the height available after deducting vertical padding.
@@ -921,7 +950,7 @@ void QQuickPopup::resetMargins()
This property holds the top margin around the popup.
- \sa margin, bottomMargin
+ \sa margins, bottomMargin
*/
qreal QQuickPopup::topMargin() const
{
@@ -948,7 +977,7 @@ void QQuickPopup::resetTopMargin()
This property holds the left margin around the popup.
- \sa margin, rightMargin
+ \sa margins, rightMargin
*/
qreal QQuickPopup::leftMargin() const
{
@@ -975,7 +1004,7 @@ void QQuickPopup::resetLeftMargin()
This property holds the right margin around the popup.
- \sa margin, leftMargin
+ \sa margins, leftMargin
*/
qreal QQuickPopup::rightMargin() const
{
@@ -1002,7 +1031,7 @@ void QQuickPopup::resetRightMargin()
This property holds the bottom margin around the popup.
- \sa margin, topMargin
+ \sa margins, topMargin
*/
qreal QQuickPopup::bottomMargin() const
{
@@ -1302,9 +1331,29 @@ QQmlListProperty<QQuickItem> QQuickPopup::contentChildren()
}
/*!
+ \qmlproperty bool Qt.labs.controls::Popup::clip
+
+ This property holds whether clipping is enabled. The default value is \c false.
+*/
+bool QQuickPopup::clip() const
+{
+ Q_D(const QQuickPopup);
+ return d->popupItem->clip();
+}
+
+void QQuickPopup::setClip(bool clip)
+{
+ Q_D(QQuickPopup);
+ if (clip == d->popupItem->clip())
+ return;
+ d->popupItem->setClip(clip);
+ emit clipChanged();
+}
+
+/*!
\qmlproperty bool Qt.labs.controls::Popup::focus
- This property holds whether the popup has focus.
+ This property holds whether the popup has focus. The default value is \c false.
*/
bool QQuickPopup::hasFocus() const
{
@@ -1322,9 +1371,21 @@ void QQuickPopup::setFocus(bool focus)
}
/*!
+ \qmlproperty bool Qt.labs.controls::Popup::activeFocus
+ \readonly
+
+ This property holds whether the popup has active focus.
+*/
+bool QQuickPopup::hasActiveFocus() const
+{
+ Q_D(const QQuickPopup);
+ return d->popupItem->hasActiveFocus();
+}
+
+/*!
\qmlproperty bool Qt.labs.controls::Popup::modal
- This property holds whether the popup is modal.
+ This property holds whether the popup is modal. The default value is \c false.
*/
bool QQuickPopup::isModal() const
{
@@ -1344,7 +1405,7 @@ void QQuickPopup::setModal(bool modal)
/*!
\qmlproperty bool Qt.labs.controls::Popup::visible
- This property holds whether the popup is visible.
+ This property holds whether the popup is visible. The default value is \c false.
*/
bool QQuickPopup::isVisible() const
{
@@ -1361,6 +1422,43 @@ void QQuickPopup::setVisible(bool visible)
}
/*!
+ \qmlproperty real Qt.labs.controls::Popup::opacity
+
+ This property holds the opacity of the popup. The default value is \c 1.0.
+*/
+qreal QQuickPopup::opacity() const
+{
+ Q_D(const QQuickPopup);
+ return d->popupItem->opacity();
+}
+
+void QQuickPopup::setOpacity(qreal opacity)
+{
+ Q_D(QQuickPopup);
+ d->popupItem->setOpacity(opacity);
+}
+
+/*!
+ \qmlproperty real Qt.labs.controls::Popup::scale
+
+ This property holds the scale factor of the popup. The default value is \c 1.0.
+*/
+qreal QQuickPopup::scale() const
+{
+ Q_D(const QQuickPopup);
+ return d->popupItem->scale();
+}
+
+void QQuickPopup::setScale(qreal scale)
+{
+ Q_D(QQuickPopup);
+ if (qFuzzyCompare(scale, d->popupItem->scale()))
+ return;
+ d->popupItem->setScale(scale);
+ emit scaleChanged();
+}
+
+/*!
\qmlproperty enumeration Qt.labs.controls::Popup::closePolicy
This property determines the circumstances under which the popup closes.