forked from qt-creator/qt-creator
ModelEditor: Use default constructor
Change-Id: I2b08e68eddbbf6bb589fd8f2ada77deabdcc6649 Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
This commit is contained in:
@@ -40,7 +40,7 @@ namespace qmt {
|
||||
class SourceChar
|
||||
{
|
||||
public:
|
||||
SourceChar() { }
|
||||
SourceChar() = default;
|
||||
SourceChar(QChar chr, const SourcePos &sourcePos)
|
||||
: ch(chr),
|
||||
pos(sourcePos)
|
||||
@@ -54,7 +54,7 @@ public:
|
||||
class ITextSource
|
||||
{
|
||||
public:
|
||||
virtual ~ITextSource() { }
|
||||
virtual ~ITextSource() = default;
|
||||
|
||||
virtual SourceChar readNextChar() = 0;
|
||||
};
|
||||
|
@@ -39,7 +39,7 @@ template<class T>
|
||||
class Container
|
||||
{
|
||||
protected:
|
||||
Container() { }
|
||||
Container() = default;
|
||||
Container(const Container<T> &rhs)
|
||||
: m_elements(rhs.m_elements)
|
||||
{
|
||||
|
@@ -39,10 +39,10 @@ template<class T>
|
||||
class References
|
||||
{
|
||||
protected:
|
||||
References() { }
|
||||
References() = default;
|
||||
|
||||
public:
|
||||
~References() { }
|
||||
~References() = default;
|
||||
|
||||
bool isEmpty() const { return m_elements.empty(); }
|
||||
int size() const { return m_elements.size(); }
|
||||
|
@@ -50,7 +50,7 @@ class DBoundary;
|
||||
class DConstVisitor
|
||||
{
|
||||
public:
|
||||
virtual ~DConstVisitor() { }
|
||||
virtual ~DConstVisitor() = default;
|
||||
|
||||
virtual void visitDElement(const DElement *element) = 0;
|
||||
virtual void visitDObject(const DObject *object) = 0;
|
||||
|
@@ -50,7 +50,7 @@ class DBoundary;
|
||||
class DVisitor
|
||||
{
|
||||
public:
|
||||
virtual ~DVisitor() { }
|
||||
virtual ~DVisitor() = default;
|
||||
|
||||
virtual void visitDElement(DElement *element) = 0;
|
||||
virtual void visitDObject(DObject *object) = 0;
|
||||
|
@@ -50,7 +50,7 @@ public:
|
||||
AlignSize
|
||||
};
|
||||
|
||||
virtual ~IAlignable() { }
|
||||
virtual ~IAlignable() = default;
|
||||
|
||||
virtual void align(AlignType alignType, const QString &identifier) = 0;
|
||||
};
|
||||
|
@@ -59,9 +59,7 @@ public:
|
||||
class Latch
|
||||
{
|
||||
public:
|
||||
Latch()
|
||||
{
|
||||
}
|
||||
Latch() = default;
|
||||
|
||||
Latch(LatchType latchType, qreal pos, qreal otherPos1, qreal otherPos2,
|
||||
const QString &identifier)
|
||||
@@ -80,7 +78,7 @@ public:
|
||||
QString m_identifier;
|
||||
};
|
||||
|
||||
virtual ~ILatchable() { }
|
||||
virtual ~ILatchable() = default;
|
||||
|
||||
virtual QList<Latch> horizontalLatches(Action action, bool grabbedItem) const = 0;
|
||||
virtual QList<Latch> verticalLatches(Action action, bool grabbedItem) const = 0;
|
||||
|
@@ -50,10 +50,6 @@ inline int sgn(T val)
|
||||
|
||||
namespace qmt {
|
||||
|
||||
GeometryUtilities::GeometryUtilities()
|
||||
{
|
||||
}
|
||||
|
||||
QLineF GeometryUtilities::stretch(const QLineF &line, double p1Extension, double p2Extension)
|
||||
{
|
||||
QLineF direction = line.unitVector();
|
||||
@@ -82,7 +78,7 @@ namespace {
|
||||
class Candidate
|
||||
{
|
||||
public:
|
||||
Candidate() { }
|
||||
Candidate() = default;
|
||||
Candidate(const QVector2D &f, const QPointF &s, GeometryUtilities::Side t) : first(f), second(s), third(t) { }
|
||||
|
||||
QVector2D first;
|
||||
|
@@ -45,8 +45,7 @@ namespace qmt {
|
||||
|
||||
class GeometryUtilities
|
||||
{
|
||||
private:
|
||||
GeometryUtilities();
|
||||
GeometryUtilities() = delete;
|
||||
|
||||
public:
|
||||
enum Side {
|
||||
|
@@ -40,7 +40,7 @@ template<class T>
|
||||
class Handle
|
||||
{
|
||||
public:
|
||||
Handle() { }
|
||||
Handle() = default;
|
||||
explicit Handle(const Uid &uid) : m_uid(uid) { }
|
||||
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) { }
|
||||
|
@@ -42,10 +42,6 @@
|
||||
|
||||
namespace qmt {
|
||||
|
||||
MChildrenVisitor::MChildrenVisitor()
|
||||
{
|
||||
}
|
||||
|
||||
void MChildrenVisitor::visitMElement(MElement *element)
|
||||
{
|
||||
Q_UNUSED(element);
|
||||
|
@@ -39,8 +39,6 @@ namespace qmt {
|
||||
class QMT_EXPORT MChildrenVisitor : public MVisitor
|
||||
{
|
||||
public:
|
||||
MChildrenVisitor();
|
||||
|
||||
void visitMElement(MElement *element) override;
|
||||
void visitMObject(MObject *object) override;
|
||||
void visitMPackage(MPackage *package) override;
|
||||
|
@@ -47,10 +47,6 @@
|
||||
|
||||
namespace qmt {
|
||||
|
||||
MVoidVisitor::MVoidVisitor()
|
||||
{
|
||||
}
|
||||
|
||||
void MVoidVisitor::visitMElement(MElement *element)
|
||||
{
|
||||
Q_UNUSED(element);
|
||||
@@ -111,10 +107,6 @@ void MVoidVisitor::visitMAssociation(MAssociation *association)
|
||||
visitMRelation(association);
|
||||
}
|
||||
|
||||
MVoidConstVisitor::MVoidConstVisitor()
|
||||
{
|
||||
}
|
||||
|
||||
void MVoidConstVisitor::visitMElement(const MElement *element)
|
||||
{
|
||||
Q_UNUSED(element);
|
||||
|
@@ -40,8 +40,6 @@ namespace qmt {
|
||||
class QMT_EXPORT MVoidVisitor : public MVisitor
|
||||
{
|
||||
public:
|
||||
MVoidVisitor();
|
||||
|
||||
void visitMElement(MElement *element) override;
|
||||
void visitMObject(MObject *object) override;
|
||||
void visitMPackage(MPackage *package) override;
|
||||
@@ -59,8 +57,6 @@ public:
|
||||
class QMT_EXPORT MVoidConstVisitor : public MConstVisitor
|
||||
{
|
||||
public:
|
||||
MVoidConstVisitor();
|
||||
|
||||
void visitMElement(const MElement *element) override;
|
||||
void visitMObject(const MObject *object) override;
|
||||
void visitMPackage(const MPackage *package) override;
|
||||
|
@@ -44,9 +44,7 @@ namespace qmt {
|
||||
class QMT_EXPORT LineShape : public IShape
|
||||
{
|
||||
public:
|
||||
LineShape()
|
||||
{
|
||||
}
|
||||
LineShape() = default;
|
||||
|
||||
LineShape(const ShapePointF &pos1, const ShapePointF &pos2)
|
||||
: m_pos1(pos1),
|
||||
@@ -69,9 +67,7 @@ private:
|
||||
class QMT_EXPORT RectShape : public IShape
|
||||
{
|
||||
public:
|
||||
RectShape()
|
||||
{
|
||||
}
|
||||
RectShape() = default;
|
||||
|
||||
RectShape(const ShapePointF &pos, const ShapeSizeF &size)
|
||||
: m_pos(pos),
|
||||
@@ -94,9 +90,7 @@ private:
|
||||
class QMT_EXPORT RoundedRectShape : public IShape
|
||||
{
|
||||
public:
|
||||
RoundedRectShape()
|
||||
{
|
||||
}
|
||||
RoundedRectShape() = default;
|
||||
|
||||
RoundedRectShape(const ShapePointF &pos, const ShapeSizeF &size, const ShapeValueF &radius)
|
||||
: m_pos(pos),
|
||||
@@ -122,9 +116,7 @@ private:
|
||||
class QMT_EXPORT CircleShape : public IShape
|
||||
{
|
||||
public:
|
||||
CircleShape()
|
||||
{
|
||||
}
|
||||
CircleShape() = default;
|
||||
|
||||
CircleShape(const ShapePointF ¢er, const ShapeValueF &radius)
|
||||
: m_center(center),
|
||||
@@ -147,9 +139,7 @@ private:
|
||||
class QMT_EXPORT EllipseShape : public IShape
|
||||
{
|
||||
public:
|
||||
EllipseShape()
|
||||
{
|
||||
}
|
||||
EllipseShape() = default;
|
||||
|
||||
EllipseShape(const ShapePointF ¢er, const ShapeSizeF &radius)
|
||||
: m_center(center),
|
||||
@@ -172,9 +162,7 @@ private:
|
||||
class QMT_EXPORT ArcShape : public IShape
|
||||
{
|
||||
public:
|
||||
ArcShape()
|
||||
{
|
||||
}
|
||||
ArcShape() = default;
|
||||
|
||||
ArcShape(const ShapePointF ¢er, const ShapeSizeF &radius, qreal startAngle, qreal spanAngle)
|
||||
: m_center(center),
|
||||
|
@@ -94,9 +94,7 @@ private:
|
||||
class QMT_EXPORT ShapePointF
|
||||
{
|
||||
public:
|
||||
ShapePointF()
|
||||
{
|
||||
}
|
||||
ShapePointF() = default;
|
||||
|
||||
ShapePointF(const ShapeValueF &x, const ShapeValueF &y)
|
||||
: m_x(x),
|
||||
@@ -123,9 +121,7 @@ private:
|
||||
class QMT_EXPORT ShapeSizeF
|
||||
{
|
||||
public:
|
||||
ShapeSizeF()
|
||||
{
|
||||
}
|
||||
ShapeSizeF() = default;
|
||||
|
||||
ShapeSizeF(const ShapeValueF &width, const ShapeValueF &height)
|
||||
: m_width(width),
|
||||
|
@@ -74,9 +74,7 @@ namespace qmt {
|
||||
class ObjectStyleKey
|
||||
{
|
||||
public:
|
||||
ObjectStyleKey()
|
||||
{
|
||||
}
|
||||
ObjectStyleKey() = default;
|
||||
|
||||
ObjectStyleKey(StyleEngine::ElementType elementType, const ObjectVisuals &objectVisuals)
|
||||
: m_elementType(elementType),
|
||||
@@ -143,12 +141,9 @@ bool operator==(const AnnotationStyleKey &lhs, const AnnotationStyleKey &rhs)
|
||||
return lhs.m_visualRole == rhs.m_visualRole;
|
||||
}
|
||||
|
||||
// TODO remove class if no attributes needed even with future extensions
|
||||
class BoundaryStyleKey
|
||||
{
|
||||
public:
|
||||
BoundaryStyleKey()
|
||||
{
|
||||
}
|
||||
};
|
||||
|
||||
uint qHash(const BoundaryStyleKey &styleKey)
|
||||
|
@@ -42,8 +42,6 @@ namespace qark {
|
||||
class ArchiveBasics
|
||||
{
|
||||
public:
|
||||
ArchiveBasics() { }
|
||||
|
||||
void setFlag(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; }
|
||||
|
@@ -38,9 +38,7 @@ namespace qark {
|
||||
class Parameters
|
||||
{
|
||||
public:
|
||||
Parameters()
|
||||
{
|
||||
}
|
||||
Parameters() = default;
|
||||
|
||||
explicit Parameters(const Flag &flag)
|
||||
: m_flags(flag.mask())
|
||||
|
@@ -149,8 +149,8 @@ template<typename KEY, typename VALUE>
|
||||
class KeyValuePair
|
||||
{
|
||||
public:
|
||||
KeyValuePair() { }
|
||||
explicit KeyValuePair(const KEY &key, const VALUE &value) : m_key(key), m_value(value) { }
|
||||
KeyValuePair() = default;
|
||||
KeyValuePair(const KEY &key, const VALUE &value) : m_key(key), m_value(value) { }
|
||||
|
||||
KEY m_key;
|
||||
VALUE m_value;
|
||||
|
Reference in New Issue
Block a user