mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2025-12-21 16:50:53 +01:00
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:
@@ -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"));
|
setPlainText(QObject::tr("T", "default text when adding a text in the element editor"));
|
||||||
|
|
||||||
adjustItemPosition(1);
|
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(blockCountChanged(int)), this, SLOT(adjustItemPosition(int)));
|
||||||
connect(document(), SIGNAL(contentsChanged()), this, SLOT(adjustItemPosition()));
|
connect(document(), SIGNAL(contentsChanged()), this, SLOT(adjustItemPosition()));
|
||||||
}
|
}
|
||||||
@@ -219,6 +219,8 @@ void PartText::setProperty(const QString &property, const QVariant &value) {
|
|||||||
} else if (property == "color") {
|
} else if (property == "color") {
|
||||||
setBlack(value.toBool());
|
setBlack(value.toBool());
|
||||||
}
|
}
|
||||||
|
// adjust item position, especially useful when changing text or size
|
||||||
|
adjustItemPosition();
|
||||||
update();
|
update();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ PartTextField::PartTextField(QETElementEditor *editor, QGraphicsItem *parent, QG
|
|||||||
setPlainText(QObject::tr("_", "default text when adding a textfield in the element editor"));
|
setPlainText(QObject::tr("_", "default text when adding a textfield in the element editor"));
|
||||||
|
|
||||||
adjustItemPosition(1);
|
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(blockCountChanged(int)), this, SLOT(adjustItemPosition(int)));
|
||||||
connect(document(), SIGNAL(contentsChanged()), this, SLOT(adjustItemPosition()));
|
connect(document(), SIGNAL(contentsChanged()), this, SLOT(adjustItemPosition()));
|
||||||
}
|
}
|
||||||
@@ -201,6 +201,8 @@ void PartTextField::setProperty(const QString &property, const QVariant &value)
|
|||||||
} else if (property == "rotate") {
|
} else if (property == "rotate") {
|
||||||
follow_parent_rotations = value.toBool();
|
follow_parent_rotations = value.toBool();
|
||||||
}
|
}
|
||||||
|
// adjust item position, especially useful when changing text or size
|
||||||
|
adjustItemPosition();
|
||||||
update();
|
update();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user