Skip to content
Permalink
Browse files

Fix clazy qvariant-template-instantiation warning

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 bd20fe425ffb754780acf85b3ccb98e257c10574
Showing with 3 additions and 3 deletions.
  1. +2 −2 src/app/qgsbookmarks.cpp
  2. +1 −1 src/gui/attributetable/qgsdualview.cpp
@@ -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() );
@@ -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() );
}

0 comments on commit bd20fe4

Please sign in to comment.
You can’t perform that action at this time.