Skip to content

Commit

Permalink
Fix clazy qvariant-template-instantiation warning
Browse files Browse the repository at this point in the history
From the clazy docs:

Detects when you're using QVariant::value<Foo>() instead
of QVariant::toFoo().

The former results in more code being generated.
  • Loading branch information
nyalldawson committed Oct 22, 2016
1 parent ad13699 commit bd20fe4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/app/qgsbookmarks.cpp
Expand Up @@ -674,8 +674,8 @@ void QgsMergedBookmarksTableModel::moveBookmark( QAbstractTableModel& modelFrom,
" VALUES (NULL,:name,:project_name,:xmin,:xmax,:ymin,:ymax,:projection_srid)",
qgisModel->database() );

query.bindValue( ":name", modelFrom.data( modelFrom.index( row, 1 ) ).value<QString>() );
query.bindValue( ":project_name", modelFrom.data( modelFrom.index( row, 2 ) ).value<QString>() );
query.bindValue( ":name", modelFrom.data( modelFrom.index( row, 1 ) ).toString() );
query.bindValue( ":project_name", modelFrom.data( modelFrom.index( row, 2 ) ).toString() );
query.bindValue( ":xmin", modelFrom.data( modelFrom.index( row, 3 ) ).toDouble() );
query.bindValue( ":ymin", modelFrom.data( modelFrom.index( row, 4 ) ).toDouble() );
query.bindValue( ":xmax", modelFrom.data( modelFrom.index( row, 5 ) ).toDouble() );
Expand Down
2 changes: 1 addition & 1 deletion src/gui/attributetable/qgsdualview.cpp
Expand Up @@ -360,7 +360,7 @@ void QgsDualView::copyCellContent() const

if ( action && action->data().isValid() && action->data().canConvert<QModelIndex>() )
{
QModelIndex index = action->data().value<QModelIndex>();
QModelIndex index = action->data().toModelIndex();
QVariant var = masterModel()->data( index, Qt::DisplayRole );
QApplication::clipboard()->setText( var.toString() );
}
Expand Down

0 comments on commit bd20fe4

Please sign in to comment.