[Qt-interest] Is the bug for QtScript when deal the ULongLong num?
lvbing lvbing
lvbing1981 at gmail.com
Tue Jun 8 04:59:30 CEST 2010
Hi all:
My Platform is WinXp + Qt4.5.3 + VS2008.
I find an error when the QtScriptEngine evaluate the QtScript like this:
id = 10696049421123587;
slotHandle.DealULongLong(id);
at first I want the parameter id in the slot function DealULongLong is also
the value 10696049421123587.
But the result is not I want.
The slot function DealUlongLong is defined like the follow class:
class MScriptHandle : public QObject
{
Q_OBJECT
public:
MScriptHandle(QObject *parent = 0);
~MScriptHandle();
public slots:
QString DealULongLong(qint64 id);
QString DealQString(QString& id);
};
QString MScriptHandle::DealULongLong(qint64 id)
{
QString strId;
strId.setNum(id);
qDebug("[MScriptHandle::DealULongLong]The id is
%s",strId.toAscii().data());
return strId;
}
but when I dubugger in my IDE ,I find the id is not the value defined in my
script.
The left is the script I input ,and the right is the id in the slot
function:
id = 10696049421123580; [MScriptHandle::DealULongLong]The id is
10696049421123580
id = 10696049421123581; [MScriptHandle::DealULongLong]The id is
10696049421123580
id = 10696049421123582; [MScriptHandle::DealULongLong]The id is
10696049421123582
id = 10696049421123583; [MScriptHandle::DealULongLong]The id is
10696049421123584
id = 10696049421123584; [MScriptHandle::DealULongLong]The id is
10696049421123584
id = 10696049421123585; [MScriptHandle::DealULongLong]The id is
10696049421123584
id = 10696049421123586; [MScriptHandle::DealULongLong]The id is
10696049421123586
id = 10696049421123587; [MScriptHandle::DealULongLong]The id is
10696049421123588
id = 10696049421123588; [MScriptHandle::DealULongLong]The id is
10696049421123588
id = 10696049421123589; [MScriptHandle::DealULongLong]The id is
10696049421123588
id = 10696049421123590; [MScriptHandle::DealULongLong]The id is
10696049421123590
so is the bug in QtScript when deal the ULongLong number?
Thanks
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20100608/e8a829e6/attachment.html
More information about the Qt-interest-old
mailing list