Aeon Engine c550894
AeonGames Open Source Game Engine
Loading...
Searching...
No Matches
AeonGames::PropertyModel Class Referenceabstract

Abstract item model base class for property editing views. More...

#include <C:/Code/AeonEngine/tools/worldeditor/models/PropertyModel.h>

Inheritance diagram for AeonGames::PropertyModel:
Inheritance graph
Collaboration diagram for AeonGames::PropertyModel:
Collaboration graph

Public Member Functions

 PropertyModel (QObject *parent=nullptr)
 Construct the property model.
virtual ~PropertyModel ()
 Destructor.
Qt QAbstractItemModel overrides
QModelIndex parent (const QModelIndex &index) const override
 Return the parent of the given model index.
int rowCount (const QModelIndex &index=QModelIndex()) const override=0
 Return the number of rows under the given parent.
int columnCount (const QModelIndex &index=QModelIndex()) const override
 Return the number of columns for children of the given parent.
QVariant headerData (int section, Qt::Orientation orientation, int role=Qt::DisplayRole) const override
 Return the header data for the given section, orientation, and role.
bool hasChildren (const QModelIndex &index=QModelIndex()) const override
 Return whether the given parent index has any children.
Qt::ItemFlags flags (const QModelIndex &index) const override
 Return the item flags for the given model index.
QModelIndex index (int row, int column, const QModelIndex &parent=QModelIndex()) const override=0
 Return the index of the item at the given row and column under parent.
QVariant data (const QModelIndex &index, int role=Qt::DisplayRole) const override=0
 Return the data for the given index and role.
bool setData (const QModelIndex &index, const QVariant &value, int role) override=0
 Set the data for the given index and role.

Detailed Description

Abstract item model base class for property editing views.

Definition at line 26 of file PropertyModel.h.

Constructor & Destructor Documentation

◆ PropertyModel()

AeonGames::PropertyModel::PropertyModel ( QObject * parent = nullptr)

Construct the property model.

Parameters
parentParent QObject.

Definition at line 35 of file PropertyModel.cpp.

Member Function Documentation

◆ columnCount()

int AeonGames::PropertyModel::columnCount ( const QModelIndex & index = QModelIndex()) const
override

Return the number of columns for children of the given parent.

Parameters
indexParent model index.
Returns
Number of columns.

Definition at line 62 of file PropertyModel.cpp.

◆ data()

QVariant AeonGames::PropertyModel::data ( const QModelIndex & index,
int role = Qt::DisplayRole ) const
overridepure virtual

Return the data for the given index and role.

Parameters
indexModel index.
roleData role.
Returns
Data as a QVariant.

Implemented in AeonGames::ComponentModel.

◆ flags()

Qt::ItemFlags AeonGames::PropertyModel::flags ( const QModelIndex & index) const
override

Return the item flags for the given model index.

Parameters
indexModel index.
Returns
Item flags.

Definition at line 73 of file PropertyModel.cpp.

◆ hasChildren()

bool AeonGames::PropertyModel::hasChildren ( const QModelIndex & index = QModelIndex()) const
override

Return whether the given parent index has any children.

Parameters
indexParent model index.
Returns
True if the parent has children.

Definition at line 67 of file PropertyModel.cpp.

◆ headerData()

QVariant AeonGames::PropertyModel::headerData ( int section,
Qt::Orientation orientation,
int role = Qt::DisplayRole ) const
override

Return the header data for the given section, orientation, and role.

Parameters
sectionHeader section index.
orientationHorizontal or vertical header.
roleData role.
Returns
Header data as a QVariant.

Definition at line 40 of file PropertyModel.cpp.

◆ index()

QModelIndex AeonGames::PropertyModel::index ( int row,
int column,
const QModelIndex & parent = QModelIndex() ) const
overridepure virtual

Return the index of the item at the given row and column under parent.

Parameters
rowRow number.
columnColumn number.
parentParent model index.
Returns
Model index for the specified item.

Implemented in AeonGames::ComponentModel.

◆ parent()

QModelIndex AeonGames::PropertyModel::parent ( const QModelIndex & index) const
override

Return the parent of the given model index.

Parameters
indexThe child model index.
Returns
Parent model index, or an invalid index if the item has no parent.

Definition at line 57 of file PropertyModel.cpp.

◆ rowCount()

int AeonGames::PropertyModel::rowCount ( const QModelIndex & index = QModelIndex()) const
overridepure virtual

Return the number of rows under the given parent.

Parameters
indexParent model index.
Returns
Number of rows.

Implemented in AeonGames::ComponentModel.

◆ setData()

bool AeonGames::PropertyModel::setData ( const QModelIndex & index,
const QVariant & value,
int role )
overridepure virtual

Set the data for the given index and role.

Parameters
indexModel index.
valueNew value.
roleData role.
Returns
True if the data was set successfully.

Implemented in AeonGames::ComponentModel.


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