January 2018
Intermediate to advanced
486 pages
11h 28m
English
Responding to user actions and events in QML code is done by adding scripts to slots of the items, in quite a similar way to Qt Widgets. The major difference here is that each signal defined internally within a QML type also has a corresponding slot for it which is automatically generated and can be filled with a script to perform an action when the relevant signal is emitted. Well, let's see this with another example. A QML Button type has a pressed signal. This automatically means that there is an onPressed slot that you can use to code the required action of the specific button. Here's an example code:
Button
{
onPressed:
{
// code goes here
}
}
For a list of available slots in QML types, you can ...