LeechCraft 0.6.70-19424-g027e980fd1
Modular cross-platform feature rich live environment.
Loading...
Searching...
No Matches
LC::Util::CategorySelector Class Reference

A checklist over a model of names. More...

#include "categoryselector.h"

Inheritance diagram for LC::Util::CategorySelector:
Collaboration diagram for LC::Util::CategorySelector:

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.

Detailed Description

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.

Constructor & Destructor Documentation

◆ CategorySelector()

LC::Util::CategorySelector::CategorySelector ( QWidget * parent = nullptr)
explicit

Definition at line 135 of file categoryselector.cpp.

References GetSelections(), and selectionEdited().

Referenced by LC::Util::CategorySelector::CheckableModel::CheckableModel().

Here is the call graph for this function:
Here is the caller graph for this function:

Member Function Documentation

◆ GetSelectedIndexes()

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.

◆ GetSelections()

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().

Here is the caller graph for this function:

◆ SelectAll()

void LC::Util::CategorySelector::SelectAll ( )

Selects exactly the names in the model.

selectionEdited() is not emitted.

Definition at line 201 of file categoryselector.cpp.

◆ selectionEdited

void LC::Util::CategorySelector::selectionEdited ( const QStringList & selected)
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().

Here is the caller graph for this function:

◆ SelectNone()

void LC::Util::CategorySelector::SelectNone ( )

Clears the selection.

selectionEdited() is not emitted.

Definition at line 206 of file categoryselector.cpp.

◆ SetCaption()

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.

◆ SetModel()

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().

Here is the caller graph for this function:

◆ SetSelections()

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().

Here is the caller graph for this function:

The documentation for this class was generated from the following files:
  • /home/abuild/rpmbuild/BUILD/leechcraft-doc-0.6.70+git.19424.g027e980fd1-build/leechcraft-0.6.70-19424-g027e980fd1/src/util/tags/categoryselector.h
  • /home/abuild/rpmbuild/BUILD/leechcraft-doc-0.6.70+git.19424.g027e980fd1-build/leechcraft-0.6.70-19424-g027e980fd1/src/util/tags/categoryselector.cpp