Qt Reference Documentation

QML PopupManager Element

Symbian: Provides convenience functions to track the depth of a popup stack. More...

This element was introduced in Qt Quick Components 1.0.

Properties

Detailed Description

PopupManager class is only accessible via a context property called platformPopupManager. The popup manager has a popupStackDepth property, which holds the number of open popups.

A popup is generic term for modal, non-fullscreen components such as Menu, ContextMenu, Dialog, QueryDialog and SelectionDialog.

The popup manager is especially useful in cases where the application is controlling the active focus in an environment where hardware keys are used. With the popup manager, an application can decide where to restore the active focus whenever there are no more popups visible.

The following example shows how the amount of open popups can be tracked using the popup manager. The example includes a Button which can be used to open two QueryDialog components.

 import QtQuick 1.1
 import com.nokia.symbian 1.1

 Window {

     Button {
         text: "Open dialogs"
         onClicked: {
             dialog1.open()
             dialog2.open()
         }
     }

     QueryDialog {
         id: dialog1
         titleText: "Dialog 1"
         acceptButtonText: "Close"
         message: "Popup count: " + platformPopupManager.popupStackDepth
     }

     QueryDialog {
         id: dialog2
         titleText: "Dialog 2"
         acceptButtonText: "Close"
         message: "Popup count: " + platformPopupManager.popupStackDepth
     }
 }

Property Documentation

popupStackDepth : int

Returns the depth of the popup stack, in other words how many popups are currently open. 0 means that there are no open popups.