2018-09-30 16:26:06 +03:00
|
|
|
#ifndef GUIOBJECT_H
|
|
|
|
#define GUIOBJECT_H
|
|
|
|
|
2018-10-08 21:10:07 +03:00
|
|
|
#include "baseclass.h"
|
|
|
|
#include "QObject"
|
2018-09-30 16:26:06 +03:00
|
|
|
|
2018-10-11 18:09:35 +03:00
|
|
|
#include <QRectF>
|
|
|
|
|
2018-10-08 21:10:07 +03:00
|
|
|
class GuiObject:public QObject, public BaseClass
|
2018-09-30 16:26:06 +03:00
|
|
|
{
|
2018-10-08 21:10:07 +03:00
|
|
|
Q_OBJECT
|
2018-10-11 18:09:35 +03:00
|
|
|
|
|
|
|
Q_PROPERTY(double angle READ angle NOTIFY angleChanged)
|
|
|
|
Q_PROPERTY(QString texture READ texture NOTIFY textureChanged)
|
2018-11-04 16:11:55 +03:00
|
|
|
Q_PROPERTY(QRectF rect READ rect WRITE setRect NOTIFY rectChanged)
|
2018-10-11 18:09:35 +03:00
|
|
|
Q_PROPERTY(int guiId READ guiId NOTIFY guiIdChanged)
|
|
|
|
|
2018-10-11 00:04:52 +03:00
|
|
|
private:
|
|
|
|
void generateId();
|
2018-10-11 18:09:35 +03:00
|
|
|
|
2018-10-08 21:10:07 +03:00
|
|
|
protected:
|
2018-10-11 18:09:35 +03:00
|
|
|
int m_guiId;
|
|
|
|
double m_angle;
|
|
|
|
QString m_texture;
|
|
|
|
QRectF m_rect;
|
2018-10-11 00:04:52 +03:00
|
|
|
|
|
|
|
void setTexture(const QString &texture);
|
2018-11-04 16:11:55 +03:00
|
|
|
void setRect(QRectF rect);
|
|
|
|
|
|
|
|
|
2018-09-30 16:26:06 +03:00
|
|
|
public:
|
2018-10-08 21:10:07 +03:00
|
|
|
GuiObject(QObject *ptr = nullptr);
|
|
|
|
|
2018-10-11 18:09:35 +03:00
|
|
|
double angle() const;
|
|
|
|
QString texture() const;
|
2018-10-08 21:10:07 +03:00
|
|
|
|
2018-10-11 18:09:35 +03:00
|
|
|
void render();
|
2018-10-08 21:10:07 +03:00
|
|
|
|
2018-10-11 18:09:35 +03:00
|
|
|
QRectF rect() const;
|
|
|
|
QRectF &getRect();
|
|
|
|
void setAngle(double angle);
|
|
|
|
int guiId() const;
|
2018-10-11 00:04:52 +03:00
|
|
|
|
2018-10-11 18:09:35 +03:00
|
|
|
signals:
|
|
|
|
void angleChanged(double angle);
|
|
|
|
void textureChanged(QString texture);
|
|
|
|
void rectChanged(QRectF rect);
|
|
|
|
void guiIdChanged(int guiId);
|
2018-09-30 16:26:06 +03:00
|
|
|
};
|
|
|
|
|
2018-10-08 21:10:07 +03:00
|
|
|
#endif // GUIOBJECT_H
|