/home/docs/checkouts/readthedocs.org/user_builds/mathvizanimator/checkouts/latest/libs/mva_gui/include/items/basic_item.h Source File

MathVizAnimator: /home/docs/checkouts/readthedocs.org/user_builds/mathvizanimator/checkouts/latest/libs/mva_gui/include/items/basic_item.h Source File
MathVizAnimator  0.0.1
basic_item.h
1 /* mathvizanimator
2  * Copyright (C) 2023-2024 codingwithmagga
3  *
4  * This program is free software: you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License as published by
6  * the Free Software Foundation, either version 3 of the License, or
7  * (at your option) any later version.
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program. If not, see <http://www.gnu.org/licenses/>.
16  */
17 
18 #ifndef LIBS_MVA_GUI_INCLUDE_ITEMS_BASIC_ITEM_H_
19 #define LIBS_MVA_GUI_INCLUDE_ITEMS_BASIC_ITEM_H_
20 
21 #include <QObject>
22 #include <QQmlEngine>
23 #include <QQuickItem>
24 #include <QString>
25 
26 class AbstractItem;
27 
28 class BasicItem : public QQuickItem {
29 
30  Q_OBJECT
31  QML_ELEMENT
32 
33  Q_PROPERTY(bool is_initialized MEMBER m_is_initialized NOTIFY isInitializedChanged)
34 
35 
40  Q_PROPERTY(AbstractItem* abstract_item READ abstractItem WRITE setAbstractItem NOTIFY abstractItemChanged REQUIRED)
41 
42  public:
43  explicit BasicItem(QQuickItem* parent = nullptr);
44 
45  inline AbstractItem* abstractItem() const { return m_abstract_item; }
46  void setAbstractItem(AbstractItem* const new_item);
47 
48  QString abstractItemName() const;
49 
50  signals:
51  void clicked(const QString& name);
52 
58  void animationAdded(const QString& name, const QString& type, const qreal start_time, const qreal duration);
59 
60  void isInitializedChanged();
61  void abstractItemChanged();
62 
63  private:
64  AbstractItem* m_abstract_item = nullptr;
65  bool m_is_initialized = false;
66 };
67 
68 #endif // LIBS_MVA_GUI_INCLUDE_ITEMS_BASIC_ITEM_H_
An abstract class representing a visible item like a circle or a rectangle.
Definition: abstractitem.h:56
Definition: basic_item.h:28
void animationAdded(const QString &name, const QString &type, const qreal start_time, const qreal duration)
Short explanation.
AbstractItem * abstract_item
Short explanation.
Definition: basic_item.h:40