[Uml-devel] KDE/kdesdk/umbrello/umbrello/widgets
Ralf Habacker
ralf.habacker at gmail.com
Fri Aug 10 08:17:23 UTC 2012
SVN commit 1309967 by habacker:
Refactored setMaximumSize/SetMinimumSize() calls to reduce the diff to soc branch.
Reordered maximum and minimum related functions to reduce the diff to soc branch.
M +2 -2 pinwidget.cpp
M +42 -61 umlwidget.cpp
M +6 -8 umlwidget.h
--- trunk/KDE/kdesdk/umbrello/umbrello/widgets/pinwidget.cpp #1309966:1309967
@@ -44,8 +44,8 @@
m_ignoreSnapToGrid = true;
m_ignoreSnapComponentSizeToGrid = true;
m_resizable = false;
- setMinimumSize(10,10);
- setMaximumSize(10,10);
+ setMinimumSize(UMLSceneSize(10,10));
+ setMaximumSize(UMLSceneSize(10,10));
setSize(10,10);
m_nY = y() < getMinY() ? getMinY() : y();
--- trunk/KDE/kdesdk/umbrello/umbrello/widgets/umlwidget.cpp #1309966:1309967
@@ -202,6 +202,48 @@
}
/**
+ * Compute the minimum possible width and height.
+ *
+ * @return UMLSceneSize(mininum_width, minimum_height)
+ */
+UMLSceneSize UMLWidget::minimumSize()
+{
+ return m_minimumSize;
+}
+
+/**
+ * This method is used to set the minimum size variable for this
+ * widget.
+ *
+ * @param newSize The size being set as minimum.
+ */
+void UMLWidget::setMinimumSize(const UMLSceneSize& newSize)
+{
+ m_minimumSize = newSize;
+}
+
+/**
+ * Compute the maximum possible width and height.
+ *
+ * @return maximum size
+ */
+UMLSceneSize UMLWidget::maximumSize()
+{
+ return m_maximumSize;
+}
+
+/**
+ * This method is used to set the maximum size variable for this
+ * widget.
+ *
+ * @param newSize The size being set as maximum.
+ */
+void UMLWidget::setMaximumSize(const UMLSceneSize& newSize)
+{
+ m_maximumSize = newSize;
+}
+
+/**
* Calls the method with the same name in UMLWidgetController.
* @see UMLWidgetController#mouseMoveEvent
*
@@ -988,67 +1030,6 @@
}
/**
- * Compute the minimum possible width and height.
- *
- * @return UMLSceneSize(mininum_width, minimum_height)
- */
-UMLSceneSize UMLWidget::minimumSize()
-{
- return m_minimumSize;
-}
-
-/**
- * This method is used to set the minimum size variable for this
- * widget.
- *
- * @param newSize The size being set as minimum.
- */
-void UMLWidget::setMinimumSize(const UMLSceneSize& newSize)
-{
- m_minimumSize = newSize;
-}
-
-void UMLWidget::setMinimumSize(UMLSceneValue width, UMLSceneValue height)
-{
- m_minimumSize.setWidth(width);
- m_minimumSize.setHeight(height);
-}
-
-/**
- * Compute the maximum possible width and height.
- *
- * @return maximum size
- */
-UMLSceneSize UMLWidget::maximumSize()
-{
- return m_maximumSize;
-}
-
-/**
- * This method is used to set the maximum size variable for this
- * widget.
- *
- * @param newSize The size being set as maximum.
- */
-void UMLWidget::setMaximumSize(const UMLSceneSize& newSize)
-{
- m_maximumSize = newSize;
-}
-
-/**
- * This method is used to set the maximum size variable for this
- * widget.
- *
- * @param width The width being set as maximum.
- * @param height The height being set as maximum.
- */
-void UMLWidget::setMaximumSize(UMLSceneValue width, UMLSceneValue height)
-{
- m_maximumSize.setWidth(width);
- m_maximumSize.setHeight(height);
-}
-
-/**
* calculate content related size of widget.
*
* @return calculated widget size
--- trunk/KDE/kdesdk/umbrello/umbrello/widgets/umlwidget.h #1309966:1309967
@@ -59,6 +59,12 @@
bool operator==(const UMLWidget& other) const;
+ virtual UMLSceneSize minimumSize();
+ void setMinimumSize(const UMLSceneSize &size);
+
+ virtual UMLSceneSize maximumSize();
+ void setMaximumSize(const UMLSceneSize &size);
+
void setUseFillColor(bool fc);
virtual void setTextColor(const QColor &color);
@@ -231,14 +237,6 @@
virtual void drawSelected(QPainter * p, int offsetX, int offsetY);
virtual void drawShape(QPainter &p);
- virtual UMLSceneSize minimumSize();
- void setMinimumSize(const UMLSceneSize &size);
- void setMinimumSize(UMLSceneValue width, UMLSceneValue height);
-
- virtual UMLSceneSize maximumSize();
- void setMaximumSize(const UMLSceneSize &size);
- void setMaximumSize(UMLSceneValue width, UMLSceneValue height);
-
virtual UMLSceneSize calculateSize();
bool fixedAspectRatio()
More information about the umbrello-devel
mailing list