Aeon Engine c550894
AeonGames Open Source Game Engine
Loading...
Searching...
No Matches
ListModel.cpp
1/*
2Copyright (C) 2018,2025 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#include <QIcon>
18#include <QFile>
19#include <QMimeData>
20#include <QDataStream>
21#include <QByteArray>
22#include <QXmlStreamWriter>
23#include <QTextStream>
24#include "ListModel.h"
25#include "aeongames/Scene.hpp"
26#include "aeongames/Node.hpp"
27
28namespace AeonGames
29{
30 ListModel::ListModel ( QObject *parent ) :
31 QAbstractListModel ( parent ) {}
32
33 ListModel::~ListModel() = default;
34
35 void ListModel::SetNode ( Node* aNode )
36 {
37 beginResetModel();
38 mNode = aNode;
39 endResetModel();
40 }
41 const Node* ListModel::GetNode () const
42 {
43 return mNode;
44 }
46 {
47 return const_cast<Node*> ( static_cast<const ListModel*> ( this )->GetNode() );
48 }
49}
Header for the Scene class.
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
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
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