![]() |
LeechCraft 0.6.70-19424-g027e980fd1
Modular cross-platform feature rich live environment.
|
A checklist over a model of names. More...
#include "categoryselector.h"
Classes | |
| class | CheckableModel |
Signals | |
| void | selectionEdited (const QStringList &selected) |
| Emitted after the user has changed the selection, with GetSelections(). | |
Public Member Functions | |
| CategorySelector (QWidget *parent=nullptr) | |
| void | SetModel (QAbstractItemModel &model) |
| Lists the names of model, which is not owned. | |
| void | SetCaption (const QString &caption) |
| Sets the header above the list; there is none by default. | |
| QStringList | GetSelections () const |
| Returns the selected names present in the model. | |
| QModelIndexList | GetSelectedIndexes () const |
| Returns the model's indexes of the selected names. | |
| void | SetSelections (const QStringList &names) |
| Replaces the selection. | |
| void | SelectAll () |
| Selects exactly the names in the model. | |
| void | SelectNone () |
| Clears the selection. | |
A checklist over a model of names.
The names are the Qt::DisplayRole of the first column of the model set via SetModel(), listed sorted. The selection is a set of names: the model decides which of them are shown and reported, so a name selected while absent from the model is checked as soon as the model lists it.
Definition at line 27 of file categoryselector.h.
|
explicit |
Definition at line 135 of file categoryselector.cpp.
References GetSelections(), and selectionEdited().
Referenced by LC::Util::CategorySelector::CheckableModel::CheckableModel().
| QModelIndexList LC::Util::CategorySelector::GetSelectedIndexes | ( | ) | const |
Returns the model's indexes of the selected names.
The names are returned in the model rows order.
Definition at line 191 of file categoryselector.cpp.
| QStringList LC::Util::CategorySelector::GetSelections | ( | ) | const |
Returns the selected names present in the model.
The names are returned in the model rows order.
Definition at line 186 of file categoryselector.cpp.
Referenced by CategorySelector().
| void LC::Util::CategorySelector::SelectAll | ( | ) |
Selects exactly the names in the model.
selectionEdited() is not emitted.
Definition at line 201 of file categoryselector.cpp.
|
signal |
Emitted after the user has changed the selection, with GetSelections().
This signal is not emitted on programmatic selection changes.
Referenced by CategorySelector(), and LC::Util::TagsEditorAddon::BindSelector().
| void LC::Util::CategorySelector::SelectNone | ( | ) |
Clears the selection.
selectionEdited() is not emitted.
Definition at line 206 of file categoryselector.cpp.
| void LC::Util::CategorySelector::SetCaption | ( | const QString & | caption | ) |
Sets the header above the list; there is none by default.
Definition at line 180 of file categoryselector.cpp.
| void LC::Util::CategorySelector::SetModel | ( | QAbstractItemModel & | model | ) |
Lists the names of model, which is not owned.
Definition at line 175 of file categoryselector.cpp.
Referenced by LC::Util::TagsEditorAddon::BindSelector().
| void LC::Util::CategorySelector::SetSelections | ( | const QStringList & | names | ) |
Replaces the selection.
selectionEdited() is not emitted.
Definition at line 196 of file categoryselector.cpp.
Referenced by LC::Util::TagsEditorAddon::BindSelector().