[Interest] JS numbers to qint64
Jean-Michaël Celerier
jeanmichael.celerier at gmail.com
Wed Jul 12 11:57:39 CEST 2017
JS numbers are stored as double AFAIK hence for big numbers the lowest bits
will be less precise.
-------
Jean-Michaël Celerier
http://www.jcelerier.name
On Wed, Jul 12, 2017 at 11:53 AM, Shantanu Tushar <shaan7in at gmail.com>
wrote:
> Hi,
>
> I'm trying to call a slot which accepts a qint64 as an argument-
>
> class Foo : public QObject
> {
> Q_OBJECT
> public slots:
> void open(qint64 id) {
> qDebug() << "Opening" << id;
> }
> };
>
> from QML-
>
> onClicked: {
> console.log("Opening " + userId);
> foo.open(userId);
> }
>
> and I see this output-
>
> qml: Opening 5762702576189441
> Opening 5762702576189442
>
> As you can see the number changes. What am I doing wrong?
>
> --
> Shantanu Tushar (UTC +0530)
> shantanu.io
>
> _______________________________________________
> Interest mailing list
> Interest at qt-project.org
> http://lists.qt-project.org/mailman/listinfo/interest
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20170712/23ba0d3a/attachment.html>
More information about the Interest
mailing list