git-svn-id: svn://db.shs.com.ru/libs@303 a8b55f48-bf90-11e4-a774-851b48703e85

This commit is contained in:
2017-10-21 20:42:32 +00:00
parent 3324d9753c
commit 7353ce37ba
3 changed files with 31 additions and 2 deletions

View File

@@ -13,13 +13,13 @@ public:
AlignedTextItem(const QString & text, QGraphicsItem * parent = 0);
void setText(const QString & t) {text_.setText(t); _move();}
void setFont(const QFont & f) {text_.setFont(f); _move();}
void setFont(const QFont & f);
void setPen(const QPen & p) {text_.setPen(p); _move();}
void setBrush(const QBrush & b) {text_.setBrush(b); _move();}
void setAlignment(Qt::Alignment align) {align_ = align; _move();}
QString text() const {return text_.text();}
QFont font() const {return text_.font();}
QFont font() const {return /*text_.font()*/font_;}
QPen pen() const {return text_.pen();}
QBrush brush() const {return text_.brush();}
Qt::Alignment alignment() const {return align_;}
@@ -27,6 +27,8 @@ public:
void clear() {setText(QString());}
enum {Type = UserType + 0x100};
static QFont sceneFont(const QFont & f);
protected:
virtual QRectF boundingRect() const {return text_.boundingRect().translated(text_.pos());}
@@ -38,6 +40,7 @@ protected:
QGraphicsSimpleTextItem text_;
Qt::Alignment align_;
QFont font_;
};