34 disconnect(
this,
static_cast < void ( QComboBox::* )(
int )
> ( &QComboBox::activated ),
this, &QgsProviderConnectionComboBox::indexChanged );
35 disconnect( mSortModel, &QAbstractItemModel::rowsInserted,
this, &QgsProviderConnectionComboBox::rowsChanged );
36 disconnect( mSortModel, &QAbstractItemModel::rowsAboutToBeRemoved,
this, &QgsProviderConnectionComboBox::rowsAboutToBeRemoved );
37 disconnect( mSortModel, &QAbstractItemModel::rowsRemoved,
this, &QgsProviderConnectionComboBox::rowsRemoved );
44 mSortModel =
new QgsProviderConnectionComboBoxSortModel(
this );
45 mSortModel->setSourceModel( mModel );
46 mSortModel->setSortRole( Qt::DisplayRole );
47 mSortModel->setSortLocaleAware(
true );
48 mSortModel->setSortCaseSensitivity( Qt::CaseInsensitive );
49 mSortModel->setDynamicSortFilter(
true );
50 mSortModel->sort( 0 );
52 setModel( mSortModel );
54 connect(
this,
static_cast < void ( QComboBox::* )(
int )
> ( &QComboBox::activated ),
this, &QgsProviderConnectionComboBox::indexChanged );
55 connect( mSortModel, &QAbstractItemModel::rowsInserted,
this, &QgsProviderConnectionComboBox::rowsChanged );
56 connect( mSortModel, &QAbstractItemModel::rowsAboutToBeRemoved,
this, &QgsProviderConnectionComboBox::rowsAboutToBeRemoved );
57 connect( mSortModel, &QAbstractItemModel::rowsRemoved,
this, &QgsProviderConnectionComboBox::rowsRemoved );