Libkdepim
kcheckcombobox.cpp
36 void updateCheckedItems(const QModelIndex &topLeft = QModelIndex(), const QModelIndex &bottomRight = QModelIndex(), int role = Qt::DisplayRole);
51void KCheckComboBox::KCheckComboBoxPrivate::makeInsertedItemsCheckable(const QModelIndex &parent, int start, int end)
61 qCWarning(LIBKDEPIM_LOG) << "KCheckComboBox: model is not a QStandardItemModel but a" << q->model() << ". Cannot proceed.";
82void KCheckComboBox::KCheckComboBoxPrivate::updateCheckedItems(const QModelIndex &topLeft, const QModelIndex &bottomRight, int role)
112 q->model()->setData(index, state == Qt::Unchecked ? Qt::Checked : Qt::Unchecked, Qt::CheckStateRole);
126 connect(model(), &QAbstractItemModel::rowsInserted, this, [this](const QModelIndex &index, int start, int end) {
129 connect(model(), &QAbstractItemModel::dataChanged, this, [this](const QModelIndex &topLeft, const QModelIndex &bottomRight) {
177 const QModelIndexList indexes = model()->match(index, Qt::CheckStateRole, Qt::Checked, -1, Qt::MatchExactly);
307 // Always eat the event: don't let QItemDelegate toggle the current index when the view is hidden.
A combobox that shows its items in such a way that they can be checked in the drop menu.
Definition kcheckcombobox.h:27
bool alwaysShowDefaultText() const
Returns whether the default text is always shown, even if there are no checked items.
Definition kcheckcombobox.cpp:334
KCheckComboBox(QWidget *parent=nullptr)
Creates a new checkable combobox.
Definition kcheckcombobox.cpp:119
void hidePopup() override
Hides the popup list if it is currently shown.
Definition kcheckcombobox.cpp:154
void setSeparator(const QString &separator)
Sets the separator used to separate items in the line edit.
Definition kcheckcombobox.cpp:251
void setSqueezeText(bool squeeze)
Sets whether or not the text must be squeezed.
Definition kcheckcombobox.cpp:216
Qt::CheckState itemCheckState(int index) const
Returns the check state of item at given index.
Definition kcheckcombobox.cpp:162
void setItemCheckState(int index, Qt::CheckState state)
Changes the check state of the given index to the given state.
Definition kcheckcombobox.cpp:167
void setDefaultText(const QString &text)
Sets the default text that is shown when no items are selected.
Definition kcheckcombobox.cpp:203
void setCheckedItems(const QStringList &items, int role=Qt::DisplayRole)
Sets the currently selected items.
Definition kcheckcombobox.cpp:186
void setAlwaysShowDefaultText(bool always)
Sets if the default text should always be shown even if there are no checked items.
Definition kcheckcombobox.cpp:339
Q_SCRIPTABLE Q_NOREPLY void start()
QAction * end(const QObject *recvr, const char *slot, QObject *parent)
void dataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight, const QList< int > &roles)
virtual QModelIndex index(int row, int column, const QModelIndex &parent) const const=0
virtual QModelIndexList match(const QModelIndex &start, int role, const QVariant &value, int hits, Qt::MatchFlags flags) const const
virtual int rowCount(const QModelIndex &parent) const const=0
void rowsInserted(const QModelIndex &parent, int first, int last)
virtual bool setData(const QModelIndex &index, const QVariant &value, int role)
QWidget * viewport() const const
void activated(int index)
count
void setEditable(bool editable)
virtual bool event(QEvent *event) override
virtual void hidePopup()
QVariant itemData(int index, int role) const const
QLineEdit * lineEdit() const const
QAbstractItemModel * model() const const
modelColumn
virtual void resizeEvent(QResizeEvent *e) override
QModelIndex rootModelIndex() const const
void setItemData(int index, const QVariant &value, int role)
virtual void showPopup()
QAbstractItemView * view() const const
KeyPress
void setAlignment(Qt::Alignment flag)
void textChanged(const QString &text)
bool isEmpty() const const
void reserve(qsizetype size)
QVariant data(int role) const const
QModelIndex siblingAtRow(int row) const const
Q_EMITQ_EMIT
QMetaObject::Connection connect(const QObject *sender, PointerToMemberFunction signal, Functor functor)
virtual bool eventFilter(QObject *watched, QEvent *event)
void installEventFilter(QObject *filterObj)
QObject * parent() const const
T qobject_cast(QObject *object)
bool isEnabled() const const
void setCheckable(bool checkable)
void setEnabled(bool enabled)
bool isEmpty() const const
bool contains(QLatin1StringView str, Qt::CaseSensitivity cs) const const
QString join(QChar separator) const const
AlignLeft
CheckState
DisplayRole
Key_Up
MatchExactly
ElideMiddle
bool isValid() const const
int toInt(bool *ok) const const
QString toString() const const
enabled
bool isVisible() const const
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Sep 27 2024 11:59:00 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Sep 27 2024 11:59:00 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.