Aeon Engine c550894
AeonGames Open Source Game Engine
Loading...
Searching...
No Matches
AeonGames::ComponentModel Class Reference

Item model for editing a single component's properties. More...

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

Inheritance diagram for AeonGames::ComponentModel:
Inheritance graph
Collaboration diagram for AeonGames::ComponentModel:
Collaboration graph

Public Member Functions

 ComponentModel (QObject *parent=nullptr)
 Construct the component model.
virtual ~ComponentModel ()
 Destructor.
Public Member Functions inherited from AeonGames::PropertyModel
 PropertyModel (QObject *parent=nullptr)
 Construct the property model.
virtual ~PropertyModel ()
 Destructor.
QModelIndex parent (const QModelIndex &index) const override
 Return the parent of the given model index.
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.

PropertyModel overrides

QModelIndex index (int row, int column, const QModelIndex &parent=QModelIndex()) const override
 Return the index of the item at the given row and column under parent.
int rowCount (const QModelIndex &index=QModelIndex()) const override
 Return the number of rows under the given parent.
QVariant data (const QModelIndex &index, int role=Qt::DisplayRole) const override
 Return the data for the given index and role.
bool setData (const QModelIndex &index, const QVariant &value, int role) override
 Set the data for the given index and role.
void SetComponent (Component *aComponent)
 Set the component whose properties are represented by this model.

Detailed Description

Item model for editing a single component's properties.

Definition at line 24 of file ComponentModel.h.

Constructor & Destructor Documentation

◆ ComponentModel()

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

Construct the component model.

Parameters
parentParent QObject.

Definition at line 41 of file ComponentModel.cpp.

Member Function Documentation

◆ data()

QVariant AeonGames::ComponentModel::data ( const QModelIndex & index,
int role = Qt::DisplayRole ) const
overridevirtual

Return the data for the given index and role.

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

Implements AeonGames::PropertyModel.

Definition at line 83 of file ComponentModel.cpp.

◆ index()

QModelIndex AeonGames::ComponentModel::index ( int row,
int column,
const QModelIndex & parent = QModelIndex() ) const
overridevirtual

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.

Implements AeonGames::PropertyModel.

Definition at line 47 of file ComponentModel.cpp.

◆ rowCount()

int AeonGames::ComponentModel::rowCount ( const QModelIndex & index = QModelIndex()) const
overridevirtual

Return the number of rows under the given parent.

Parameters
indexParent model index.
Returns
Number of rows.

Implements AeonGames::PropertyModel.

Definition at line 56 of file ComponentModel.cpp.

◆ SetComponent()

void AeonGames::ComponentModel::SetComponent ( Component * aComponent)

Set the component whose properties are represented by this model.

Parameters
aComponentPointer to the component.

Definition at line 171 of file ComponentModel.cpp.

◆ setData()

bool AeonGames::ComponentModel::setData ( const QModelIndex & index,
const QVariant & value,
int role )
overridevirtual

Set the data for the given index and role.

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

Implements AeonGames::PropertyModel.

Definition at line 117 of file ComponentModel.cpp.


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