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