Element editor: fixed a text position bug that occurred when changing font size.

git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@1865 bfdf4180-ca20-0410-9c96-a3a8aa849046
This commit is contained in:
xavier
2012-05-27 15:18:21 +00:00
parent 869cd4baf5
commit 800aa588bf
2 changed files with 6 additions and 2 deletions

View File

@@ -44,7 +44,7 @@ PartText::PartText(QETElementEditor *editor, QGraphicsItem *parent, ElementScene
setPlainText(QObject::tr("T", "default text when adding a text in the element editor"));
adjustItemPosition(1);
// ajuste la position du champ de texte lorsqu'on lui ajoute/retire des lignes ou lorsqu'on change sa taille de police
// adjust textfield position after line additions/deletions
connect(document(), SIGNAL(blockCountChanged(int)), this, SLOT(adjustItemPosition(int)));
connect(document(), SIGNAL(contentsChanged()), this, SLOT(adjustItemPosition()));
}
@@ -219,6 +219,8 @@ void PartText::setProperty(const QString &property, const QVariant &value) {
} else if (property == "color") {
setBlack(value.toBool());
}
// adjust item position, especially useful when changing text or size
adjustItemPosition();
update();
}

View File

@@ -40,7 +40,7 @@ PartTextField::PartTextField(QETElementEditor *editor, QGraphicsItem *parent, QG
setPlainText(QObject::tr("_", "default text when adding a textfield in the element editor"));
adjustItemPosition(1);
// ajuste la position du champ de texte lorsqu'on lui ajoute/retire des lignes ou lorsqu'on change sa taille de police
// adjust textfield position after line additions/deletions
connect(document(), SIGNAL(blockCountChanged(int)), this, SLOT(adjustItemPosition(int)));
connect(document(), SIGNAL(contentsChanged()), this, SLOT(adjustItemPosition()));
}
@@ -201,6 +201,8 @@ void PartTextField::setProperty(const QString &property, const QVariant &value)
} else if (property == "rotate") {
follow_parent_rotations = value.toBool();
}
// adjust item position, especially useful when changing text or size
adjustItemPosition();
update();
}