Skip to content

Commit

Permalink
Make sublayer dialog sortable and sort by layername initially. Patch …
Browse files Browse the repository at this point in the history
…provided by Stefan Ziegler
  • Loading branch information
mhugent committed Apr 27, 2016
1 parent 11e7140 commit 42e386f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/gui/qgssublayersdialog.cpp
Expand Up @@ -162,6 +162,9 @@ int QgsSublayersDialog::exec()
return QDialog::Accepted;
}

layersTable->sortByColumn( 1, Qt::AscendingOrder );
layersTable->setSortingEnabled( true );

// if we got here, disable override cursor, open dialog and return result
// TODO add override cursor where it is missing (e.g. when opening via "Add Raster")
QCursor cursor;
Expand Down
6 changes: 6 additions & 0 deletions src/ui/qgssublayersdialogbase.ui
Expand Up @@ -28,6 +28,12 @@
<property name="selectionBehavior">
<enum>QAbstractItemView::SelectRows</enum>
</property>
<property name="sortingEnabled">
<bool>false</bool>
</property>
<attribute name="headerShowSortIndicator" stdset="0">
<bool>true</bool>
</attribute>
<column>
<property name="text">
<string>1</string>
Expand Down

0 comments on commit 42e386f

Please sign in to comment.