Aeon Engine c550894
AeonGames Open Source Game Engine
Loading...
Searching...
No Matches
ListModel.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_LISTMODEL_H
18#define AEONGAMES_LISTMODEL_H
19#include <QAbstractListModel>
20#include <vector>
21#include "aeongames/Node.hpp"
22
23namespace AeonGames
24{
26 class ListModel : public QAbstractListModel
27 {
28 Q_OBJECT
29 public:
34 ListModel ( QObject *parent = nullptr );
36 virtual ~ListModel();
38
39
42 int rowCount ( const QModelIndex & index = QModelIndex() ) const = 0;
47 QVariant data ( const QModelIndex & index, int role = Qt::DisplayRole ) const = 0;
53 QVariant headerData ( int section, Qt::Orientation orientation, int role = Qt::DisplayRole ) const = 0;
55
59 void SetNode ( Node* aNode );
62 const Node* GetNode () const;
65 Node* GetNode ();
66 protected:
68 };
69}
70#endif
QVariant data(const QModelIndex &index, int role=Qt::DisplayRole) const =0
Return the data for the given index and role.
Node * mNode
Pointer to the associated node.
Definition ListModel.h:67
const Node * GetNode() const
Get a const pointer to the associated node.
Definition ListModel.cpp:41
QVariant headerData(int section, Qt::Orientation orientation, int role=Qt::DisplayRole) const =0
Return the header data for the given section, orientation, and role.
ListModel(QObject *parent=nullptr)
Construct the list model.
Definition ListModel.cpp:30
virtual ~ListModel()
Destructor.
void SetNode(Node *aNode)
Set the node associated with this model.
Definition ListModel.cpp:35
int rowCount(const QModelIndex &index=QModelIndex()) const =0
Return the number of rows under the given parent.
Scene graph node representing an entity in the game world.
Definition Node.hpp:54
<- This is here just for the literals
Definition AABB.hpp:31