feat: add ptposition property to tect item
This commit is contained in:
parent
2e93156093
commit
fda709c0e2
|
|
@ -13,7 +13,8 @@ class GraphicsTextItem : public AbstractShapeType<QGraphicsTextItem>,
|
|||
{
|
||||
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(); }
|
||||
|
|
|
|||
|
|
@ -65,7 +65,8 @@ QString GraphicsTextItem::getPropertyGroup(const QString &propertyName) const
|
|||
{
|
||||
QList<QString> properties = {
|
||||
QStringLiteral("text"),
|
||||
QStringLiteral("itemFont"),
|
||||
QStringLiteral("ptPosition"),
|
||||
QStringLiteral("textFont"),
|
||||
QStringLiteral("textColor"),
|
||||
QStringLiteral("backgroundColor")
|
||||
};
|
||||
|
|
|
|||
Loading…
Reference in New Issue