[Uml-devel] branches/work/soc-umbrello/umbrello
Andi Fischer
andi.fischer at hispeed.ch
Tue Nov 15 22:27:41 UTC 2011
SVN commit 1264474 by fischer:
Rename fillColor with brush.
M +1 -1 dialogs/umlviewdialog.cpp
M +21 -6 umlscene.cpp
M +2 -10 umlscene.h
M +2 -6 widgets/associationwidget.cpp
--- branches/work/soc-umbrello/umbrello/dialogs/umlviewdialog.cpp #1264473:1264474
@@ -184,7 +184,7 @@
m_pColorPage->updateUMLWidget();
m_pScene->setUseFillColor( m_options.uiState.useFillColor );
m_pScene->setLineColor( m_options.uiState.lineColor );
- m_pScene->setFillColor( m_options.uiState.fillColor );
+ m_pScene->setBrush( m_options.uiState.fillColor );
//:TODO:
m_pScene->setGridDotColor(m_options.uiState.gridDotColor);
// gridCrossColor, gridTextColor, gridTextFont, gridTextIsVisible
--- branches/work/soc-umbrello/umbrello/umlscene.cpp #1264473:1264474
@@ -287,11 +287,19 @@
m_Pos = pos;
}
+/**
+ * Get the color of the grid dots.
+ * @return the color of the dots
+ */
QColor UMLScene::gridDotColor() const
{
return m_layoutGrid->gridDotColor();
}
+/**
+ * Set the color of the grid dots.
+ * @param gridColor the color of the dots
+ */
void UMLScene::setGridDotColor(const QColor &gridColor)
{
m_layoutGrid->setGridDotColor(gridColor);
@@ -561,6 +569,10 @@
m_bPaste = false;
}
+/**
+ * Slot called when an object is created.
+ * @param o created UML object
+ */
void UMLScene::slotObjectCreated(UMLObject* o)
{
m_bPaste = false;
@@ -616,6 +628,10 @@
resizeCanvasToItems();
}
+/**
+ * Slot called when an object is removed.
+ * @param o removed UML object
+ */
void UMLScene::slotObjectRemoved(UMLObject * o)
{
m_bPaste = false;
@@ -1074,19 +1090,18 @@
}
/**
- * Returns the fill color to use.
+ * Returns the default brush for diagram widgets.
*/
-QColor UMLScene::fillColor() const
+QBrush UMLScene::brush() const
{
- return m_Options.uiState.fillColor;
+ return QBrush(m_Options.uiState.fillColor);
}
/**
- * Set the background color.
- *
+ * Defines the color or pattern that is used for filling shapes.
* @param color The color to use.
*/
-void UMLScene::setFillColor(const QColor &color)
+void UMLScene::setBrush(const QColor &color)
{
m_Options.uiState.fillColor = color;
emit sigColorChanged(getID());
--- branches/work/soc-umbrello/umbrello/umlscene.h #1264473:1264474
@@ -82,17 +82,9 @@
QColor gridDotColor() const;
void setGridDotColor(const QColor &gridColor);
- QColor fillColor() const;
- void setFillColor(const QColor &color);
+ void setBrush(const QColor &color);
+ QBrush brush() const;
- /**
- * Returns the default brush for diagram widgets.
- */
- QBrush brush() const {
- // TODO: Remove fillColor()
- return fillColor();
- }
-
QColor lineColor() const;
void setLineColor(const QColor &color);
--- branches/work/soc-umbrello/umbrello/widgets/associationwidget.cpp #1264473:1264474
@@ -381,8 +381,6 @@
setMultiplicity(seqNum, Uml::A);
}
-QGraphicsEllipseItem *eellipse = 0;
-QGraphicsLineItem *lline = 0;
void AssociationWidget::constrainTextPos(qreal &textX, qreal &textY, qreal textWidth,
qreal textHeight, Uml::TextRole tr)
{
@@ -462,10 +460,8 @@
projected = line.p2();
}
- if (!eellipse) {
- eellipse = new QGraphicsEllipseItem(this);
- lline = new QGraphicsLineItem(this);
- }
+ QGraphicsEllipseItem* eellipse = new QGraphicsEllipseItem(this);
+ QGraphicsLineItem* lline = new QGraphicsLineItem(this);
QGraphicsScene *s = umlScene();
if (eellipse->scene() != s && s) {
s->addItem(eellipse);
More information about the umbrello-devel
mailing list