summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRalf Habacker <[email protected]>2015-05-18 10:45:23 +0200
committerRalf Habacker <[email protected]>2015-05-18 10:51:19 +0200
commit8e6e605c0d62f5ba1ccf1d5b071e420c9ee726f4 (patch)
treee4ba3157bc3d7d53c4bddf65bd95ed3e29ba137d
parentbb94b057a294204c168b3ddbbe398e99b73c87de (diff)
Fix 'No colour change for fork/join widgets possible'.
FIXED-IN:2.16.2 (KDE Applications 15.04.2) Bug:347886
-rw-r--r--umbrello/widgets/forkjoinwidget.cpp21
-rw-r--r--umbrello/widgets/forkjoinwidget.h2
2 files changed, 22 insertions, 1 deletions
diff --git a/umbrello/widgets/forkjoinwidget.cpp b/umbrello/widgets/forkjoinwidget.cpp
index f2172e1..43dc554 100644
--- a/umbrello/widgets/forkjoinwidget.cpp
+++ b/umbrello/widgets/forkjoinwidget.cpp
@@ -14,8 +14,12 @@
//app includes
#include "debug_utils.h"
#include "umlview.h"
+#include "umldoc.h"
#include "listpopupmenu.h"
+// qt includes
+#include <QColorDialog>
+
/**
* Constructs a ForkJoinWidget.
*
@@ -28,6 +32,8 @@ ForkJoinWidget::ForkJoinWidget(UMLScene * scene, Qt::Orientation ori, Uml::ID::T
m_orientation(ori)
{
setSize(10, 40);
+ m_usesDiagramFillColor = false;
+ setFillColorCmd(QColor("black"));
}
/**
@@ -64,7 +70,7 @@ void ForkJoinWidget::paint(QPainter *painter, const QStyleOptionGraphicsItem *op
Q_UNUSED(option);
Q_UNUSED(widget);
- painter->fillRect(0, 0, width(), height(), QBrush(Qt::black));
+ painter->fillRect(0, 0, width(), height(), fillColor());
UMLWidget::paint(painter, option, widget);
}
@@ -108,6 +114,19 @@ void ForkJoinWidget::saveToXMI(QDomDocument& qDoc, QDomElement& qElement)
}
/**
+ * Show a properties dialog for a Fork/Join Widget.
+ */
+void ForkJoinWidget::showPropertiesDialog()
+{
+ QColor newColor = QColorDialog::getColor(fillColor()); // krazy:exclude=qclasses
+ if (newColor != fillColor()) {
+ setFillColor(newColor);
+ setUsesDiagramFillColor(false);
+ umlDoc()->setModified(true);
+ }
+}
+
+/**
* Reimplemented form UMLWidget::slotMenuSelection to handle
* Flip action.
*/
diff --git a/umbrello/widgets/forkjoinwidget.h b/umbrello/widgets/forkjoinwidget.h
index a90260f..89b218a 100644
--- a/umbrello/widgets/forkjoinwidget.h
+++ b/umbrello/widgets/forkjoinwidget.h
@@ -38,6 +38,8 @@ public:
virtual bool loadFromXMI(QDomElement & qElement);
virtual void saveToXMI(QDomDocument& qDoc, QDomElement& qElement);
+ void showPropertiesDialog();
+
public Q_SLOTS:
virtual void slotMenuSelection(QAction* action);