summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--demos/mediaplayer/mediaplayer.pro2
-rw-r--r--examples/draganddrop/delayedencoding/delayedencoding.pro2
-rw-r--r--examples/draganddrop/draggableicons/draggableicons.pro2
-rw-r--r--examples/draganddrop/draggabletext/draggabletext.pro2
-rw-r--r--examples/draganddrop/puzzle/puzzle.pro1
-rw-r--r--examples/mainwindows/menus/menus.pro2
-rw-r--r--examples/network/securesocketclient/securesocketclient.pro2
-rw-r--r--examples/painting/svggenerator/svggenerator.pro2
-rw-r--r--examples/phonon/capabilities/capabilities.pro2
-rw-r--r--examples/phonon/musicplayer/musicplayer.pro1
-rw-r--r--src/corelib/global/qglobal.h5
-rw-r--r--tests/auto/qvariant/tst_qvariant.cpp26
12 files changed, 49 insertions, 0 deletions
diff --git a/demos/mediaplayer/mediaplayer.pro b/demos/mediaplayer/mediaplayer.pro
index 001989d..ef07a3f 100644
--- a/demos/mediaplayer/mediaplayer.pro
+++ b/demos/mediaplayer/mediaplayer.pro
@@ -26,3 +26,5 @@ DEPLOYMENT_PLUGIN += phonon_ds9 phonon_waveout
}
include($$QT_SOURCE_TREE/demos/demobase.pri)
+
+symbian:TARGET.UID3 = 0xA000C613 \ No newline at end of file
diff --git a/examples/draganddrop/delayedencoding/delayedencoding.pro b/examples/draganddrop/delayedencoding/delayedencoding.pro
index c7b95b6..7315ac5 100644
--- a/examples/draganddrop/delayedencoding/delayedencoding.pro
+++ b/examples/draganddrop/delayedencoding/delayedencoding.pro
@@ -12,3 +12,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/draganddrop/delayedencoding
sources.files = $$SOURCES $$HEADERS *.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/itemviews/delayedencoding
INSTALLS += target sources
+
+symbian:TARGET.UID3 = 0xA000C614 \ No newline at end of file
diff --git a/examples/draganddrop/draggableicons/draggableicons.pro b/examples/draganddrop/draggableicons/draggableicons.pro
index 5212abc..6d53baa 100644
--- a/examples/draganddrop/draggableicons/draggableicons.pro
+++ b/examples/draganddrop/draggableicons/draggableicons.pro
@@ -10,3 +10,5 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/draganddrop/draggableicons
INSTALLS += target sources
include($$QT_SOURCE_TREE/examples/examplebase.pri)
+
+symbian:TARGET.UID3 = 0xA000C615 \ No newline at end of file
diff --git a/examples/draganddrop/draggabletext/draggabletext.pro b/examples/draganddrop/draggabletext/draggabletext.pro
index 109be5d..15d909d 100644
--- a/examples/draganddrop/draggabletext/draggabletext.pro
+++ b/examples/draganddrop/draggabletext/draggabletext.pro
@@ -12,3 +12,5 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/draganddrop/draggabletext
INSTALLS += target sources
include($$QT_SOURCE_TREE/examples/examplebase.pri)
+
+symbian:TARGET.UID3 = 0xA000CF64 \ No newline at end of file
diff --git a/examples/draganddrop/puzzle/puzzle.pro b/examples/draganddrop/puzzle/puzzle.pro
index e51eb78..ecaf706 100644
--- a/examples/draganddrop/puzzle/puzzle.pro
+++ b/examples/draganddrop/puzzle/puzzle.pro
@@ -19,6 +19,7 @@ symbian:{
addFile.sources = example.jpg
addFile.path = .
DEPLOYMENT += addFile
+ TARGET.UID3 = 0xA000CF65
}
wince*: {
addFile.sources = example.jpg
diff --git a/examples/mainwindows/menus/menus.pro b/examples/mainwindows/menus/menus.pro
index 448e779..8cf60bf 100644
--- a/examples/mainwindows/menus/menus.pro
+++ b/examples/mainwindows/menus/menus.pro
@@ -9,3 +9,5 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/mainwindows/menus
INSTALLS += target sources
include($$QT_SOURCE_TREE/examples/examplebase.pri)
+
+symbian:TARGET.UID3 = 0xA000CF66 \ No newline at end of file
diff --git a/examples/network/securesocketclient/securesocketclient.pro b/examples/network/securesocketclient/securesocketclient.pro
index 166d7ad..2e9141d 100644
--- a/examples/network/securesocketclient/securesocketclient.pro
+++ b/examples/network/securesocketclient/securesocketclient.pro
@@ -16,3 +16,5 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/network/securesocketclient
INSTALLS += target sources
include($$QT_SOURCE_TREE/examples/examplebase.pri)
+
+symbian:TARGET.UID3 = 0xA000CF67 \ No newline at end of file
diff --git a/examples/painting/svggenerator/svggenerator.pro b/examples/painting/svggenerator/svggenerator.pro
index 4d08ba4..1134619 100644
--- a/examples/painting/svggenerator/svggenerator.pro
+++ b/examples/painting/svggenerator/svggenerator.pro
@@ -13,3 +13,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/painting/svggenerator
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS svggenerator.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/painting/svggenerator
INSTALLS += target sources
+
+symbian:TARGET.UID3 = 0xA000CF68 \ No newline at end of file
diff --git a/examples/phonon/capabilities/capabilities.pro b/examples/phonon/capabilities/capabilities.pro
index 29d7501..7f1ca76 100644
--- a/examples/phonon/capabilities/capabilities.pro
+++ b/examples/phonon/capabilities/capabilities.pro
@@ -9,3 +9,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/phonon/capabilities
sources.files = $$SOURCES $$HEADERS capabilities.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/phonon/capabilities
INSTALLS += target sources
+
+symbian:TARGET.UID3 = 0xA000CF69 \ No newline at end of file
diff --git a/examples/phonon/musicplayer/musicplayer.pro b/examples/phonon/musicplayer/musicplayer.pro
index 0a93dc2..e17d29c 100644
--- a/examples/phonon/musicplayer/musicplayer.pro
+++ b/examples/phonon/musicplayer/musicplayer.pro
@@ -14,3 +14,4 @@ wince*{
DEPLOYMENT_PLUGIN += phonon_ds9 phonon_waveout
}
+symbian:TARGET.UID3 = 0xA000CF6A \ No newline at end of file
diff --git a/src/corelib/global/qglobal.h b/src/corelib/global/qglobal.h
index 27aaac1..b075db6 100644
--- a/src/corelib/global/qglobal.h
+++ b/src/corelib/global/qglobal.h
@@ -1055,8 +1055,13 @@ inline T qAbs(const T &t) { return t >= 0 ? t : -t; }
inline int qRound(qreal d)
{ return d >= 0.0 ? int(d + 0.5) : int(d - int(d-1) + 0.5) + int(d-1); }
+#if defined(QT_NO_FPU) || defined(QT_ARCH_ARM) || defined(QT_ARCH_WINDOWSCE) || defined(QT_ARCH_SYMBIAN)
+inline qint64 qRound64(double d)
+{ return d >= 0.0 ? qint64(d + 0.5) : qint64(d - qint64(d-1) + 0.5) + qint64(d-1); }
+#else
inline qint64 qRound64(qreal d)
{ return d >= 0.0 ? qint64(d + 0.5) : qint64(d - qint64(d-1) + 0.5) + qint64(d-1); }
+#endif
template <typename T>
inline const T &qMin(const T &a, const T &b) { if (a < b) return a; return b; }
diff --git a/tests/auto/qvariant/tst_qvariant.cpp b/tests/auto/qvariant/tst_qvariant.cpp
index d15f9c8..9c9ff33 100644
--- a/tests/auto/qvariant/tst_qvariant.cpp
+++ b/tests/auto/qvariant/tst_qvariant.cpp
@@ -255,6 +255,7 @@ private slots:
void convertByteArrayToBool() const;
void convertByteArrayToBool_data() const;
void toIntFromQString() const;
+ void toIntFromDouble() const;
};
Q_DECLARE_METATYPE(QDate)
@@ -2909,5 +2910,30 @@ void tst_QVariant::toIntFromQString() const
QVERIFY(ok);
}
+/*!
+ We verify that:
+ 1. Conversion from (64 bit) double to int works (no overflow).
+ 2. Same conversion works for QVariant::convert.
+
+ Rationale: if 2147483630 is set in float and then converted to int,
+ there will be overflow and the result will be -2147483648.
+
+ See task 250267.
+ */
+void tst_QVariant::toIntFromDouble() const
+{
+ double d = 2147483630; // max int 2147483647
+ QVERIFY((int)d == 2147483630);
+
+ QVariant var(d);
+ QVERIFY( var.canConvert( QVariant::Int ) );
+
+ bool ok;
+ int result = var.toInt(&ok);
+
+ QVERIFY( ok == true );
+ QCOMPARE(result, 2147483630);
+}
+
QTEST_MAIN(tst_QVariant)
#include "tst_qvariant.moc"