how we can use qml as a class with some method and property in our app?
-
hi, i want to use myclass.qml for defining "myclass" class,with some property and some method in qml;
myclass.qmlimport quick 2.0 Window{id:myclass property1=1; property2=2; ... function f1(){} function f2(){} function f3(){} .......... }
in main.qml i want to detect myclass detect for example:
when i write these source:myclass.f1(); myclass.property1();
i can execute and run in my main.qml file.
can any one help me?
thanks for reply. -
for more info, how main.qml can inheritance from myclass.qml?????????
i write in main.qml this type.myclass{id:class1;}
but the methods and the propery is undefined in main.qml!!!!!
can any help me?
i.e. when in my main.qml i writevar x:class1.f1();
the result is :
f1 is not defined.
-
i after examine the qml i concluded that we define objects in myclass.qml,and for calling in my main.qml we define type:
myclass{.....}
this type inherited functions and attributes from myclass.qml and we can use it only in our main.qml file
thanks for attention