Skip to content

Commit

Permalink
[postgres] Fix jumping item when changing pkey / geom type / srid
Browse files Browse the repository at this point in the history
On change of on of the properties the affected item would suddenly jump to the end of the list.
  • Loading branch information
wonder-sk committed Oct 9, 2018
1 parent c225f56 commit 1a5a23d
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/providers/postgres/qgspgsourceselect.cpp
Expand Up @@ -253,6 +253,11 @@ QgsPgSourceSelect::QgsPgSourceSelect( QWidget *parent, Qt::WindowFlags fl, QgsPr
mProxyModel.setFilterCaseSensitivity( Qt::CaseInsensitive );
mProxyModel.setSourceModel( &mTableModel );

// Do not do dynamic sorting - otherwise whenever user selects geometry type / srid / pk columns,
// that item suddenly jumps to the end of the list (because the item gets changed) which is very annoying.
// The list gets sorted in finishList() method when the listing of tables and views has finished.
mProxyModel.setDynamicSortFilter( false );

mTablesTreeView->setModel( &mProxyModel );
mTablesTreeView->setSortingEnabled( true );
mTablesTreeView->setEditTriggers( QAbstractItemView::CurrentChanged );
Expand Down

0 comments on commit 1a5a23d

Please sign in to comment.