
Global object for invoking native system dialogs. More...
Import Statement: | import Felgo 4.0 |
Inherits: |
NativeDialog allows to invoke native system dialogs and may be used to confirm a user action or to request a text input from the user. NativeDialog is a global object, and can be used without creating additional QML objects.
As an alternative to invoking a native dialog, InputDialog may be used to show a QML based dialog. It also supports multi-line text input. If you want to show a dialog with custom content, use the Dialog component.
The confirm dialog has a title and can display a message. The dialog can be canceled or accepted:
AppButton { id: confirmBtn text: "Confirm Dialog" onClicked: NativeDialog.confirm("Please Confirm", "Confirm this action?", function(ok) { if(ok) { confirmBtn.text = "Confirmed!" } }) }
The input dialog allows to enter text and may either be cancelled or accepted:
AppButton { id: inputBtn text: "Input Dialog" onClicked: { NativeDialog.inputText("Quick Question", "What do you think?", "Input here", "", function(ok, text) { if(ok) { inputBtn.text = "Input: " + text } }) } }
Invokes the native confirm dialog with two buttons to cancel or accept. The optional allowCancel parameter is true
by default and may be used to display a dialog with no cancel option.
The callback function will be called when one of the buttons is clicked. It receives a bool
value as a parameter. It is set to true
if the user chose to accept.
Invokes a native input dialog that holds a text field and two buttons to cancel or accept. The text and placeholder parameter set the initial text of the input field and the placeholder text if it is empty.
The callback function will be called when one of the buttons is clicked. It receives a bool
value as the first and a string
as the second parameter. The first parameter is set to
true
if the user chose to accept. The second parameter holds the entered text.
As part of the free Business evaluation, we offer a free welcome call for companies, to talk about your requirements, and how the Felgo SDK & Services can help you. Just sign up and schedule your call.
Sign up now to start your free Business evaluation: