summaryrefslogtreecommitdiffstats
path: root/src/corelib/serialization/qjsonvalue.h
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@qt.io>2019-10-21 10:26:45 +0200
committerAllan Sandfeld Jensen <allan.jensen@qt.io>2019-11-05 10:12:04 +0100
commitedec095cf80b62057116ce75c581b5ca5866bdcc (patch)
treea849983cff625c80f9386865988f32ad552837cd /src/corelib/serialization/qjsonvalue.h
parente99b0016e8b639e40d5330e0c3eaa199b48e34f4 (diff)
Fix 64-bit integer support in QtJSON
Fixes parsing writing and pass-through of integers with higher precision than double can handle. Note this adds extra precision compared to JavaScript, but the JSON files read and written this way are still valid, and the extra precision in reading and writing this way is used by many JSON libraries. Fixes: QTBUG-28560 Change-Id: I30b2415c928d1c34c8cb4e4c6218602095e7e8aa Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/corelib/serialization/qjsonvalue.h')
-rw-r--r--src/corelib/serialization/qjsonvalue.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/corelib/serialization/qjsonvalue.h b/src/corelib/serialization/qjsonvalue.h
index 5adcd641768..bd8bf14baf8 100644
--- a/src/corelib/serialization/qjsonvalue.h
+++ b/src/corelib/serialization/qjsonvalue.h
@@ -112,6 +112,7 @@ public:
bool toBool(bool defaultValue = false) const;
int toInt(int defaultValue = 0) const;
+ qint64 toInteger(qint64 defaultValue = 0) const;
double toDouble(double defaultValue = 0) const;
QString toString() const;
QString toString(const QString &defaultValue) const;