Clang's warnings.
--HG-- branch : develop
This commit is contained in:
parent
e128317c9c
commit
a6ffb16054
|
@ -103,28 +103,70 @@ CONFIG(debug, debug|release){
|
||||||
# Debug
|
# Debug
|
||||||
unix {
|
unix {
|
||||||
*-g++{
|
*-g++{
|
||||||
QMAKE_CXXFLAGS += -isystem "/usr/include/qt5" -isystem "/usr/include/qt5/QtWidgets" \
|
QMAKE_CXXFLAGS += \
|
||||||
-isystem "/usr/include/qt5/QtXml" -isystem "/usr/include/qt5/QtGui" \
|
-isystem "/usr/include/qt5" \
|
||||||
-isystem "/usr/include/qt5/QtCore" -isystem "/usr/include/qt5/QtXmlPatterns" \
|
-isystem "/usr/include/qt5/QtWidgets" \
|
||||||
-isystem "$${UI_DIR}" -isystem "$${MOC_DIR}" -isystem "$${RCC_DIR}" \
|
-isystem "/usr/include/qt5/QtXml" \
|
||||||
-O0 -Wall -Wextra -pedantic -Weffc++ -Woverloaded-virtual -Wctor-dtor-privacy \
|
-isystem "/usr/include/qt5/QtGui" \
|
||||||
-Wnon-virtual-dtor -Wold-style-cast -Wconversion -Winit-self -Wstack-protector \
|
-isystem "/usr/include/qt5/QtXmlPatterns" \
|
||||||
-Wunreachable-code -Wcast-align -Wcast-qual -Wdisabled-optimization -Wfloat-equal \
|
-isystem "/usr/include/qt5/QtCore" \
|
||||||
-Wformat=2 -Wimport \
|
-isystem "$${OUT_PWD}/$${UI_DIR}" \
|
||||||
-Winvalid-pch -Wunsafe-loop-optimizations -Wlong-long -Wmissing-format-attribute \
|
-isystem "$${OUT_PWD}/$${MOC_DIR}" \
|
||||||
-Wmissing-include-dirs -Wpacked -Wredundant-decls -Winline \
|
-isystem "$${OUT_PWD}/$${RCC_DIR}" \
|
||||||
-Wswitch-default -Wswitch-enum -Wuninitialized -Wvariadic-macros \
|
-O0 \
|
||||||
-Wlogical-op -Wnoexcept -Wmissing-noreturn -Wpointer-arith\
|
-Wall \
|
||||||
-Wstrict-null-sentinel -Wstrict-overflow=5 -Wundef -Wno-unused -gdwarf-3 \
|
-Wextra \
|
||||||
|
-pedantic \
|
||||||
|
-Weffc++ \
|
||||||
|
-Woverloaded-virtual \
|
||||||
|
-Wctor-dtor-privacy \
|
||||||
|
-Wnon-virtual-dtor \
|
||||||
|
-Wold-style-cast \
|
||||||
|
-Wconversion \
|
||||||
|
-Winit-self \
|
||||||
|
-Wstack-protector \
|
||||||
|
-Wunreachable-code \
|
||||||
|
-Wcast-align \
|
||||||
|
-Wcast-qual \
|
||||||
|
-Wdisabled-optimization \
|
||||||
|
-Wfloat-equal \
|
||||||
|
-Wformat=2 \
|
||||||
|
-Wimport \
|
||||||
|
-Wmissing-include-dirs \
|
||||||
|
-Wpacked \
|
||||||
|
-Wredundant-decls \
|
||||||
|
-Winline \
|
||||||
|
-Winvalid-pch \
|
||||||
|
-Wunsafe-loop-optimizations \
|
||||||
|
-Wlong-long \
|
||||||
|
-Wmissing-format-attribute \
|
||||||
|
-Wswitch-default \
|
||||||
|
-Wswitch-enum \
|
||||||
|
-Wuninitialized \
|
||||||
|
-Wvariadic-macros \
|
||||||
|
-Wlogical-op \
|
||||||
|
-Wnoexcept \
|
||||||
|
-Wmissing-noreturn \
|
||||||
|
-Wpointer-arith \
|
||||||
|
-Wstrict-null-sentinel \
|
||||||
|
-Wstrict-overflow=5 \
|
||||||
|
-Wundef \
|
||||||
|
-Wno-unused \
|
||||||
|
-gdwarf-3 \
|
||||||
-ftrapv
|
-ftrapv
|
||||||
}
|
}
|
||||||
#Turn on Clang warnings
|
#Turn on Clang warnings
|
||||||
clang*{
|
clang*{
|
||||||
QMAKE_CXXFLAGS += \
|
QMAKE_CXXFLAGS += \
|
||||||
-isystem "/usr/include/qt5" -isystem "/usr/include/qt5/QtWidgets" \
|
-isystem "/usr/include/qt5" \
|
||||||
-isystem "/usr/include/qt5/QtXml" -isystem "/usr/include/qt5/QtGui" \
|
-isystem "/usr/include/qt5/QtWidgets" \
|
||||||
-isystem "/usr/include/qt5/QtCore" -isystem "/usr/include/qt5/QtXmlPatterns" \
|
-isystem "/usr/include/qt5/QtXml" \
|
||||||
-isystem "$${UI_DIR}" -isystem "$${OUT_PWD}/$${MOC_DIR}" -isystem "$${RCC_DIR}" \
|
-isystem "/usr/include/qt5/QtGui" \
|
||||||
|
-isystem "/usr/include/qt5/QtCore" \
|
||||||
|
-isystem "/usr/include/qt5/QtXmlPatterns" \
|
||||||
|
-isystem "$${OUT_PWD}/$${UI_DIR}" \
|
||||||
|
-isystem "$${OUT_PWD}/$${MOC_DIR}" \
|
||||||
|
-isystem "$${OUT_PWD}/$${RCC_DIR}" \
|
||||||
-O0 \
|
-O0 \
|
||||||
-fparse-all-comments \
|
-fparse-all-comments \
|
||||||
-Wabi \
|
-Wabi \
|
||||||
|
@ -200,7 +242,7 @@ CONFIG(debug, debug|release){
|
||||||
-Wconstexpr-not-const \
|
-Wconstexpr-not-const \
|
||||||
-Wconversion \
|
-Wconversion \
|
||||||
-Wconversion-null \
|
-Wconversion-null \
|
||||||
-Wcovered-switch-default \
|
-Wno-covered-switch-default \
|
||||||
-Wctor-dtor-privacy \
|
-Wctor-dtor-privacy \
|
||||||
-Wcustom-atomic-properties \
|
-Wcustom-atomic-properties \
|
||||||
-Wdangling-else \
|
-Wdangling-else \
|
||||||
|
@ -241,7 +283,6 @@ CONFIG(debug, debug|release){
|
||||||
-Wendif-labels \
|
-Wendif-labels \
|
||||||
-Wenum-compare \
|
-Wenum-compare \
|
||||||
-Wenum-conversion \
|
-Wenum-conversion \
|
||||||
-Wexit-time-destructors \
|
|
||||||
-Wexplicit-ownership-type \
|
-Wexplicit-ownership-type \
|
||||||
-Wextended-offsetof \
|
-Wextended-offsetof \
|
||||||
-Wextern-initializer \
|
-Wextern-initializer \
|
||||||
|
@ -261,7 +302,6 @@ CONFIG(debug, debug|release){
|
||||||
-Wformat=2 \
|
-Wformat=2 \
|
||||||
-Wfour-char-constants \
|
-Wfour-char-constants \
|
||||||
-Wgcc-compat \
|
-Wgcc-compat \
|
||||||
-Wglobal-constructors \
|
|
||||||
-Wgnu \
|
-Wgnu \
|
||||||
-Wgnu-array-member-paren-init \
|
-Wgnu-array-member-paren-init \
|
||||||
-Wgnu-designator \
|
-Wgnu-designator \
|
||||||
|
@ -339,7 +379,6 @@ CONFIG(debug, debug|release){
|
||||||
-Wmost \
|
-Wmost \
|
||||||
-Wmultichar \
|
-Wmultichar \
|
||||||
-Wnarrowing \
|
-Wnarrowing \
|
||||||
-Wnested-anon-types \
|
|
||||||
-Wnested-externs \
|
-Wnested-externs \
|
||||||
-Wnewline-eof \
|
-Wnewline-eof \
|
||||||
-Wnon-gcc \
|
-Wnon-gcc \
|
||||||
|
@ -364,7 +403,6 @@ CONFIG(debug, debug|release){
|
||||||
-Woverloaded-virtual \
|
-Woverloaded-virtual \
|
||||||
-Woverriding-method-mismatch \
|
-Woverriding-method-mismatch \
|
||||||
-Wpacked \
|
-Wpacked \
|
||||||
-Wpadded \
|
|
||||||
-Wparentheses \
|
-Wparentheses \
|
||||||
-Wparentheses-equality \
|
-Wparentheses-equality \
|
||||||
-Wpedantic \
|
-Wpedantic \
|
||||||
|
@ -461,7 +499,6 @@ CONFIG(debug, debug|release){
|
||||||
-Wunicode \
|
-Wunicode \
|
||||||
-Wunicode-whitespace \
|
-Wunicode-whitespace \
|
||||||
-Wuninitialized \
|
-Wuninitialized \
|
||||||
-Wunknown-pragmas \
|
|
||||||
-Wunknown-warning-option \
|
-Wunknown-warning-option \
|
||||||
-Wunnamed-type-template-args \
|
-Wunnamed-type-template-args \
|
||||||
-Wunneeded-internal-declaration \
|
-Wunneeded-internal-declaration \
|
||||||
|
|
|
@ -31,6 +31,8 @@
|
||||||
#include <QSettings>
|
#include <QSettings>
|
||||||
#include "../widgets/vapplication.h"
|
#include "../widgets/vapplication.h"
|
||||||
|
|
||||||
|
using namespace qmu;
|
||||||
|
|
||||||
int Calculator::iVal = -1;
|
int Calculator::iVal = -1;
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
@ -78,7 +80,7 @@ Calculator::Calculator(const VContainer *data)
|
||||||
* numbers = cal->GetNumbers();
|
* numbers = cal->GetNumbers();
|
||||||
* delete cal;
|
* delete cal;
|
||||||
*
|
*
|
||||||
* @param data pointer to a variable container.
|
* @param formula string with formula.
|
||||||
* @param fromUser true if we parse formula from user
|
* @param fromUser true if we parse formula from user
|
||||||
*/
|
*/
|
||||||
Calculator::Calculator(const QString &formula, bool fromUser)
|
Calculator::Calculator(const QString &formula, bool fromUser)
|
||||||
|
|
|
@ -32,7 +32,6 @@
|
||||||
#include "vcontainer.h"
|
#include "vcontainer.h"
|
||||||
|
|
||||||
#include "../../libs/qmuparser/qmuparser.h"
|
#include "../../libs/qmuparser/qmuparser.h"
|
||||||
using namespace qmu;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief The Calculator class for calculation formula.
|
* @brief The Calculator class for calculation formula.
|
||||||
|
@ -53,7 +52,7 @@ using namespace qmu;
|
||||||
* delete cal;//Here can be memory leak, but dialog already check this formula and probability very low.
|
* delete cal;//Here can be memory leak, but dialog already check this formula and probability very low.
|
||||||
* }
|
* }
|
||||||
*/
|
*/
|
||||||
class Calculator:public QmuParser
|
class Calculator:public qmu::QmuParser
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
Calculator(const VContainer *data);
|
Calculator(const VContainer *data);
|
||||||
|
|
|
@ -263,9 +263,9 @@ const VDetail VContainer::GetDetail(quint32 id) const
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
* @brief AddPoint add new point to container
|
* @brief AddGObject add new GObject to container
|
||||||
* @param point new point
|
* @param obj new object
|
||||||
* @return return id of new point in container
|
* @return return id of new object in container
|
||||||
*/
|
*/
|
||||||
quint32 VContainer::AddGObject(VGObject *obj)
|
quint32 VContainer::AddGObject(VGObject *obj)
|
||||||
{
|
{
|
||||||
|
@ -287,9 +287,9 @@ quint32 VContainer::AddDetail(VDetail detail)
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
* @brief AddIncrement add new row of increment table
|
* @brief AddIncrement add new increment
|
||||||
* @param name name of new row of increment table
|
* @param name increment name
|
||||||
* @param row new row of increment table
|
* @param incr increment
|
||||||
*/
|
*/
|
||||||
void VContainer::AddIncrement(const QString &name, VIncrement incr)
|
void VContainer::AddIncrement(const QString &name, VIncrement incr)
|
||||||
{
|
{
|
||||||
|
@ -521,7 +521,6 @@ qreal VContainer::FindVar(const QString &name, bool *ok)const
|
||||||
* @brief AddLine add line to container
|
* @brief AddLine add line to container
|
||||||
* @param firstPointId id of first point of line
|
* @param firstPointId id of first point of line
|
||||||
* @param secondPointId id of second point of line
|
* @param secondPointId id of second point of line
|
||||||
* @param mode mode of line
|
|
||||||
*/
|
*/
|
||||||
void VContainer::AddLine(const quint32 &firstPointId, const quint32 &secondPointId)
|
void VContainer::AddLine(const quint32 &firstPointId, const quint32 &secondPointId)
|
||||||
{
|
{
|
||||||
|
@ -582,9 +581,9 @@ QString VContainer::GetNameLineAngle(const quint32 &firstPoint, const quint32 &s
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
* @brief UpdatePoint update point by id
|
* @brief UpdateGObject update GObject by id
|
||||||
* @param id id of existing point
|
* @param id id of existing GObject
|
||||||
* @param point point
|
* @param obj object
|
||||||
*/
|
*/
|
||||||
void VContainer::UpdateGObject(quint32 id, VGObject* obj)
|
void VContainer::UpdateGObject(quint32 id, VGObject* obj)
|
||||||
{
|
{
|
||||||
|
|
|
@ -116,7 +116,6 @@ private:
|
||||||
* @brief NewItem add new object (point, arc, spline or spline path) to list
|
* @brief NewItem add new object (point, arc, spline or spline path) to list
|
||||||
* @param id id of object
|
* @param id id of object
|
||||||
* @param typeTool type of tool
|
* @param typeTool type of tool
|
||||||
* @param mode mode
|
|
||||||
* @param typeNode type of node in detail
|
* @param typeNode type of node in detail
|
||||||
* @param mx offset respect to x
|
* @param mx offset respect to x
|
||||||
* @param my offset respect to y
|
* @param my offset respect to y
|
||||||
|
|
|
@ -92,12 +92,12 @@ public:
|
||||||
void setP2Line2(const quint32 &value);
|
void setP2Line2(const quint32 &value);
|
||||||
/**
|
/**
|
||||||
* @brief getPointName return name of point
|
* @brief getPointName return name of point
|
||||||
* @return
|
* @return name of point
|
||||||
*/
|
*/
|
||||||
QString getPointName() const;
|
QString getPointName() const;
|
||||||
/**
|
/**
|
||||||
* @brief setPointName set name of point
|
* @brief setPointName set name of point
|
||||||
* @param value
|
* @param value name of point
|
||||||
*/
|
*/
|
||||||
void setPointName(const QString &value);
|
void setPointName(const QString &value);
|
||||||
public slots:
|
public slots:
|
||||||
|
|
|
@ -424,7 +424,7 @@ quint32 DialogTool::getCurrentObjectId(QComboBox *box) const
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
return -1;
|
return 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -396,9 +396,9 @@ protected:
|
||||||
const quint32 &id,
|
const quint32 &id,
|
||||||
ComboMode::ComboBoxCutSpline cut = ComboMode::NoCutSpline) const;
|
ComboMode::ComboBoxCutSpline cut = ComboMode::NoCutSpline) const;
|
||||||
/**
|
/**
|
||||||
* @brief getCurrentPointId return current point id in combobox
|
* @brief getCurrentPointId return current point id stored in combobox
|
||||||
* @param box combobox
|
* @param box combobox
|
||||||
* @return id or -1 if combobox is empty
|
* @return id or 0 if combobox is empty
|
||||||
*/
|
*/
|
||||||
quint32 getCurrentObjectId(QComboBox *box) const;
|
quint32 getCurrentObjectId(QComboBox *box) const;
|
||||||
bool ChoosedPoint(const quint32 &id, QComboBox *box, const QString &toolTip);
|
bool ChoosedPoint(const quint32 &id, QComboBox *box, const QString &toolTip);
|
||||||
|
|
|
@ -95,3 +95,21 @@ QString VException::MoreInfo(const QString &detInfo) const
|
||||||
return detInfo;
|
return detInfo;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
QString VException::DetailedInformation() const
|
||||||
|
{
|
||||||
|
return moreInfo;
|
||||||
|
}
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
VException *VException::clone() const
|
||||||
|
{
|
||||||
|
return new VException(*this);
|
||||||
|
}
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
void VException::raise() const
|
||||||
|
{
|
||||||
|
throw *this;
|
||||||
|
}
|
||||||
|
|
|
@ -104,26 +104,13 @@ protected:
|
||||||
QString MoreInfo(const QString &detInfo) const;
|
QString MoreInfo(const QString &detInfo) const;
|
||||||
};
|
};
|
||||||
|
|
||||||
inline void VException::raise() const
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
{
|
|
||||||
throw *this;
|
|
||||||
}
|
|
||||||
|
|
||||||
inline VException *VException::clone() const
|
|
||||||
{
|
|
||||||
return new VException(*this);
|
|
||||||
}
|
|
||||||
|
|
||||||
inline QString VException::DetailedInformation() const
|
|
||||||
{
|
|
||||||
return moreInfo;
|
|
||||||
}
|
|
||||||
|
|
||||||
inline QString VException::What() const
|
inline QString VException::What() const
|
||||||
{
|
{
|
||||||
return what;
|
return what;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
inline QString VException::MoreInformation() const
|
inline QString VException::MoreInformation() const
|
||||||
{
|
{
|
||||||
return moreInfo;
|
return moreInfo;
|
||||||
|
|
|
@ -197,14 +197,14 @@ void VDetail::NodeOnEdge(const quint32 &index, VNodeDetail &p1, VNodeDetail &p2)
|
||||||
qDebug()<<"Wrong edge index index ="<<index;
|
qDebug()<<"Wrong edge index index ="<<index;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
p1 = list.at(index);
|
p1 = list.at(static_cast<int>(index));
|
||||||
if (index + 1 > static_cast<quint32>(list.size()) - 1)
|
if (index + 1 > static_cast<quint32>(list.size()) - 1)
|
||||||
{
|
{
|
||||||
p2 = list.at(0);
|
p2 = list.at(0);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
p2 = list.at(index+1);
|
p2 = list.at(static_cast<int>(index+1));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -221,7 +221,7 @@ VDetail VDetail::RemoveEdge(const quint32 &index) const
|
||||||
{
|
{
|
||||||
if (i == index)
|
if (i == index)
|
||||||
{
|
{
|
||||||
det.append(this->at(k));
|
det.append(this->at(static_cast<int>(k)));
|
||||||
++k;
|
++k;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
|
@ -50,10 +50,6 @@ VPointF::VPointF() :VGObject(GObject::Point, 0, Valentina::Calculation), _mx(0),
|
||||||
{}
|
{}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
/**
|
|
||||||
* @brief VPointF copy constructor
|
|
||||||
* @param point
|
|
||||||
*/
|
|
||||||
VPointF::VPointF(const VPointF &point) :VGObject(point), _mx(point.mx()), _my(point.my()), _x(point.x()), _y(point.y())
|
VPointF::VPointF(const VPointF &point) :VGObject(point), _mx(point.mx()), _my(point.my()), _x(point.x()), _y(point.y())
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
@ -61,7 +57,7 @@ VPointF::VPointF(const VPointF &point) :VGObject(point), _mx(point.mx()), _my(po
|
||||||
VPointF::VPointF(const QPointF &point) :VGObject(VPointF()), _mx(0), _my(0), _x(point.x()), _y(point.y())
|
VPointF::VPointF(const QPointF &point) :VGObject(VPointF()), _mx(0), _my(0), _x(point.x()), _y(point.y())
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
* @brief operator = assignment operator
|
* @brief operator = assignment operator
|
||||||
* @param point point
|
* @param point point
|
||||||
|
|
|
@ -716,11 +716,6 @@ QVector<QPointF> VSpline::SplinePoints(const QPointF &p1, const QPointF &p4, qre
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
/**
|
|
||||||
* @brief operator = assignmeant operator
|
|
||||||
* @param spl spline
|
|
||||||
* @return spline
|
|
||||||
*/
|
|
||||||
VSpline &VSpline::operator =(const VSpline &spline)
|
VSpline &VSpline::operator =(const VSpline &spline)
|
||||||
{
|
{
|
||||||
VGObject::operator=(spline);
|
VGObject::operator=(spline);
|
||||||
|
|
|
@ -212,6 +212,9 @@ QPointF VSplinePath::CutSplinePath(qreal length, qint32 &p1, qint32 &p2, QPointF
|
||||||
return QPointF();
|
return QPointF();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
QString VSplinePath::name() const{return _name;}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
qint32 VSplinePath::getMaxCountPoints() const
|
qint32 VSplinePath::getMaxCountPoints() const
|
||||||
{
|
{
|
||||||
|
|
|
@ -184,7 +184,7 @@ public:
|
||||||
* @brief name return spline path name.
|
* @brief name return spline path name.
|
||||||
* @return name.
|
* @return name.
|
||||||
*/
|
*/
|
||||||
virtual QString name() const{return _name;}
|
virtual QString name() const;
|
||||||
/**
|
/**
|
||||||
* @brief getMaxCountPoints return max count of points what can have spline path. This method use tool union detail.
|
* @brief getMaxCountPoints return max count of points what can have spline path. This method use tool union detail.
|
||||||
* Because cutting point can change position spline can have diffirent count of points. Need know max value. This
|
* Because cutting point can change position spline can have diffirent count of points. Need know max value. This
|
||||||
|
|
|
@ -36,7 +36,7 @@
|
||||||
#include "version.h"
|
#include "version.h"
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
void noisyFailureMsgHandler(QtMsgType type, const QMessageLogContext &context, const QString &msg)
|
inline void noisyFailureMsgHandler(QtMsgType type, const QMessageLogContext &context, const QString &msg)
|
||||||
{
|
{
|
||||||
// Why on earth didn't Qt want to make failed signal/slot connections qWarning?
|
// Why on earth didn't Qt want to make failed signal/slot connections qWarning?
|
||||||
if ((type == QtDebugMsg) && msg.contains("::connect"))
|
if ((type == QtDebugMsg) && msg.contains("::connect"))
|
||||||
|
|
|
@ -52,5 +52,7 @@
|
||||||
<file>icon/flags/uk.png</file>
|
<file>icon/flags/uk.png</file>
|
||||||
<file>icon/Graduation.png</file>
|
<file>icon/Graduation.png</file>
|
||||||
<file>icon/individual.png</file>
|
<file>icon/individual.png</file>
|
||||||
|
<file>icon/flags/nl.png</file>
|
||||||
|
<file>icon/flags/it.png</file>
|
||||||
</qresource>
|
</qresource>
|
||||||
</RCC>
|
</RCC>
|
||||||
|
|
|
@ -48,7 +48,7 @@ signals:
|
||||||
/**
|
/**
|
||||||
* @brief RefreshLine refresh control line.
|
* @brief RefreshLine refresh control line.
|
||||||
* @param indexSpline position spline in spline list.
|
* @param indexSpline position spline in spline list.
|
||||||
* @param position position point in spline.
|
* @param pos position point in spline.
|
||||||
* @param controlPoint new position control point.
|
* @param controlPoint new position control point.
|
||||||
* @param splinePoint new position spline point.
|
* @param splinePoint new position spline point.
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -42,7 +42,6 @@ qreal VDrawTool::factor = 1;
|
||||||
* @param doc dom document container.
|
* @param doc dom document container.
|
||||||
* @param data container with variables.
|
* @param data container with variables.
|
||||||
* @param id object id in container.
|
* @param id object id in container.
|
||||||
* @param parent parent object.
|
|
||||||
*/
|
*/
|
||||||
VDrawTool::VDrawTool(VPattern *doc, VContainer *data, quint32 id)
|
VDrawTool::VDrawTool(VPattern *doc, VContainer *data, quint32 id)
|
||||||
:VAbstractTool(doc, data, id), ignoreContextMenuEvent(false), ignoreFullUpdate(false),
|
:VAbstractTool(doc, data, id), ignoreContextMenuEvent(false), ignoreFullUpdate(false),
|
||||||
|
@ -162,6 +161,7 @@ qreal VDrawTool::CheckFormula(QString &formula, VContainer *data)
|
||||||
}
|
}
|
||||||
catch(qmu::QmuParserError &e)
|
catch(qmu::QmuParserError &e)
|
||||||
{
|
{
|
||||||
|
Q_UNUSED(e)
|
||||||
delete cal;
|
delete cal;
|
||||||
DialogEditWrongFormula *dialog = new DialogEditWrongFormula(data);
|
DialogEditWrongFormula *dialog = new DialogEditWrongFormula(data);
|
||||||
dialog->setFormula(formula);
|
dialog->setFormula(formula);
|
||||||
|
|
|
@ -72,7 +72,7 @@ public:
|
||||||
* @param _id tool id, 0 if tool doesn't exist yet.
|
* @param _id tool id, 0 if tool doesn't exist yet.
|
||||||
* @param pointName point name.
|
* @param pointName point name.
|
||||||
* @param formula string with formula length first splinePath.
|
* @param formula string with formula length first splinePath.
|
||||||
* @param splineId id splinePath in data container.
|
* @param splinePathId id of splinePath in data container.
|
||||||
* @param mx label bias x axis.
|
* @param mx label bias x axis.
|
||||||
* @param my label bias y axis.
|
* @param my label bias y axis.
|
||||||
* @param scene pointer to scene.
|
* @param scene pointer to scene.
|
||||||
|
|
|
@ -42,7 +42,7 @@ public:
|
||||||
* @param doc dom document container.
|
* @param doc dom document container.
|
||||||
* @param data container with variables.
|
* @param data container with variables.
|
||||||
* @param id object id in container.
|
* @param id object id in container.
|
||||||
* @param radius string with formula radius arc.
|
* @param arcRadius string with formula radius arc.
|
||||||
* @param center id center arc point.
|
* @param center id center arc point.
|
||||||
* @param firstPointId id first line point.
|
* @param firstPointId id first line point.
|
||||||
* @param secondPointId id second line point.
|
* @param secondPointId id second line point.
|
||||||
|
@ -59,7 +59,7 @@ public:
|
||||||
virtual void setDialog();
|
virtual void setDialog();
|
||||||
/**
|
/**
|
||||||
* @brief FindPoint return point intersection line and arc.
|
* @brief FindPoint return point intersection line and arc.
|
||||||
* @param radius string with formula radius arc.
|
* @param arcRadius string with formula radius arc.
|
||||||
* @param center center arc point.
|
* @param center center arc point.
|
||||||
* @param firstPoint first line point.
|
* @param firstPoint first line point.
|
||||||
* @param secondPoint second line point.
|
* @param secondPoint second line point.
|
||||||
|
@ -78,7 +78,7 @@ public:
|
||||||
/**
|
/**
|
||||||
* @brief Create help create tool.
|
* @brief Create help create tool.
|
||||||
* @param _id tool id, 0 if tool doesn't exist yet.
|
* @param _id tool id, 0 if tool doesn't exist yet.
|
||||||
* @param radius string with formula radius arc.
|
* @param arcRadius string with formula radius arc.
|
||||||
* @param center id center arc point.
|
* @param center id center arc point.
|
||||||
* @param firstPointId id first line point.
|
* @param firstPointId id first line point.
|
||||||
* @param secondPointId id second line point.
|
* @param secondPointId id second line point.
|
||||||
|
|
|
@ -78,7 +78,7 @@ signals:
|
||||||
/**
|
/**
|
||||||
* @brief RefreshLine refresh control line.
|
* @brief RefreshLine refresh control line.
|
||||||
* @param indexSpline position spline in spline list.
|
* @param indexSpline position spline in spline list.
|
||||||
* @param position position point in spline.
|
* @param pos position point in spline.
|
||||||
* @param controlPoint new position control point.
|
* @param controlPoint new position control point.
|
||||||
* @param splinePoint new position spline point.
|
* @param splinePoint new position spline point.
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -43,7 +43,8 @@ public:
|
||||||
* @param doc dom document container.
|
* @param doc dom document container.
|
||||||
* @param data container with variables.
|
* @param data container with variables.
|
||||||
* @param id object id in container.
|
* @param id object id in container.
|
||||||
* @param id object id in containerNode.
|
* @param idNode object id in containerNode.
|
||||||
|
* @param idTool id tool.
|
||||||
* @param parent parent object.
|
* @param parent parent object.
|
||||||
*/
|
*/
|
||||||
VAbstractNode(VPattern *doc, VContainer *data, const quint32 &id, const quint32 &idNode,
|
VAbstractNode(VPattern *doc, VContainer *data, const quint32 &id, const quint32 &idNode,
|
||||||
|
|
|
@ -44,8 +44,10 @@ public:
|
||||||
* @param doc dom document container.
|
* @param doc dom document container.
|
||||||
* @param data container with variables.
|
* @param data container with variables.
|
||||||
* @param id object id in container.
|
* @param id object id in container.
|
||||||
* @param id object id in containerArc.
|
* @param idArc object id in containerArc.
|
||||||
* @param typeCreation way we create this tool.
|
* @param typeCreation way we create this tool.
|
||||||
|
* @param idTool tool id.
|
||||||
|
* @param qoParent QObject parent
|
||||||
* @param parent parent object.
|
* @param parent parent object.
|
||||||
*/
|
*/
|
||||||
VNodeArc(VPattern *doc, VContainer *data, quint32 id, quint32 idArc,
|
VNodeArc(VPattern *doc, VContainer *data, quint32 id, quint32 idArc,
|
||||||
|
@ -56,9 +58,11 @@ public:
|
||||||
* @param doc dom document container.
|
* @param doc dom document container.
|
||||||
* @param data container with variables.
|
* @param data container with variables.
|
||||||
* @param id object id in container.
|
* @param id object id in container.
|
||||||
* @param id object id in containerArc.
|
* @param idArc object id in containerArc.
|
||||||
* @param parse parser file mode.
|
* @param parse parser file mode.
|
||||||
* @param typeCreation way we create this tool.
|
* @param typeCreation way we create this tool.
|
||||||
|
* @param idTool tool id.
|
||||||
|
* @param parent QObject parent
|
||||||
*/
|
*/
|
||||||
static void Create(VPattern *doc, VContainer *data, quint32 id, quint32 idArc, const Document::Documents &parse,
|
static void Create(VPattern *doc, VContainer *data, quint32 id, quint32 idArc, const Document::Documents &parse,
|
||||||
const Valentina::Sources &typeCreation, const quint32 &idTool = 0, QObject *parent = nullptr);
|
const Valentina::Sources &typeCreation, const quint32 &idTool = 0, QObject *parent = nullptr);
|
||||||
|
|
|
@ -44,8 +44,10 @@ public:
|
||||||
* @param doc dom document container.
|
* @param doc dom document container.
|
||||||
* @param data container with variables.
|
* @param data container with variables.
|
||||||
* @param id object id in container.
|
* @param id object id in container.
|
||||||
* @param id object id in containerPoint.
|
* @param idPoint object id in containerPoint.
|
||||||
* @param typeCreation way we create this tool.
|
* @param typeCreation way we create this tool.
|
||||||
|
* @param idTool tool id.
|
||||||
|
* @param qoParent QObject parent
|
||||||
* @param parent parent object.
|
* @param parent parent object.
|
||||||
*/
|
*/
|
||||||
VNodePoint(VPattern *doc, VContainer *data, quint32 id, quint32 idPoint, const Valentina::Sources &typeCreation,
|
VNodePoint(VPattern *doc, VContainer *data, quint32 id, quint32 idPoint, const Valentina::Sources &typeCreation,
|
||||||
|
@ -55,9 +57,11 @@ public:
|
||||||
* @param doc dom document container.
|
* @param doc dom document container.
|
||||||
* @param data container with variables.
|
* @param data container with variables.
|
||||||
* @param id object id in container.
|
* @param id object id in container.
|
||||||
* @param id object id in containerPoint.
|
* @param idPoint object id in containerPoint.
|
||||||
* @param parse parser file mode.
|
* @param parse parser file mode.
|
||||||
* @param typeCreation way we create this tool.
|
* @param typeCreation way we create this tool.
|
||||||
|
* @param idTool tool id.
|
||||||
|
* @param parent QObject parent
|
||||||
*/
|
*/
|
||||||
static void Create(VPattern *doc, VContainer *data, quint32 id, quint32 idPoint, const Document::Documents &parse,
|
static void Create(VPattern *doc, VContainer *data, quint32 id, quint32 idPoint, const Document::Documents &parse,
|
||||||
const Valentina::Sources &typeCreation, const quint32 &idTool = 0, QObject *parent = nullptr);
|
const Valentina::Sources &typeCreation, const quint32 &idTool = 0, QObject *parent = nullptr);
|
||||||
|
|
|
@ -44,9 +44,11 @@ public:
|
||||||
* @param doc dom document container.
|
* @param doc dom document container.
|
||||||
* @param data container with variables.
|
* @param data container with variables.
|
||||||
* @param id object id in container.
|
* @param id object id in container.
|
||||||
* @param id object id in containerSpline.
|
* @param idSpline object id in containerSpline.
|
||||||
* @param typeCreation way we create this tool.
|
* @param typeCreation way we create this tool.
|
||||||
* @param parent parent object.
|
* @param idTool id node.
|
||||||
|
* @param qoParent QObject parent.
|
||||||
|
* @param parent QGraphicsItem parent.
|
||||||
*/
|
*/
|
||||||
VNodeSpline(VPattern *doc, VContainer *data, quint32 id, quint32 idSpline, const Valentina::Sources &typeCreation,
|
VNodeSpline(VPattern *doc, VContainer *data, quint32 id, quint32 idSpline, const Valentina::Sources &typeCreation,
|
||||||
const quint32 &idTool = 0, QObject *qoParent = nullptr, QGraphicsItem * parent = nullptr);
|
const quint32 &idTool = 0, QObject *qoParent = nullptr, QGraphicsItem * parent = nullptr);
|
||||||
|
@ -55,10 +57,11 @@ public:
|
||||||
* @param doc dom document container.
|
* @param doc dom document container.
|
||||||
* @param data container with variables.
|
* @param data container with variables.
|
||||||
* @param id object id in container.
|
* @param id object id in container.
|
||||||
* @param id object id in containerSpline.
|
* @param idSpline object id in containerSpline.
|
||||||
* @param parse parser file mode.
|
* @param parse parser file mode.
|
||||||
* @param typeCreation way we create this tool.
|
* @param typeCreation way we create this tool.
|
||||||
* @return
|
* @param idTool id node.
|
||||||
|
* @return pointer to node.
|
||||||
*/
|
*/
|
||||||
static VNodeSpline *Create(VPattern *doc, VContainer *data, quint32 id, quint32 idSpline,
|
static VNodeSpline *Create(VPattern *doc, VContainer *data, quint32 id, quint32 idSpline,
|
||||||
const Document::Documents &parse, const Valentina::Sources &typeCreation,
|
const Document::Documents &parse, const Valentina::Sources &typeCreation,
|
||||||
|
|
|
@ -44,8 +44,10 @@ public:
|
||||||
* @param doc dom document container.
|
* @param doc dom document container.
|
||||||
* @param data container with variables.
|
* @param data container with variables.
|
||||||
* @param id object id in container.
|
* @param id object id in container.
|
||||||
* @param id object id in containerSpline.
|
* @param idSpline object id in containerSpline.
|
||||||
* @param typeCreation way we create this tool.
|
* @param typeCreation way we create this tool.
|
||||||
|
* @param idTool tool id.
|
||||||
|
* @param qoParent QObject parent.
|
||||||
* @param parent parent object.
|
* @param parent parent object.
|
||||||
*/
|
*/
|
||||||
VNodeSplinePath(VPattern *doc, VContainer *data, quint32 id, quint32 idSpline,
|
VNodeSplinePath(VPattern *doc, VContainer *data, quint32 id, quint32 idSpline,
|
||||||
|
@ -56,9 +58,11 @@ public:
|
||||||
* @param doc dom document container.
|
* @param doc dom document container.
|
||||||
* @param data container with variables.
|
* @param data container with variables.
|
||||||
* @param id object id in container.
|
* @param id object id in container.
|
||||||
* @param id object id in containerSpline.
|
* @param idSpline object id in containerSpline.
|
||||||
* @param parse parser file mode.
|
* @param parse parser file mode.
|
||||||
* @param typeCreation way we create this tool.
|
* @param typeCreation way we create this tool.
|
||||||
|
* @param idTool tool id.
|
||||||
|
* @param parent QObject parent.
|
||||||
*/
|
*/
|
||||||
static void Create(VPattern *doc, VContainer *data, quint32 id, quint32 idSpline, const Document::Documents &parse,
|
static void Create(VPattern *doc, VContainer *data, quint32 id, quint32 idSpline, const Document::Documents &parse,
|
||||||
const Valentina::Sources &typeCreation, const quint32 &idTool = 0, QObject *parent = 0);
|
const Valentina::Sources &typeCreation, const quint32 &idTool = 0, QObject *parent = 0);
|
||||||
|
|
|
@ -76,18 +76,9 @@ public:
|
||||||
/**
|
/**
|
||||||
* @brief ClosestPoint find point projection of point onto line.
|
* @brief ClosestPoint find point projection of point onto line.
|
||||||
* @param line line.
|
* @param line line.
|
||||||
* @param p point.
|
|
||||||
* @return point on line or extended line if origin size too small.
|
* @return point on line or extended line if origin size too small.
|
||||||
*/
|
*/
|
||||||
static QPointF ClosestPoint(const QLineF &line, const QPointF &point);
|
static QPointF ClosestPoint(const QLineF &line, const QPointF &point);
|
||||||
/**
|
|
||||||
* @brief addVector
|
|
||||||
* @param p
|
|
||||||
* @param p1
|
|
||||||
* @param p2
|
|
||||||
* @param k
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
static QPointF addVector (const QPointF &p, const QPointF &p1, const QPointF &p2, qreal k);
|
static QPointF addVector (const QPointF &p, const QPointF &p1, const QPointF &p2, qreal k);
|
||||||
/**
|
/**
|
||||||
* @brief getId return object id.
|
* @brief getId return object id.
|
||||||
|
@ -143,7 +134,7 @@ public:
|
||||||
static const QString TypeLineDashDotDotLine;
|
static const QString TypeLineDashDotDotLine;
|
||||||
/**
|
/**
|
||||||
* @brief Styles return list of all line styles.
|
* @brief Styles return list of all line styles.
|
||||||
* @return
|
* @return list of all line styles.
|
||||||
*/
|
*/
|
||||||
static const QStringList Styles();
|
static const QStringList Styles();
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -133,7 +133,7 @@ void VToolUnionDetails::AddToNewDetail(QObject *tool, VPattern *doc, VContainer
|
||||||
|
|
||||||
VPointF *p1 = new VPointF(spline->GetP1());
|
VPointF *p1 = new VPointF(spline->GetP1());
|
||||||
BiasRotatePoint(p1, dx, dy, data->GeometricObject<const VPointF *>(pRotate)->toQPointF(), angle);
|
BiasRotatePoint(p1, dx, dy, data->GeometricObject<const VPointF *>(pRotate)->toQPointF(), angle);
|
||||||
quint32 idP1 = data->AddGObject(p1);
|
//quint32 idP1 = data->AddGObject(p1);
|
||||||
|
|
||||||
VPointF p2 = VPointF(spline->GetP2());
|
VPointF p2 = VPointF(spline->GetP2());
|
||||||
BiasRotatePoint(&p2, dx, dy, data->GeometricObject<const VPointF *>(pRotate)->toQPointF(), angle);
|
BiasRotatePoint(&p2, dx, dy, data->GeometricObject<const VPointF *>(pRotate)->toQPointF(), angle);
|
||||||
|
@ -143,7 +143,7 @@ void VToolUnionDetails::AddToNewDetail(QObject *tool, VPattern *doc, VContainer
|
||||||
|
|
||||||
VPointF *p4 = new VPointF(spline->GetP4());
|
VPointF *p4 = new VPointF(spline->GetP4());
|
||||||
BiasRotatePoint(p4, dx, dy, data->GeometricObject<const VPointF *>(pRotate)->toQPointF(), angle);
|
BiasRotatePoint(p4, dx, dy, data->GeometricObject<const VPointF *>(pRotate)->toQPointF(), angle);
|
||||||
quint32 idP4 = data->AddGObject(p4);
|
//quint32 idP4 = data->AddGObject(p4);
|
||||||
|
|
||||||
VSpline *spl = new VSpline(*p1, p2.toQPointF(), p3.toQPointF(), *p4, spline->GetKcurve(), 0,
|
VSpline *spl = new VSpline(*p1, p2.toQPointF(), p3.toQPointF(), *p4, spline->GetKcurve(), 0,
|
||||||
Valentina::Modeling);
|
Valentina::Modeling);
|
||||||
|
@ -177,7 +177,7 @@ void VToolUnionDetails::AddToNewDetail(QObject *tool, VPattern *doc, VContainer
|
||||||
VPointF *p1 = new VPointF(spline.GetP1());
|
VPointF *p1 = new VPointF(spline.GetP1());
|
||||||
BiasRotatePoint(p1, dx, dy, data->GeometricObject<const VPointF *>(pRotate)->toQPointF(),
|
BiasRotatePoint(p1, dx, dy, data->GeometricObject<const VPointF *>(pRotate)->toQPointF(),
|
||||||
angle);
|
angle);
|
||||||
quint32 idP1 = data->AddGObject(p1);
|
//quint32 idP1 = data->AddGObject(p1);
|
||||||
--k;
|
--k;
|
||||||
|
|
||||||
VPointF p2 = VPointF(spline.GetP2());
|
VPointF p2 = VPointF(spline.GetP2());
|
||||||
|
@ -191,7 +191,7 @@ void VToolUnionDetails::AddToNewDetail(QObject *tool, VPattern *doc, VContainer
|
||||||
VPointF *p4 = new VPointF(spline.GetP4());
|
VPointF *p4 = new VPointF(spline.GetP4());
|
||||||
BiasRotatePoint(p4, dx, dy, data->GeometricObject<const VPointF *>(pRotate)->toQPointF(),
|
BiasRotatePoint(p4, dx, dy, data->GeometricObject<const VPointF *>(pRotate)->toQPointF(),
|
||||||
angle);
|
angle);
|
||||||
quint32 idP4 = data->AddGObject(p4);
|
//quint32 idP4 = data->AddGObject(p4);
|
||||||
--k;
|
--k;
|
||||||
|
|
||||||
VSpline spl = VSpline(*p1, p2.toQPointF(), p3.toQPointF(), *p4, spline.GetKcurve());
|
VSpline spl = VSpline(*p1, p2.toQPointF(), p3.toQPointF(), *p4, spline.GetKcurve());
|
||||||
|
@ -392,8 +392,8 @@ void VToolUnionDetails::Create(DialogTool *dialog, VMainGraphicsScene *scene, VP
|
||||||
Q_CHECK_PTR(dialogTool);
|
Q_CHECK_PTR(dialogTool);
|
||||||
VDetail d1 = data->GetDetail(dialogTool->getD1());
|
VDetail d1 = data->GetDetail(dialogTool->getD1());
|
||||||
VDetail d2 = data->GetDetail(dialogTool->getD2());
|
VDetail d2 = data->GetDetail(dialogTool->getD2());
|
||||||
ptrdiff_t indexD1 = dialogTool->getIndexD1();
|
quint32 indexD1 = static_cast<quint32>(dialogTool->getIndexD1());
|
||||||
ptrdiff_t indexD2 = dialogTool->getIndexD2();
|
quint32 indexD2 = static_cast<quint32>(dialogTool->getIndexD2());
|
||||||
Create(0, d1, d2, dialogTool->getD1(), dialogTool->getD2(), indexD1, indexD2, scene, doc, data, Document::FullParse,
|
Create(0, d1, d2, dialogTool->getD1(), dialogTool->getD2(), indexD1, indexD2, scene, doc, data, Document::FullParse,
|
||||||
Valentina::FromGui);
|
Valentina::FromGui);
|
||||||
}
|
}
|
||||||
|
@ -535,7 +535,7 @@ void VToolUnionDetails::Create(const quint32 _id, const VDetail &d1, const VDeta
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
void VToolUnionDetails::PointsOnEdge(const VDetail &d, const qint32 &index, VPointF &p1, VPointF &p2, VContainer *data)
|
void VToolUnionDetails::PointsOnEdge(const VDetail &d, const quint32 &index, VPointF &p1, VPointF &p2, VContainer *data)
|
||||||
{
|
{
|
||||||
VNodeDetail det2p1;
|
VNodeDetail det2p1;
|
||||||
VNodeDetail det2p2;
|
VNodeDetail det2p2;
|
||||||
|
@ -545,7 +545,7 @@ void VToolUnionDetails::PointsOnEdge(const VDetail &d, const qint32 &index, VPoi
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
void VToolUnionDetails::FindJ(const qint32 &pointsD2, const VDetail &d2, const qint32 &indexD2, qint32 &j)
|
void VToolUnionDetails::FindJ(const qint32 &pointsD2, const VDetail &d2, const quint32 &indexD2, qint32 &j)
|
||||||
{
|
{
|
||||||
if (pointsD2 == 0)
|
if (pointsD2 == 0)
|
||||||
{
|
{
|
||||||
|
|
|
@ -84,8 +84,8 @@ public:
|
||||||
const quint32 &d2id, const quint32 &indexD1, const quint32 &indexD2, VMainGraphicsScene *scene,
|
const quint32 &d2id, const quint32 &indexD1, const quint32 &indexD2, VMainGraphicsScene *scene,
|
||||||
VPattern *doc, VContainer *data, const Document::Documents &parse,
|
VPattern *doc, VContainer *data, const Document::Documents &parse,
|
||||||
const Valentina::Sources &typeCreation);
|
const Valentina::Sources &typeCreation);
|
||||||
static void PointsOnEdge(const VDetail &d, const qint32 &index, VPointF &p1, VPointF &p2, VContainer *data);
|
static void PointsOnEdge(const VDetail &d, const quint32 &index, VPointF &p1, VPointF &p2, VContainer *data);
|
||||||
static void FindJ(const qint32 &pointsD2, const VDetail &d2, const qint32 &indexD2, qint32 &j);
|
static void FindJ(const qint32 &pointsD2, const VDetail &d2, const quint32 &indexD2, qint32 &j);
|
||||||
/**
|
/**
|
||||||
* @brief GetDetailFromFile parse detail from file.
|
* @brief GetDetailFromFile parse detail from file.
|
||||||
* @param doc dom document container.
|
* @param doc dom document container.
|
||||||
|
@ -126,7 +126,7 @@ public:
|
||||||
* @param data container with variables.
|
* @param data container with variables.
|
||||||
* @param det detail what we union.
|
* @param det detail what we union.
|
||||||
* @param i index node in detail.
|
* @param i index node in detail.
|
||||||
* @param idCount
|
* @param idCount count updated or created objects.
|
||||||
* @param dx bias node x axis.
|
* @param dx bias node x axis.
|
||||||
* @param dy bias node y axis.
|
* @param dy bias node y axis.
|
||||||
* @param pRotate point rotation.
|
* @param pRotate point rotation.
|
||||||
|
|
|
@ -26,6 +26,7 @@
|
||||||
**
|
**
|
||||||
*************************************************************************/
|
*************************************************************************/
|
||||||
|
|
||||||
|
#include "version.h"
|
||||||
#include <QString>
|
#include <QString>
|
||||||
|
|
||||||
extern const int MAJOR_VERSION = 0;
|
extern const int MAJOR_VERSION = 0;
|
||||||
|
|
|
@ -52,12 +52,12 @@ signals:
|
||||||
public slots:
|
public slots:
|
||||||
/**
|
/**
|
||||||
* @brief scalingTime call each time when need handle scaling.
|
* @brief scalingTime call each time when need handle scaling.
|
||||||
* @param x
|
* @param x value from 0.0 to 1.0
|
||||||
*/
|
*/
|
||||||
void scalingTime(qreal x);
|
void scalingTime(qreal x);
|
||||||
/**
|
/**
|
||||||
* @brief scrollingTime call each time when need handle scrolling.
|
* @brief scrollingTime call each time when need handle scrolling.
|
||||||
* @param x
|
* @param x value from 0.0 to 1.0
|
||||||
*/
|
*/
|
||||||
void scrollingTime(qreal x);
|
void scrollingTime(qreal x);
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -50,15 +50,7 @@ public:
|
||||||
protected:
|
protected:
|
||||||
// cppcheck-suppress unusedFunction
|
// cppcheck-suppress unusedFunction
|
||||||
virtual void handleMessage(QtMsgType type, const QString &description,
|
virtual void handleMessage(QtMsgType type, const QString &description,
|
||||||
const QUrl &identifier, const QSourceLocation &sourceLocation)
|
const QUrl &identifier, const QSourceLocation &sourceLocation);
|
||||||
{
|
|
||||||
Q_UNUSED(type);
|
|
||||||
Q_UNUSED(identifier);
|
|
||||||
|
|
||||||
m_messageType = type;
|
|
||||||
m_description = description;
|
|
||||||
m_sourceLocation = sourceLocation;
|
|
||||||
}
|
|
||||||
private:
|
private:
|
||||||
QtMsgType m_messageType;
|
QtMsgType m_messageType;
|
||||||
QString m_description;
|
QString m_description;
|
||||||
|
@ -83,6 +75,18 @@ inline qint64 MessageHandler::column() const
|
||||||
return m_sourceLocation.column();
|
return m_sourceLocation.column();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
void MessageHandler::handleMessage(QtMsgType type, const QString &description, const QUrl &identifier,
|
||||||
|
const QSourceLocation &sourceLocation)
|
||||||
|
{
|
||||||
|
Q_UNUSED(type);
|
||||||
|
Q_UNUSED(identifier);
|
||||||
|
|
||||||
|
m_messageType = type;
|
||||||
|
m_description = description;
|
||||||
|
m_sourceLocation = sourceLocation;
|
||||||
|
}
|
||||||
|
|
||||||
const QString VDomDocument::AttrId = QStringLiteral("id");
|
const QString VDomDocument::AttrId = QStringLiteral("id");
|
||||||
const QString VDomDocument::AttrUnit = QStringLiteral("unit");
|
const QString VDomDocument::AttrUnit = QStringLiteral("unit");
|
||||||
const QString VDomDocument::UnitMM = QStringLiteral("mm");
|
const QString VDomDocument::UnitMM = QStringLiteral("mm");
|
||||||
|
@ -95,6 +99,10 @@ VDomDocument::VDomDocument(VContainer *data)
|
||||||
: QDomDocument(), data(data), map(QHash<QString, QDomElement>())
|
: QDomDocument(), data(data), map(QHash<QString, QDomElement>())
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
VDomDocument::~VDomDocument()
|
||||||
|
{}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
QDomElement VDomDocument::elementById(const QString& id)
|
QDomElement VDomDocument::elementById(const QString& id)
|
||||||
{
|
{
|
||||||
|
|
|
@ -78,12 +78,9 @@ public:
|
||||||
static const QString TagVersion;
|
static const QString TagVersion;
|
||||||
/**
|
/**
|
||||||
* @param data container with variables
|
* @param data container with variables
|
||||||
* @param comboBoxDraws pointer to the ComboBox that will hold the pattern piece names
|
|
||||||
* @param mode draw mode
|
|
||||||
* @param parent
|
|
||||||
*/
|
*/
|
||||||
VDomDocument(VContainer *data);
|
VDomDocument(VContainer *data);
|
||||||
virtual ~VDomDocument(){}
|
virtual ~VDomDocument();
|
||||||
/**
|
/**
|
||||||
* @brief Finds an element by id.
|
* @brief Finds an element by id.
|
||||||
* @param id value id attribute.
|
* @param id value id attribute.
|
||||||
|
@ -142,10 +139,6 @@ public:
|
||||||
* @brief ValidateXML validate xml file by xsd schema.
|
* @brief ValidateXML validate xml file by xsd schema.
|
||||||
* @param schema path to schema file.
|
* @param schema path to schema file.
|
||||||
* @param fileName name of xml file.
|
* @param fileName name of xml file.
|
||||||
* @param errorMsg error message.
|
|
||||||
* @param errorLine number error line.
|
|
||||||
* @param errorColumn number error column.
|
|
||||||
* @return true if validation successful.
|
|
||||||
*/
|
*/
|
||||||
static void ValidateXML(const QString &schema, const QString &fileName);
|
static void ValidateXML(const QString &schema, const QString &fileName);
|
||||||
void setContent(const QString &fileName);
|
void setContent(const QString &fileName);
|
||||||
|
|
|
@ -43,6 +43,10 @@ const QString VIndividualMeasurements::SexFemale = QStringLiteral("female")
|
||||||
VIndividualMeasurements::VIndividualMeasurements(VContainer *data):VDomDocument(data)
|
VIndividualMeasurements::VIndividualMeasurements(VContainer *data):VDomDocument(data)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
VIndividualMeasurements::~VIndividualMeasurements()
|
||||||
|
{}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
Valentina::Units VIndividualMeasurements::Unit() const
|
Valentina::Units VIndividualMeasurements::Unit() const
|
||||||
{
|
{
|
||||||
|
|
|
@ -47,6 +47,7 @@ public:
|
||||||
Q_DECLARE_FLAGS(Genders, Sex)
|
Q_DECLARE_FLAGS(Genders, Sex)
|
||||||
|
|
||||||
VIndividualMeasurements(VContainer *data);
|
VIndividualMeasurements(VContainer *data);
|
||||||
|
virtual ~VIndividualMeasurements();
|
||||||
Valentina::Units Unit() const;
|
Valentina::Units Unit() const;
|
||||||
void setUnit(const Valentina::Units &unit);
|
void setUnit(const Valentina::Units &unit);
|
||||||
void Measurements();
|
void Measurements();
|
||||||
|
@ -73,6 +74,7 @@ public:
|
||||||
static QString GenderToStr(const VIndividualMeasurements::Genders &sex);
|
static QString GenderToStr(const VIndividualMeasurements::Genders &sex);
|
||||||
static VIndividualMeasurements::Genders StrToGender(const QString &sex);
|
static VIndividualMeasurements::Genders StrToGender(const QString &sex);
|
||||||
private:
|
private:
|
||||||
|
Q_DISABLE_COPY(VIndividualMeasurements)
|
||||||
void Measurement(const QString &tag);
|
void Measurement(const QString &tag);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -65,7 +65,7 @@ public:
|
||||||
VPattern(VContainer *data, QComboBox *comboBoxDraws, Valentina::Draws *mode, QObject *parent = nullptr);
|
VPattern(VContainer *data, QComboBox *comboBoxDraws, Valentina::Draws *mode, QObject *parent = nullptr);
|
||||||
/**
|
/**
|
||||||
* @brief CreateEmptyFile create minimal empty file.
|
* @brief CreateEmptyFile create minimal empty file.
|
||||||
* @param tablePath
|
* @param tablePath path to measurement file (standard or individual)
|
||||||
*/
|
*/
|
||||||
void CreateEmptyFile(const QString &tablePath);
|
void CreateEmptyFile(const QString &tablePath);
|
||||||
/**
|
/**
|
||||||
|
@ -333,7 +333,6 @@ private:
|
||||||
* @param domElement tag in xml tree.
|
* @param domElement tag in xml tree.
|
||||||
* @param parse parser file mode.
|
* @param parse parser file mode.
|
||||||
* @param type type of point.
|
* @param type type of point.
|
||||||
* @param mode draw mode.
|
|
||||||
*/
|
*/
|
||||||
void ParsePointElement(VMainGraphicsScene *scene, QDomElement &domElement,
|
void ParsePointElement(VMainGraphicsScene *scene, QDomElement &domElement,
|
||||||
const Document::Documents &parse, const QString &type);
|
const Document::Documents &parse, const QString &type);
|
||||||
|
@ -342,7 +341,6 @@ private:
|
||||||
* @param scene scene.
|
* @param scene scene.
|
||||||
* @param domElement tag in xml tree.
|
* @param domElement tag in xml tree.
|
||||||
* @param parse parser file mode.
|
* @param parse parser file mode.
|
||||||
* @param mode draw mode.
|
|
||||||
*/
|
*/
|
||||||
void ParseLineElement(VMainGraphicsScene *scene, const QDomElement& domElement,
|
void ParseLineElement(VMainGraphicsScene *scene, const QDomElement& domElement,
|
||||||
const Document::Documents &parse);
|
const Document::Documents &parse);
|
||||||
|
@ -352,7 +350,6 @@ private:
|
||||||
* @param domElement tag in xml tree.
|
* @param domElement tag in xml tree.
|
||||||
* @param parse parser file mode.
|
* @param parse parser file mode.
|
||||||
* @param type type of spline.
|
* @param type type of spline.
|
||||||
* @param mode draw mode.
|
|
||||||
*/
|
*/
|
||||||
void ParseSplineElement(VMainGraphicsScene *scene, const QDomElement& domElement,
|
void ParseSplineElement(VMainGraphicsScene *scene, const QDomElement& domElement,
|
||||||
const Document::Documents &parse, const QString& type);
|
const Document::Documents &parse, const QString& type);
|
||||||
|
@ -362,7 +359,6 @@ private:
|
||||||
* @param domElement tag in xml tree.
|
* @param domElement tag in xml tree.
|
||||||
* @param parse parser file mode.
|
* @param parse parser file mode.
|
||||||
* @param type type of spline.
|
* @param type type of spline.
|
||||||
* @param mode draw mode.
|
|
||||||
*/
|
*/
|
||||||
void ParseArcElement(VMainGraphicsScene *scene, QDomElement &domElement,
|
void ParseArcElement(VMainGraphicsScene *scene, QDomElement &domElement,
|
||||||
const Document::Documents &parse, const QString& type);
|
const Document::Documents &parse, const QString& type);
|
||||||
|
|
|
@ -41,6 +41,10 @@ const QString VStandardMeasurements::AttrHeight_increase = QStringLiteral("heigh
|
||||||
VStandardMeasurements::VStandardMeasurements(VContainer *data):VDomDocument(data)
|
VStandardMeasurements::VStandardMeasurements(VContainer *data):VDomDocument(data)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
VStandardMeasurements::~VStandardMeasurements()
|
||||||
|
{}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
Valentina::Units VStandardMeasurements::Unit()
|
Valentina::Units VStandardMeasurements::Unit()
|
||||||
{
|
{
|
||||||
|
|
|
@ -43,6 +43,7 @@ class VStandardMeasurements:public VDomDocument
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
VStandardMeasurements(VContainer *data);
|
VStandardMeasurements(VContainer *data);
|
||||||
|
virtual ~VStandardMeasurements();
|
||||||
Valentina::Units Unit();
|
Valentina::Units Unit();
|
||||||
QString Description();
|
QString Description();
|
||||||
void Measurements();
|
void Measurements();
|
||||||
|
@ -56,6 +57,7 @@ public:
|
||||||
static const QString AttrSize_increase;
|
static const QString AttrSize_increase;
|
||||||
static const QString AttrHeight_increase;
|
static const QString AttrHeight_increase;
|
||||||
private:
|
private:
|
||||||
|
Q_DISABLE_COPY(VStandardMeasurements)
|
||||||
void Measurement(const QString &tag);
|
void Measurement(const QString &tag);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -32,6 +32,10 @@
|
||||||
* @brief Definition of the parser bytecode class.
|
* @brief Definition of the parser bytecode class.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#ifdef Q_CC_CLANG
|
||||||
|
#pragma clang diagnostic push
|
||||||
|
#pragma clang diagnostic ignored "-Wnested-anon-types"
|
||||||
|
#endif
|
||||||
namespace qmu
|
namespace qmu
|
||||||
{
|
{
|
||||||
struct SToken
|
struct SToken
|
||||||
|
@ -67,6 +71,9 @@ struct SToken
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#ifdef Q_CC_CLANG
|
||||||
|
#pragma clang diagnostic pop
|
||||||
|
#endif
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Bytecode implementation of the Math Parser.
|
* @brief Bytecode implementation of the Math Parser.
|
||||||
|
@ -97,7 +104,7 @@ public:
|
||||||
void Finalize();
|
void Finalize();
|
||||||
void clear();
|
void clear();
|
||||||
std::size_t GetMaxStackSize() const;
|
std::size_t GetMaxStackSize() const;
|
||||||
std::size_t GetSize() const;
|
int GetSize() const;
|
||||||
const SToken* GetBase() const;
|
const SToken* GetBase() const;
|
||||||
void AsciiDump();
|
void AsciiDump();
|
||||||
private:
|
private:
|
||||||
|
@ -138,7 +145,7 @@ inline std::size_t QmuParserByteCode::GetMaxStackSize() const
|
||||||
* @brief Returns the number of entries in the bytecode.
|
* @brief Returns the number of entries in the bytecode.
|
||||||
*/
|
*/
|
||||||
// cppcheck-suppress unusedFunction
|
// cppcheck-suppress unusedFunction
|
||||||
inline std::size_t QmuParserByteCode::GetSize() const
|
inline int QmuParserByteCode::GetSize() const
|
||||||
{
|
{
|
||||||
return m_vRPN.size();
|
return m_vRPN.size();
|
||||||
}
|
}
|
||||||
|
|
|
@ -239,4 +239,23 @@ void QmuParserError::Reset()
|
||||||
m_iErrc = ecUNDEFINED;
|
m_iErrc = ecUNDEFINED;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief raise method raise for exception
|
||||||
|
*/
|
||||||
|
void qmu::QmuParserError::raise() const
|
||||||
|
{
|
||||||
|
throw *this;
|
||||||
|
}
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief clone clone exception
|
||||||
|
* @return new exception
|
||||||
|
*/
|
||||||
|
QmuParserError *qmu::QmuParserError::clone() const
|
||||||
|
{
|
||||||
|
return new QmuParserError(*this);
|
||||||
|
}
|
||||||
|
|
||||||
} // namespace qmu
|
} // namespace qmu
|
||||||
|
|
|
@ -101,7 +101,7 @@ public:
|
||||||
~QmuParserErrorMsg();
|
~QmuParserErrorMsg();
|
||||||
|
|
||||||
static const QmuParserErrorMsg& Instance();
|
static const QmuParserErrorMsg& Instance();
|
||||||
QString operator[] ( unsigned a_iIdx ) const;
|
QString operator[] ( int a_iIdx ) const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Q_DISABLE_COPY(QmuParserErrorMsg)
|
Q_DISABLE_COPY(QmuParserErrorMsg)
|
||||||
|
@ -117,9 +117,9 @@ inline const QmuParserErrorMsg& QmuParserErrorMsg::Instance()
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
inline QString QmuParserErrorMsg::operator[] ( unsigned a_iIdx ) const
|
inline QString QmuParserErrorMsg::operator[] ( int a_iIdx ) const
|
||||||
{
|
{
|
||||||
return ( a_iIdx < static_cast<unsigned>( m_vErrMsg.size() ) ) ? m_vErrMsg[a_iIdx] : QString();
|
return ( a_iIdx < m_vErrMsg.size() ) ? m_vErrMsg[a_iIdx] : QString();
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------
|
//---------------------------------------------------------------------------
|
||||||
|
@ -163,25 +163,6 @@ private:
|
||||||
void Reset();
|
void Reset();
|
||||||
};
|
};
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
|
||||||
/**
|
|
||||||
* @brief raise method raise for exception
|
|
||||||
*/
|
|
||||||
inline void QmuParserError::raise() const
|
|
||||||
{
|
|
||||||
throw *this;
|
|
||||||
}
|
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
|
||||||
/**
|
|
||||||
* @brief clone clone exception
|
|
||||||
* @return new exception
|
|
||||||
*/
|
|
||||||
inline QmuParserError *QmuParserError::clone() const
|
|
||||||
{
|
|
||||||
return new QmuParserError(*this);
|
|
||||||
}
|
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
* @brief Set the expression related to this error.
|
* @brief Set the expression related to this error.
|
||||||
|
|
|
@ -38,9 +38,6 @@
|
||||||
|
|
||||||
#if defined __cplusplus
|
#if defined __cplusplus
|
||||||
/* Add C++ includes here */
|
/* Add C++ includes here */
|
||||||
#ifdef Q_CC_MSVC
|
|
||||||
#define _USE_MATH_DEFINES
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef QT_CORE_LIB
|
#ifdef QT_CORE_LIB
|
||||||
#include <QtCore>
|
#include <QtCore>
|
||||||
|
|
Loading…
Reference in New Issue
Block a user