Commit 1f0191cd authored by Torsten Rahn's avatar Torsten Rahn Committed by Torsten Rahn
Browse files

Replace qVariantFromValue by QVariant::fromValue and remove some other deprecated API.

parent 345e516c
......@@ -62,7 +62,7 @@ void MarbleTest::timeDemo()
}
}
qDebug( "Timedemo finished in %ims", t.elapsed() );
qDebug( "Timedemo finished in %ims", static_cast<int>(t.elapsed()));
qDebug() << QString("= %1 fps").arg(200*1000/(qreal)(t.elapsed()));
}
......@@ -170,7 +170,7 @@ QVariant TargetModel::currentLocationData ( int role ) const
case Qt::DisplayRole: return tr( "Current Location: %1" ).arg( currentLocation.toString() ) ;
case Qt::DecorationRole: return QIcon(QStringLiteral(":/icons/gps.png"));
case MarblePlacemarkModel::CoordinateRole: {
return qVariantFromValue( currentLocation );
return QVariant::fromValue( currentLocation );
}
}
}
......@@ -186,7 +186,7 @@ QVariant TargetModel::routeData ( const QVector<GeoDataPlacemark> &via, int inde
case Qt::DecorationRole: return QIcon( request->pixmap( index ) );
case MarblePlacemarkModel::CoordinateRole: {
const GeoDataCoordinates coordinates = via.at( index ).coordinate();
return qVariantFromValue( coordinates );
return QVariant::fromValue( coordinates );
}
}
......@@ -203,7 +203,7 @@ QVariant TargetModel::homeData ( int role ) const
int zoom( 0 );
m_marbleModel->home( lon, lat, zoom );
const GeoDataCoordinates coordinates = GeoDataCoordinates( lon, lat, 0, GeoDataCoordinates::Degree );
return qVariantFromValue( coordinates );
return QVariant::fromValue( coordinates );
}
}
......@@ -222,7 +222,7 @@ QVariant TargetModel::bookmarkData ( int index, int role ) const
return QVariant();
}
case Qt::DecorationRole: return QIcon(QStringLiteral(":/icons/bookmarks.png"));
case MarblePlacemarkModel::CoordinateRole: return qVariantFromValue( m_bookmarks[index]->lookAt()->coordinates() );
case MarblePlacemarkModel::CoordinateRole: return QVariant::fromValue( m_bookmarks[index]->lookAt()->coordinates() );
}
return QVariant();
......
......@@ -385,7 +385,7 @@ Marble::TextureLayer* MarbleWidget::textureLayer() const
QPixmap MarbleWidget::mapScreenShot()
{
return QPixmap::grabWidget( this );
return grab();
}
RenderStatus MarbleWidget::renderStatus() const
......
......@@ -273,7 +273,7 @@ void FrameGraphicsItem::paint( QPainter *painter )
if ( frame() == ShadowFrame )
{
QPixmap shadow;
if ( !QPixmapCache::find( "marble/frames/shadowframe.png", shadow ) ) {
if ( !QPixmapCache::find( "marble/frames/shadowframe.png", &shadow ) ) {
shadow = QPixmap(QStringLiteral(":/marble/frames/shadowframe.png"));
QPixmapCache::insert( "marble/frames/shadowframe.png", shadow );
}
......
......@@ -80,7 +80,7 @@ void OsmTagEditorWidgetPrivate::populateCurrentTagsList()
// Custom tag adder item
QTreeWidgetItem *adderItem = new QTreeWidgetItem();
adderItem->setText( 0, m_customTagAdderText );
adderItem->setTextColor( 0, Qt::gray );
adderItem->setForeground( 0, Qt::gray );
adderItem->setIcon(0, QIcon(QStringLiteral(":marble/list-add.png")));
adderItem->setFlags( adderItem->flags() | Qt::ItemIsEditable );
m_currentTagsList->addTopLevelItem( adderItem );
......
......@@ -234,7 +234,7 @@ void RoutingInputWidgetPrivate::createBookmarkActions( QMenu* menu, GeoDataFolde
for (; i != end; ++i ) {
QAction *bookmarkAction = new QAction( (*i)->name(), parent );
bookmarkAction->setData( qVariantFromValue( (*i)->coordinate() ) );
bookmarkAction->setData( QVariant::fromValue( (*i)->coordinate() ) );
menu->addAction( bookmarkAction );
QObject::connect( menu, SIGNAL(triggered(QAction*)), parent, SLOT(setBookmarkPosition(QAction*)) );
}
......
......@@ -139,7 +139,7 @@ QVector<GeoDataPlacemark*> GosmoreRunnerPrivate::parseGosmoreInstructions( const
GeoDataExtendedData extendedData;
GeoDataData turnType;
turnType.setName(QStringLiteral("turnType"));
turnType.setValue( qVariantFromValue<int>( int( directions[i].turnType() ) ) );
turnType.setValue( QVariant::fromValue( int( directions[i].turnType() ) ) );
extendedData.addValue( turnType );
GeoDataData roadName;
roadName.setName(QStringLiteral("roadName"));
......
......@@ -171,7 +171,7 @@ int MonavRunnerPrivate::retrieveRoute( const Marble::RouteRequest* route, QVecto
GeoDataExtendedData extendedData;
GeoDataData turnType;
turnType.setName(QStringLiteral("turnType"));
turnType.setValue( qVariantFromValue<int>( int( directions[i].turnType() ) ) );
turnType.setValue( QVariant::fromValue( int( directions[i].turnType() ) ) );
extendedData.addValue( turnType );
GeoDataData roadName;
roadName.setName(QStringLiteral("roadName"));
......
......@@ -160,7 +160,7 @@ QVector<GeoDataPlacemark*> RoutinoRunnerPrivate::parseRoutinoInstructions( const
GeoDataExtendedData extendedData;
GeoDataData turnType;
turnType.setName(QStringLiteral("turnType"));
turnType.setValue( qVariantFromValue<int>( int( directions[i].turnType() ) ) );
turnType.setValue( QVariant::fromValue( int( directions[i].turnType() ) ) );
extendedData.addValue( turnType );
GeoDataData roadName;
roadName.setName(QStringLiteral("roadName"));
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment