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 { ...@@ -47,12 +47,7 @@ namespace qmt {
class ConfigController::ConfigControllerPrivate class ConfigController::ConfigControllerPrivate
{ {
public: public:
ConfigControllerPrivate() StereotypeController *m_stereotypeController = 0;
: m_stereotypeController(0)
{
}
StereotypeController *m_stereotypeController;
}; };
ConfigController::ConfigController(QObject *parent) ConfigController::ConfigController(QObject *parent)
......
...@@ -106,12 +106,7 @@ StereotypeDefinitionParserError::~StereotypeDefinitionParserError() ...@@ -106,12 +106,7 @@ StereotypeDefinitionParserError::~StereotypeDefinitionParserError()
class StereotypeDefinitionParser::StereotypeDefinitionParserPrivate class StereotypeDefinitionParser::StereotypeDefinitionParserPrivate
{ {
public: public:
StereotypeDefinitionParserPrivate() TextScanner *m_scanner = 0;
: m_scanner(0)
{
}
TextScanner *m_scanner;
}; };
......
...@@ -57,18 +57,12 @@ TextScannerError::~TextScannerError() ...@@ -57,18 +57,12 @@ TextScannerError::~TextScannerError()
class TextScanner::TextScannerPrivate class TextScanner::TextScannerPrivate
{ {
public: public:
TextScannerPrivate()
: m_maxOperatorLength(0),
m_source(0)
{
}
QHash<QString, int> m_keywordToSubtypeMap; QHash<QString, int> m_keywordToSubtypeMap;
QHash<QString, int> m_operatorToSubtypeMap; QHash<QString, int> m_operatorToSubtypeMap;
int m_maxOperatorLength; int m_maxOperatorLength = 0;
QSet<QChar> m_operatorFirstCharsSet; QSet<QChar> m_operatorFirstCharsSet;
QSet<QChar> m_operatorCharsSet; QSet<QChar> m_operatorCharsSet;
ITextSource *m_source; ITextSource *m_source = 0;
QStack<SourceChar> m_unreadSourceChars; QStack<SourceChar> m_unreadSourceChars;
SourcePos m_lastSourcePos; SourcePos m_lastSourcePos;
QStack<Token> m_unreadTokens; QStack<Token> m_unreadTokens;
......
...@@ -33,14 +33,11 @@ ...@@ -33,14 +33,11 @@
namespace qmt { namespace qmt {
Token::Token() Token::Token()
: m_type(TokenUndefined),
m_subtype(0)
{ {
} }
Token::Token(Type type, const QString &text, const SourcePos &sourcePos) Token::Token(Type type, const QString &text, const SourcePos &sourcePos)
: m_type(type), : m_type(type),
m_subtype(0),
m_text(text), m_text(text),
m_sourcePos(sourcePos) m_sourcePos(sourcePos)
{ {
......
...@@ -68,8 +68,8 @@ public: ...@@ -68,8 +68,8 @@ public:
void setSourcePos(const SourcePos &sourcePos); void setSourcePos(const SourcePos &sourcePos);
private: private:
Type m_type; Type m_type = TokenUndefined;
int m_subtype; int m_subtype = 0;
QString m_text; QString m_text;
SourcePos m_sourcePos; SourcePos m_sourcePos;
}; };
......
...@@ -56,18 +56,11 @@ namespace qmt { ...@@ -56,18 +56,11 @@ namespace qmt {
class DiagramController::Clone class DiagramController::Clone
{ {
public: public:
Clone();
Uid m_elementKey; Uid m_elementKey;
int m_indexOfElement; int m_indexOfElement = -1;
DElement *m_clonedElement; DElement *m_clonedElement = 0;
}; };
DiagramController::Clone::Clone()
: m_indexOfElement(-1),
m_clonedElement(0)
{
}
class DiagramController::DiagramUndoCommand : public UndoCommand class DiagramController::DiagramUndoCommand : public UndoCommand
{ {
public: public:
...@@ -94,7 +87,7 @@ protected: ...@@ -94,7 +87,7 @@ protected:
} }
private: private:
DiagramController *m_diagramController; DiagramController *m_diagramController = 0;
Uid m_diagramKey; Uid m_diagramKey;
}; };
...@@ -180,7 +173,7 @@ private: ...@@ -180,7 +173,7 @@ private:
diagramController->diagramModified(diagram); diagramController->diagramModified(diagram);
} }
DiagramController::UpdateAction m_updateAction; DiagramController::UpdateAction m_updateAction = DiagramController::UpdateMajor;
QHash<Uid, DElement *> m_clonedElements; QHash<Uid, DElement *> m_clonedElements;
}; };
...@@ -241,7 +234,7 @@ protected: ...@@ -241,7 +234,7 @@ protected:
diagramController->diagramModified(diagram); diagramController->diagramModified(diagram);
} }
QList<Clone> m_clonedElements; QList<DiagramController::Clone> m_clonedElements;
}; };
class DiagramController::AddElementsCommand : public AbstractAddRemCommand class DiagramController::AddElementsCommand : public AbstractAddRemCommand
...@@ -328,7 +321,7 @@ public: ...@@ -328,7 +321,7 @@ public:
} }
private: private:
QList<MDiagram *> *m_allDiagrams; QList<MDiagram *> *m_allDiagrams = 0;
}; };
DiagramController::DiagramController(QObject *parent) DiagramController::DiagramController(QObject *parent)
......
...@@ -60,11 +60,6 @@ public: ...@@ -60,11 +60,6 @@ public:
{ {
public: public:
Latch() Latch()
: m_latchType(None),
m_pos(0.0),
m_otherPos1(0.0),
m_otherPos2(0.0),
m_identifier()
{ {
} }
...@@ -78,9 +73,10 @@ public: ...@@ -78,9 +73,10 @@ public:
{ {
} }
LatchType m_latchType; LatchType m_latchType = LatchType::None;
qreal m_pos; qreal m_pos = 0.0;
qreal m_otherPos1, m_otherPos2; qreal m_otherPos1 = 0.0;
qreal m_otherPos2 = 0.0;
QString m_identifier; QString m_identifier;
}; };
......
...@@ -76,14 +76,7 @@ public: ...@@ -76,14 +76,7 @@ public:
AnnotationItem::AnnotationItem(DAnnotation *annotation, DiagramSceneModel *diagramSceneModel, QGraphicsItem *parent) AnnotationItem::AnnotationItem(DAnnotation *annotation, DiagramSceneModel *diagramSceneModel, QGraphicsItem *parent)
: QGraphicsItem(parent), : QGraphicsItem(parent),
m_annotation(annotation), m_annotation(annotation),
m_diagramSceneModel(diagramSceneModel), m_diagramSceneModel(diagramSceneModel)
m_isSecondarySelected(false),
m_isFocusSelected(false),
m_selectionMarker(0),
m_noTextItem(0),
m_textItem(0),
m_isUpdating(false),
m_isChanged(false)
{ {
setFlags(QGraphicsItem::ItemIsSelectable); setFlags(QGraphicsItem::ItemIsSelectable);
} }
......
...@@ -104,15 +104,15 @@ private: ...@@ -104,15 +104,15 @@ private:
QSizeF calcMinimumGeometry() const; QSizeF calcMinimumGeometry() const;
void updateGeometry(); void updateGeometry();
DAnnotation *m_annotation; DAnnotation *m_annotation = 0;
DiagramSceneModel *m_diagramSceneModel; DiagramSceneModel *m_diagramSceneModel = 0;
bool m_isSecondarySelected; bool m_isSecondarySelected = false;
bool m_isFocusSelected; bool m_isFocusSelected = false;
RectangularSelectionItem *m_selectionMarker; RectangularSelectionItem *m_selectionMarker = 0;
QGraphicsRectItem *m_noTextItem; QGraphicsRectItem *m_noTextItem = 0;
AnnotationTextItem *m_textItem; AnnotationTextItem *m_textItem = 0;
bool m_isUpdating; bool m_isUpdating = false;
bool m_isChanged; bool m_isChanged = false;
}; };
} // namespace qmt } // namespace qmt
......
...@@ -50,11 +50,7 @@ namespace qmt { ...@@ -50,11 +50,7 @@ namespace qmt {
AssociationItem::AssociationItem(DAssociation *association, DiagramSceneModel *diagramSceneModel, QGraphicsItem *parent) AssociationItem::AssociationItem(DAssociation *association, DiagramSceneModel *diagramSceneModel, QGraphicsItem *parent)
: RelationItem(association, diagramSceneModel, parent), : RelationItem(association, diagramSceneModel, parent),
m_association(association), m_association(association)
m_endAName(0),
m_endACardinality(0),
m_endBName(0),
m_endBCardinality(0)
{ {
} }
......
...@@ -60,11 +60,11 @@ private: ...@@ -60,11 +60,11 @@ private:
QGraphicsItem *endCardinality, QGraphicsItem *endCardinality,
QGraphicsItem *endItem, double headLength); QGraphicsItem *endItem, double headLength);
DAssociation *m_association; DAssociation *m_association = 0;
QGraphicsSimpleTextItem *m_endAName; QGraphicsSimpleTextItem *m_endAName = 0;
QGraphicsSimpleTextItem *m_endACardinality; QGraphicsSimpleTextItem *m_endACardinality = 0;
QGraphicsSimpleTextItem *m_endBName; QGraphicsSimpleTextItem *m_endBName = 0;
QGraphicsSimpleTextItem *m_endBCardinality; QGraphicsSimpleTextItem *m_endBCardinality = 0;
}; };
} // namespace qmt } // namespace qmt
......
...@@ -78,15 +78,7 @@ public: ...@@ -78,15 +78,7 @@ public:
BoundaryItem::BoundaryItem(DBoundary *boundary, DiagramSceneModel *diagramSceneModel, QGraphicsItem *parent) BoundaryItem::BoundaryItem(DBoundary *boundary, DiagramSceneModel *diagramSceneModel, QGraphicsItem *parent)
: QGraphicsItem(parent), : QGraphicsItem(parent),
m_boundary(boundary), m_boundary(boundary),
m_diagramSceneModel(diagramSceneModel), 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)
{ {
setFlags(QGraphicsItem::ItemIsSelectable); setFlags(QGraphicsItem::ItemIsSelectable);
} }
......
...@@ -102,16 +102,16 @@ private: ...@@ -102,16 +102,16 @@ private:
QSizeF calcMinimumGeometry() const; QSizeF calcMinimumGeometry() const;
void updateGeometry(); void updateGeometry();
DBoundary *m_boundary; DBoundary *m_boundary = 0;
DiagramSceneModel *m_diagramSceneModel; DiagramSceneModel *m_diagramSceneModel = 0;
bool m_isSecondarySelected; bool m_isSecondarySelected = false;
bool m_isFocusSelected; bool m_isFocusSelected = false;
RectangularSelectionItem *m_selectionMarker; RectangularSelectionItem *m_selectionMarker = 0;
QGraphicsRectItem *m_borderItem; QGraphicsRectItem *m_borderItem = 0;
QGraphicsRectItem *m_noTextItem; QGraphicsRectItem *m_noTextItem = 0;
BoundaryTextItem *m_textItem; BoundaryTextItem *m_textItem = 0;
bool m_isUpdating; bool m_isUpdating = false;
bool m_isChanged; bool m_isChanged = false;
}; };
} // namespace qmt } // namespace qmt
......
...@@ -68,18 +68,7 @@ static const qreal BODY_VERT_BORDER = 4.0; ...@@ -68,18 +68,7 @@ static const qreal BODY_VERT_BORDER = 4.0;
static const qreal BODY_HORIZ_BORDER = 4.0; static const qreal BODY_HORIZ_BORDER = 4.0;
ClassItem::ClassItem(DClass *klass, DiagramSceneModel *diagramSceneModel, QGraphicsItem *parent) ClassItem::ClassItem(DClass *klass, DiagramSceneModel *diagramSceneModel, QGraphicsItem *parent)
: ObjectItem(klass, diagramSceneModel, 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)
{ {
} }
......
...@@ -78,19 +78,19 @@ private: ...@@ -78,19 +78,19 @@ private:
void updateGeometry(); void updateGeometry();
void updateMembers(const Style *style); void updateMembers(const Style *style);
CustomIconItem *m_customIcon; CustomIconItem *m_customIcon = 0;
QGraphicsRectItem *m_shape; QGraphicsRectItem *m_shape = 0;
QGraphicsSimpleTextItem *m_namespace; QGraphicsSimpleTextItem *m_namespace = 0;
QGraphicsSimpleTextItem *m_className; QGraphicsSimpleTextItem *m_className = 0;
ContextLabelItem *m_contextLabel; ContextLabelItem *m_contextLabel = 0;
QGraphicsLineItem *m_attributesSeparator; QGraphicsLineItem *m_attributesSeparator = 0;
QString m_attributesText; QString m_attributesText;
QGraphicsTextItem *m_attributes; QGraphicsTextItem *m_attributes = 0;
QGraphicsLineItem *m_methodsSeparator; QGraphicsLineItem *m_methodsSeparator = 0;
QString m_methodsText; QString m_methodsText;
QGraphicsTextItem *m_methods; QGraphicsTextItem *m_methods = 0;
TemplateParameterBox *m_templateParameterBox; TemplateParameterBox *m_templateParameterBox = 0;
RelationStarter *m_relationStarter; RelationStarter *m_relationStarter = 0;
}; };
} // namespace qmt } // namespace qmt
......
...@@ -65,14 +65,7 @@ static const qreal BODY_VERT_BORDER = 4.0; ...@@ -65,14 +65,7 @@ static const qreal BODY_VERT_BORDER = 4.0;
static const qreal BODY_HORIZ_BORDER = 4.0; static const qreal BODY_HORIZ_BORDER = 4.0;
ComponentItem::ComponentItem(DComponent *component, DiagramSceneModel *diagramSceneModel, QGraphicsItem *parent) ComponentItem::ComponentItem(DComponent *component, DiagramSceneModel *diagramSceneModel, QGraphicsItem *parent)
: ObjectItem(component, diagramSceneModel, 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)
{ {
} }
......
...@@ -75,13 +75,13 @@ private: ...@@ -75,13 +75,13 @@ private:
QSizeF calcMinimumGeometry() const; QSizeF calcMinimumGeometry() const;
void updateGeometry(); void updateGeometry();
CustomIconItem *m_customIcon; CustomIconItem *m_customIcon = 0;
QGraphicsRectItem *m_shape; QGraphicsRectItem *m_shape = 0;
QGraphicsRectItem *m_upperRect; QGraphicsRectItem *m_upperRect = 0;
QGraphicsRectItem *m_lowerRect; QGraphicsRectItem *m_lowerRect = 0;
QGraphicsSimpleTextItem *m_componentName; QGraphicsSimpleTextItem *m_componentName = 0;
ContextLabelItem *m_contextLabel; ContextLabelItem *m_contextLabel = 0;
RelationStarter *m_relationStarter; RelationStarter *m_relationStarter = 0;
}; };
} // namespace qmt } // namespace qmt
......
...@@ -58,11 +58,7 @@ static const qreal BODY_HORIZ_BORDER = 4.0; ...@@ -58,11 +58,7 @@ static const qreal BODY_HORIZ_BORDER = 4.0;
static const qreal BODY_VERT_BORDER = 4.0; static const qreal BODY_VERT_BORDER = 4.0;
DiagramItem::DiagramItem(DDiagram *diagram, DiagramSceneModel *diagramSceneModel, QGraphicsItem *parent) DiagramItem::DiagramItem(DDiagram *diagram, DiagramSceneModel *diagramSceneModel, QGraphicsItem *parent)
: ObjectItem(diagram, diagramSceneModel, parent), : ObjectItem(diagram, diagramSceneModel, parent)
m_customIcon(0),
m_body(0),
m_fold(0),
m_diagramName(0)
{ {
} }
......
...@@ -57,10 +57,10 @@ private: ...@@ -57,10 +57,10 @@ private:
QSizeF calcMinimumGeometry() const; QSizeF calcMinimumGeometry() const;
void updateGeometry(); void updateGeometry();
CustomIconItem *m_customIcon; CustomIconItem *m_customIcon = 0;
QGraphicsPolygonItem *m_body; QGraphicsPolygonItem *m_body = 0;
QGraphicsPolygonItem *m_fold; QGraphicsPolygonItem *m_fold = 0;
QGraphicsSimpleTextItem *m_diagramName; QGraphicsSimpleTextItem *m_diagramName = 0;
}; };
} // namespace qmt } // namespace qmt
......
...@@ -60,12 +60,7 @@ static const qreal BODY_VERT_BORDER = 4.0; ...@@ -60,12 +60,7 @@ static const qreal BODY_VERT_BORDER = 4.0;
static const qreal BODY_HORIZ_BORDER = 4.0; static const qreal BODY_HORIZ_BORDER = 4.0;
ItemItem::ItemItem(DItem *item, DiagramSceneModel *diagramSceneModel, QGraphicsItem *parent) ItemItem::ItemItem(DItem *item, DiagramSceneModel *diagramSceneModel, QGraphicsItem *parent)
: ObjectItem(item, diagramSceneModel, parent), : ObjectItem(item, diagramSceneModel, parent)
m_customIcon(0),
m_shape(0),
m_itemName(0),
m_contextLabel(0),
m_relationStarter(0)
{ {
} }
......
...@@ -73,11 +73,11 @@ private: ...@@ -73,11 +73,11 @@ private:
QSizeF calcMinimumGeometry() const; QSizeF calcMinimumGeometry() const;
void updateGeometry(); void updateGeometry();
CustomIconItem *m_customIcon; CustomIconItem *m_customIcon = 0;
QGraphicsRectItem *m_shape; QGraphicsRectItem *m_shape = 0;
QGraphicsSimpleTextItem *m_itemName; QGraphicsSimpleTextItem *m_itemName = 0;
ContextLabelItem *m_contextLabel; ContextLabelItem *m_contextLabel = 0;
RelationStarter *m_relationStarter; RelationStarter *m_relationStarter = 0;
}; };
} // namespace qmt } // namespace qmt
......
...@@ -63,15 +63,7 @@ namespace qmt { ...@@ -63,15 +63,7 @@ namespace qmt {
ObjectItem::ObjectItem(DObject *object, DiagramSceneModel *diagramSceneModel, QGraphicsItem *parent) ObjectItem::ObjectItem(DObject *object, DiagramSceneModel *diagramSceneModel, QGraphicsItem *parent)
: QGraphicsItem(parent), : QGraphicsItem(parent),
m_object(object), m_object(object),
m_diagramSceneModel(diagramSceneModel), 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)
{ {
setFlags(QGraphicsItem::ItemIsSelectable); setFlags(QGraphicsItem::ItemIsSelectable);
} }
......
...@@ -150,18 +150,18 @@ protected: ...@@ -150,18 +150,18 @@ protected:
private: private:
QSizeF minimumSize(const QSet<QGraphicsItem *> &items) const; QSizeF minimumSize(const QSet<QGraphicsItem *> &items) const;
DObject *m_object; DObject *m_object = 0;
DiagramSceneModel *m_diagramSceneModel; DiagramSceneModel *m_diagramSceneModel = 0;
bool m_isSecondarySelected; bool m_isSecondarySelected = false;
bool m_isFocusSelected; bool m_isFocusSelected = false;
QString m_stereotypeIconId; QString m_stereotypeIconId;
QString m_shapeIconId; QString m_shapeIconId;
StereotypeIcon::Display m_stereotypeIconDisplay; StereotypeIcon::Display m_stereotypeIconDisplay = StereotypeIcon::DisplayLabel;
StereotypesItem *m_stereotypes; StereotypesItem *m_stereotypes = 0;
CustomIconItem *m_stereotypeIcon; CustomIconItem *m_stereotypeIcon = 0;
RectangularSelectionItem *m_selectionMarker; RectangularSelectionItem *m_selectionMarker = 0;
AlignButtonsItem *m_horizontalAlignButtons; AlignButtonsItem *m_horizontalAlignButtons = 0;
AlignButtonsItem *m_verticalAlignButtons; AlignButtonsItem *m_verticalAlignButtons = 0;
}; };
} // namespace qmt } // namespace qmt
......
...@@ -76,12 +76,7 @@ public: ...@@ -76,12 +76,7 @@ public:
}; };
PackageItem::PackageItem(DPackage *package, DiagramSceneModel *diagramSceneModel, QGraphicsItem *parent) PackageItem::PackageItem(DPackage *package, DiagramSceneModel *diagramSceneModel, QGraphicsItem *parent)
: ObjectItem(package, diagramSceneModel, parent), : ObjectItem(package, diagramSceneModel, parent)
m_customIcon(0),
m_shape(0),
m_packageName(0),
m_contextLabel(0),
m_relationStarter(0)
{ {
} }
......
...@@ -74,11 +74,11 @@ private: ...@@ -74,11 +74,11 @@ private:
ShapeGeometry calcMinimumGeometry() const; ShapeGeometry calcMinimumGeometry() const;
void updateGeometry(); void updateGeometry();
CustomIconItem *m_customIcon; CustomIconItem *m_customIcon = 0;
QGraphicsPolygonItem *m_shape; QGraphicsPolygonItem *m_shape = 0;
QGraphicsSimpleTextItem *m_packageName; QGraphicsSimpleTextItem *m_packageName = 0;
ContextLabelItem *m_contextLabel; ContextLabelItem *m_contextLabel = 0;
RelationStarter *m_relationStarter; RelationStarter *m_relationStarter = 0;