mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2025-12-20 16:20:52 +01:00
Correction d'un bug lors du deplacement d'elements
git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@149 bfdf4180-ca20-0410-9c96-a3a8aa849046
This commit is contained in:
@@ -154,11 +154,7 @@ void Conducer::segmentsToPath() {
|
|||||||
@param o2 Orientation de la borne 2
|
@param o2 Orientation de la borne 2
|
||||||
*/
|
*/
|
||||||
void Conducer::priv_modifieConducer(const QPointF &p1, QET::Orientation, const QPointF &p2, QET::Orientation) {
|
void Conducer::priv_modifieConducer(const QPointF &p1, QET::Orientation, const QPointF &p2, QET::Orientation) {
|
||||||
// determine le nombre de segments horizontaux et verticaux
|
Q_ASSERT_X(conducer_profile.nbSegments(QET::Both) > 1, "Conducer::priv_modifieConducer", "pas de points a modifier");
|
||||||
uint nb_horiz_segments = conducer_profile.nbSegments(QET::Horizontal);
|
|
||||||
uint nb_verti_segments = conducer_profile.nbSegments(QET::Vertical);
|
|
||||||
|
|
||||||
Q_ASSERT_X(nb_horiz_segments + nb_verti_segments > 1, "Conducer::priv_modifieConducer", "pas de points a modifier");
|
|
||||||
Q_ASSERT_X(!conducer_profile.isNull(), "Conducer::priv_modifieConducer", "pas de profil utilisable");
|
Q_ASSERT_X(!conducer_profile.isNull(), "Conducer::priv_modifieConducer", "pas de profil utilisable");
|
||||||
|
|
||||||
// recupere les coordonnees fournies des bornes
|
// recupere les coordonnees fournies des bornes
|
||||||
|
|||||||
@@ -22,6 +22,7 @@ Diagram::Diagram(QObject *parent) : QGraphicsScene(parent), qgi_manager(this) {
|
|||||||
conducer_setter -> setLine(QLineF(QPointF(0.0, 0.0), QPointF(0.0, 0.0)));
|
conducer_setter -> setLine(QLineF(QPointF(0.0, 0.0), QPointF(0.0, 0.0)));
|
||||||
draw_grid = true;
|
draw_grid = true;
|
||||||
use_border = true;
|
use_border = true;
|
||||||
|
moved_elements_fetched = false;
|
||||||
connect(this, SIGNAL(selectionChanged()), this, SLOT(slot_checkSelectionEmptinessChange()));
|
connect(this, SIGNAL(selectionChanged()), this, SLOT(slot_checkSelectionEmptinessChange()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -264,7 +264,8 @@ void Element::moveOtherElements(const QPointF &diff) {
|
|||||||
|
|
||||||
void Element::mouseReleaseEvent(QGraphicsSceneMouseEvent *e) {
|
void Element::mouseReleaseEvent(QGraphicsSceneMouseEvent *e) {
|
||||||
Diagram *diagram_ptr = diagram();
|
Diagram *diagram_ptr = diagram();
|
||||||
if (diagram_ptr && !diagram_ptr -> current_movement.isNull()) {
|
if (diagram_ptr) {
|
||||||
|
if (!diagram_ptr -> current_movement.isNull()) {
|
||||||
diagram_ptr -> undoStack().push(
|
diagram_ptr -> undoStack().push(
|
||||||
new MoveElementsCommand(
|
new MoveElementsCommand(
|
||||||
diagram_ptr,
|
diagram_ptr,
|
||||||
@@ -274,9 +275,10 @@ void Element::mouseReleaseEvent(QGraphicsSceneMouseEvent *e) {
|
|||||||
diagram_ptr -> current_movement
|
diagram_ptr -> current_movement
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
diagram_ptr -> invalidateMovedElements();
|
|
||||||
diagram_ptr -> current_movement = QPointF();
|
diagram_ptr -> current_movement = QPointF();
|
||||||
}
|
}
|
||||||
|
diagram_ptr -> invalidateMovedElements();
|
||||||
|
}
|
||||||
QGraphicsItem::mouseReleaseEvent(e);
|
QGraphicsItem::mouseReleaseEvent(e);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
</names>
|
</names>
|
||||||
<description>
|
<description>
|
||||||
<polygon x1="-7.5" y1="-13" x2="7.5" y2="-13" x3="0" y3="0" antialias="true" style="filling:white;" />
|
<polygon x1="-7.5" y1="-13" x2="7.5" y2="-13" x3="0" y3="0" antialias="true" style="filling:white;" />
|
||||||
<line x1="0" y1="0" x2="0" y2="13" antialias="false" />
|
<line x1="0" y1="0" x2="0" y2="15" antialias="false" />
|
||||||
<terminal orientation="s" x="0" y="15" />
|
<terminal orientation="s" x="0" y="15" />
|
||||||
</description>
|
</description>
|
||||||
</definition>
|
</definition>
|
||||||
|
|||||||
Reference in New Issue
Block a user