[Uml-devel] branches/work/soc-umbrello/umbrello
Gopala Krishna A
krishna.ggk at gmail.com
Fri Aug 29 15:44:49 UTC 2008
SVN commit 854475 by gopala:
Patch by Andi.
Fixes usage of tabs instead of spaces.
Also fixes some compiler warnings due to unused parameter.
M +80 -80 newumlwidget.cpp
M +19 -19 widget_utils.cpp
--- branches/work/soc-umbrello/umbrello/newumlwidget.cpp #854474:854475
@@ -100,7 +100,7 @@
m_widgetInterfaceData = new WidgetInterfaceData;
}
setFlags(ItemIsSelectable | ItemIsMovable);
- hide(); // Show up in slotInit
+ hide(); // Show up in slotInit
// Call init this way so that virtual methods may be called.
QTimer::singleShot(0, this, SLOT(slotInit()));
@@ -147,7 +147,7 @@
m_widgetInterfaceData = new WidgetInterfaceData;
}
- //slotUMLObjectDataChanged();
+ //slotUMLObjectDataChanged();
umlObjectChanged(oldObj);
}
@@ -175,12 +175,12 @@
*/
void NewUMLWidget::setID(Uml::IDType id)
{
- const Uml::IDType oldId = this->id();
+ const Uml::IDType oldId = this->id();
if(m_umlObject) {
if(m_umlObject->getID() != Uml::id_None) {
uWarning() << "changing old UMLObject " << ID2STR(m_umlObject->getID())
- << " to " << ID2STR(id) << endl;
+ << " to " << ID2STR(id);
}
m_umlObject->setID(id);
@@ -189,7 +189,7 @@
m_widgetInterfaceData->id = id;
}
- attributeChange(IDHasChanged, ID2STR(id));
+ attributeChange(IDHasChanged, ID2STR(id));
}
/**
@@ -240,16 +240,16 @@
*/
void NewUMLWidget::setDocumentation(const QString& doc)
{
- const QString oldDoc = documentation();
+ const QString oldDoc = documentation();
- if(m_umlObject) {
+ if(m_umlObject) {
m_umlObject->setDoc(doc);
}
else {
m_widgetInterfaceData->documentation = doc;
}
- attributeChange(DocumentationHasChanged, oldDoc);
+ attributeChange(DocumentationHasChanged, oldDoc);
}
/**
@@ -279,7 +279,7 @@
*/
void NewUMLWidget::setName(const QString& name)
{
- const QString oldName = this->name();
+ const QString oldName = this->name();
if(m_umlObject) {
m_umlObject->setName(name);
}
@@ -287,7 +287,7 @@
m_widgetInterfaceData->name = name;
}
- attributeChange(NameHasChanged, oldName);
+ attributeChange(NameHasChanged, oldName);
}
/**
@@ -300,14 +300,14 @@
*/
void NewUMLWidget::setLineColor(const QColor& color)
{
- const QColor oldColor = lineColor();
+ const QColor oldColor = lineColor();
m_lineColor = color;
if(!m_lineColor.isValid()) {
uDebug() << "Invalid color";
m_lineColor = Qt::black;
}
- attributeChange(LineColorHasChanged, oldColor);
+ attributeChange(LineColorHasChanged, oldColor);
}
/**
@@ -323,10 +323,10 @@
*/
void NewUMLWidget::setLineWidth(uint lw)
{
- const qreal oldWidth = lineWidth();
+ const qreal oldWidth = lineWidth();
m_lineWidth = lw;
- attributeChange(LineWidthHasChanged, oldWidth);
+ attributeChange(LineWidthHasChanged, oldWidth);
}
/**
@@ -339,13 +339,13 @@
*/
void NewUMLWidget::setFontColor(const QColor& color)
{
- const QColor oldColor = fontColor();
+ const QColor oldColor = fontColor();
m_fontColor = color;
if(!m_fontColor.isValid()) {
m_fontColor = m_lineColor;
}
- attributeChange(FontColorHasChanged, oldColor);
+ attributeChange(FontColorHasChanged, oldColor);
}
/**
@@ -358,10 +358,10 @@
*/
void NewUMLWidget::setBrush(const QBrush& brush)
{
- const QBrush oldBrush = this->brush();
- m_brush = brush;
+ const QBrush oldBrush = this->brush();
+ m_brush = brush;
- attributeChange(BrushHasChanged, oldBrush);
+ attributeChange(BrushHasChanged, oldBrush);
}
/**
@@ -373,10 +373,10 @@
*/
void NewUMLWidget::setFont(const QFont& font)
{
- const QFont oldFont = this->font();
+ const QFont oldFont = this->font();
m_font = font;
- attributeChange(FontHasChanged, oldFont);
+ attributeChange(FontHasChanged, oldFont);
}
/**
@@ -398,7 +398,7 @@
*/
void NewUMLWidget::setupContextMenuActions(ListPopupMenu &menu)
{
- Q_UNUSED(menu);
+ Q_UNUSED(menu);
}
/**
@@ -540,23 +540,23 @@
*/
bool NewUMLWidget::widgetHasUMLObject(Uml::Widget_Type type)
{
- switch(type)
- {
- case Uml::wt_Actor:
- case Uml::wt_UseCase:
- case Uml::wt_Class:
- case Uml::wt_Interface:
- case Uml::wt_Enum:
- case Uml::wt_Datatype:
- case Uml::wt_Package:
- case Uml::wt_Component:
- case Uml::wt_Node:
- case Uml::wt_Artifact:
- case Uml::wt_Object:
- return true;
- default:
- return false;
- }
+ switch(type)
+ {
+ case Uml::wt_Actor:
+ case Uml::wt_UseCase:
+ case Uml::wt_Class:
+ case Uml::wt_Interface:
+ case Uml::wt_Enum:
+ case Uml::wt_Datatype:
+ case Uml::wt_Package:
+ case Uml::wt_Component:
+ case Uml::wt_Node:
+ case Uml::wt_Artifact:
+ case Uml::wt_Object:
+ return true;
+ default:
+ return false;
+ }
}
/**
@@ -708,7 +708,7 @@
// }
default:
- uDebug() << "Menu_Type " << sel << " not implemented" << endl;
+ uDebug() << "Menu_Type " << sel << " not implemented";
}
}
@@ -732,16 +732,16 @@
void NewUMLWidget::slotInit()
{
setUMLObject(m_umlObject);
- // Ensure the texts of subclasses are properly initialized.
- slotUMLObjectDataChanged();
- // TODO: Move these to an explicit intializer method
- QVariant v;
- attributeChange(LineColorHasChanged, v);
- attributeChange(LineWidthHasChanged, v);
- attributeChange(FontHasChanged, v);
- attributeChange(FontColorHasChanged, v);
- attributeChange(BrushHasChanged, v);
- show(); // Now show the item
+ // Ensure the texts of subclasses are properly initialized.
+ slotUMLObjectDataChanged();
+ // TODO: Move these to an explicit intializer method
+ QVariant v;
+ attributeChange(LineColorHasChanged, v);
+ attributeChange(LineWidthHasChanged, v);
+ attributeChange(FontHasChanged, v);
+ attributeChange(FontColorHasChanged, v);
+ attributeChange(BrushHasChanged, v);
+ show(); // Now show the item
}
/**
@@ -770,25 +770,25 @@
*/
QVariant NewUMLWidget::attributeChange(WidgetAttributeChange change, const QVariant& oldValue)
{
- Q_UNUSED(oldValue);
+ Q_UNUSED(oldValue);
- switch(change) {
- case FontHasChanged:
- case NameHasChanged:
- case LineWidthHasChanged:
- updateGeometry();
- break;
+ switch(change) {
+ case FontHasChanged:
+ case NameHasChanged:
+ case LineWidthHasChanged:
+ updateGeometry();
+ break;
- case LineColorHasChanged:
- case FontColorHasChanged:
- case BrushHasChanged:
- update();
- break;
+ case LineColorHasChanged:
+ case FontColorHasChanged:
+ case BrushHasChanged:
+ update();
+ break;
- default:
- break;
- }
- return QVariant();
+ default:
+ break;
+ }
+ return QVariant();
}
/**
@@ -895,7 +895,7 @@
m_widgetInterfaceData = new WidgetInterfaceData;
}
setFlags(ItemIsSelectable | ItemIsMovable);
- hide();
+ hide();
// Call init this way so that virtual methods may be called.
QTimer::singleShot(0, this, SLOT(slotInit()));
if(scene) {
@@ -924,7 +924,7 @@
if(scene) {
scene->addItem(this);
}
- hide();
+ hide();
setFlags(ItemIsSelectable | ItemIsMovable);
// Call init this way so that virtual methods may be called.
QTimer::singleShot(0, this, SLOT(slotInit()));
@@ -1029,18 +1029,18 @@
void NewUMLWidget::updateComponentSize()
{
- if(firstTime) {
- firstTime = false;
- }
- else {
- NewUMLRectWidget *rect = dynamic_cast<NewUMLRectWidget*>(this);
- if(rect) {
- slotUMLObjectDataChanged();
- }
- else {
- updateGeometry();
- }
- }
+ if(firstTime) {
+ firstTime = false;
+ }
+ else {
+ NewUMLRectWidget *rect = dynamic_cast<NewUMLRectWidget*>(this);
+ if(rect) {
+ slotUMLObjectDataChanged();
+ }
+ else {
+ updateGeometry();
+ }
+ }
}
#include "newumlwidget.moc"
--- branches/work/soc-umbrello/umbrello/widget_utils.cpp #854474:854475
@@ -1,5 +1,4 @@
/***************************************************************************
- * *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
@@ -98,24 +97,24 @@
p->translate(-r.center().x(), -r.center().y());
}
- void drawTriangledRect(QPainter *painter,
+ void drawTriangledRect(QPainter *painter,
const QRectF& rect, const QSizeF& triSize)
- {
- // Draw outer boundary defined by polygon "poly".
- QPolygonF poly(5);
- poly[0] = rect.topLeft();
- poly[1] = rect.topRight() - QPointF(triSize.width(), 0);
- poly[2] = rect.topRight() + QPointF(0, triSize.height());
- poly[3] = rect.bottomRight();
- poly[4] = rect.bottomLeft();
- painter->drawPolygon(poly);
+ {
+ // Draw outer boundary defined by polygon "poly".
+ QPolygonF poly(5);
+ poly[0] = rect.topLeft();
+ poly[1] = rect.topRight() - QPointF(triSize.width(), 0);
+ poly[2] = rect.topRight() + QPointF(0, triSize.height());
+ poly[3] = rect.bottomRight();
+ poly[4] = rect.bottomLeft();
+ painter->drawPolygon(poly);
- // Now draw the triangle base and height edges.
- QLineF heightEdge(poly[1], poly[1] + QPointF(0, triSize.height()));
- painter->drawLine(heightEdge);
- QLineF baseEdge(heightEdge.p2(), poly[2]);
- painter->drawLine(baseEdge);
- }
+ // Now draw the triangle base and height edges.
+ QLineF heightEdge(poly[1], poly[1] + QPointF(0, triSize.height()));
+ painter->drawLine(heightEdge);
+ QLineF baseEdge(heightEdge.p2(), poly[2]);
+ painter->drawLine(baseEdge);
+ }
void drawArrowHead(QPainter *painter, const QPointF &arrowPos,
const QSizeF& arrowSize, Qt::ArrowType arrowType,
@@ -160,12 +159,13 @@
bool loadPixmapFromXMI(const QDomElement &qElement, QPixmap &pixmap)
{
+ Q_UNUSED(qElement); Q_UNUSED(pixmap);
return true;
}
void savePixmapToXMI(QDomDocument &qDoc, QDomElement &qElement, const QPixmap& pixmap)
{
-
+ Q_UNUSED(qDoc); Q_UNUSED(qElement); Q_UNUSED(pixmap);
}
bool loadGradientFromXMI(const QDomElement &qElement, QGradient *&gradient)
@@ -181,7 +181,6 @@
QGradient::CoordinateMode cmode = QGradient::LogicalMode;
QGradient::Spread spread = QGradient::PadSpread;
-
type_as_int = gradientElement.attribute("type").toInt();
type = QGradient::Type(type_as_int);
type_as_int = gradientElement.attribute("spread").toInt();
@@ -332,4 +331,5 @@
//TODO: Check if transform of this brush needs to be saved.
qElement.appendChild(brushElement);
}
+
} // namespace Widget_Utils
More information about the umbrello-devel
mailing list