diff --git a/src/core/types.hpp b/src/core/types.hpp index e2b43e59..43224d82 100644 --- a/src/core/types.hpp +++ b/src/core/types.hpp @@ -2,6 +2,7 @@ #include #include +#include #include #include @@ -21,6 +22,7 @@ public: Box(qint32 x, qint32 y, qint32 w, qint32 h): x(x), y(y), w(w), h(h) {} Q_INVOKABLE Box(const QRect& rect): x(rect.x()), y(rect.y()), w(rect.width()), h(rect.height()) {} + Q_INVOKABLE Box(const QPoint& rect): x(rect.x()), y(rect.y()) {} Q_INVOKABLE Box(const QRectF& rect) : x(static_cast(rect.x())) @@ -28,6 +30,10 @@ public: , w(static_cast(rect.width())) , h(static_cast(rect.height())) {} + Q_INVOKABLE Box(const QPointF& rect) + : x(static_cast(rect.x())) + , y(static_cast(rect.y())) {} + bool operator==(const Box& other) const; qint32 x = 0;