Aeon Engine c550894
AeonGames Open Source Game Engine
Loading...
Searching...
No Matches
ComponentModel.h
1/*
2Copyright (C) 2018,2019,2025,2026 Rodrigo Jose Hernandez Cordoba
3
4Licensed under the Apache License, Version 2.0 (the "License");
5you may not use this file except in compliance with the License.
6You may obtain a copy of the License at
7
8http://www.apache.org/licenses/LICENSE-2.0
9
10Unless required by applicable law or agreed to in writing, software
11distributed under the License is distributed on an "AS IS" BASIS,
12WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13See the License for the specific language governing permissions and
14limitations under the License.
15*/
16
17#ifndef AEONGAMES_COMPONENTMODEL_H
18#define AEONGAMES_COMPONENTMODEL_H
19#include "aeongames/Component.hpp"
20#include "PropertyModel.h"
21namespace AeonGames
22{
25 {
26 Q_OBJECT
27 public:
32 ComponentModel ( QObject *parent = nullptr );
34 virtual ~ComponentModel();
36
37
42 QModelIndex index ( int row, int column, const QModelIndex & parent = QModelIndex() ) const override;
46 int rowCount ( const QModelIndex & index = QModelIndex() ) const override;
51 QVariant data ( const QModelIndex & index, int role = Qt::DisplayRole ) const override;
57 bool setData ( const QModelIndex & index, const QVariant & value, int role ) override;
59
63 void SetComponent ( Component* aComponent );
64 private:
65 Component* mComponent{};
66 };
67}
68#endif
Abstract base class for node components.
Definition Component.hpp:39
virtual ~ComponentModel()
Destructor.
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.
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.
ComponentModel(QObject *parent=nullptr)
Construct the component model.
QVariant data(const QModelIndex &index, int role=Qt::DisplayRole) const override
Return the data for the given index and role.
QModelIndex parent(const QModelIndex &index) const override
Return the parent of the given model index.
PropertyModel(QObject *parent=nullptr)
Construct the property model.
<- This is here just for the literals
Definition AABB.hpp:31