popupUtils QML Type

Popover utility functions. More...

Import Statement: import Lomiri.Components.Popups 1.3

Methods

Detailed Description

Method Documentation

close(popupObject)

Closes (hides and destroys) the given popup.

import Lomiri.Components 1.3
import Lomiri.Components.Popups 1.3

Button {
    onClicked: PopupUtils.close(popup)
}

open(popup, caller, params)

The function creates and shows a popup object from either a Component or URL of a QML document. The caller drives the placement of the popup as well as the pointer's. The third parameter (param) can hold a series of properties configuring the popup to be opened. This can be any property defined by the popups and additional custom ones defined in derived popups.

caller should be given when a ComposerSheet or Dialog is specified using a URL and opened inside a Window. If not, the application's root item will be the dismiss area.

Returns a popup object, which can be closed using close.

Note that popups created from a file or component will be created as children of the root item. If that's not a good choice, a MainWindow used as the root item can set the visualRoot property an arbitrary Item that acts as the parent of all popups.

import Lomiri.Components 1.3
import Lomiri.Components.Popups 1.3

Button {
    onClicked: PopupUtils.open(popoverComponent, popoverButton, { 'dummy': true } )
}

See Popover, ComposerSheet and Dialog for their respective documentation and more examples.