Skip to content
Browse files

[postgres] Fix jumping item when changing pkey / geom type / srid

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 8, 2018
1 parent c225f56 commit 1a5a23d1a50931322637b6094388c9ee4d056401
Showing with 5 additions and 0 deletions.
  1. +5 −0 src/providers/postgres/qgspgsourceselect.cpp
@@ -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 );

0 comments on commit 1a5a23d

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