digiKam
|
Public Types | |
enum | Role { HeaderRole = Qt::UserRole + 1 , WidgetRole } |
Signals | |
void | toggled (DConfigDlgWdgItem *page, bool checked) |
Public Member Functions | |
void | addPage (DConfigDlgWdgItem *item) |
DConfigDlgWdgItem * | addPage (QWidget *widget, const QString &name) |
void | addSubPage (DConfigDlgWdgItem *parent, DConfigDlgWdgItem *item) |
DConfigDlgWdgItem * | addSubPage (DConfigDlgWdgItem *parent, QWidget *widget, const QString &name) |
int | columnCount (const QModelIndex &parent=QModelIndex()) const override |
QVariant | data (const QModelIndex &index, int role=Qt::DisplayRole) const override |
DConfigDlgWdgModel (QObject *const parent=nullptr) | |
Qt::ItemFlags | flags (const QModelIndex &index) const override |
QModelIndex | index (const DConfigDlgWdgItem *item) const |
QModelIndex | index (int row, int column, const QModelIndex &parent=QModelIndex()) const override |
void | insertPage (DConfigDlgWdgItem *before, DConfigDlgWdgItem *item) |
DConfigDlgWdgItem * | insertPage (DConfigDlgWdgItem *before, QWidget *widget, const QString &name) |
DConfigDlgWdgItem * | item (const QModelIndex &index) const |
QModelIndex | parent (const QModelIndex &index) const override |
void | removePage (DConfigDlgWdgItem *item) |
int | rowCount (const QModelIndex &parent=QModelIndex()) const override |
bool | setData (const QModelIndex &index, const QVariant &value, int role=Qt::EditRole) override |
~DConfigDlgWdgModel () override | |
Protected Attributes | |
DConfigDlgModelPrivate *const | d_ptr |
This page model is used by
|
inherited |
Additional roles that DConfigDlgView uses.
Enumerator | |
---|---|
HeaderRole | A string to be rendered as page header. |
WidgetRole | A pointer to the page widget. This is the widget that is shown when the item is selected. |
|
explicit |
Creates a new page widget model.
parent | The parent object. |
|
override |
Destroys the page widget model.
void Digikam::DConfigDlgWdgModel::addPage | ( | DConfigDlgWdgItem * | item | ) |
Adds a new top level page to the model.
item | The |
DConfigDlgWdgItem * Digikam::DConfigDlgWdgModel::addPage | ( | QWidget * | widget, |
const QString & | name | ||
) |
Adds a new top level page to the model.
widget | The widget of the page. |
name | The name which is displayed in the navigation view. |
References item().
void Digikam::DConfigDlgWdgModel::addSubPage | ( | DConfigDlgWdgItem * | parent, |
DConfigDlgWdgItem * | item | ||
) |
Inserts a new sub page in the model.
parent | The new page will be insert as child of this |
item | The |
References Digikam::PageItem::appendChild(), Digikam::PageItem::childCount(), Digikam::PageItem::findChild(), index(), item(), parent(), Digikam::PageItem::row(), and toggled().
DConfigDlgWdgItem * Digikam::DConfigDlgWdgModel::addSubPage | ( | DConfigDlgWdgItem * | parent, |
QWidget * | widget, | ||
const QString & | name | ||
) |
Inserts a new sub page in the model.
parent | The new page will be insert as child of this |
widget | The widget of the page. |
name | The name which is displayed in the navigation view. |
|
override |
These methods are reimplemented from QAbstractItemModel.
|
override |
References Digikam::DConfigDlgWdgItem::header, Digikam::DConfigDlgModel::HeaderRole, Digikam::DConfigDlgWdgItem::icon, index(), Digikam::DConfigDlgWdgItem::isCheckable(), Digikam::DConfigDlgWdgItem::isChecked(), item(), Digikam::DConfigDlgWdgItem::name, Digikam::DConfigDlgWdgItem::widget(), and Digikam::DConfigDlgModel::WidgetRole.
|
override |
QModelIndex Digikam::DConfigDlgWdgModel::index | ( | const DConfigDlgWdgItem * | item | ) | const |
Returns the index for a given
References Digikam::PageItem::findChild(), item(), and Digikam::PageItem::row().
|
override |
References Digikam::PageItem::child(), and parent().
Referenced by addSubPage(), data(), flags(), insertPage(), item(), parent(), removePage(), and setData().
void Digikam::DConfigDlgWdgModel::insertPage | ( | DConfigDlgWdgItem * | before, |
DConfigDlgWdgItem * | item | ||
) |
Inserts a new page in the model.
before | The new page will be insert before this |
item | The |
References Digikam::PageItem::findChild(), index(), item(), Digikam::PageItem::parent(), parent(), Digikam::PageItem::row(), and toggled().
DConfigDlgWdgItem * Digikam::DConfigDlgWdgModel::insertPage | ( | DConfigDlgWdgItem * | before, |
QWidget * | widget, | ||
const QString & | name | ||
) |
Inserts a new page in the model.
before | The new page will be insert before this |
widget | The widget of the page. |
name | The name which is displayed in the navigation view. |
References item().
DConfigDlgWdgItem * Digikam::DConfigDlgWdgModel::item | ( | const QModelIndex & | index | ) | const |
Returns the
References index().
Referenced by Digikam::DConfigDlgWdgPrivate::_k_slotCurrentPageChanged(), addPage(), addSubPage(), data(), flags(), index(), insertPage(), parent(), removePage(), and setData().
|
override |
References index(), item(), and Digikam::PageItem::row().
Referenced by addSubPage(), index(), insertPage(), and rowCount().
void Digikam::DConfigDlgWdgModel::removePage | ( | DConfigDlgWdgItem * | item | ) |
Removes the page associated with the given
References Digikam::PageItem::findChild(), index(), item(), Digikam::PageItem::parent(), Digikam::PageItem::removeChild(), Digikam::PageItem::row(), and toggled().
|
override |
References Digikam::PageItem::childCount(), and parent().
|
override |
|
signal |
This signal is emitted whenever a checkable page changes its state.
checked | is true when the |
page | is checked, or false if the |
page | is unchecked. |
Referenced by addPage(), addSubPage(), Digikam::DConfigDlgWdg::DConfigDlgWdg(), insertPage(), and removePage().
|
protectedinherited |