Correction d'un bug dans la modification des conducteurs apres un deplacement d'elements

Implementation partielle de l'alignement des conducteurs sur la grille. Lors de la modification manuelle des conducteurs, les segments se fixent sur la grille. L'ancien comportement peut etre obtenu en maintenant la touche Shift enfoncee.
Optimisation des fonctions "Selectionner tout" et "Deselectionner tout"
Remplacement des #define par des attributs static const


git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@168 bfdf4180-ca20-0410-9c96-a3a8aa849046
This commit is contained in:
xavierqet
2007-10-10 22:35:32 +00:00
parent 08b01bccb0
commit b91b418c95
12 changed files with 63 additions and 42 deletions

View File

@@ -47,7 +47,9 @@ DiagramView::~DiagramView() {
*/
void DiagramView::selectAll() {
if (scene -> items().isEmpty()) return;
foreach (QGraphicsItem *item, scene -> items()) item -> setSelected(true);
QPainterPath path;
path.addRect(scene -> itemsBoundingRect());
scene -> setSelectionArea(path);
}
/**
@@ -55,7 +57,7 @@ void DiagramView::selectAll() {
*/
void DiagramView::selectNothing() {
if (scene -> items().isEmpty()) return;
foreach (QGraphicsItem *item, scene -> items()) item -> setSelected(false);
scene -> clearSelection();
}
/**
@@ -595,7 +597,7 @@ void DiagramView::adjustSceneRect() {
QRectF elements_bounding_rect = scene -> itemsBoundingRect();
// rectangle contenant le cadre = colonnes + cartouche
QRectF border_bounding_rect = scene -> border().adjusted(-MARGIN, -MARGIN, MARGIN, MARGIN);
QRectF border_bounding_rect = scene -> border().adjusted(-Diagram::margin, -Diagram::margin, Diagram::margin, Diagram::margin);
// ajuste la sceneRect
QRectF new_scene_rect = elements_bounding_rect.united(border_bounding_rect);