Skip to content

Commit

Permalink
Minor ui tweaks to afs source select dialog
Browse files Browse the repository at this point in the history
(cherry picked from commit 0ba475b)
  • Loading branch information
nyalldawson committed Nov 10, 2018
1 parent 25faaa0 commit 3e67b18
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions src/providers/arcgisrest/qgsarcgisservicesourceselect.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ QgsArcGisServiceSourceSelect::QgsArcGisServiceSourceSelect( const QString &servi
mModelProxy->setSourceModel( mModel );
mModelProxy->setSortCaseSensitivity( Qt::CaseInsensitive );
treeView->setModel( mModelProxy );
treeView->setSortingEnabled( true );

connect( treeView, &QAbstractItemView::doubleClicked, this, &QgsArcGisServiceSourceSelect::treeWidgetItemDoubleClicked );
connect( treeView->selectionModel(), &QItemSelectionModel::currentRowChanged, this, &QgsArcGisServiceSourceSelect::treeWidgetCurrentRowChanged );
Expand Down Expand Up @@ -265,16 +266,10 @@ void QgsArcGisServiceSourceSelect::connectToServer()

if ( haveLayers )
{
for ( int i = 0; i < treeView->header()->count(); ++i )
{
treeView->resizeColumnToContents( i );
if ( i < 2 && treeView->columnWidth( i ) > 300 )
{
treeView->setColumnWidth( i, 300 );
}
}
treeView->selectionModel()->select( mModel->index( 0, 0 ), QItemSelectionModel::SelectCurrent | QItemSelectionModel::Rows );
treeView->setFocus();

treeView->sortByColumn( 0, Qt::AscendingOrder );
}
else
{
Expand Down

0 comments on commit 3e67b18

Please sign in to comment.