Time for action – Adding states to the form

Open the CalculatorForm.ui.qml file in the form editor. The bottom part of the main area contains the states editor. The base state item is always present on the left. Click on the Add a new state button on the right of the states editor. A new state will appear in the editor. It contains a text field that you can use to set the state's name. Set the name to single_argument.

Only one of the states can be selected at a time. When a custom state is selected, any changes in the form editor will only affect the selected state. When the base state is selected, you can edit the base state and all the changes will affect all other states unless the changed property is overridden in some state.

Select the ...

Get Game Programming using Qt 5 Beginner's Guide - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.