[Uml-devel] KDE/kdesdk/umbrello/umbrello
Ralf Habacker
ralf.habacker at gmail.com
Mon Mar 12 02:05:47 UTC 2012
SVN commit 1285083 by habacker:
Added state widget type selection to dot generator.
M +8 -4 dotgenerator.h
A layouts/state-export.desktop
M +7 -0 widgets/statewidget.h
--- trunk/KDE/kdesdk/umbrello/umbrello/dotgenerator.h #1285082:1285083
@@ -12,6 +12,7 @@
// app includes
#include "associationwidget.h"
+#include "statewidget.h"
#include "debug_utils.h"
#include "umlwidget.h"
@@ -210,15 +211,18 @@
QString type = QString(widget->baseTypeStr()).toLower().remove("wt_");
QString key = "type::" + type;
+
+ if (type == "state") {
+ StateWidget *w = static_cast<StateWidget *>(widget);
+ type = w->stateTypeStr().toLower();
+ }
+ key = "type::" + type;
QString label = widget->name() + "\\n" + type;
if (m_nodeParameters.contains(key))
params << m_nodeParameters[key];
- else if (m_nodeParameters.contains("type::default")) {
+ else if (m_nodeParameters.contains("type::default"))
params << m_nodeParameters["type::default"];
- if (label.isEmpty())
- label = type;
- }
params << QString("label=\"%1\"").arg(label);
--- trunk/KDE/kdesdk/umbrello/umbrello/widgets/statewidget.h #1285082:1285083
@@ -13,7 +13,9 @@
#include <QtGui/QPainter>
#include <QtCore/QStringList>
+#include <QMetaEnum>
+#include "debug_utils.h"
#include "umlwidget.h"
#include "worktoolbar.h"
@@ -67,6 +69,11 @@
virtual void setName(const QString &strName);
StateType stateType() const;
+ QString stateTypeStr() const
+ {
+ return QLatin1String(ENUM_NAME(StateWidget, StateType, m_stateType));
+ }
+
void setStateType(StateType stateType);
bool addActivity(const QString &activity);
More information about the umbrello-devel
mailing list