diff --git a/src/app/container/calculator.cpp b/src/app/container/calculator.cpp index e23b549b0..aa36c999c 100644 --- a/src/app/container/calculator.cpp +++ b/src/app/container/calculator.cpp @@ -153,11 +153,10 @@ void Calculator::InitVariables(const VContainer *data, const QMap const QHash > *vars = data->DataVariables(); - bool found = false; QMap::const_iterator i = tokens.constBegin(); while (i != tokens.constEnd()) { - found = false; + bool found = false; if (vars->contains(i.value())) { QSharedPointer var = vars->value(i.value()); diff --git a/src/app/container/vcontainer.cpp b/src/app/container/vcontainer.cpp index aa68c101e..3d3536316 100644 --- a/src/app/container/vcontainer.cpp +++ b/src/app/container/vcontainer.cpp @@ -495,7 +495,7 @@ void VContainer::SetHeightName(const QString &name) * @brief size return size * @return size in mm */ -qreal VContainer::size() const +qreal VContainer::size() { return _size; } @@ -511,7 +511,7 @@ QString VContainer::SizeName() const * @brief height return height * @return height in pattern units */ -qreal VContainer::height() const +qreal VContainer::height() { return _height; } diff --git a/src/app/container/vcontainer.h b/src/app/container/vcontainer.h index 3676a80ea..7c341899a 100644 --- a/src/app/container/vcontainer.h +++ b/src/app/container/vcontainer.h @@ -200,13 +200,13 @@ public: void ClearDetails(); static void ClearUniqueNames(); - void SetSize(qreal size); + static void SetSize(qreal size); void SetSizeName(const QString &name); - void SetHeight(qreal height); + static void SetHeight(qreal height); void SetHeightName(const QString &name); - qreal size() const; - QString SizeName()const; - qreal height() const; + static qreal size(); + QString SizeName() const; + static qreal height(); QString HeightName()const; bool VariableExist(const QString& name); diff --git a/src/app/dialogs/tools/dialogbisector.cpp b/src/app/dialogs/tools/dialogbisector.cpp index 8b8c5ec0f..7b7ed07ad 100644 --- a/src/app/dialogs/tools/dialogbisector.cpp +++ b/src/app/dialogs/tools/dialogbisector.cpp @@ -44,7 +44,7 @@ DialogBisector::DialogBisector(const VContainer *data, const quint32 &toolId, QWidget *parent) :DialogTool(data, toolId, parent), ui(new Ui::DialogBisector), number(0), typeLine(QString()), formula(QString()), firstPointId(NULL_ID), secondPointId(NULL_ID), thirdPointId(NULL_ID), formulaBaseHeight(0), - line(nullptr), prepare(false) + line(nullptr) { ui->setupUi(this); InitVariables(ui); diff --git a/src/app/dialogs/tools/dialogbisector.h b/src/app/dialogs/tools/dialogbisector.h index 6a0816a45..4b3cabad0 100644 --- a/src/app/dialogs/tools/dialogbisector.h +++ b/src/app/dialogs/tools/dialogbisector.h @@ -110,7 +110,6 @@ private: /** @brief formulaBaseHeight base height defined by dialogui */ int formulaBaseHeight; VisToolBisector *line; - bool prepare; }; diff --git a/src/app/geometry/varc_p.h b/src/app/geometry/varc_p.h index c98b4f7ee..dd56deb94 100644 --- a/src/app/geometry/varc_p.h +++ b/src/app/geometry/varc_p.h @@ -54,13 +54,9 @@ public: {} VArcData(VPointF center, qreal radius, qreal f1, qreal f2) - : f1(f1), formulaF1(QStringLiteral("")), f2(f2), formulaF2(QStringLiteral("")), radius(radius), - formulaRadius(QStringLiteral("")), center(center) - { - formulaF1 = QString("%1").arg(f1); - formulaF2 = QString("%1").arg(f2); - formulaRadius = QString("%1").arg(radius); - } + : f1(f1), formulaF1(QString("%1").arg(f1)), f2(f2), formulaF2(QString("%1").arg(f2)), radius(radius), + formulaRadius(QString("%1").arg(radius)), center(center) + {} VArcData(const VArcData &arc) : QSharedData(arc), f1(arc.f1), formulaF1(arc.formulaF1), f2(arc.f2), formulaF2(arc.formulaF2), diff --git a/src/app/geometry/vspline.cpp b/src/app/geometry/vspline.cpp index ec695751a..57d76ce62 100644 --- a/src/app/geometry/vspline.cpp +++ b/src/app/geometry/vspline.cpp @@ -303,7 +303,7 @@ QVector VSpline::GetPoints (const QPointF &p1, const QPointF &p2, const * @param p4 last spline point. * @return length. */ -qreal VSpline::LengthBezier ( const QPointF &p1, const QPointF &p2, const QPointF &p3, const QPointF &p4 ) const +qreal VSpline::LengthBezier ( const QPointF &p1, const QPointF &p2, const QPointF &p3, const QPointF &p4 ) { QPainterPath splinePath; QVector points = GetPoints (p1, p2, p3, p4); diff --git a/src/app/geometry/vspline.h b/src/app/geometry/vspline.h index cf57a0fe1..9b08e2e66 100644 --- a/src/app/geometry/vspline.h +++ b/src/app/geometry/vspline.h @@ -77,7 +77,7 @@ protected: static QVector GetPoints (const QPointF &p1, const QPointF &p2, const QPointF &p3, const QPointF &p4 ); private: QSharedDataPointer d; - qreal LengthBezier (const QPointF &p1, const QPointF &p2, const QPointF &p3, const QPointF &p4 ) const; + static qreal LengthBezier (const QPointF &p1, const QPointF &p2, const QPointF &p3, const QPointF &p4 ); static void PointBezier_r ( qreal x1, qreal y1, qreal x2, qreal y2, qreal x3, qreal y3, qreal x4, qreal y4, qint16 level, QVector &px, QVector &py); static qreal CalcSqDistance ( qreal x1, qreal y1, qreal x2, qreal y2); diff --git a/src/app/visualization/vistoolsplinepath.cpp b/src/app/visualization/vistoolsplinepath.cpp index 18bbdbe89..f6388d8b8 100644 --- a/src/app/visualization/vistoolsplinepath.cpp +++ b/src/app/visualization/vistoolsplinepath.cpp @@ -113,7 +113,6 @@ void VisToolSplinePath::setMode(const Mode &value) //--------------------------------------------------------------------------------------------------------------------- QGraphicsEllipseItem *VisToolSplinePath::getPoint(unsigned int i) { - SCASSERT(i >= 0) if (static_cast(points.size() - 1) >= i && points.isEmpty() == false) { return points.at(static_cast(i)); diff --git a/src/app/widgets/vformulapropertyeditor.cpp b/src/app/widgets/vformulapropertyeditor.cpp index 2873b84a3..3bff0d170 100644 --- a/src/app/widgets/vformulapropertyeditor.cpp +++ b/src/app/widgets/vformulapropertyeditor.cpp @@ -105,7 +105,7 @@ void VFormulaPropertyEditor::onToolButtonClicked() //--------------------------------------------------------------------------------------------------------------------- bool VFormulaPropertyEditor::eventFilter(QObject *obj, QEvent *ev) { - if (obj == ToolButton && (ev->type() == QEvent::KeyPress || ev->type() == QEvent::KeyPress)) + if (obj == ToolButton && ev->type() == QEvent::KeyPress) { // Ignore the event, so that eventually the delegate gets the event. ev->ignore(); diff --git a/src/libs/qmuparser/qmuparsertoken.h b/src/libs/qmuparser/qmuparsertoken.h index 933f4ebde..8db39d292 100644 --- a/src/libs/qmuparser/qmuparsertoken.h +++ b/src/libs/qmuparser/qmuparsertoken.h @@ -328,7 +328,7 @@ public: //------------------------------------------------------------------------------ template < class FunctionPtr > - FunctionPtr union_cast( void* objectPtr ) const + static FunctionPtr union_cast( void* objectPtr ) { union { diff --git a/src/libs/vpropertyexplorer/plugins/vcolorpropertyeditor.cpp b/src/libs/vpropertyexplorer/plugins/vcolorpropertyeditor.cpp index 9ed51fced..01d6e58c2 100644 --- a/src/libs/vpropertyexplorer/plugins/vcolorpropertyeditor.cpp +++ b/src/libs/vpropertyexplorer/plugins/vcolorpropertyeditor.cpp @@ -112,7 +112,7 @@ void VColorPropertyEditor::onToolButtonClicked() bool VColorPropertyEditor::eventFilter(QObject *obj, QEvent *ev) { - if (obj == ToolButton && (ev->type() == QEvent::KeyPress || ev->type() == QEvent::KeyPress)) + if (obj == ToolButton && ev->type() == QEvent::KeyPress) { // Ignore the event, so that eventually the delegate gets the event. ev->ignore(); diff --git a/src/libs/vpropertyexplorer/plugins/vfilepropertyeditor.cpp b/src/libs/vpropertyexplorer/plugins/vfilepropertyeditor.cpp index 573bc04d5..ad5826be2 100644 --- a/src/libs/vpropertyexplorer/plugins/vfilepropertyeditor.cpp +++ b/src/libs/vpropertyexplorer/plugins/vfilepropertyeditor.cpp @@ -132,7 +132,7 @@ bool VFileEditWidget::eventFilter(QObject *obj, QEvent *ev) else return QWidget::eventFilter(obj, ev); } - else if (obj == ToolButton && (ev->type() == QEvent::KeyPress || ev->type() == QEvent::KeyPress)) + else if (obj == ToolButton && ev->type() == QEvent::KeyPress) { // Ignore the event, so that eventually the delegate gets the event. ev->ignore(); diff --git a/src/libs/vpropertyexplorer/plugins/vshortcutproperty.cpp b/src/libs/vpropertyexplorer/plugins/vshortcutproperty.cpp index 75049fe08..dd9a3974b 100644 --- a/src/libs/vpropertyexplorer/plugins/vshortcutproperty.cpp +++ b/src/libs/vpropertyexplorer/plugins/vshortcutproperty.cpp @@ -63,7 +63,6 @@ QWidget* VShortcutProperty::createEditor(QWidget * parent, const QStyleOptionVie } return tmpWidget; - return nullptr; } diff --git a/src/libs/vpropertyexplorer/vpropertyformview_p.h b/src/libs/vpropertyexplorer/vpropertyformview_p.h index 18904c601..92646ce7b 100644 --- a/src/libs/vpropertyexplorer/vpropertyformview_p.h +++ b/src/libs/vpropertyexplorer/vpropertyformview_p.h @@ -47,13 +47,16 @@ public: bool IgnoreDataChangedSignal; VPropertyFormViewPrivate() - : VPropertyFormWidgetPrivate(), Model(NULL), PropertySet(NULL), NeedsRebuild(false) {} + : VPropertyFormWidgetPrivate(), Model(NULL), PropertySet(NULL), NeedsRebuild(false), + IgnoreDataChangedSignal(false) {} VPropertyFormViewPrivate(VPropertyModel* prop_model) - : VPropertyFormWidgetPrivate(), Model(prop_model), PropertySet(NULL), NeedsRebuild(false) {} + : VPropertyFormWidgetPrivate(), Model(prop_model), PropertySet(NULL), NeedsRebuild(false), + IgnoreDataChangedSignal(false) {} VPropertyFormViewPrivate(VPropertySet* prop_set) - : VPropertyFormWidgetPrivate(), Model(NULL), PropertySet(prop_set), NeedsRebuild(false) {} + : VPropertyFormWidgetPrivate(), Model(NULL), PropertySet(prop_set), NeedsRebuild(false), + IgnoreDataChangedSignal(false) {} }; } diff --git a/src/libs/vpropertyexplorer/vpropertymodel.cpp b/src/libs/vpropertyexplorer/vpropertymodel.cpp index a9e6709d6..378d88dfe 100644 --- a/src/libs/vpropertyexplorer/vpropertymodel.cpp +++ b/src/libs/vpropertyexplorer/vpropertymodel.cpp @@ -85,7 +85,7 @@ VProperty* VPropertyModel::createProperty(const QString& id, const QString& name { VProperty* tmpProp = new VProperty(name); tmpProp->setValue(data); - if (tmpProp && addProperty(tmpProp, id, parentid)) + if (addProperty(tmpProp, id, parentid)) { return tmpProp; }