24 #ifndef DIGIKAM_CHOICE_SEARCH_UTILITIES_H
25 #define DIGIKAM_CHOICE_SEARCH_UTILITIES_H
29 #include <QAbstractListModel>
94 template <
typename T>
void setChecked(
const T& key,
bool checked =
true);
114 int rowCount(
const QModelIndex& parent)
const override;
115 QVariant
data(
const QModelIndex&
index,
int role)
const override;
116 QModelIndex
index(
int row,
int column = 0,
const QModelIndex& parent = QModelIndex())
const override;
117 Qt::ItemFlags
flags(
const QModelIndex&
index)
const override;
118 bool setData(
const QModelIndex&
index,
const QVariant&
value,
int role)
override;
135 Entry(
const QVariant& key,
const QString& userDisplay);
156 QVariant variantKey(key);
158 for (
int i = 0 ; i <
m_entries.size() ; ++i)
169 for (
int i = 0 ; i <
m_entries.size() ; ++i)
177 foreach (
T key, keys)
189 if ((*it).m_checkState)
191 list << (*it).m_key.value<
T>();
Definition: choicesearchutilities.h:201
ChoiceSearchModel * model() const
Definition: choicesearchutilities.cpp:242
void setLabelText(const QString &text)
Definition: choicesearchutilities.cpp:252
DSqueezedClickLabel * m_label
Definition: choicesearchutilities.h:242
void setSearchModel(ChoiceSearchModel *model)
Definition: choicesearchutilities.cpp:236
ChoiceSearchComboBox(QWidget *const parent=nullptr)
Definition: choicesearchutilities.cpp:230
DSqueezedClickLabel * label() const
Definition: choicesearchutilities.cpp:247
void installView(QAbstractItemView *view=nullptr) override
Definition: choicesearchutilities.cpp:263
void labelClicked()
Definition: choicesearchutilities.cpp:257
Definition: choicesearchutilities.h:131
bool m_checkState
Definition: choicesearchutilities.h:146
bool operator==(const QVariant &other) const
Entry()
Definition: choicesearchutilities.cpp:38
bool operator==(const Entry &other) const
Definition: choicesearchutilities.cpp:50
QString m_display
Definition: choicesearchutilities.h:145
QVariant m_key
Definition: choicesearchutilities.h:144
Definition: choicesearchutilities.h:43
void setChoice(const QMap< int, QString > &data)
Definition: choicesearchutilities.cpp:60
void checkStateChanged(const QVariant &key, bool isChecked)
QVariant data(const QModelIndex &index, int role) const override
Definition: choicesearchutilities.cpp:177
bool setData(const QModelIndex &index, const QVariant &value, int role) override
Definition: choicesearchutilities.cpp:213
QStringList checkedDisplayTexts() const
Definition: choicesearchutilities.cpp:132
QModelIndex index(int row, int column=0, const QModelIndex &parent=QModelIndex()) const override
Definition: choicesearchutilities.cpp:198
Qt::ItemFlags flags(const QModelIndex &index) const override
Definition: choicesearchutilities.cpp:208
ChoiceSearchModel(QObject *const parent=nullptr)
Definition: choicesearchutilities.cpp:55
void resetChecked()
Definition: choicesearchutilities.cpp:156
QVariantList checkedKeys() const
Definition: choicesearchutilities.cpp:117
void setChecked(const T &key, bool checked=true)
Definition: choicesearchutilities.h:154
CustomRoles
Definition: choicesearchutilities.h:49
@ IdRole
Definition: choicesearchutilities.h:50
QList< Entry > m_entries
Definition: choicesearchutilities.h:151
int rowCount(const QModelIndex &parent) const override
Definition: choicesearchutilities.cpp:167
Definition: dexpanderbox.h:132
Definition: comboboxutilities.h:238
QListView * view() const
Definition: comboboxutilities.cpp:439
Definition: piwigotalker.h:48
qulonglong value
Definition: itemviewutilities.cpp:592
Relation
Definition: coredbsearchxml.h:66
bool testRelation(T v1, T v2, Relation rel)
Definition: coredbsearchxml.h:86
Definition: datefolderview.cpp:43