Thanks, Yes, that was exatctly my point. Looks like the only real solution is "real".
 
Sent: Sunday, September 16, 2018 at 4:09 AM
From: "Stanislas RENAN" <qt-proj...@renan.org>
To: interest@qt-project.org
Subject: Re: [Interest] QML int not big enough

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 ?
property real now: new Date().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
_______________________________________________
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest

Reply via email to