diff --git a/src/libkdepim/widgets/kcheckcombobox.h b/src/libkdepim/widgets/kcheckcombobox.h --- a/src/libkdepim/widgets/kcheckcombobox.h +++ b/src/libkdepim/widgets/kcheckcombobox.h @@ -152,6 +152,14 @@ */ Q_REQUIRED_RESULT QStringList checkedItems(int role = Qt::DisplayRole) const; + /** + * Update the KCheckComboBox text with Item belonging to the role. + * @param topLeft Curently unused. + * @param bottomRight Curently unused. + * @param role The role the updated values belong to. + */ + void updateCheckedItems(const QModelIndex &topLeft = QModelIndex(), const QModelIndex &bottomRight = QModelIndex(), int role = Qt::DisplayRole); + public Q_SLOTS: /** * Sets the currently selected items. Items that are not found in the model diff --git a/src/libkdepim/widgets/kcheckcombobox.cpp b/src/libkdepim/widgets/kcheckcombobox.cpp --- a/src/libkdepim/widgets/kcheckcombobox.cpp +++ b/src/libkdepim/widgets/kcheckcombobox.cpp @@ -368,4 +368,9 @@ } } +void KCheckComboBox::updateCheckedItems(const QModelIndex &topLeft, const QModelIndex &bottomRight, int role) +{ + d->updateCheckedItems(topLeft, bottomRight, role); +} + #include "moc_kcheckcombobox.cpp" diff --git a/src/libkdepimakonadi/widgets/tagselectioncombo.cpp b/src/libkdepimakonadi/widgets/tagselectioncombo.cpp --- a/src/libkdepimakonadi/widgets/tagselectioncombo.cpp +++ b/src/libkdepimakonadi/widgets/tagselectioncombo.cpp @@ -59,8 +59,9 @@ setModel(checkableProxy); //We need to reconnect from the constructor of KCheckComboBox to the new model - connect(checkableProxy, SIGNAL(dataChanged(QModelIndex,QModelIndex)), - this, SLOT(updateCheckedItems(QModelIndex,QModelIndex))); + connect(checkableProxy, &QAbstractItemModel::dataChanged, this, [this] (const QModelIndex &topLeft, const QModelIndex &bottomRight) { + updateCheckedItems(topLeft, bottomRight); + }); } TagCombo::TagCombo(QWidget *parent)