Quantcast
Channel: Qt DevNet forums: Qt Quick 1283365070**
Viewing all articles
Browse latest Browse all 4972

Defining own QML type - can i define method ?

$
0
0
Hi, i was wondering about how i can define own C++ methods for QML component. class TimeModel : public QObject {     Q_OBJECT     Q_PROPERTY(int hour READ hour NOTIFY timeChanged)     Q_PROPERTY(int minute READ minute NOTIFY timeChanged)     ... This is code example from documentation. Thereis defined properties, but i want to define method to which i will call later in QML code, like this: TimeModel {  id: tm }   .. tm.someMethod() .. I didnt found Q_METHOD() in qt. Anny suggestions ??

Viewing all articles
Browse latest Browse all 4972

Trending Articles