EMessageBox Message box
Examples
Message box
Properties
alignCenterboolCenter the layout or text.
Inherited; default trueautofocusboolFocus automatically when shown, subject to availability and popup lifecycle.
truebackgroundColorcolorBackground color.
Dynamic bindingbeforeClosevarCallback before closing; dialogs complete asynchronous checks through done(cancel).
function(action, instance, done) { done() }borderColorcolorBorder color.
Dynamic bindingbuttonSizeintSize of the action buttons.
EStyle.SmallEStyle.MediumEStyle.Large
EStyle.MediumcallbackvarMessage-box result callback receiving action type and input value.
nullcancelButtonLoadingboolShow loading state on the cancel or confirm button.
falsecancelButtonLoadingIconintIcon used by the component.
EIcons.*
0 (no icon)
0cancelStyleTypeintSemantic color style.
EStyle.DefaultEStyle.PrimaryEStyle.SuccessEStyle.InfoEStyle.WarningEStyle.Danger
EStyle.DefaultcancelTextstringCancel button text.
Localized textcenterboolCenter the layout or text.
falsecloseDelayintDelay, throttling or automatic close time in milliseconds; 0 means no delay or no timed close.
0closeIconintIcon used by the component.
EIcons.*
0 (no icon)
EIcons.XMARKcloseOnClickOutsideboolClose when clicking outside the popup.
truecloseOnEscapeboolAllow Escape to close the component.
trueclosePolicyenumAutomatic popup closing conditions; flags can be combined.
Popup.* (combine with |)
NoAutoClose
CloseOnPressOutside
CloseOnPressOutsideParent
CloseOnReleaseOutside
CloseOnReleaseOutsideParent
CloseOnEscape
Dynamic bindingconfirmButtonLoadingboolShow loading state on the cancel or confirm button.
falseconfirmButtonLoadingIconintIcon used by the component.
EIcons.*
0 (no icon)
0confirmStyleTypeintSemantic color style.
EStyle.DefaultEStyle.PrimaryEStyle.SuccessEStyle.InfoEStyle.WarningEStyle.Danger
EStyle.PrimaryconfirmTextstringConfirm button text.
Localized textcontentaliasContent slot; declare QML child objects directly inside the component.
Alias: dialogContent.datacontentComponentComponentComponent slot for custom body content; null uses the default content. See this page’s examples for delegate context.
nulldangerouslyUseHTMLStringboolInterpret content as rich text; enable only for trusted content.
falsedestroyOnCloseboolDestroy Component-loaded content after closing.
falsedialogRadiusrealCorner radius in pixels.
8distinguishCancelAndCloseboolDistinguish cancellation from other close actions.
falsedraggableboolEnable dragging of the object defined by the current component.
Inherited; default falseenabledboolAllow interaction; false disables the control.
trueenterDurationintAnimation or display duration in milliseconds; the component binding identifies its use.
220exitDurationintAnimation or display duration in milliseconds; the component binding identifies its use.
180focusboolWhether the popup requests focus.
autofocusfullscreenboolUse full-screen display or a full-window overlay.
falseheightrealComponent size in pixels; may be bound to its parent layout.
fullscreen && Overlay.overlay ? Overlay.overlay.height : implicitHeighticonSourceintIcon used by the component.
EIcons.*
0 (no icon)
0inputErrorMessagestringMessage shown for invalid message-box input.
""inputPatternvarRegular expression validating message-box input.
nullinputPlaceholderstringPlaceholder shown when the value is empty.
""inputTypestringInput type in the message box.
"text" / "textarea""password" / "number""email" / "tel""url"
"text"inputValidatorvarCustom message-box input validator returning a boolean or error text.
nullinputValuestringCurrent message-box input value.
""modalboolUse a modal popup that blocks interaction with underlying content.
truemodalOverlayColorcolorModal or non-modal overlay color.
Dynamic bindingmodalPenetrableboolAllow input to pass through the non-modal overlay.
falsemodelessOverlayColorcolorModal or non-modal overlay color.
Dynamic bindingopenDelayintDelay, throttling or automatic close time in milliseconds; 0 means no delay or no timed close.
0overflowboolAllow the dialog to be dragged beyond the window bounds.
Inherited; default falseroundButtonboolUse rounded pill button styling.
falseshowCancelButtonboolShow the cancel button.
trueshowCloseboolShow a close or remove button.
trueshowConfirmButtonboolShow the confirm button.
trueshowHeaderboolShow the header area.
trueshowInputboolShow numeric input or the message-box input area.
falsestyleTypeintSemantic color style.
EStyle.DefaultEStyle.PrimaryEStyle.SuccessEStyle.InfoEStyle.WarningEStyle.Danger
EStyle.DefaulttextstringDisplayed text.
""textColorcolorText color.
Dynamic bindingtitlestringTitle text.
""titleColorcolorTitle color.
Dynamic bindingtoprealDialog top position in pixels, used when not vertically centered.
0visibleboolWhether the component is visible.
truewidthrealComponent size in pixels; may be bound to its parent layout.
Dynamic bindingwindowMarginrealMinimum dialog margin from the window edges in pixels.
16loadedContentaliasRead onlyActual content item instantiated from a Component.
Alias: contentLoader.itemloadedMessageContentaliasRead onlyActual content item instantiated from a Component.
Alias: messageContentLoader.itemmaximumDialogWidthrealRead onlyMaximum dialog width after subtracting window margins.
Computed at runtimeSignals
closeRejected()Emitted when beforeClose rejects a close request.
openAutoFocused()Emitted after the popup opens and finishes focusing its content.
closeAutoFocused()Emitted after the popup closes and restores focus.
canceled()Emitted when the current operation is cancelled.
confirmed(string value)Emitted on confirmation; value, when present, is the confirmed value.
completed(string action, string value)Emitted when the message box finishes; action is the closing action and value is the input text.
Methods
close()Close the component panel or popup.
open()Open the component panel or popup.
resetPosition()Restore the dialog to its initial position.
requestClose()Request popup closure and run the beforeClose check.
reject()Cancel the current confirmation.
accept()Confirm the current action; invalid input is not submitted.
alert(message, heading)Show an alert message box with message and heading.
confirm(message, heading)Show a confirmation message box with message and heading.
prompt(message, heading, initialValue)Show a prompt with message, heading, and initialValue.