[Uml-devel] KDE/kdesdk/umbrello/umbrello

Andi Fischer andi.fischer at hispeed.ch
Sun Oct 14 13:18:06 UTC 2012


SVN commit 1320503 by fischer:

Slot show() moved from scene to view according to API doc.

 M  +8 -11     umlscene.cpp  
 M  +0 -2      umlscene.h  
 M  +10 -0     umlview.cpp  
 M  +1 -0      umlview.h  
 M  +3 -3      widgets/widget_utils.cpp  
 M  +1 -1      widgets/widget_utils.h  


--- trunk/KDE/kdesdk/umbrello/umbrello/umlscene.cpp #1320502:1320503
@@ -3905,16 +3905,6 @@
 }
 
 /**
- * Overrides standard method from QWidget to resize canvas when
- * it's shown.
- */
-void UMLScene::show()
-{
-    activeView()->show();
-    resizeCanvasToItems();
-}
-
-/**
  * Updates the size of all components in this view.
  */
 void UMLScene::updateComponentSizes()
@@ -4404,6 +4394,7 @@
         widget->setX(smallestX);
         widget->adjustAssocs(widget->x(), widget->y());
     }
+    //TODO: Push stored cmds to stack.
 }
 
 /**
@@ -4420,6 +4411,7 @@
         widget->setX(biggestX - widget->width());
         widget->adjustAssocs(widget->x(), widget->y());
     }
+    //TODO: Push stored cmds to stack.
 }
 
 /**
@@ -4437,6 +4429,7 @@
         widget->setY(smallestY);
         widget->adjustAssocs(widget->x(), widget->y());
     }
+    //TODO: Push stored cmds to stack.
 }
 
 /**
@@ -4453,6 +4446,7 @@
         widget->setY(biggestY - widget->height());
         widget->adjustAssocs(widget->x(), widget->y());
     }
+    //TODO: Push stored cmds to stack.
 }
 
 /**
@@ -4472,6 +4466,7 @@
         widget->setX(middle - int(widget->width() / 2));
         widget->adjustAssocs(widget->x(), widget->y());
     }
+    //TODO: Push stored cmds to stack.
 }
 
 /**
@@ -4491,6 +4486,7 @@
         widget->setY(middle - int(widget->height() / 2));
         widget->adjustAssocs(widget->x(), widget->y());
     }
+    //TODO: Push stored cmds to stack.
 }
 
 /**
@@ -4521,6 +4517,7 @@
         }
         i++;
     }
+    //TODO: Push stored cmds to stack.
 }
 
 /**
@@ -4551,7 +4548,7 @@
         }
         i++;
     }
-
+    //TODO: Push stored cmds to stack.
 }
 
 /**
--- trunk/KDE/kdesdk/umbrello/umbrello/umlscene.h #1320502:1320503
@@ -564,8 +564,6 @@
     bool isWidgetOrAssociation(const UMLScenePoint& atPos);
 
 public slots:
-    void show();
-
     void slotToolBarChanged(int c);
     void slotObjectCreated(UMLObject * o);
     void slotObjectRemoved(UMLObject * o);
--- trunk/KDE/kdesdk/umbrello/umbrello/umlview.cpp #1320502:1320503
@@ -108,6 +108,16 @@
 }
 
 /**
+ * Overrides standard method from QWidget to resize canvas when
+ * it's shown.
+ */
+void UMLView::show()
+{
+    QWidget::show();
+    umlScene()->resizeCanvasToItems();
+}
+
+/**
  * Override standard method - Q3CanvasView specific.
  * Superceded by UMLScene::dragEnterEvent() - to be removed when transition
  * to QGraphicsView is complete
--- trunk/KDE/kdesdk/umbrello/umbrello/umlview.h #1320502:1320503
@@ -45,6 +45,7 @@
 public slots:
     void zoomIn();
     void zoomOut();
+    void show();
 
 protected:
     void dragEnterEvent(QDragEnterEvent* mouseEvent);
--- trunk/KDE/kdesdk/umbrello/umbrello/widgets/widget_utils.cpp #1320502:1320503
@@ -127,7 +127,7 @@
      * @param triSize The size of the triange in the top-right corner.
      */
     void drawTriangledRect(QPainter *painter,
-                           const QRectF& rect, const QSizeF& triSize)
+                           const UMLSceneRect& rect, const UMLSceneSize& triSize)
     {
         // Draw outer boundary defined by polygon "poly".
         QPolygonF poly(5);
@@ -139,9 +139,9 @@
         painter->drawPolygon(poly);
 
         // Now draw the triangle base and height edges.
-        QLineF heightEdge(poly[1], poly[1] + QPointF(0, triSize.height()));
+        UMLSceneLine heightEdge(poly[1], poly[1] + QPointF(0, triSize.height()));
         painter->drawLine(heightEdge);
-        QLineF baseEdge(heightEdge.p2(), poly[2]);
+        UMLSceneLine baseEdge(heightEdge.p2(), poly[2]);
         painter->drawLine(baseEdge);
     }
 
--- trunk/KDE/kdesdk/umbrello/umbrello/widgets/widget_utils.h #1320502:1320503
@@ -35,7 +35,7 @@
     UMLSceneRectItem* decoratePoint(const UMLScenePoint& p);
 
     void drawCrossInEllipse(QPainter *p, const QRectF& ellipse);
-    void drawTriangledRect(QPainter *painter, const QRectF& rect, const QSizeF& triSize);
+    void drawTriangledRect(QPainter *painter, const UMLSceneRect& rect, const UMLSceneSize& triSize);
     void drawArrowHead(QPainter *painter, const QPointF& arrowPos,
                        const QSizeF& arrowSize, Qt::ArrowType arrowType,
                        bool solid = false);




More information about the umbrello-devel mailing list