Skip to content
Permalink
Browse files

Fix layer id sorting in ArcGIS rest source select dialogs

  • Loading branch information
nyalldawson committed Feb 9, 2018
1 parent 75d88af commit 8bb297d55453a73517de00f3d96ede8af0b465ec
@@ -62,6 +62,13 @@ bool QgsAfsSourceSelect::connectToService( const QgsOwsConnection &connection )
}
// insert the typenames, titles and abstracts into the tree view
QStandardItem *idItem = new QStandardItem( layerData[QStringLiteral( "id" )].toString() );
bool ok = false;
int idInt = layerData[QStringLiteral( "id" )].toInt( &ok );
if ( ok )
{
// force display role to be int value, so that sorting works correctly
idItem->setData( idInt, Qt::DisplayRole );
}
QStandardItem *nameItem = new QStandardItem( layerData[QStringLiteral( "name" )].toString() );
QStandardItem *abstractItem = new QStandardItem( layerData[QStringLiteral( "description" )].toString() );
abstractItem->setToolTip( layerData[QStringLiteral( "description" )].toString() );
@@ -64,6 +64,13 @@ bool QgsAmsSourceSelect::connectToService( const QgsOwsConnection &connection )
}
// insert the typenames, titles and abstracts into the tree view
QStandardItem *idItem = new QStandardItem( layerData[QStringLiteral( "id" )].toString() );
bool ok = false;
int idInt = layerData[QStringLiteral( "id" )].toInt( &ok );
if ( ok )
{
// force display role to be int value, so that sorting works correctly
idItem->setData( idInt, Qt::DisplayRole );
}
QStandardItem *nameItem = new QStandardItem( layerData[QStringLiteral( "name" )].toString() );
QStandardItem *abstractItem = new QStandardItem( layerData[QStringLiteral( "description" )].toString() );
abstractItem->setToolTip( layerData[QStringLiteral( "description" )].toString() );

0 comments on commit 8bb297d

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