c++ - QML: how to use Date function -


i trying develop first qml application. have control returns integer supposed year. check if value leap year.

the qdate class has isleapyear() static method wonder how can use within qml file.

something below using javascript/qml should work, assuming on qt5:

// myitem.qml item { function isleap(hyear) {     return ((hyear % 100 != 0) && (hyear % 4 == 0)) || (hyear % 400 == 0);   } } 

if want value , use in c++, need type cast values methods outlined in

http://doc.qt.io/qt-5/qtqml-cppintegration-data.html


Comments

Popular posts from this blog

Hatching array of circles in AutoCAD using c# -

ios - UITEXTFIELD InputView Uipicker not working in swift -