summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFriedrich W. H. Kossebau <kossebau@kde.org>2016-08-15 17:09:13 (GMT)
committerFriedrich W. H. Kossebau <kossebau@kde.org>2016-08-15 17:09:13 (GMT)
commit4b3a1b84c44293c63a62252259b7f3f39d33f931 (patch)
tree4ba4c64af02764f889ced3c104d0a3b6e4a38d08
parent4eb9d675faba8cc872c13c8f6f611fc48364985f (diff)
Use existing QVariant constructors instead of QVariant::fromValue
-rw-r--r--examples/cpp/marble-game/ClickOnThat.cpp2
-rw-r--r--examples/cpp/marble-game/CountryByFlag.cpp6
-rw-r--r--examples/cpp/marble-game/CountryByShape.cpp4
-rw-r--r--examples/cpp/marble-game/GameMainWindow.cpp4
-rw-r--r--src/lib/marble/declarative/MarbleQuickItem.cpp4
-rw-r--r--src/lib/marble/declarative/Routing.cpp12
-rw-r--r--src/lib/marble/routing/RoutingModel.cpp4
7 files changed, 18 insertions, 18 deletions
diff --git a/examples/cpp/marble-game/ClickOnThat.cpp b/examples/cpp/marble-game/ClickOnThat.cpp
index d696dd7..6ffed5a 100644
--- a/examples/cpp/marble-game/ClickOnThat.cpp
+++ b/examples/cpp/marble-game/ClickOnThat.cpp
@@ -237,7 +237,7 @@ void ClickOnThat::postQuestion( QObject *gameObject )
d->m_correctAnswer = point->coordinates();
if ( gameObject ) {
QMetaObject::invokeMethod( gameObject, "clickOnThatQuestion",
- Q_ARG(QVariant, QVariant::fromValue(placemark->name())) );
+ Q_ARG(QVariant, QVariant(placemark->name())) );
}
}
}
diff --git a/examples/cpp/marble-game/CountryByFlag.cpp b/examples/cpp/marble-game/CountryByFlag.cpp
index a209cdc..a9e5ddb 100644
--- a/examples/cpp/marble-game/CountryByFlag.cpp
+++ b/examples/cpp/marble-game/CountryByFlag.cpp
@@ -157,9 +157,9 @@ void CountryByFlag::postQuestion( QObject *gameObject )
}
if ( gameObject ) {
QMetaObject::invokeMethod( gameObject, "countryByFlagQuestion",
- Q_ARG(QVariant, QVariant::fromValue(answerOptions)),
- Q_ARG(QVariant, QVariant::fromValue(flagPath)),
- Q_ARG(QVariant, QVariant::fromValue(placemark->name())) );
+ Q_ARG(QVariant, QVariant(answerOptions)),
+ Q_ARG(QVariant, QVariant(flagPath)),
+ Q_ARG(QVariant, QVariant(placemark->name())) );
}
}
diff --git a/examples/cpp/marble-game/CountryByShape.cpp b/examples/cpp/marble-game/CountryByShape.cpp
index a0d1a34..3a838d8 100644
--- a/examples/cpp/marble-game/CountryByShape.cpp
+++ b/examples/cpp/marble-game/CountryByShape.cpp
@@ -252,8 +252,8 @@ void CountryByShape::postQuestion( QObject *gameObject )
if ( gameObject ) {
QMetaObject::invokeMethod( gameObject, "countryByShapeQuestion",
- Q_ARG(QVariant, QVariant::fromValue(answerOptions)),
- Q_ARG(QVariant, QVariant::fromValue(placemark->name())) );
+ Q_ARG(QVariant, QVariant(answerOptions)),
+ Q_ARG(QVariant, QVariant(placemark->name())) );
}
}
diff --git a/examples/cpp/marble-game/GameMainWindow.cpp b/examples/cpp/marble-game/GameMainWindow.cpp
index 8c66cd1..783ea4b 100644
--- a/examples/cpp/marble-game/GameMainWindow.cpp
+++ b/examples/cpp/marble-game/GameMainWindow.cpp
@@ -263,7 +263,7 @@ void MainWindow::displayResult(bool result )
QObject *gameObject = d->m_view.rootObject()->findChild<QObject*>("gameOptions");
if ( gameObject ) {
QMetaObject::invokeMethod( gameObject, "displayResult",
- Q_ARG(QVariant, QVariant::fromValue(result)) );
+ Q_ARG(QVariant, QVariant(result)) );
}
}
@@ -279,7 +279,7 @@ void MainWindow::resizeEvent(QResizeEvent* event)
if ( root ) {
QMetaObject::invokeMethod( root, "resizeWindow",
- Q_ARG(QVariant, QVariant::fromValue(size.height()*9/10)) );
+ Q_ARG(QVariant, QVariant(size.height()*9/10)) );
}
}
diff --git a/src/lib/marble/declarative/MarbleQuickItem.cpp b/src/lib/marble/declarative/MarbleQuickItem.cpp
index 11ce7d7..18806a0 100644
--- a/src/lib/marble/declarative/MarbleQuickItem.cpp
+++ b/src/lib/marble/declarative/MarbleQuickItem.cpp
@@ -285,8 +285,8 @@ namespace Marble
const bool visible = d->m_map.viewport()->screenCoordinates(d->m_placemark->placemark().coordinate(), x, y);
d->m_placemarkItem->setVisible(visible);
if (visible) {
- d->m_placemarkItem->setProperty("xPos", QVariant::fromValue(x));
- d->m_placemarkItem->setProperty("yPos", QVariant::fromValue(y));
+ d->m_placemarkItem->setProperty("xPos", QVariant(x));
+ d->m_placemarkItem->setProperty("yPos", QVariant(y));
}
}
diff --git a/src/lib/marble/declarative/Routing.cpp b/src/lib/marble/declarative/Routing.cpp
index f17e609..d242c57 100644
--- a/src/lib/marble/declarative/Routing.cpp
+++ b/src/lib/marble/declarative/Routing.cpp
@@ -136,7 +136,7 @@ void Routing::updateWaypointItems()
for (int i = d->m_waypointItems.keys().size()-1; i >= d->m_routeRequestModel->rowCount(); i--) {
QQuickItem* item = d->m_waypointItems[i];
- item->setProperty("visible", QVariant::fromValue(false) );
+ item->setProperty("visible", QVariant(false) );
d->m_waypointItems.erase(d->m_waypointItems.find(i));
item->deleteLater();
}
@@ -153,8 +153,8 @@ void Routing::updateWaypointItems()
if ( item ) {
item->setVisible( visible );
if ( visible ) {
- item->setProperty("xPos", QVariant::fromValue(x));
- item->setProperty("yPos", QVariant::fromValue(y));
+ item->setProperty("xPos", QVariant(x));
+ item->setProperty("yPos", QVariant(y));
if (iter.key() == 0 && waypointCount() == 1) {
item->setProperty("type", QVariant(QStringLiteral("departure")));
}
@@ -223,7 +223,7 @@ void Routing::updateSearchResultPlacemarks()
for (int i = d->m_searchResultItems.keys().size()-1; i >= d->m_searchResultPlacemarks.size(); i--) {
QQuickItem* item = d->m_searchResultItems[i];
- item->setProperty("visible", QVariant::fromValue(false) );
+ item->setProperty("visible", QVariant(false) );
d->m_searchResultItems.erase(d->m_searchResultItems.find(i));
item->deleteLater();
}
@@ -239,8 +239,8 @@ void Routing::updateSearchResultPlacemarks()
if ( item ) {
item->setVisible( visible );
if ( visible ) {
- item->setProperty("xPos", QVariant::fromValue(x));
- item->setProperty("yPos", QVariant::fromValue(y));
+ item->setProperty("xPos", QVariant(x));
+ item->setProperty("yPos", QVariant(y));
}
}
}
diff --git a/src/lib/marble/routing/RoutingModel.cpp b/src/lib/marble/routing/RoutingModel.cpp
index a7894a7..234893f 100644
--- a/src/lib/marble/routing/RoutingModel.cpp
+++ b/src/lib/marble/routing/RoutingModel.cpp
@@ -138,10 +138,10 @@ QVariant RoutingModel::data ( const QModelIndex & index, int role ) const
return QVariant::fromValue( segment.maneuver().position() );
break;
case RoutingModel::LongitudeRole:
- return QVariant::fromValue( segment.maneuver().position().longitude( GeoDataCoordinates::Degree ) );
+ return QVariant(segment.maneuver().position().longitude(GeoDataCoordinates::Degree));
break;
case RoutingModel::LatitudeRole:
- return QVariant::fromValue( segment.maneuver().position().latitude( GeoDataCoordinates::Degree ) );
+ return QVariant(segment.maneuver().position().latitude(GeoDataCoordinates::Degree));
break;
case RoutingModel::TurnTypeIconRole:
return segment.maneuver().directionPixmap();