diff --git a/include/graphicsItem/graphicsTextItem.h b/include/graphicsItem/graphicsTextItem.h index 284f344..bced226 100644 --- a/include/graphicsItem/graphicsTextItem.h +++ b/include/graphicsItem/graphicsTextItem.h @@ -13,7 +13,8 @@ class GraphicsTextItem : public AbstractShapeType, { Q_OBJECT Q_PROPERTY(QString text READ toPlainText WRITE setPlainText) - Q_PROPERTY(QFont itemFont READ itemFont WRITE setItemFont) + Q_PROPERTY(QPointF ptPosition READ pos WRITE setPos FINAL) + Q_PROPERTY(QFont textFont READ textFont WRITE setTextFont) Q_PROPERTY(QColor textColor READ textColor WRITE setTextColor) Q_PROPERTY(QColor backgroundColor READ brushColor WRITE setBrushColor) @@ -41,8 +42,8 @@ public: void syncRotationDataFromParent(const double &) override; // Font property accessors - QFont itemFont() const { return font(); } - void setItemFont(const QFont &f) { setFont(f); updateSizeFromText(); } + QFont textFont() const { return font(); } + void setTextFont(const QFont &f) { setFont(f); updateSizeFromText(); } // Text color accessor (foreground) QColor textColor() const { return defaultTextColor(); } diff --git a/source/graphicsItem/graphicsTextItem.cpp b/source/graphicsItem/graphicsTextItem.cpp index 3b70d64..291094f 100644 --- a/source/graphicsItem/graphicsTextItem.cpp +++ b/source/graphicsItem/graphicsTextItem.cpp @@ -65,7 +65,8 @@ QString GraphicsTextItem::getPropertyGroup(const QString &propertyName) const { QList properties = { QStringLiteral("text"), - QStringLiteral("itemFont"), + QStringLiteral("ptPosition"), + QStringLiteral("textFont"), QStringLiteral("textColor"), QStringLiteral("backgroundColor") };