[qet] [1865] Element editor: fixed a text position bug that occurred when changing font size. |
[ Thread Index |
Date Index
| More lists.tuxfamily.org/qet Archives
]
Revision: 1865
Author: xavier
Date: 2012-05-27 17:18:21 +0200 (Sun, 27 May 2012)
Log Message:
-----------
Element editor: fixed a text position bug that occurred when changing font size.
Modified Paths:
--------------
trunk/sources/editor/parttext.cpp
trunk/sources/editor/parttextfield.cpp
Modified: trunk/sources/editor/parttext.cpp
===================================================================
--- trunk/sources/editor/parttext.cpp 2012-05-27 14:02:18 UTC (rev 1864)
+++ trunk/sources/editor/parttext.cpp 2012-05-27 15:18:21 UTC (rev 1865)
@@ -44,7 +44,7 @@
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 @@
} else if (property == "color") {
setBlack(value.toBool());
}
+ // adjust item position, especially useful when changing text or size
+ adjustItemPosition();
update();
}
Modified: trunk/sources/editor/parttextfield.cpp
===================================================================
--- trunk/sources/editor/parttextfield.cpp 2012-05-27 14:02:18 UTC (rev 1864)
+++ trunk/sources/editor/parttextfield.cpp 2012-05-27 15:18:21 UTC (rev 1865)
@@ -40,7 +40,7 @@
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 @@
} else if (property == "rotate") {
follow_parent_rotations = value.toBool();
}
+ // adjust item position, especially useful when changing text or size
+ adjustItemPosition();
update();
}