[Uml-devel] branches/work/soc-umbrello/umbrello
Gopala Krishna A
krishna.ggk at gmail.com
Wed Oct 1 17:29:46 UTC 2008
SVN commit 866695 by gopala:
Added Q_PROPERTY lines for some widgets (WidgetBase and UMLWidget
mainly) as a first step which eases undo/redo implementation.
M +6 -2 activitywidget.h
M +2 -1 classifierwidget.h
M +2 -0 enumwidget.h
M +1 -0 forkjoinwidget.h
M +1 -0 objectnodewidget.h
M +4 -6 objectwidget.h
M +10 -0 umlwidget.h
M +9 -1 widgetbase.h
--- branches/work/soc-umbrello/umbrello/activitywidget.h #866694:866695
@@ -31,7 +31,11 @@
*/
class ActivityWidget : public UMLWidget
{
-Q_OBJECT
+ Q_OBJECT
+ Q_ENUMS(ActivityType)
+ Q_PROPERTY(ActivityType activityType READ activityType WRITE setActivityType DESIGNABLE false)
+ Q_PROPERTY(QString preconditionText READ preconditionText WRITE setPreconditionText DESIGNABLE false)
+ Q_PROPERTY(QString postconditionText READ postconditionText WRITE setPostconditionText DESIGNABLE false)
public:
enum ActivityType
@@ -89,7 +93,7 @@
*/
bool m_NormalActivityType;
- public Q_SLOTS:
+public Q_SLOTS:
virtual void slotMenuSelection(QAction* action);
--- branches/work/soc-umbrello/umbrello/classifierwidget.h #866694:866695
@@ -30,7 +30,8 @@
*/
class ClassifierWidget : public UMLWidget
{
- Q_OBJECT;
+ Q_OBJECT
+ Q_ENUMS(VisualProperty)
public:
/**
--- branches/work/soc-umbrello/umbrello/enumwidget.h #866694:866695
@@ -33,6 +33,8 @@
class EnumWidget : public UMLWidget
{
Q_OBJECT
+ Q_PROPERTY(bool showPackage READ showPackage WRITE setShowPackage)
+
public:
explicit EnumWidget(UMLObject* o);
virtual ~EnumWidget();
--- branches/work/soc-umbrello/umbrello/forkjoinwidget.h #866694:866695
@@ -27,6 +27,7 @@
class ForkJoinWidget : public BoxWidget
{
Q_OBJECT
+ Q_PROPERTY(Qt::Orientation orientation READ orientation WRITE setOrientation)
public:
explicit ForkJoinWidget(Qt::Orientation o = Qt::Horizontal, Uml::IDType id = Uml::id_None);
--- branches/work/soc-umbrello/umbrello/objectnodewidget.h #866694:866695
@@ -26,6 +26,7 @@
class ObjectNodeWidget : public UMLWidget
{
Q_OBJECT
+ Q_PROPERTY(QString state READ state WRITE setState)
public:
enum ObjectNodeType
--- branches/work/soc-umbrello/umbrello/objectwidget.h #866694:866695
@@ -12,12 +12,6 @@
#ifndef OBJECTWIDGET_H
#define OBJECTWIDGET_H
-#define O_MARGIN 5
-#define O_WIDTH 40
-#define A_WIDTH 20
-#define A_HEIGHT 40
-#define A_MARGIN 5
-
#include "messagewidgetlist.h"
#include "messagewidget.h"
@@ -37,6 +31,10 @@
class ObjectWidget : public UMLWidget
{
Q_OBJECT
+ Q_PROPERTY(bool multipleInstance READ multipleInstance WRITE setMultipleInstance)
+ Q_PROPERTY(bool drawAsActor READ drawAsActor WRITE setDrawAsActor)
+ Q_PROPERTY(bool showDestruction READ showDestruction WRITE setShowDestruction)
+
public:
ObjectWidget(UMLObject *o, const Uml::IDType &lid = Uml::id_None );
virtual ~ObjectWidget();
--- branches/work/soc-umbrello/umbrello/umlwidget.h #866694:866695
@@ -41,6 +41,16 @@
class UMLWidget : public WidgetBase
{
Q_OBJECT
+ Q_PROPERTY(QSizeF minimumSize READ minimumSize WRITE setMinimumSize DESIGNABLE false)
+ Q_PROPERTY(QSizeF maximumSize READ maximumSize WRITE setMaximumSize DESIGNABLE false)
+ Q_PROPERTY(QSizeF size READ size WRITE setSize)
+ Q_PROPERTY(bool resizable READ isResizable WRITE setResizable DESIGNABLE false)
+ Q_PROPERTY(QRectF rect READ rect DESIGNABLE false)
+ Q_PROPERTY(double margin READ margin WRITE setMargin)
+ Q_PROPERTY(QString instanceName READ instanceName WRITE setInstanceName)
+ Q_PROPERTY(bool isInstance READ isInstance WRITE setIsInstance)
+ Q_PROPERTY(bool showStereotype READ showStereotype WRITE setShowStereotype)
+
public:
/**
--- branches/work/soc-umbrello/umbrello/widgetbase.h #866694:866695
@@ -50,7 +50,15 @@
*/
class WidgetBase : public QObject, public QGraphicsItem
{
- Q_OBJECT;
+ Q_OBJECT
+ Q_PROPERTY(QString name READ name WRITE setName)
+ Q_PROPERTY(QString documentation READ documentation WRITE setDocumentation)
+ Q_PROPERTY(QColor lineColor READ lineColor WRITE setLineColor)
+ Q_PROPERTY(uint lineWidth READ lineWidth WRITE setLineWidth)
+ Q_PROPERTY(QColor fontColor READ fontColor WRITE setFontColor)
+ Q_PROPERTY(QBrush brush READ brush WRITE setBrush)
+ Q_PROPERTY(QFont font READ font WRITE setFont)
+ Q_PROPERTY(QPointF pos READ pos WRITE setPos)
public:
/**
* This enumeration is used by WidgetBase::attributeChange() to
More information about the umbrello-devel
mailing list