aboutsummaryrefslogtreecommitdiffstats
path: root/src/templates/qquickpopup.cpp
diff options
context:
space:
mode:
authorMitch Curtis <mitch.curtis@theqtcompany.com>2016-02-16 10:01:10 +0100
committerJ-P Nurmi <jpnurmi@theqtcompany.com>2016-02-19 16:00:04 +0000
commitda3bf2a7c16763c21b1bc127382130f8eee92cd0 (patch)
treeb1a35ed0017af7c38360b786dabd309e7f08a069 /src/templates/qquickpopup.cpp
parent7d13b5dc38ecaa06636b05d2d3474c1372bcfe73 (diff)
Recommend the use of ApplicationWindow with popups
It's important to mention that ApplicationWindow provides some extra support for popups. Change-Id: Iecea78d9d4446bbc4694fcde0166d1b1c2fb62ee Reviewed-by: Venugopal Shivashankar <venugopal.shivashankar@digia.com>
Diffstat (limited to 'src/templates/qquickpopup.cpp')
-rw-r--r--src/templates/qquickpopup.cpp35
1 files changed, 34 insertions, 1 deletions
diff --git a/src/templates/qquickpopup.cpp b/src/templates/qquickpopup.cpp
index 00b7ed84..df452a73 100644
--- a/src/templates/qquickpopup.cpp
+++ b/src/templates/qquickpopup.cpp
@@ -55,7 +55,40 @@ QT_BEGIN_NAMESPACE
\ingroup qtlabscontrols-popups
\brief A popup control.
- Popup is the base type of popup-like user interface controls.
+ Popup is the base type of popup-like user interface controls. It can be
+ used with Window or ApplicationWindow.
+
+ \qml
+ import QtQuick.Window 2.2
+ import Qt.labs.controls 1.0
+
+ Window {
+ id: window
+ width: 400
+ height: 400
+ visible: true
+
+ Button {
+ text: "Open"
+ onClicked: popup.open()
+ }
+
+ Popup {
+ id: popup
+ x: 100
+ y: 100
+ width: 200
+ height: 300
+ modal: true
+ focus: true
+ closePolicy: Popup.OnEscape | Popup.OnPressOutside
+ }
+ }
+ \endqml
+
+ In order to ensure that a popup is displayed above other items in the
+ scene, it is recommended to use ApplicationWindow. ApplicationWindow also
+ provides background dimming effects.
\labs
*/