
Check out this quick tour to find the best demos and examples for you, and to see how the Felgo SDK can help you to develop your next app or game!
A dialog with custom content and one or two buttons. More...
Import Statement: | import Felgo 3.0 |
Dialog is a container type for displaying a modal dialog on the screen. It displays customizable content and one or two buttons, for positive and negative actions.
Dialog displays no content other than a title text and one or two buttons by default. To display simply a text message or text input, InputDialog can be used for convenience.
For example, to display a Dialog with an AppImage, the following code can be used:
App { Page { AppButton { anchors.centerIn: parent text: "Custom Dialog" onClicked: customDialog.open() } Dialog { id: customDialog title: "Do you think this is awesome?" positiveActionLabel: "Yes" negativeActionLabel: "No" onCanceled: title = "Think again!" onAccepted: close() AppImage { //will be placed inside the dialogs content area anchors.fill: parent source: "../assets/vplay-logo.png" fillMode: Image.PreserveAspectFit } } } }
autoSize : bool |
If set to true
, the Dialog height will resize based on the content Items within your dialog, the default value is false
. Your content items require a fixed height in this case and can not
calculate it's size or position based on the Dialog height.
This property was introduced in Felgo 2.12.0.
isOpen : bool |
True, when the dialog is currently open. Changing this property has no effect, call Dialog::open() and Dialog::close() instead..
mainWindow : var |
negativeAction : bool |
Set to true
if a negative action button should be visible, with the text negativeActionLabel, which calls canceled signal on click.
negativeActionLabel : string |
Text for the negativeAction button.
Allows to change properties of the opacity animation when showing or closing the dialog.
This property was introduced in Felgo 2.10.0.
See also scaleAnimation.
outsideTouchable : bool |
Set this to true
, to make the Dialog close, when the user touches the screen outside of it.
positiveAction : bool |
Set to true
if a positive action button should be visible, with the text positiveActionLabel, which calls accepted signal on click.
positiveActionLabel : string |
Text for the positiveAction button.
Allows to change properties of the scale animation when showing or closing the dialog.
This property was introduced in Felgo 2.10.0.
See also opacityAnimation.
title : string |
Title text displayed on top of the dialog.
This property is used to display a divider below the dialog title. It uses the ThemeDialog::dividerHeight and ThemeDialog::dividerColor properties. The default value is false
.
You can also set this globally for all dialogs using the ThemeDialog::titleDividerVisible property.
This property was introduced in Felgo 3.3.0.
titleItem : AppText |
Alias to the AppText item used for the title. Use this for advanced customization.
This property was introduced in Felgo 3.3.0.
Called, when the positive action button was clicked. The Dialog will not close automatically when this signal is emitted.
Called, when the negative action button was clicked. The Dialog will not close automatically when this signal is emitted.
Called, when the dialog has been closed and is fully hidden.
This signal was introduced in Felgo 2.10.0.
See also close().
Closes the dialog.
Returns true if it has been closed, and was not already closed before the call.
Opens the dialog.
Returns true if it has been opened, and was not already opened before the call.