Commit 5f31eee3 authored by Jochen Becher's avatar Jochen Becher

ModelEditor: Use override keyword

Change-Id: I258fd9e644db16a97fa2b667da38238d24841d90
Reviewed-by: default avatarTobias Hunger <tobias.hunger@theqtcompany.com>
parent 52082905
......@@ -47,7 +47,7 @@ class QMT_EXPORT ConfigController : public QObject
public:
explicit ConfigController(QObject *parent = 0);
~ConfigController();
~ConfigController() override;
void setStereotypeController(StereotypeController *stereotypeController);
......
......@@ -48,7 +48,7 @@ class QMT_EXPORT StereotypeDefinitionParserError : public Exception
{
public:
StereotypeDefinitionParserError(const QString &errorMsg, const SourcePos &sourcePos);
~StereotypeDefinitionParserError();
~StereotypeDefinitionParserError() override;
SourcePos sourcePos() const { return m_sourcePos; }
......@@ -64,7 +64,7 @@ class QMT_EXPORT StereotypeDefinitionParser : public QObject
public:
explicit StereotypeDefinitionParser(QObject *parent = 0);
~StereotypeDefinitionParser();
~StereotypeDefinitionParser() override;
signals:
void iconParsed(const StereotypeIcon &stereotypeIcon);
......
......@@ -41,14 +41,14 @@ class QMT_EXPORT StringTextSource : public ITextSource
{
public:
StringTextSource();
~StringTextSource();
~StringTextSource() override;
void setText(const QString &text);
int sourceId() const { return m_sourceId; }
void setSourceId(int sourceId);
// ITextSource interface
SourceChar readNextChar();
SourceChar readNextChar() override;
private:
QString m_text;
......
......@@ -47,7 +47,7 @@ class QMT_EXPORT TextScannerError : public Exception
{
public:
TextScannerError(const QString &errorMsg, const SourcePos &sourcePos);
~TextScannerError();
~TextScannerError() override;
SourcePos sourcePos() const { return m_sourcePos; }
......@@ -62,7 +62,7 @@ class QMT_EXPORT TextScanner : public QObject
public:
explicit TextScanner(QObject *parent = 0);
~TextScanner();
~TextScanner() override;
void setKeywords(const QList<QPair<QString, int> > &keywords);
void setOperators(const QList<QPair<QString, int> > &operators);
......
......@@ -45,7 +45,7 @@ class QMT_EXPORT NameController : public QObject
private:
NameController(QObject *parent = 0);
~NameController();
~NameController() override;
public:
static QString convertFileNameToElementName(const QString &fileName);
......
......@@ -40,17 +40,17 @@ class QMT_EXPORT UndoCommand : public QUndoCommand
{
public:
explicit UndoCommand(const QString &text);
~UndoCommand();
~UndoCommand() override;
bool canRedo() const { return m_canRedo; }
int id() const;
int id() const override;
void setDoNotMerge(bool doNotMerge);
bool mergeWith(const QUndoCommand *other);
bool mergeWith(const QUndoCommand *other) override;
virtual bool mergeWith(const UndoCommand *other);
void undo();
void redo();
void undo() override;
void redo() override;
private:
bool m_canRedo;
......
......@@ -48,7 +48,7 @@ class QMT_EXPORT UndoController : public QObject
public:
explicit UndoController(QObject *parent = 0);
~UndoController();
~UndoController() override;
QUndoStack *undoStack() const { return m_undoStack; }
......
......@@ -52,11 +52,11 @@ public:
DAnnotation();
DAnnotation(const DAnnotation &);
~DAnnotation();
~DAnnotation() override;
DAnnotation &operator=(const DAnnotation &);
Uid modelUid() const { return Uid::invalidUid(); }
Uid modelUid() const override { return Uid::invalidUid(); }
QString text() const { return m_text; }
void setText(const QString &text);
QPointF pos() const { return m_pos; }
......@@ -68,8 +68,8 @@ public:
bool isAutoSized() const { return m_isAutoSized; }
void setAutoSized(bool autoSized);
virtual void accept(DVisitor *visitor);
virtual void accept(DConstVisitor *visitor) const;
void accept(DVisitor *visitor) override;
void accept(DConstVisitor *visitor) const override;
private:
QString m_text;
......
......@@ -67,7 +67,7 @@ class QMT_EXPORT DAssociation : public DRelation
{
public:
DAssociation();
~DAssociation();
~DAssociation() override;
DAssociationEnd endA() const { return m_endA; }
void setEndA(const DAssociationEnd &endA);
......@@ -76,8 +76,8 @@ public:
Uid assoicationClassUid() const { return m_associationClassUid; }
void setAssociationClassUid(const Uid &uid);
virtual void accept(DVisitor *visitor);
virtual void accept(DConstVisitor *visitor) const;
void accept(DVisitor *visitor) override;
void accept(DConstVisitor *visitor) const override;
private:
DAssociationEnd m_endA;
......
......@@ -43,11 +43,11 @@ class QMT_EXPORT DBoundary : public DElement
public:
DBoundary();
DBoundary(const DBoundary &rhs);
~DBoundary();
~DBoundary() override;
DBoundary &operator=(const DBoundary &rhs);
Uid modelUid() const { return Uid::invalidUid(); }
Uid modelUid() const override { return Uid::invalidUid(); }
QString text() const { return m_text; }
void setText(const QString &text);
QPointF pos() const { return m_pos; }
......@@ -55,8 +55,8 @@ public:
QRectF rect() const { return m_rect; }
void setRect(const QRectF &rect);
virtual void accept(DVisitor *visitor);
virtual void accept(DConstVisitor *visitor) const;
void accept(DVisitor *visitor) override;
void accept(DConstVisitor *visitor) const override;
private:
QString m_text;
......
......@@ -62,8 +62,8 @@ public:
bool showAllMembers() const { return m_showAllMembers; }
void setShowAllMembers(bool showAllMembers);
virtual void accept(DVisitor *visitor);
virtual void accept(DConstVisitor *visitor) const;
void accept(DVisitor *visitor) override;
void accept(DConstVisitor *visitor) const override;
private:
QString m_umlNamespace;
......
......@@ -43,8 +43,8 @@ public:
bool isPlainShape() const { return m_isPlainShape; }
void setPlainShape(bool planeShape);
virtual void accept(DVisitor *visitor);
virtual void accept(DConstVisitor *visitor) const;
void accept(DVisitor *visitor) override;
void accept(DConstVisitor *visitor) const override;
private:
bool m_isPlainShape;
......
......@@ -43,7 +43,7 @@ class QMT_EXPORT DDependency : public DRelation
{
public:
DDependency();
~DDependency();
~DDependency() override;
Uid source() const;
void setSource(const Uid &source);
......@@ -52,8 +52,8 @@ public:
MDependency::Direction direction() const { return m_direction; }
void setDirection(MDependency::Direction direction);
virtual void accept(DVisitor *visitor);
virtual void accept(DConstVisitor *visitor) const;
void accept(DVisitor *visitor) override;
void accept(DConstVisitor *visitor) const override;
private:
MDependency::Direction m_direction;
......
......@@ -40,8 +40,8 @@ class QMT_EXPORT DDiagram : public DObject
public:
DDiagram();
virtual void accept(DVisitor *visitor);
virtual void accept(DConstVisitor *visitor) const;
void accept(DVisitor *visitor) override;
void accept(DConstVisitor *visitor) const override;
};
} // namespace qmt
......
......@@ -47,8 +47,8 @@ public:
Uid base() const;
void setBase(const Uid &base);
virtual void accept(DVisitor *visitor);
virtual void accept(DConstVisitor *visitor) const;
void accept(DVisitor *visitor) override;
void accept(DConstVisitor *visitor) const override;
};
} // namespace qmt
......
......@@ -39,7 +39,7 @@ class QMT_EXPORT DItem : public DObject
{
public:
DItem();
~DItem();
~DItem() override;
QString variety() const { return m_variety; }
void setVariety(const QString &variety);
......@@ -48,8 +48,8 @@ public:
bool isShapeEditable() const { return m_isShapeEditable; }
void setShapeEditable(bool shapeEditable);
virtual void accept(DVisitor *visitor);
virtual void accept(DConstVisitor *visitor) const;
void accept(DVisitor *visitor) override;
void accept(DConstVisitor *visitor) const override;
private:
QString m_variety;
......
......@@ -77,11 +77,11 @@ public:
DObject();
DObject(const DObject &);
~DObject();
~DObject() override;
DObject &operator=(const DObject &rhs);
Uid modelUid() const { return m_modelUid; }
Uid modelUid() const override { return m_modelUid; }
void setModelUid(const Uid &uid);
QList<QString> stereotypes() const { return m_stereotypes; }
void setStereotypes(const QList<QString> &stereotypes);
......@@ -106,8 +106,8 @@ public:
bool isVisualEmphasized() const { return m_isVisualEmphasized; }
void setVisualEmphasized(bool visualEmphasized);
virtual void accept(DVisitor *visitor);
virtual void accept(DConstVisitor *visitor) const;
void accept(DVisitor *visitor) override;
void accept(DConstVisitor *visitor) const override;
private:
Uid m_modelUid;
......
......@@ -40,8 +40,8 @@ class QMT_EXPORT DPackage : public DObject
public:
DPackage();
virtual void accept(DVisitor *visitor);
virtual void accept(DConstVisitor *visitor) const;
void accept(DVisitor *visitor) override;
void accept(DConstVisitor *visitor) const override;
};
} // namespace qmt
......
......@@ -56,9 +56,9 @@ public:
};
DRelation();
~DRelation();
~DRelation() override;
Uid modelUid() const { return m_modelUid; }
Uid modelUid() const override { return m_modelUid; }
void setModelUid(const Uid &uid);
QList<QString> stereotypes() const { return m_stereotypes; }
void setStereotypes(const QList<QString> &stereotypes);
......@@ -71,8 +71,8 @@ public:
QList<IntermediatePoint> intermediatePoints() const { return m_intermediatePoints; }
void setIntermediatePoints(const QList<IntermediatePoint> &intermediatePoints);
void accept(DVisitor *visitor);
void accept(DConstVisitor *visitor) const;
void accept(DVisitor *visitor) override;
void accept(DConstVisitor *visitor) const override;
private:
Uid m_modelUid;
......
......@@ -43,19 +43,19 @@ public:
DElement *cloned() const { return m_cloned; }
void visitDElement(const DElement *element);
void visitDObject(const DObject *object);
void visitDPackage(const DPackage *package);
void visitDClass(const DClass *klass);
void visitDComponent(const DComponent *component);
void visitDDiagram(const DDiagram *diagram);
void visitDItem(const DItem *item);
void visitDRelation(const DRelation *relation);
void visitDInheritance(const DInheritance *inheritance);
void visitDDependency(const DDependency *dependency);
void visitDAssociation(const DAssociation *association);
void visitDAnnotation(const DAnnotation *annotation);
void visitDBoundary(const DBoundary *boundary);
void visitDElement(const DElement *element) override;
void visitDObject(const DObject *object) override;
void visitDPackage(const DPackage *package) override;
void visitDClass(const DClass *klass) override;
void visitDComponent(const DComponent *component) override;
void visitDDiagram(const DDiagram *diagram) override;
void visitDItem(const DItem *item) override;
void visitDRelation(const DRelation *relation) override;
void visitDInheritance(const DInheritance *inheritance) override;
void visitDDependency(const DDependency *dependency) override;
void visitDAssociation(const DAssociation *association) override;
void visitDAnnotation(const DAnnotation *annotation) override;
void visitDBoundary(const DBoundary *boundary) override;
private:
DElement *m_cloned;
......@@ -68,19 +68,19 @@ public:
DElement *cloned() const { return m_cloned; }
void visitDElement(const DElement *element);
void visitDObject(const DObject *object);
void visitDPackage(const DPackage *package);
void visitDClass(const DClass *klass);
void visitDComponent(const DComponent *component);
void visitDDiagram(const DDiagram *diagram);
void visitDItem(const DItem *item);
void visitDRelation(const DRelation *relation);
void visitDInheritance(const DInheritance *inheritance);
void visitDDependency(const DDependency *dependency);
void visitDAssociation(const DAssociation *association);
void visitDAnnotation(const DAnnotation *annotation);
void visitDBoundary(const DBoundary *boundary);
void visitDElement(const DElement *element) override;
void visitDObject(const DObject *object) override;
void visitDPackage(const DPackage *package) override;
void visitDClass(const DClass *klass) override;
void visitDComponent(const DComponent *component) override;
void visitDDiagram(const DDiagram *diagram) override;
void visitDItem(const DItem *item) override;
void visitDRelation(const DRelation *relation) override;
void visitDInheritance(const DInheritance *inheritance) override;
void visitDDependency(const DDependency *dependency) override;
void visitDAssociation(const DAssociation *association) override;
void visitDAnnotation(const DAnnotation *annotation) override;
void visitDBoundary(const DBoundary *boundary) override;
private:
DElement *m_cloned;
......
......@@ -45,18 +45,18 @@ public:
DElement *product() const { return m_product; }
void visitMElement(const MElement *element);
void visitMObject(const MObject *object);
void visitMPackage(const MPackage *package);
void visitMClass(const MClass *klass);
void visitMComponent(const MComponent *component);
void visitMDiagram(const MDiagram *diagram);
void visitMCanvasDiagram(const MCanvasDiagram *diagram);
void visitMItem(const MItem *item);
void visitMRelation(const MRelation *relation);
void visitMDependency(const MDependency *dependency);
void visitMInheritance(const MInheritance *inheritance);
void visitMAssociation(const MAssociation *association);
void visitMElement(const MElement *element) override;
void visitMObject(const MObject *object) override;
void visitMPackage(const MPackage *package) override;
void visitMClass(const MClass *klass) override;
void visitMComponent(const MComponent *component) override;
void visitMDiagram(const MDiagram *diagram) override;
void visitMCanvasDiagram(const MCanvasDiagram *diagram) override;
void visitMItem(const MItem *item) override;
void visitMRelation(const MRelation *relation) override;
void visitMDependency(const MDependency *dependency) override;
void visitMInheritance(const MInheritance *inheritance) override;
void visitMAssociation(const MAssociation *association) override;
private:
DElement *m_product;
......
......@@ -41,19 +41,19 @@ class QMT_EXPORT DFlatAssignmentVisitor : public DConstVisitor
public:
DFlatAssignmentVisitor(DElement *target);
void visitDElement(const DElement *element);
void visitDObject(const DObject *object);
void visitDPackage(const DPackage *package);
void visitDClass(const DClass *klass);
void visitDComponent(const DComponent *component);
void visitDDiagram(const DDiagram *diagram);
void visitDItem(const DItem *item);
void visitDRelation(const DRelation *relation);
void visitDInheritance(const DInheritance *inheritance);
void visitDDependency(const DDependency *dependency);
void visitDAssociation(const DAssociation *association);
void visitDAnnotation(const DAnnotation *annotation);
void visitDBoundary(const DBoundary *boundary);
void visitDElement(const DElement *element) override;
void visitDObject(const DObject *object) override;
void visitDPackage(const DPackage *package) override;
void visitDClass(const DClass *klass) override;
void visitDComponent(const DComponent *component) override;
void visitDDiagram(const DDiagram *diagram) override;
void visitDItem(const DItem *item) override;
void visitDRelation(const DRelation *relation) override;
void visitDInheritance(const DInheritance *inheritance) override;
void visitDDependency(const DDependency *dependency) override;
void visitDAssociation(const DAssociation *association) override;
void visitDAnnotation(const DAnnotation *annotation) override;
void visitDBoundary(const DBoundary *boundary) override;
private:
DElement *m_target;
......
......@@ -111,12 +111,12 @@ public:
m_clonedElements.insert(visitor.cloned()->uid(), visitor.cloned());
}
~UpdateElementCommand()
~UpdateElementCommand() override
{
qDeleteAll(m_clonedElements);
}
bool mergeWith(const UndoCommand *other)
bool mergeWith(const UndoCommand *other) override
{
auto otherUpdateCommand = dynamic_cast<const UpdateElementCommand *>(other);
if (!otherUpdateCommand)
......@@ -140,7 +140,7 @@ public:
return true;
}
void redo()
void redo() override
{
if (canRedo()) {
swap();
......@@ -148,7 +148,7 @@ public:
}
}
void undo()
void undo() override
{
swap();
UndoCommand::undo();
......@@ -192,7 +192,7 @@ protected:
{
}
~AbstractAddRemCommand()
~AbstractAddRemCommand() override
{
foreach (const Clone &clone, m_clonedElements)
delete clone.m_clonedElement;
......@@ -260,7 +260,7 @@ public:
m_clonedElements.append(clone);
}
void redo()
void redo() override
{
if (canRedo()) {
insert();
......@@ -268,7 +268,7 @@ public:
}
}
void undo()
void undo() override
{
remove();
UndoCommand::undo();
......@@ -298,7 +298,7 @@ public:
m_clonedElements.append(clone);
}
void redo()
void redo() override
{
if (canRedo()) {
remove();
......@@ -306,7 +306,7 @@ public:
}
}
void undo()
void undo() override
{
insert();
UndoCommand::undo();
......@@ -321,7 +321,7 @@ public:
{
}
void visitMDiagram(MDiagram *diagram)
void visitMDiagram(MDiagram *diagram) override
{
m_allDiagrams->append(diagram);
MChildrenVisitor::visitMDiagram(diagram);
......
......@@ -72,7 +72,7 @@ private:
public:
explicit DiagramController(QObject *parent = 0);
~DiagramController();
~DiagramController() override;
signals:
void beginResetAllDiagrams();
......
......@@ -46,18 +46,18 @@ public:
bool isUpdateNeeded() const { return m_isUpdateNeeded; }
void setCheckNeedsUpdate(bool checkNeedsUpdate);
void visitMElement(const MElement *element);
void visitMObject(const MObject *object);
void visitMPackage(const MPackage *package);
void visitMClass(const MClass *klass);
void visitMComponent(const MComponent *component);
void visitMDiagram(const MDiagram *diagram);
void visitMCanvasDiagram(const MCanvasDiagram *diagram);
void visitMItem(const MItem *item);
void visitMRelation(const MRelation *relation);