digiKam
Digikam::DConfigDlgWdgModel Class Reference
+ Inheritance diagram for Digikam::DConfigDlgWdgModel:

Public Types

enum  Role { HeaderRole = Qt::UserRole + 1 , WidgetRole }
 

Signals

void toggled (DConfigDlgWdgItem *page, bool checked)
 

Public Member Functions

void addPage (DConfigDlgWdgItem *item)
 
DConfigDlgWdgItemaddPage (QWidget *widget, const QString &name)
 
void addSubPage (DConfigDlgWdgItem *parent, DConfigDlgWdgItem *item)
 
DConfigDlgWdgItemaddSubPage (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)
 
DConfigDlgWdgIteminsertPage (DConfigDlgWdgItem *before, QWidget *widget, const QString &name)
 
DConfigDlgWdgItemitem (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
 

Detailed Description

This page model is used by

See also
DConfigDlgWdg to provide a hierarchical layout of pages.

Member Enumeration Documentation

◆ Role

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.

Constructor & Destructor Documentation

◆ DConfigDlgWdgModel()

Digikam::DConfigDlgWdgModel::DConfigDlgWdgModel ( QObject *const  parent = nullptr)
explicit

Creates a new page widget model.

Parameters
parentThe parent object.

◆ ~DConfigDlgWdgModel()

Digikam::DConfigDlgWdgModel::~DConfigDlgWdgModel ( )
override

Destroys the page widget model.

Member Function Documentation

◆ addPage() [1/2]

void Digikam::DConfigDlgWdgModel::addPage ( DConfigDlgWdgItem item)

Adds a new top level page to the model.

Parameters
itemThe
See also
DConfigDlgWdgItem which describes the page.

References item(), and toggled().

◆ addPage() [2/2]

DConfigDlgWdgItem * Digikam::DConfigDlgWdgModel::addPage ( QWidget *  widget,
const QString &  name 
)

Adds a new top level page to the model.

Parameters
widgetThe widget of the page.
nameThe name which is displayed in the navigation view.
Returns
The associated
See also
DConfigDlgWdgItem.

References item().

◆ addSubPage() [1/2]

void Digikam::DConfigDlgWdgModel::addSubPage ( DConfigDlgWdgItem parent,
DConfigDlgWdgItem item 
)

Inserts a new sub page in the model.

Parameters
parentThe new page will be insert as child of this
See also
DConfigDlgWdgItem.
Parameters
itemThe
See also
DConfigDlgWdgItem which describes the page.

References Digikam::PageItem::appendChild(), Digikam::PageItem::childCount(), Digikam::PageItem::findChild(), index(), item(), parent(), Digikam::PageItem::row(), and toggled().

◆ addSubPage() [2/2]

DConfigDlgWdgItem * Digikam::DConfigDlgWdgModel::addSubPage ( DConfigDlgWdgItem parent,
QWidget *  widget,
const QString &  name 
)

Inserts a new sub page in the model.

Parameters
parentThe new page will be insert as child of this
See also
DConfigDlgWdgItem.
Parameters
widgetThe widget of the page.
nameThe name which is displayed in the navigation view.
Returns
The associated
See also
DConfigDlgWdgItem.

References item(), and parent().

◆ columnCount()

int Digikam::DConfigDlgWdgModel::columnCount ( const QModelIndex &  parent = QModelIndex()) const
override

These methods are reimplemented from QAbstractItemModel.

◆ data()

◆ flags()

Qt::ItemFlags Digikam::DConfigDlgWdgModel::flags ( const QModelIndex &  index) const
override

◆ index() [1/2]

QModelIndex Digikam::DConfigDlgWdgModel::index ( const DConfigDlgWdgItem item) const

Returns the index for a given

See also
DConfigDlgWdgItem. The index is invalid if the item can't be found in the model.

References Digikam::PageItem::findChild(), item(), and Digikam::PageItem::row().

◆ index() [2/2]

QModelIndex Digikam::DConfigDlgWdgModel::index ( int  row,
int  column,
const QModelIndex &  parent = QModelIndex() 
) const
override

◆ insertPage() [1/2]

void Digikam::DConfigDlgWdgModel::insertPage ( DConfigDlgWdgItem before,
DConfigDlgWdgItem item 
)

Inserts a new page in the model.

Parameters
beforeThe new page will be insert before this
See also
DConfigDlgWdgItem on the same level in hierarchy.
Parameters
itemThe
See also
DConfigDlgWdgItem which describes the page.

References Digikam::PageItem::findChild(), index(), item(), Digikam::PageItem::parent(), parent(), Digikam::PageItem::row(), and toggled().

◆ insertPage() [2/2]

DConfigDlgWdgItem * Digikam::DConfigDlgWdgModel::insertPage ( DConfigDlgWdgItem before,
QWidget *  widget,
const QString &  name 
)

Inserts a new page in the model.

Parameters
beforeThe new page will be insert before this
See also
DConfigDlgWdgItem on the same level in hierarchy.
Parameters
widgetThe widget of the page.
nameThe name which is displayed in the navigation view.
Returns
The associated
See also
DConfigDlgWdgItem.

References item().

◆ item()

DConfigDlgWdgItem * Digikam::DConfigDlgWdgModel::item ( const QModelIndex &  index) const

◆ parent()

QModelIndex Digikam::DConfigDlgWdgModel::parent ( const QModelIndex &  index) const
override

◆ removePage()

void Digikam::DConfigDlgWdgModel::removePage ( DConfigDlgWdgItem item)

◆ rowCount()

int Digikam::DConfigDlgWdgModel::rowCount ( const QModelIndex &  parent = QModelIndex()) const
override

◆ setData()

bool Digikam::DConfigDlgWdgModel::setData ( const QModelIndex &  index,
const QVariant &  value,
int  role = Qt::EditRole 
)
override

◆ toggled

void Digikam::DConfigDlgWdgModel::toggled ( DConfigDlgWdgItem page,
bool  checked 
)
signal

This signal is emitted whenever a checkable page changes its state.

Parameters
checkedis true when the
pageis checked, or false if the
pageis unchecked.

Referenced by addPage(), addSubPage(), Digikam::DConfigDlgWdg::DConfigDlgWdg(), insertPage(), and removePage().

Member Data Documentation

◆ d_ptr

DConfigDlgModelPrivate* const Digikam::DConfigDlgModel::d_ptr
protectedinherited

The documentation for this class was generated from the following files: