Page Contents

Topics

Classes

QLThemeLineageModel Class

#include <QLayers/qlthemelineagemodel.h>

Inherits: QAbstractTableModel

Public Functions

QLThemeLineageModel(QObject* parent = nullptr)
void append(const LThemeLineageData& lineage_data)
void clear()
virtual int columnCount(const QModelIndex& parent = QModelIndex()) const override
virtual QVariant data(const QModelIndex& index, int role) const override
virtual QVariant headerData(int section, Qt::Orientation orientation, int role) const override
virtual int rowCount(const QModelIndex& parent = QModelIndex()) const override

Detailed Description

A QLThemeLineageModel is a QAbstractTableModel that implements a table model for LThemeLineageData data.

Member Function Documentation

QLThemeLineageModel(QObject* parent = nullptr)

Constructs a theme lineage model.

void append(const LThemeLineageData& lineage_data)

Adds lineage_data to the list of lineage data that the model represents.

void clear()

Clears the model data.

int columnCount(const QModelIndex& parent = QModelIndex()) const

Virtual

Override

Returns 2 since theme lineage data is sorted into 2 columns.

QVariant data(const QModelIndex& index, int role) const

Virtual

Override

Returns a QVariant containing data for the specified index.

The type of data returned depends on the specified Qt::ItemDataRole role. The following table describes the available roles and the data returned:

Role QVariant Data
Qt::DisplayRole || Qt::EditRole Column 0: QString name and UUID of LThemeLineageData specified by index
Qt::DecorationRole Column 1: Bool value determining whether LThemeLineageData specified by index has an implementation file available for the current application.

QVariant headerData(int section, Qt::Orientation orientation, int role) const

Virtual

Override

Returns a QVariant containing the header for the specified section.

There is only header data for the horizontal orientation, so be sure to use Qt::Horizontal as your argument for orientation.

The following table contains the available header values:

Section (Column) QVariant Data
0 QString containing "Theme".
1 QString containing "Compatible".

int rowCount(const QModelIndex& parent = QModelIndex()) const

Virtual

Override

Returns the number of rows under the given parent. When the parent is valid it means that rowCount() is returning the number of children of parent.