ModelEditor: Use default constructor

Change-Id: I2b08e68eddbbf6bb589fd8f2ada77deabdcc6649
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
This commit is contained in:
Jochen Becher
2015-11-24 20:00:24 +01:00
parent b977b2f4b1
commit 701dd53fd3
20 changed files with 26 additions and 76 deletions

View File

@@ -40,7 +40,7 @@ namespace qmt {
class SourceChar class SourceChar
{ {
public: public:
SourceChar() { } SourceChar() = default;
SourceChar(QChar chr, const SourcePos &sourcePos) SourceChar(QChar chr, const SourcePos &sourcePos)
: ch(chr), : ch(chr),
pos(sourcePos) pos(sourcePos)
@@ -54,7 +54,7 @@ public:
class ITextSource class ITextSource
{ {
public: public:
virtual ~ITextSource() { } virtual ~ITextSource() = default;
virtual SourceChar readNextChar() = 0; virtual SourceChar readNextChar() = 0;
}; };

View File

@@ -39,7 +39,7 @@ template<class T>
class Container class Container
{ {
protected: protected:
Container() { } Container() = default;
Container(const Container<T> &rhs) Container(const Container<T> &rhs)
: m_elements(rhs.m_elements) : m_elements(rhs.m_elements)
{ {

View File

@@ -39,10 +39,10 @@ template<class T>
class References class References
{ {
protected: protected:
References() { } References() = default;
public: public:
~References() { } ~References() = default;
bool isEmpty() const { return m_elements.empty(); } bool isEmpty() const { return m_elements.empty(); }
int size() const { return m_elements.size(); } int size() const { return m_elements.size(); }

View File

@@ -50,7 +50,7 @@ class DBoundary;
class DConstVisitor class DConstVisitor
{ {
public: public:
virtual ~DConstVisitor() { } virtual ~DConstVisitor() = default;
virtual void visitDElement(const DElement *element) = 0; virtual void visitDElement(const DElement *element) = 0;
virtual void visitDObject(const DObject *object) = 0; virtual void visitDObject(const DObject *object) = 0;

View File

@@ -50,7 +50,7 @@ class DBoundary;
class DVisitor class DVisitor
{ {
public: public:
virtual ~DVisitor() { } virtual ~DVisitor() = default;
virtual void visitDElement(DElement *element) = 0; virtual void visitDElement(DElement *element) = 0;
virtual void visitDObject(DObject *object) = 0; virtual void visitDObject(DObject *object) = 0;

View File

@@ -50,7 +50,7 @@ public:
AlignSize AlignSize
}; };
virtual ~IAlignable() { } virtual ~IAlignable() = default;
virtual void align(AlignType alignType, const QString &identifier) = 0; virtual void align(AlignType alignType, const QString &identifier) = 0;
}; };

View File

@@ -59,9 +59,7 @@ public:
class Latch class Latch
{ {
public: public:
Latch() Latch() = default;
{
}
Latch(LatchType latchType, qreal pos, qreal otherPos1, qreal otherPos2, Latch(LatchType latchType, qreal pos, qreal otherPos1, qreal otherPos2,
const QString &identifier) const QString &identifier)
@@ -80,7 +78,7 @@ public:
QString m_identifier; QString m_identifier;
}; };
virtual ~ILatchable() { } virtual ~ILatchable() = default;
virtual QList<Latch> horizontalLatches(Action action, bool grabbedItem) const = 0; virtual QList<Latch> horizontalLatches(Action action, bool grabbedItem) const = 0;
virtual QList<Latch> verticalLatches(Action action, bool grabbedItem) const = 0; virtual QList<Latch> verticalLatches(Action action, bool grabbedItem) const = 0;

View File

@@ -50,10 +50,6 @@ inline int sgn(T val)
namespace qmt { namespace qmt {
GeometryUtilities::GeometryUtilities()
{
}
QLineF GeometryUtilities::stretch(const QLineF &line, double p1Extension, double p2Extension) QLineF GeometryUtilities::stretch(const QLineF &line, double p1Extension, double p2Extension)
{ {
QLineF direction = line.unitVector(); QLineF direction = line.unitVector();
@@ -82,7 +78,7 @@ namespace {
class Candidate class Candidate
{ {
public: public:
Candidate() { } Candidate() = default;
Candidate(const QVector2D &f, const QPointF &s, GeometryUtilities::Side t) : first(f), second(s), third(t) { } Candidate(const QVector2D &f, const QPointF &s, GeometryUtilities::Side t) : first(f), second(s), third(t) { }
QVector2D first; QVector2D first;

View File

@@ -45,8 +45,7 @@ namespace qmt {
class GeometryUtilities class GeometryUtilities
{ {
private: GeometryUtilities() = delete;
GeometryUtilities();
public: public:
enum Side { enum Side {

View File

@@ -40,7 +40,7 @@ template<class T>
class Handle class Handle
{ {
public: public:
Handle() { } Handle() = default;
explicit Handle(const Uid &uid) : m_uid(uid) { } explicit Handle(const Uid &uid) : m_uid(uid) { }
explicit Handle(T *t) : m_uid(t ? t->uid() : Uid()), m_target(t) { } explicit Handle(T *t) : m_uid(t ? t->uid() : Uid()), m_target(t) { }
Handle(const Handle &rhs) : m_uid(rhs.m_uid), m_target(rhs.m_target) { } Handle(const Handle &rhs) : m_uid(rhs.m_uid), m_target(rhs.m_target) { }

View File

@@ -42,10 +42,6 @@
namespace qmt { namespace qmt {
MChildrenVisitor::MChildrenVisitor()
{
}
void MChildrenVisitor::visitMElement(MElement *element) void MChildrenVisitor::visitMElement(MElement *element)
{ {
Q_UNUSED(element); Q_UNUSED(element);

View File

@@ -39,8 +39,6 @@ namespace qmt {
class QMT_EXPORT MChildrenVisitor : public MVisitor class QMT_EXPORT MChildrenVisitor : public MVisitor
{ {
public: public:
MChildrenVisitor();
void visitMElement(MElement *element) override; void visitMElement(MElement *element) override;
void visitMObject(MObject *object) override; void visitMObject(MObject *object) override;
void visitMPackage(MPackage *package) override; void visitMPackage(MPackage *package) override;

View File

@@ -47,10 +47,6 @@
namespace qmt { namespace qmt {
MVoidVisitor::MVoidVisitor()
{
}
void MVoidVisitor::visitMElement(MElement *element) void MVoidVisitor::visitMElement(MElement *element)
{ {
Q_UNUSED(element); Q_UNUSED(element);
@@ -111,10 +107,6 @@ void MVoidVisitor::visitMAssociation(MAssociation *association)
visitMRelation(association); visitMRelation(association);
} }
MVoidConstVisitor::MVoidConstVisitor()
{
}
void MVoidConstVisitor::visitMElement(const MElement *element) void MVoidConstVisitor::visitMElement(const MElement *element)
{ {
Q_UNUSED(element); Q_UNUSED(element);

View File

@@ -40,8 +40,6 @@ namespace qmt {
class QMT_EXPORT MVoidVisitor : public MVisitor class QMT_EXPORT MVoidVisitor : public MVisitor
{ {
public: public:
MVoidVisitor();
void visitMElement(MElement *element) override; void visitMElement(MElement *element) override;
void visitMObject(MObject *object) override; void visitMObject(MObject *object) override;
void visitMPackage(MPackage *package) override; void visitMPackage(MPackage *package) override;
@@ -59,8 +57,6 @@ public:
class QMT_EXPORT MVoidConstVisitor : public MConstVisitor class QMT_EXPORT MVoidConstVisitor : public MConstVisitor
{ {
public: public:
MVoidConstVisitor();
void visitMElement(const MElement *element) override; void visitMElement(const MElement *element) override;
void visitMObject(const MObject *object) override; void visitMObject(const MObject *object) override;
void visitMPackage(const MPackage *package) override; void visitMPackage(const MPackage *package) override;

View File

@@ -44,9 +44,7 @@ namespace qmt {
class QMT_EXPORT LineShape : public IShape class QMT_EXPORT LineShape : public IShape
{ {
public: public:
LineShape() LineShape() = default;
{
}
LineShape(const ShapePointF &pos1, const ShapePointF &pos2) LineShape(const ShapePointF &pos1, const ShapePointF &pos2)
: m_pos1(pos1), : m_pos1(pos1),
@@ -69,9 +67,7 @@ private:
class QMT_EXPORT RectShape : public IShape class QMT_EXPORT RectShape : public IShape
{ {
public: public:
RectShape() RectShape() = default;
{
}
RectShape(const ShapePointF &pos, const ShapeSizeF &size) RectShape(const ShapePointF &pos, const ShapeSizeF &size)
: m_pos(pos), : m_pos(pos),
@@ -94,9 +90,7 @@ private:
class QMT_EXPORT RoundedRectShape : public IShape class QMT_EXPORT RoundedRectShape : public IShape
{ {
public: public:
RoundedRectShape() RoundedRectShape() = default;
{
}
RoundedRectShape(const ShapePointF &pos, const ShapeSizeF &size, const ShapeValueF &radius) RoundedRectShape(const ShapePointF &pos, const ShapeSizeF &size, const ShapeValueF &radius)
: m_pos(pos), : m_pos(pos),
@@ -122,9 +116,7 @@ private:
class QMT_EXPORT CircleShape : public IShape class QMT_EXPORT CircleShape : public IShape
{ {
public: public:
CircleShape() CircleShape() = default;
{
}
CircleShape(const ShapePointF &center, const ShapeValueF &radius) CircleShape(const ShapePointF &center, const ShapeValueF &radius)
: m_center(center), : m_center(center),
@@ -147,9 +139,7 @@ private:
class QMT_EXPORT EllipseShape : public IShape class QMT_EXPORT EllipseShape : public IShape
{ {
public: public:
EllipseShape() EllipseShape() = default;
{
}
EllipseShape(const ShapePointF &center, const ShapeSizeF &radius) EllipseShape(const ShapePointF &center, const ShapeSizeF &radius)
: m_center(center), : m_center(center),
@@ -172,9 +162,7 @@ private:
class QMT_EXPORT ArcShape : public IShape class QMT_EXPORT ArcShape : public IShape
{ {
public: public:
ArcShape() ArcShape() = default;
{
}
ArcShape(const ShapePointF &center, const ShapeSizeF &radius, qreal startAngle, qreal spanAngle) ArcShape(const ShapePointF &center, const ShapeSizeF &radius, qreal startAngle, qreal spanAngle)
: m_center(center), : m_center(center),

View File

@@ -94,9 +94,7 @@ private:
class QMT_EXPORT ShapePointF class QMT_EXPORT ShapePointF
{ {
public: public:
ShapePointF() ShapePointF() = default;
{
}
ShapePointF(const ShapeValueF &x, const ShapeValueF &y) ShapePointF(const ShapeValueF &x, const ShapeValueF &y)
: m_x(x), : m_x(x),
@@ -123,9 +121,7 @@ private:
class QMT_EXPORT ShapeSizeF class QMT_EXPORT ShapeSizeF
{ {
public: public:
ShapeSizeF() ShapeSizeF() = default;
{
}
ShapeSizeF(const ShapeValueF &width, const ShapeValueF &height) ShapeSizeF(const ShapeValueF &width, const ShapeValueF &height)
: m_width(width), : m_width(width),

View File

@@ -74,9 +74,7 @@ namespace qmt {
class ObjectStyleKey class ObjectStyleKey
{ {
public: public:
ObjectStyleKey() ObjectStyleKey() = default;
{
}
ObjectStyleKey(StyleEngine::ElementType elementType, const ObjectVisuals &objectVisuals) ObjectStyleKey(StyleEngine::ElementType elementType, const ObjectVisuals &objectVisuals)
: m_elementType(elementType), : m_elementType(elementType),
@@ -143,12 +141,9 @@ bool operator==(const AnnotationStyleKey &lhs, const AnnotationStyleKey &rhs)
return lhs.m_visualRole == rhs.m_visualRole; return lhs.m_visualRole == rhs.m_visualRole;
} }
// TODO remove class if no attributes needed even with future extensions
class BoundaryStyleKey class BoundaryStyleKey
{ {
public:
BoundaryStyleKey()
{
}
}; };
uint qHash(const BoundaryStyleKey &styleKey) uint qHash(const BoundaryStyleKey &styleKey)

View File

@@ -42,8 +42,6 @@ namespace qark {
class ArchiveBasics class ArchiveBasics
{ {
public: public:
ArchiveBasics() { }
void setFlag(const Flag &flag) { m_flags |= flag.mask(); } void setFlag(const Flag &flag) { m_flags |= flag.mask(); }
void clearFlag(const Flag &flag) { m_flags &= ~flag.mask(); } void clearFlag(const Flag &flag) { m_flags &= ~flag.mask(); }
bool hasFlag(const Flag &flag) const { return (m_flags & flag.mask()) != 0; } bool hasFlag(const Flag &flag) const { return (m_flags & flag.mask()) != 0; }

View File

@@ -38,9 +38,7 @@ namespace qark {
class Parameters class Parameters
{ {
public: public:
Parameters() Parameters() = default;
{
}
explicit Parameters(const Flag &flag) explicit Parameters(const Flag &flag)
: m_flags(flag.mask()) : m_flags(flag.mask())

View File

@@ -149,8 +149,8 @@ template<typename KEY, typename VALUE>
class KeyValuePair class KeyValuePair
{ {
public: public:
KeyValuePair() { } KeyValuePair() = default;
explicit KeyValuePair(const KEY &key, const VALUE &value) : m_key(key), m_value(value) { } KeyValuePair(const KEY &key, const VALUE &value) : m_key(key), m_value(value) { }
KEY m_key; KEY m_key;
VALUE m_value; VALUE m_value;