Hi,

Le 15/09/2018 à 22:30, Jason H a écrit :
Item {
     property int now: 0 // will be new Date().getTime() // milliseconds since 
epoch is 64 bit
     property var now: new Date().getTime() // this gives me a parning of "use 
int or real to improve performance (M311)
}

How can I use the right type and not get the warning?
Why not use real as the warning says ?
propertyrealnow:newDate().getTime()

Do not store the 64 bit value in an int as it overflows (getTime() returns around 1537084902522 right now).
http://doc.qt.io/qt-5/qml-int.html
https://stackoverflow.com/questions/25709429/qt-qml-int-overflow

Best regards,
--
Stanislas RENAN

_______________________________________________
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest

Reply via email to