EForm Form
Examples
Form
Form
Properties
columnSpacingintGap between content, columns, rows or text in pixels.
spacingcontentDataaliasContent slot; declare QML child objects directly inside the component.
Alias: formGrid.datadisabledboolDisable controls in this configuration scope or form.
falseenabledboolAllow interaction; false disables the control.
truefocusFirstErrorboolFocus the first invalid field after validation fails.
trueheightrealComponent size in pixels; may be bound to its parent layout.
implicitHeighthideRequiredAsteriskboolHide the required-field asterisk.
falseinlineboolUse inline form layout.
falseinlineMessageboolDisplay validation messages inline.
falselabelPositionstringPosition of the form label.
left
right
top
"top"labelSuffixstringText appended to labels.
""labelWidthintLabel width in pixels.
0modelvarComponent data source; item structure follows the current example and component contract.
nullrequiredAsteriskPositionstringPosition of the required marker relative to the label.
"left" / "right"
"left"rulesvarValidation rule object keyed by field.
Fields:
required, whitespace, type
len, min, max
pattern, enum, oneOf
validator, transform, message
trigger
({})showMessageboolShow validation messages.
truesizeintControl size; inherits the nearest EConfigProvider by default.
EStyle.SmallEStyle.MediumEStyle.Large
Inherited; EStyle.Medium by defaultspacingintGap between content, columns, rows or text in pixels.
18validateOnChangeboolValidate automatically when a field value changes.
falsevalidateOnRuleChangeboolValidate automatically when rules change.
truevisibleboolWhether the component is visible.
truewidthrealComponent size in pixels; may be bound to its parent layout.
implicitWidthfieldsvarRead onlyRegistered field items in the form.
Computed at runtimefirstInvalidItemvarRead onlyFirst invalid field item in the form.
Computed at runtimevalidboolRead onlyWhether QR encoding or form validation is valid.
Computed at runtimevalidatingboolRead onlyWhether asynchronous form validation is running.
Computed at runtimeSignals
submitted(bool valid, var model)Emitted after submit validation completes; valid is the result and model is the submitted form data.
validationFinished(bool valid, var firstInvalidItem)Emitted after form validation; valid is the result and firstInvalidItem is the first invalid field.
fieldValidated(string prop, bool valid, string message)Emitted after validating a field; prop is its path, valid is the result, and message is the validation message.
Methods
clearValidation(props)Clear validation messages and state without changing field values.
modelValue(prop)Return the form model value at path prop.
validateAsync(callback)Run asynchronous validation and receive the result through callback.
setModelValue(prop, value)Update the form model value at path prop.
validate(callback)Validate the current data; components supporting callback pass the result to that callback.
submit()Validate the form and emit submitted with the validation result and form data.
getField(prop)Return the form field component identified by prop.
validateField(props, callback, trigger)Validate the fields specified by props; callback receives the result and trigger optionally limits the validation trigger.
setInitialValues(valuesOrProps)Set initial form values for subsequent resetFields calls.
resetFields(props)Reset fields specified by props to their initial values and clear validation; omit props to reset all fields.
clearValidate(props)Clear validation messages and state without changing current data.
scrollToField(prop)Scroll the field identified by prop into view.