Commit 99bb1590 authored by Jochen Becher's avatar Jochen Becher

ModelEditor: Use data member initialization in private classes

Change-Id: I3004fcfc8663196c1ce1b1c49aeba60ce2753175
Reviewed-by: default avatarTobias Hunger <tobias.hunger@theqtcompany.com>
parent 5f31eee3
......@@ -47,12 +47,7 @@ namespace qmt {
class ConfigController::ConfigControllerPrivate
{
public:
ConfigControllerPrivate()
: m_stereotypeController(0)
{
}
StereotypeController *m_stereotypeController;
StereotypeController *m_stereotypeController = 0;
};
ConfigController::ConfigController(QObject *parent)
......
......@@ -106,12 +106,7 @@ StereotypeDefinitionParserError::~StereotypeDefinitionParserError()
class StereotypeDefinitionParser::StereotypeDefinitionParserPrivate
{
public:
StereotypeDefinitionParserPrivate()
: m_scanner(0)
{
}
TextScanner *m_scanner;
TextScanner *m_scanner = 0;
};
......
......@@ -57,18 +57,12 @@ TextScannerError::~TextScannerError()
class TextScanner::TextScannerPrivate
{
public:
TextScannerPrivate()
: m_maxOperatorLength(0),
m_source(0)
{
}
QHash<QString, int> m_keywordToSubtypeMap;
QHash<QString, int> m_operatorToSubtypeMap;
int m_maxOperatorLength;
int m_maxOperatorLength = 0;
QSet<QChar> m_operatorFirstCharsSet;
QSet<QChar> m_operatorCharsSet;
ITextSource *m_source;
ITextSource *m_source = 0;
QStack<SourceChar> m_unreadSourceChars;
SourcePos m_lastSourcePos;
QStack<Token> m_unreadTokens;
......
......@@ -33,14 +33,11 @@
namespace qmt {
Token::Token()
: m_type(TokenUndefined),
m_subtype(0)
{
}
Token::Token(Type type, const QString &text, const SourcePos &sourcePos)
: m_type(type),
m_subtype(0),
m_text(text),
m_sourcePos(sourcePos)
{
......
......@@ -68,8 +68,8 @@ public:
void setSourcePos(const SourcePos &sourcePos);
private:
Type m_type;
int m_subtype;
Type m_type = TokenUndefined;
int m_subtype = 0;
QString m_text;
SourcePos m_sourcePos;
};
......
......@@ -56,18 +56,11 @@ namespace qmt {
class DiagramController::Clone
{
public:
Clone();
Uid m_elementKey;
int m_indexOfElement;
DElement *m_clonedElement;
int m_indexOfElement = -1;
DElement *m_clonedElement = 0;
};
DiagramController::Clone::Clone()
: m_indexOfElement(-1),
m_clonedElement(0)
{
}
class DiagramController::DiagramUndoCommand : public UndoCommand
{
public:
......@@ -94,7 +87,7 @@ protected:
}
private:
DiagramController *m_diagramController;
DiagramController *m_diagramController = 0;
Uid m_diagramKey;
};
......@@ -180,7 +173,7 @@ private:
diagramController->diagramModified(diagram);
}
DiagramController::UpdateAction m_updateAction;
DiagramController::UpdateAction m_updateAction = DiagramController::UpdateMajor;
QHash<Uid, DElement *> m_clonedElements;
};
......@@ -241,7 +234,7 @@ protected:
diagramController->diagramModified(diagram);
}
QList<Clone> m_clonedElements;
QList<DiagramController::Clone> m_clonedElements;
};
class DiagramController::AddElementsCommand : public AbstractAddRemCommand
......@@ -328,7 +321,7 @@ public:
}
private:
QList<MDiagram *> *m_allDiagrams;
QList<MDiagram *> *m_allDiagrams = 0;
};
DiagramController::DiagramController(QObject *parent)
......
......@@ -60,11 +60,6 @@ public:
{
public:
Latch()
: m_latchType(None),
m_pos(0.0),
m_otherPos1(0.0),
m_otherPos2(0.0),
m_identifier()
{
}
......@@ -78,9 +73,10 @@ public:
{
}
LatchType m_latchType;
qreal m_pos;
qreal m_otherPos1, m_otherPos2;
LatchType m_latchType = LatchType::None;
qreal m_pos = 0.0;
qreal m_otherPos1 = 0.0;
qreal m_otherPos2 = 0.0;
QString m_identifier;
};
......
......@@ -76,14 +76,7 @@ public:
AnnotationItem::AnnotationItem(DAnnotation *annotation, DiagramSceneModel *diagramSceneModel, QGraphicsItem *parent)
: QGraphicsItem(parent),
m_annotation(annotation),
m_diagramSceneModel(diagramSceneModel),
m_isSecondarySelected(false),
m_isFocusSelected(false),
m_selectionMarker(0),
m_noTextItem(0),
m_textItem(0),
m_isUpdating(false),
m_isChanged(false)
m_diagramSceneModel(diagramSceneModel)
{
setFlags(QGraphicsItem::ItemIsSelectable);
}
......
......@@ -104,15 +104,15 @@ private:
QSizeF calcMinimumGeometry() const;
void updateGeometry();
DAnnotation *m_annotation;
DiagramSceneModel *m_diagramSceneModel;
bool m_isSecondarySelected;
bool m_isFocusSelected;
RectangularSelectionItem *m_selectionMarker;
QGraphicsRectItem *m_noTextItem;
AnnotationTextItem *m_textItem;
bool m_isUpdating;
bool m_isChanged;
DAnnotation *m_annotation = 0;
DiagramSceneModel *m_diagramSceneModel = 0;
bool m_isSecondarySelected = false;
bool m_isFocusSelected = false;
RectangularSelectionItem *m_selectionMarker = 0;
QGraphicsRectItem *m_noTextItem = 0;
AnnotationTextItem *m_textItem = 0;
bool m_isUpdating = false;
bool m_isChanged = false;
};
} // namespace qmt
......
......@@ -50,11 +50,7 @@ namespace qmt {
AssociationItem::AssociationItem(DAssociation *association, DiagramSceneModel *diagramSceneModel, QGraphicsItem *parent)
: RelationItem(association, diagramSceneModel, parent),
m_association(association),
m_endAName(0),
m_endACardinality(0),
m_endBName(0),
m_endBCardinality(0)
m_association(association)
{
}
......
......@@ -60,11 +60,11 @@ private:
QGraphicsItem *endCardinality,
QGraphicsItem *endItem, double headLength);
DAssociation *m_association;
QGraphicsSimpleTextItem *m_endAName;
QGraphicsSimpleTextItem *m_endACardinality;
QGraphicsSimpleTextItem *m_endBName;
QGraphicsSimpleTextItem *m_endBCardinality;
DAssociation *m_association = 0;
QGraphicsSimpleTextItem *m_endAName = 0;
QGraphicsSimpleTextItem *m_endACardinality = 0;
QGraphicsSimpleTextItem *m_endBName = 0;
QGraphicsSimpleTextItem *m_endBCardinality = 0;
};
} // namespace qmt
......
......@@ -78,15 +78,7 @@ public:
BoundaryItem::BoundaryItem(DBoundary *boundary, DiagramSceneModel *diagramSceneModel, QGraphicsItem *parent)
: QGraphicsItem(parent),
m_boundary(boundary),
m_diagramSceneModel(diagramSceneModel),
m_isSecondarySelected(false),
m_isFocusSelected(false),
m_selectionMarker(0),
m_borderItem(0),
m_noTextItem(0),
m_textItem(0),
m_isUpdating(false),
m_isChanged(false)
m_diagramSceneModel(diagramSceneModel)
{
setFlags(QGraphicsItem::ItemIsSelectable);
}
......
......@@ -102,16 +102,16 @@ private:
QSizeF calcMinimumGeometry() const;
void updateGeometry();
DBoundary *m_boundary;
DiagramSceneModel *m_diagramSceneModel;
bool m_isSecondarySelected;
bool m_isFocusSelected;
RectangularSelectionItem *m_selectionMarker;
QGraphicsRectItem *m_borderItem;
QGraphicsRectItem *m_noTextItem;
BoundaryTextItem *m_textItem;
bool m_isUpdating;
bool m_isChanged;
DBoundary *m_boundary = 0;
DiagramSceneModel *m_diagramSceneModel = 0;
bool m_isSecondarySelected = false;
bool m_isFocusSelected = false;
RectangularSelectionItem *m_selectionMarker = 0;
QGraphicsRectItem *m_borderItem = 0;
QGraphicsRectItem *m_noTextItem = 0;
BoundaryTextItem *m_textItem = 0;
bool m_isUpdating = false;
bool m_isChanged = false;
};
} // namespace qmt
......
......@@ -68,18 +68,7 @@ static const qreal BODY_VERT_BORDER = 4.0;
static const qreal BODY_HORIZ_BORDER = 4.0;
ClassItem::ClassItem(DClass *klass, DiagramSceneModel *diagramSceneModel, QGraphicsItem *parent)
: ObjectItem(klass, diagramSceneModel, parent),
m_customIcon(0),
m_shape(0),
m_namespace(0),
m_className(0),
m_contextLabel(0),
m_attributesSeparator(0),
m_attributes(0),
m_methodsSeparator(0),
m_methods(0),
m_templateParameterBox(0),
m_relationStarter(0)
: ObjectItem(klass, diagramSceneModel, parent)
{
}
......
......@@ -78,19 +78,19 @@ private:
void updateGeometry();
void updateMembers(const Style *style);
CustomIconItem *m_customIcon;
QGraphicsRectItem *m_shape;
QGraphicsSimpleTextItem *m_namespace;
QGraphicsSimpleTextItem *m_className;
ContextLabelItem *m_contextLabel;
QGraphicsLineItem *m_attributesSeparator;
CustomIconItem *m_customIcon = 0;
QGraphicsRectItem *m_shape = 0;
QGraphicsSimpleTextItem *m_namespace = 0;
QGraphicsSimpleTextItem *m_className = 0;
ContextLabelItem *m_contextLabel = 0;
QGraphicsLineItem *m_attributesSeparator = 0;
QString m_attributesText;
QGraphicsTextItem *m_attributes;
QGraphicsLineItem *m_methodsSeparator;
QGraphicsTextItem *m_attributes = 0;
QGraphicsLineItem *m_methodsSeparator = 0;
QString m_methodsText;
QGraphicsTextItem *m_methods;
TemplateParameterBox *m_templateParameterBox;
RelationStarter *m_relationStarter;
QGraphicsTextItem *m_methods = 0;
TemplateParameterBox *m_templateParameterBox = 0;
RelationStarter *m_relationStarter = 0;
};
} // namespace qmt
......
......@@ -65,14 +65,7 @@ static const qreal BODY_VERT_BORDER = 4.0;
static const qreal BODY_HORIZ_BORDER = 4.0;
ComponentItem::ComponentItem(DComponent *component, DiagramSceneModel *diagramSceneModel, QGraphicsItem *parent)
: ObjectItem(component, diagramSceneModel, parent),
m_customIcon(0),
m_shape(0),
m_upperRect(0),
m_lowerRect(0),
m_componentName(0),
m_contextLabel(0),
m_relationStarter(0)
: ObjectItem(component, diagramSceneModel, parent)
{
}
......
......@@ -75,13 +75,13 @@ private:
QSizeF calcMinimumGeometry() const;
void updateGeometry();
CustomIconItem *m_customIcon;
QGraphicsRectItem *m_shape;
QGraphicsRectItem *m_upperRect;
QGraphicsRectItem *m_lowerRect;
QGraphicsSimpleTextItem *m_componentName;
ContextLabelItem *m_contextLabel;
RelationStarter *m_relationStarter;
CustomIconItem *m_customIcon = 0;
QGraphicsRectItem *m_shape = 0;
QGraphicsRectItem *m_upperRect = 0;
QGraphicsRectItem *m_lowerRect = 0;
QGraphicsSimpleTextItem *m_componentName = 0;
ContextLabelItem *m_contextLabel = 0;
RelationStarter *m_relationStarter = 0;
};
} // namespace qmt
......
......@@ -58,11 +58,7 @@ static const qreal BODY_HORIZ_BORDER = 4.0;
static const qreal BODY_VERT_BORDER = 4.0;
DiagramItem::DiagramItem(DDiagram *diagram, DiagramSceneModel *diagramSceneModel, QGraphicsItem *parent)
: ObjectItem(diagram, diagramSceneModel, parent),
m_customIcon(0),
m_body(0),
m_fold(0),
m_diagramName(0)
: ObjectItem(diagram, diagramSceneModel, parent)
{
}
......
......@@ -57,10 +57,10 @@ private:
QSizeF calcMinimumGeometry() const;
void updateGeometry();
CustomIconItem *m_customIcon;
QGraphicsPolygonItem *m_body;
QGraphicsPolygonItem *m_fold;
QGraphicsSimpleTextItem *m_diagramName;
CustomIconItem *m_customIcon = 0;
QGraphicsPolygonItem *m_body = 0;
QGraphicsPolygonItem *m_fold = 0;
QGraphicsSimpleTextItem *m_diagramName = 0;
};
} // namespace qmt
......
......@@ -60,12 +60,7 @@ static const qreal BODY_VERT_BORDER = 4.0;
static const qreal BODY_HORIZ_BORDER = 4.0;
ItemItem::ItemItem(DItem *item, DiagramSceneModel *diagramSceneModel, QGraphicsItem *parent)
: ObjectItem(item, diagramSceneModel, parent),
m_customIcon(0),
m_shape(0),
m_itemName(0),
m_contextLabel(0),
m_relationStarter(0)
: ObjectItem(item, diagramSceneModel, parent)
{
}
......
......@@ -73,11 +73,11 @@ private:
QSizeF calcMinimumGeometry() const;
void updateGeometry();
CustomIconItem *m_customIcon;
QGraphicsRectItem *m_shape;
QGraphicsSimpleTextItem *m_itemName;
ContextLabelItem *m_contextLabel;
RelationStarter *m_relationStarter;
CustomIconItem *m_customIcon = 0;
QGraphicsRectItem *m_shape = 0;
QGraphicsSimpleTextItem *m_itemName = 0;
ContextLabelItem *m_contextLabel = 0;
RelationStarter *m_relationStarter = 0;
};
} // namespace qmt
......
......@@ -63,15 +63,7 @@ namespace qmt {
ObjectItem::ObjectItem(DObject *object, DiagramSceneModel *diagramSceneModel, QGraphicsItem *parent)
: QGraphicsItem(parent),
m_object(object),
m_diagramSceneModel(diagramSceneModel),
m_isSecondarySelected(false),
m_isFocusSelected(false),
m_stereotypeIconDisplay(StereotypeIcon::DisplayLabel),
m_stereotypes(0),
m_stereotypeIcon(0),
m_selectionMarker(0),
m_horizontalAlignButtons(0),
m_verticalAlignButtons(0)
m_diagramSceneModel(diagramSceneModel)
{
setFlags(QGraphicsItem::ItemIsSelectable);
}
......
......@@ -150,18 +150,18 @@ protected:
private:
QSizeF minimumSize(const QSet<QGraphicsItem *> &items) const;
DObject *m_object;
DiagramSceneModel *m_diagramSceneModel;
bool m_isSecondarySelected;
bool m_isFocusSelected;
DObject *m_object = 0;
DiagramSceneModel *m_diagramSceneModel = 0;
bool m_isSecondarySelected = false;
bool m_isFocusSelected = false;
QString m_stereotypeIconId;
QString m_shapeIconId;
StereotypeIcon::Display m_stereotypeIconDisplay;
StereotypesItem *m_stereotypes;
CustomIconItem *m_stereotypeIcon;
RectangularSelectionItem *m_selectionMarker;
AlignButtonsItem *m_horizontalAlignButtons;
AlignButtonsItem *m_verticalAlignButtons;
StereotypeIcon::Display m_stereotypeIconDisplay = StereotypeIcon::DisplayLabel;
StereotypesItem *m_stereotypes = 0;
CustomIconItem *m_stereotypeIcon = 0;
RectangularSelectionItem *m_selectionMarker = 0;
AlignButtonsItem *m_horizontalAlignButtons = 0;
AlignButtonsItem *m_verticalAlignButtons = 0;
};
} // namespace qmt
......
......@@ -76,12 +76,7 @@ public:
};
PackageItem::PackageItem(DPackage *package, DiagramSceneModel *diagramSceneModel, QGraphicsItem *parent)
: ObjectItem(package, diagramSceneModel, parent),
m_customIcon(0),
m_shape(0),
m_packageName(0),
m_contextLabel(0),
m_relationStarter(0)
: ObjectItem(package, diagramSceneModel, parent)
{
}
......
......@@ -74,11 +74,11 @@ private:
ShapeGeometry calcMinimumGeometry() const;
void updateGeometry();
CustomIconItem *m_customIcon;
QGraphicsPolygonItem *m_shape;
QGraphicsSimpleTextItem *m_packageName;
ContextLabelItem *m_contextLabel;
RelationStarter *m_relationStarter;
CustomIconItem *m_customIcon = 0;
QGraphicsPolygonItem *m_shape = 0;
QGraphicsSimpleTextItem *m_packageName = 0;
ContextLabelItem *m_contextLabel = 0;
RelationStarter *m_relationStarter = 0;
};
} // namespace qmt
......
......@@ -169,21 +169,15 @@ public:
}
private:
DiagramSceneModel *m_diagramSceneModel;
ArrowItem *m_arrow;
DiagramSceneModel *m_diagramSceneModel = 0;
ArrowItem *m_arrow = 0;
QList<QPointF> m_points;
};
RelationItem::RelationItem(DRelation *relation, DiagramSceneModel *diagramSceneModel, QGraphicsItem *parent)
: QGraphicsItem(parent),
m_relation(relation),
m_diagramSceneModel(diagramSceneModel),
m_isSecondarySelected(false),
m_isFocusSelected(false),
m_arrow(0),
m_name(0),
m_stereotypes(0),
m_selectionHandles(0)
m_diagramSceneModel(diagramSceneModel)
{
setFlags(QGraphicsItem::ItemIsSelectable);
}
......
......@@ -98,16 +98,16 @@ private:
QPointF calcEndPoint(const Uid &end, const QPointF &otherEndPos,
int nearestIntermediatePointIndex);
DRelation *m_relation;
DRelation *m_relation = 0;
protected:
DiagramSceneModel *m_diagramSceneModel;
bool m_isSecondarySelected;
bool m_isFocusSelected;
ArrowItem *m_arrow;
QGraphicsSimpleTextItem *m_name;
StereotypesItem *m_stereotypes;
PathSelectionItem *m_selectionHandles;
DiagramSceneModel *m_diagramSceneModel = 0;
bool m_isSecondarySelected = false;
bool m_isFocusSelected = false;
ArrowItem *m_arrow = 0;
QGraphicsSimpleTextItem *m_name = 0;
StereotypesItem *m_stereotypes = 0;
PathSelectionItem *m_selectionHandles = 0;
};
} // namespace qmt
......
......@@ -43,12 +43,7 @@
namespace qmt {
StereotypeDisplayVisitor::StereotypeDisplayVisitor()
: DConstVoidVisitor(),
m_modelController(0),
m_stereotypeController(0),
m_stereotypeDisplay(DObject::StereotypeNone),
m_stereotypeIconElement(StereotypeIcon::ElementAny),
m_stereotypeSmartDisplay(DObject::StereotypeDecoration)
: DConstVoidVisitor()
{
}
......
......@@ -62,13 +62,13 @@ public:
void visitDItem(const DItem *item) override;
private:
ModelController *m_modelController;
StereotypeController *m_stereotypeController;
DObject::StereotypeDisplay m_stereotypeDisplay;
ModelController *m_modelController = 0;
StereotypeController *m_stereotypeController = 0;
DObject::StereotypeDisplay m_stereotypeDisplay = DObject::StereotypeNone;
QString m_stereotypeIconId;
QString m_shapeIconId;
StereotypeIcon::Element m_stereotypeIconElement;
DObject::StereotypeDisplay m_stereotypeSmartDisplay;
StereotypeIcon::Element m_stereotypeIconElement = StereotypeIcon::ElementAny;
DObject::StereotypeDisplay m_stereotypeSmartDisplay = DObject::StereotypeDecoration;
};
} // namespace qmt
......
......@@ -89,10 +89,10 @@ public:
}
private:
IAlignable::AlignType m_alignType;
IAlignable::AlignType m_alignType = IAlignable::AlignLeft;
QString m_identifier;
IAlignable *m_alignable;
QGraphicsPixmapItem *m_pixmapItem;
IAlignable *m_alignable = 0;
QGraphicsPixmapItem *m_pixmapItem = 0;
};
AlignButtonsItem::AlignButtonsItem(IAlignable *alignable, QGraphicsItem *parent)
......
......@@ -64,7 +64,7 @@ public:
void addButton(IAlignable::AlignType alignType, const QString &identifier, qreal pos);
private:
IAlignable *m_alignable;
IAlignable *m_alignable = 0;
QList<AlignButtonItem *> m_alignItems;
};
......
......@@ -53,9 +53,9 @@ public:
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option,
QWidget *widget = 0) override;
Direction m_direction;
QGraphicsLineItem *m_alignLine;
QGraphicsLineItem *m_highlightLine;
Direction m_direction = Horizontal;
QGraphicsLineItem *m_alignLine = 0;
QGraphicsLineItem *m_highlightLine = 0;
};
} // namespace qmt
......
......@@ -66,12 +66,7 @@ class ArrowItem::GraphicsHeadItem : public QGraphicsItem
{
public:
GraphicsHeadItem(QGraphicsItem *parent)
: QGraphicsItem(parent),
m_head(ArrowItem::HeadNone),
m_arrowSize(10.0),
m_diamondSize(15.0), </