[Uml-devel] branches/work/soc-umbrello/umbrello

Gopala Krishna A krishna.ggk at gmail.com
Fri Jul 25 13:53:42 UTC 2008


SVN commit 837695 by gopala:

Use setIsInstance, isInstance non virtual methods operating on
variable m_isInstance in NewUMLRectWidget rather than using a virtual
isIntance method.



 M  +10 -0     newumlrectwidget.cpp  
 M  +4 -2      newumlrectwidget.h  


--- branches/work/soc-umbrello/umbrello/newumlrectwidget.cpp #837694:837695
@@ -44,6 +44,7 @@
 	m_minimumSize(NewUMLRectWidget::DefaultMinimumSize),
 	m_maximumSize(NewUMLRectWidget::DefaultMaximumSize),
 	m_margin(5.0), // Default margin size
+	m_isInstance(false),
     m_resizable(true),
     m_widgetHandle(0)
 {
@@ -137,6 +138,13 @@
     updateTextItemGroups();
 }
 
+/// Sets whether this object is instance or not.
+void NewUMLRectWidget::setIsInstance(bool b)
+{
+	m_isInstance = b;
+	updateTextItemGroups();
+}
+
 void NewUMLRectWidget::setShowStereotype(bool b)
 {
     m_showStereotype = b;
@@ -391,6 +399,7 @@
 	m_minimumSize(NewUMLRectWidget::DefaultMinimumSize),
 	m_maximumSize(NewUMLRectWidget::DefaultMaximumSize),
 	m_margin(5),
+	m_isInstance(false),
 	m_resizable(true),
     m_widgetHandle(0)
 {
@@ -402,6 +411,7 @@
 	m_minimumSize(NewUMLRectWidget::DefaultMinimumSize),
 	m_maximumSize(NewUMLRectWidget::DefaultMaximumSize),
 	m_margin(5),
+	m_isInstance(false),
 	m_resizable(true),
     m_widgetHandle(0)
 {
--- branches/work/soc-umbrello/umbrello/newumlrectwidget.h #837694:837695
@@ -98,9 +98,10 @@
     void setInstanceName(const QString &name);
 
 	/// @return Whether this is an instance or not.
-    virtual bool isInstance() const {
-		return false;
+	bool isInstance() const {
+		return m_isInstance;
 	}
+	void setIsInstance(bool b);
 
 	/// @return Whether to show stereotype or not.
     bool showStereotype() const {
@@ -161,6 +162,7 @@
 	qreal m_margin;
 
 	QString m_instanceName;
+	bool m_isInstance;
 	bool m_showStereotype;
 
 	/// Whether resizable or not.




More information about the umbrello-devel mailing list