diff options
author | Alex Blasche <alexander.blasche@qt.io> | 2018-12-17 13:34:04 +0100 |
---|---|---|
committer | Alex Blasche <alexander.blasche@qt.io> | 2018-12-21 10:48:29 +0000 |
commit | 100e0416e7faff954221df9ef97920ba512712c0 (patch) | |
tree | 25237ea3913a3ac053f8b897e4b6ac6aead74968 | |
parent | 550abd7159306e5e68f3b73f70319d9fa19bd186 (diff) | |
download | qtlocation-100e0416e7faff954221df9ef97920ba512712c0.tar.gz |
Register QGeoCoordinate debug streaming operator
This enables the following code:
QGeoCoordinate coord(foo, bar);
QVariant v; v.setValue(coord)
qDebug() << v;
Change-Id: I3cc66c359d6be8b8ab9471170ae8763e08c3b3e9
Reviewed-by: Paolo Angelelli <paolo.angelelli@qt.io>
-rw-r--r-- | src/positioning/qgeocoordinate.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/positioning/qgeocoordinate.cpp b/src/positioning/qgeocoordinate.cpp index 414125ca..f3d3ef9c 100644 --- a/src/positioning/qgeocoordinate.cpp +++ b/src/positioning/qgeocoordinate.cpp @@ -50,16 +50,21 @@ QT_BEGIN_NAMESPACE -#ifndef QT_NO_DATASTREAM + struct CoordinateStreamOperators { CoordinateStreamOperators() { +#ifndef QT_NO_DATASTREAM qRegisterMetaTypeStreamOperators<QGeoCoordinate>(); +#endif +#ifndef QT_NO_DEBUG_STREAM + QMetaType::registerDebugStreamOperator<QGeoCoordinate>(); +#endif } }; Q_GLOBAL_STATIC(CoordinateStreamOperators, initStreamOperators); -#endif + static const double qgeocoordinate_EARTH_MEAN_RADIUS = 6371.0072; |