Correcting dynamicElementTextItem alignment on copying

When copying and pasting selected areas, right-aligned dynamic text in
report and slave elements was not displayed correctly. The text
insertion point was always shifted to the left by the text width.

To correct this, the insertion point of dynamicElementTextItems is reset
to its origin insertion point before writing to clipboard.
This commit is contained in:
achim
2025-08-02 23:27:09 +02:00
parent f20ea041b6
commit 0a6efa466e
3 changed files with 93 additions and 4 deletions

View File

@@ -142,6 +142,8 @@ class Diagram : public QGraphicsScene
void wheelEvent (QGraphicsSceneWheelEvent *event) override;
void keyPressEvent (QKeyEvent *event) override;
void keyReleaseEvent (QKeyEvent *) override;
void correctTextPos(Element* elmt);
void restoreText(Element* elmt);
public:
QUuid uuid();
@@ -167,7 +169,7 @@ class Diagram : public QGraphicsScene
QList < QSet <Conductor *> > potentials();
// methods related to XML import/export
QDomDocument toXml(bool = true);
QDomDocument toXml(bool wholeContent = true, bool is_copy_command = false);
bool initFromXml(QDomElement &,
QPointF = QPointF(),
bool = true,