diff --git a/sources/editor/partarc.cpp b/sources/editor/partarc.cpp index bc953d642..1b39fe3d3 100644 --- a/sources/editor/partarc.cpp +++ b/sources/editor/partarc.cpp @@ -31,6 +31,9 @@ PartArc::PartArc(QETElementEditor *editor, QGraphicsItem *parent, QGraphicsScene start_angle(0) { setFlags(QGraphicsItem::ItemIsMovable | QGraphicsItem::ItemIsSelectable); +#if QT_VERSION >= 0x040600 + setFlag(QGraphicsItem::ItemSendsGeometryChanges, true); +#endif setAcceptedMouseButtons(Qt::LeftButton); informations = new ArcEditor(elementEditor(), this); informations -> setElementTypeName(name()); diff --git a/sources/editor/partcircle.cpp b/sources/editor/partcircle.cpp index e71e6c3dd..b8831b8a0 100644 --- a/sources/editor/partcircle.cpp +++ b/sources/editor/partcircle.cpp @@ -26,6 +26,9 @@ */ PartCircle::PartCircle(QETElementEditor *editor, QGraphicsItem *parent, QGraphicsScene *scene) : QGraphicsEllipseItem(parent, scene), CustomElementGraphicPart(editor) { setFlags(QGraphicsItem::ItemIsMovable | QGraphicsItem::ItemIsSelectable); +#if QT_VERSION >= 0x040600 + setFlag(QGraphicsItem::ItemSendsGeometryChanges, true); +#endif setAcceptedMouseButtons(Qt::LeftButton); informations = new CircleEditor(elementEditor(), this); informations -> setElementTypeName(name()); diff --git a/sources/editor/partellipse.cpp b/sources/editor/partellipse.cpp index c1ed1bc1e..5e535437e 100644 --- a/sources/editor/partellipse.cpp +++ b/sources/editor/partellipse.cpp @@ -26,6 +26,9 @@ */ PartEllipse::PartEllipse(QETElementEditor *editor, QGraphicsItem *parent, QGraphicsScene *scene) : QGraphicsEllipseItem(parent, scene), CustomElementGraphicPart(editor) { setFlags(QGraphicsItem::ItemIsMovable | QGraphicsItem::ItemIsSelectable); +#if QT_VERSION >= 0x040600 + setFlag(QGraphicsItem::ItemSendsGeometryChanges, true); +#endif setAcceptedMouseButtons(Qt::LeftButton); informations = new EllipseEditor(elementEditor(), this); informations -> setElementTypeName(name()); diff --git a/sources/editor/partline.cpp b/sources/editor/partline.cpp index 65d34f078..0934ed73a 100644 --- a/sources/editor/partline.cpp +++ b/sources/editor/partline.cpp @@ -34,6 +34,9 @@ PartLine::PartLine(QETElementEditor *editor, QGraphicsItem *parent, QGraphicsSce second_length(1.5) { setFlags(QGraphicsItem::ItemIsMovable | QGraphicsItem::ItemIsSelectable); +#if QT_VERSION >= 0x040600 + setFlag(QGraphicsItem::ItemSendsGeometryChanges, true); +#endif setAcceptedMouseButtons(Qt::LeftButton); informations = new LineEditor(elementEditor(), this); informations -> setElementTypeName(name()); diff --git a/sources/editor/partpolygon.cpp b/sources/editor/partpolygon.cpp index 5f1dac275..01eea254e 100644 --- a/sources/editor/partpolygon.cpp +++ b/sources/editor/partpolygon.cpp @@ -31,6 +31,9 @@ PartPolygon::PartPolygon(QETElementEditor *editor, QGraphicsItem *parent, QGraph closed(false) { setFlags(QGraphicsItem::ItemIsMovable | QGraphicsItem::ItemIsSelectable); +#if QT_VERSION >= 0x040600 + setFlag(QGraphicsItem::ItemSendsGeometryChanges, true); +#endif setAcceptedMouseButtons(Qt::LeftButton); informations = new PolygonEditor(elementEditor(), this); informations -> setElementTypeName(name()); diff --git a/sources/editor/partrectangle.cpp b/sources/editor/partrectangle.cpp index e648a7e3c..63e418ff7 100644 --- a/sources/editor/partrectangle.cpp +++ b/sources/editor/partrectangle.cpp @@ -26,6 +26,9 @@ */ PartRectangle::PartRectangle(QETElementEditor *editor, QGraphicsItem *parent, QGraphicsScene *scene) : QGraphicsRectItem(parent, scene), CustomElementGraphicPart(editor) { setFlags(QGraphicsItem::ItemIsMovable | QGraphicsItem::ItemIsSelectable); +#if QT_VERSION >= 0x040600 + setFlag(QGraphicsItem::ItemSendsGeometryChanges, true); +#endif setAcceptedMouseButtons(Qt::LeftButton); informations = new RectangleEditor(elementEditor(), this); informations -> setElementTypeName(name()); diff --git a/sources/editor/partterminal.cpp b/sources/editor/partterminal.cpp index 451cc1b4f..8ca9df8f9 100644 --- a/sources/editor/partterminal.cpp +++ b/sources/editor/partterminal.cpp @@ -34,6 +34,9 @@ PartTerminal::PartTerminal(QETElementEditor *editor, QGraphicsItem *parent, QGra informations -> setElementTypeName(name()); updateSecondPoint(); setFlags(QGraphicsItem::ItemIsMovable | QGraphicsItem::ItemIsSelectable); +#if QT_VERSION >= 0x040600 + setFlag(QGraphicsItem::ItemSendsGeometryChanges, true); +#endif setZValue(100000); } diff --git a/sources/editor/parttext.cpp b/sources/editor/parttext.cpp index bcbbad875..e80529015 100644 --- a/sources/editor/parttext.cpp +++ b/sources/editor/parttext.cpp @@ -34,6 +34,9 @@ PartText::PartText(QETElementEditor *editor, QGraphicsItem *parent, ElementScene setDefaultTextColor(Qt::black); setFont(QETApp::diagramTextsFont()); setFlags(QGraphicsItem::ItemIsMovable | QGraphicsItem::ItemIsSelectable); +#if QT_VERSION >= 0x040600 + setFlag(QGraphicsItem::ItemSendsGeometryChanges, true); +#endif setPlainText(QObject::tr("T", "default text when adding a text in the element editor")); infos = new TextEditor(elementEditor(), this); infos -> setElementTypeName(name()); @@ -147,7 +150,7 @@ void PartText::focusOutEvent(QFocusEvent *e) { setTextCursor(qtc); setTextInteractionFlags(Qt::NoTextInteraction); - setFlags(QGraphicsItem::ItemIsMovable | QGraphicsItem::ItemIsSelectable); + setFlag(QGraphicsItem::ItemIsFocusable, false); } /** @@ -155,7 +158,7 @@ void PartText::focusOutEvent(QFocusEvent *e) { @param e Le QGraphicsSceneMouseEvent qui decrit le double-clic */ void PartText::mouseDoubleClickEvent(QGraphicsSceneMouseEvent *e) { - setFlags(QGraphicsItem::ItemIsMovable | QGraphicsItem::ItemIsSelectable | QGraphicsItem::ItemIsFocusable); + setFlag(QGraphicsItem::ItemIsFocusable, true); setTextInteractionFlags(Qt::TextEditorInteraction); previous_text = toPlainText(); QGraphicsTextItem::mouseDoubleClickEvent(e); diff --git a/sources/editor/parttextfield.cpp b/sources/editor/parttextfield.cpp index 1fad8744c..ffcee2e85 100644 --- a/sources/editor/parttextfield.cpp +++ b/sources/editor/parttextfield.cpp @@ -34,6 +34,9 @@ PartTextField::PartTextField(QETElementEditor *editor, QGraphicsItem *parent, QG setDefaultTextColor(Qt::black); setFont(QETApp::diagramTextsFont()); setFlags(QGraphicsItem::ItemIsMovable | QGraphicsItem::ItemIsSelectable); +#if QT_VERSION >= 0x040600 + setFlag(QGraphicsItem::ItemSendsGeometryChanges, true); +#endif setPlainText(QObject::tr("_", "default text when adding a textfield in the element editor")); infos = new TextFieldEditor(elementEditor(), this); infos -> setElementTypeName(name()); @@ -166,7 +169,7 @@ void PartTextField::focusOutEvent(QFocusEvent *e) { setTextCursor(qtc); setTextInteractionFlags(Qt::NoTextInteraction); - setFlags(QGraphicsItem::ItemIsMovable | QGraphicsItem::ItemIsSelectable); + setFlag(QGraphicsItem::ItemIsFocusable, false); } /** @@ -174,7 +177,7 @@ void PartTextField::focusOutEvent(QFocusEvent *e) { @param e Le QGraphicsSceneMouseEvent qui decrit le double-clic */ void PartTextField::mouseDoubleClickEvent(QGraphicsSceneMouseEvent *e) { - setFlags(QGraphicsItem::ItemIsMovable | QGraphicsItem::ItemIsSelectable | QGraphicsItem::ItemIsFocusable); + setFlag(QGraphicsItem::ItemIsFocusable, true); setTextInteractionFlags(Qt::TextEditorInteraction); previous_text = toPlainText(); QGraphicsTextItem::mouseDoubleClickEvent(e);