2018-09-30 16:26:06 +03:00
|
|
|
#include "guiobject.h"
|
|
|
|
|
2018-10-08 21:10:07 +03:00
|
|
|
GuiObject::GuiObject(QObject *ptr) :
|
2018-10-11 00:04:52 +03:00
|
|
|
QObject (ptr) {
|
2018-09-30 16:26:06 +03:00
|
|
|
|
2018-10-11 00:04:52 +03:00
|
|
|
generateId();
|
|
|
|
}
|
|
|
|
|
2018-10-11 18:09:35 +03:00
|
|
|
double GuiObject::angle() const {
|
|
|
|
return m_angle;
|
2018-09-30 16:26:06 +03:00
|
|
|
}
|
2018-10-08 21:10:07 +03:00
|
|
|
|
2018-10-11 18:09:35 +03:00
|
|
|
QString GuiObject::texture() const {
|
|
|
|
return m_texture;
|
2018-10-08 21:10:07 +03:00
|
|
|
}
|
|
|
|
|
2018-10-11 18:09:35 +03:00
|
|
|
void GuiObject::render() {
|
2018-10-08 21:10:07 +03:00
|
|
|
|
|
|
|
}
|
|
|
|
|
2018-10-11 18:09:35 +03:00
|
|
|
QRectF GuiObject::rect() const {
|
|
|
|
return m_rect;
|
2018-10-08 21:10:07 +03:00
|
|
|
}
|
|
|
|
|
2018-10-11 18:09:35 +03:00
|
|
|
QRectF& GuiObject::getRect() {
|
|
|
|
return m_rect;
|
2018-10-08 21:10:07 +03:00
|
|
|
}
|
|
|
|
|
2018-10-11 18:09:35 +03:00
|
|
|
void GuiObject::setAngle(double angle) {
|
|
|
|
m_angle = angle;
|
|
|
|
emit angleChanged(m_angle);
|
2018-10-08 21:10:07 +03:00
|
|
|
}
|
|
|
|
|
2018-10-11 18:09:35 +03:00
|
|
|
int GuiObject::guiId() const {
|
|
|
|
return m_guiId;
|
2018-10-11 00:04:52 +03:00
|
|
|
}
|
|
|
|
|
2018-10-11 18:09:35 +03:00
|
|
|
void GuiObject::generateId() {
|
|
|
|
static int id = 0;
|
|
|
|
m_guiId = id++;
|
2018-10-11 00:04:52 +03:00
|
|
|
}
|
|
|
|
|
2018-10-08 21:10:07 +03:00
|
|
|
void GuiObject::setTexture(const QString &texture) {
|
2018-10-11 18:09:35 +03:00
|
|
|
m_texture = texture;
|
|
|
|
emit textureChanged(m_texture);
|
2018-10-08 21:10:07 +03:00
|
|
|
}
|