Fix some warning after checking cppcheck.

master
dismine 2013-09-12 16:25:24 +03:00
parent 2ed982faeb
commit ea072a35f4
28 changed files with 126 additions and 214 deletions

View File

@ -24,7 +24,6 @@ SOURCES += main.cpp\
dialogs/dialogincrements.cpp \
container/vstandarttablecell.cpp \
container/vincrementtablerow.cpp \
widgets/delegate.cpp \
widgets/doubledelegate.cpp \
dialogs/dialogendline.cpp \
tools/drawTools/vtoolendline.cpp \
@ -103,7 +102,6 @@ HEADERS += mainwindow.h \
dialogs/dialogincrements.h \
container/vstandarttablecell.h \
container/vincrementtablerow.h \
widgets/delegate.h \
widgets/doubledelegate.h \
dialogs/dialogendline.h \
tools/drawTools/vtoolendline.h \

View File

@ -79,7 +79,7 @@ private:
* @param c символ.
* @return true - належить рядку, false - не належить рядку.
*/
bool StrChr(QString string, QChar c);
static bool StrChr(QString string, QChar c);
/**
* @brief putback повертає зчитану лексему назад у потік.
*/
@ -120,13 +120,13 @@ private:
* @param r перший елемент.
* @param h другий елемент.
*/
void arith(QChar o, qreal *r, qreal *h);
static void arith(QChar o, qreal *r, qreal *h);
/**
* @brief unary метод зміни знаку.
* @param o символ знаку.
* @param r елемент.
*/
void unary(QChar o, qreal *r);
static void unary(QChar o, qreal *r);
/**
* @brief find_var метод знаходить змінну за іменем.
* @param s ім'я змінної.
@ -139,19 +139,19 @@ private:
* @param s ім'я лексеми.
* @return внутрішній номер лексеми.
*/
char look_up(QString s);
static char look_up(QString s);
/**
* @brief isdelim повертає "істино", якщо с розділювач.
* @param c символ.
* @return розділювач, або ні.
*/
bool isdelim(QChar c);
static bool isdelim(QChar c);
/**
* @brief iswhite перевіряє чи с пробіл чи табуляція.
* @param c символ.
* @return так або ні.
*/
bool iswhite(QChar c);
static bool iswhite(QChar c);
};
#endif // CALCULATOR_H

View File

@ -18,7 +18,7 @@ VContainer::VContainer():base(QMap<QString, qint32>()), points(QMap<qint64, VPoi
CreateManTableIGroup ();
}
const VContainer &VContainer::operator =(const VContainer &data){
VContainer &VContainer::operator =(const VContainer &data){
setData(data);
return *this;
}
@ -55,7 +55,7 @@ void VContainer::setData(const VContainer &data){
}
template <typename key, typename val>
val VContainer::GetObject(const QMap<key,val> &obj, key id)const{
val VContainer::GetObject(const QMap<key,val> &obj, key id){
if(obj.contains(id)){
return obj.value(id);
} else {
@ -134,13 +134,13 @@ qint64 VContainer::getId(){
}
qint64 VContainer::getNextId(){
++_id;
this->_id++;
return _id;
}
void VContainer::UpdateId(qint64 newId){
if(newId > _id){
_id = newId;
if(newId > this->_id){
this->_id = newId;
}
}
@ -316,14 +316,14 @@ QPainterPath VContainer::Equidistant(QVector<QPointF> points, const Detail::Equi
return ekv;
}
QLineF VContainer::ParallelLine(const QLineF &line, qreal width) const{
QLineF VContainer::ParallelLine(const QLineF &line, qreal width){
Q_ASSERT(width > 0);
QLineF paralel = QLineF (SingleParallelPoint(line, 90, width),
SingleParallelPoint(QLineF(line.p2(), line.p1()), -90, width));
return paralel;
}
QPointF VContainer::SingleParallelPoint(const QLineF &line, const qreal &angle, const qreal &width) const{
QPointF VContainer::SingleParallelPoint(const QLineF &line, const qreal &angle, const qreal &width){
Q_ASSERT(width > 0);
QLineF l = line;
l.setAngle( l.angle() + angle );

View File

@ -23,7 +23,7 @@ public:
* @brief VContainer
*/
VContainer();
const VContainer &operator=(const VContainer &data);
VContainer &operator=(const VContainer &data);
VContainer(const VContainer &data);
void setData(const VContainer &data);
/**
@ -44,7 +44,7 @@ public:
VSplinePath GetSplinePath(qint64 id) const;
VSplinePath GetModelingSplinePath(qint64 id) const;
VDetail GetDetail(qint64 id) const;
qint64 getId();
static qint64 getId();
qint64 AddPoint(const VPointF& point);
qint64 AddModelingPoint(const VPointF& point);
qint64 AddDetail(const VDetail& detail);
@ -101,7 +101,7 @@ public:
qint32 growth() const;
qreal FindVar(const QString& name, bool *ok)const;
bool IncrementTableContains(const QString& name);
qint64 getNextId();
static qint64 getNextId();
void RemoveIncrementTableRow(const QString& name);
const QMap<qint64, VPointF> *DataPoints() const;
const QMap<qint64, VPointF> *DataModelingPoints() const;
@ -119,13 +119,13 @@ public:
const QMap<qint64, VSplinePath> *DataSplinePaths() const;
const QMap<qint64, VSplinePath> *DataModelingSplinePaths() const;
const QMap<qint64, VDetail> *DataDetails() const;
void UpdateId(qint64 newId);
static void UpdateId(qint64 newId);
void IncrementReferens(qint64 id, Scene::Type obj, Draw::Mode mode = Draw::Calculation);
QPainterPath ContourPath(qint64 idDetail) const;
QPainterPath Equidistant(QVector<QPointF> points, const Detail::Equidistant &eqv,
const qreal &width)const;
QLineF ParallelLine(const QLineF &line, qreal width ) const;
QPointF SingleParallelPoint(const QLineF &line, const qreal &angle, const qreal &width)const;
static QLineF ParallelLine(const QLineF &line, qreal width );
static QPointF SingleParallelPoint(const QLineF &line, const qreal &angle, const qreal &width);
QVector<QPointF> EkvPoint(const QLineF &line1, const QLineF &line2, const qreal &width)const;
void PrepareDetails(QVector<VItem*> & list)const;
private:
@ -146,9 +146,10 @@ private:
QMap<qint64, VSplinePath> splinePaths;
QMap<qint64, VSplinePath> modelingSplinePaths;
QMap<qint64, VDetail> details;
template <typename key, typename val> val GetObject(const QMap<key,val> &obj, key id) const;
template <typename val> void UpdateObject(QMap<qint64, val> &obj, const qint64 &id, const val& point);
template <typename key, typename val> qint64 AddObject(QMap<key, val> &obj, const val& value);
template <typename key, typename val> static val GetObject(const QMap<key,val> &obj, key id);
template <typename val> static void UpdateObject(QMap<qint64, val> &obj, const qint64 &id,
const val& point);
template <typename key, typename val> static qint64 AddObject(QMap<key, val> &obj, const val& value);
void CreateManTableIGroup ();
QVector<QPointF> GetReversePoint(const QVector<QPointF> &points)const;
qreal GetLengthContour(const QVector<QPointF> &contour, const QVector<QPointF> &newPoints)const;

View File

@ -169,7 +169,7 @@ void DialogArc::F2Changed(){
void DialogArc::CheckState(){
Q_CHECK_PTR(bOk);
bOk->setEnabled(flagRadius & flagF1 & flagF2);
bOk->setEnabled(flagRadius && flagF1 && flagF2);
}
void DialogArc::EvalRadius(){

View File

@ -2,7 +2,6 @@
#include "ui_dialogincrements.h"
#include <QHeaderView>
#include <QCloseEvent>
#include "widgets/delegate.h"
#include "widgets/doubledelegate.h"
#include "container/vincrementtablerow.h"

View File

@ -1,8 +1,6 @@
#ifndef DIALOGINCREMENTS_H
#define DIALOGINCREMENTS_H
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Weffc++"
#include "dialogtool.h"
#include <QPushButton>
#include "xml/vdomdocument.h"

View File

@ -133,7 +133,7 @@ void DialogLineIntersect::P2Line2Changed(int index){
void DialogLineIntersect::CheckState(){
Q_CHECK_PTR(bOk);
bOk->setEnabled(flagName & flagPoint);
bOk->setEnabled(flagName && flagPoint);
}
bool DialogLineIntersect::CheckIntersecion(){

View File

@ -175,7 +175,7 @@ qint64 DialogTool::getCurrentPointId(QComboBox *box) const{
void DialogTool::CheckState(){
Q_CHECK_PTR(bOk);
bOk->setEnabled(flagFormula & flagName);
bOk->setEnabled(flagFormula && flagName);
}

View File

@ -82,7 +82,7 @@ protected:
void setCurrentPointId(QComboBox *box, qint64 &pointId, const qint64 &value, const qint64 &id) const;
qint64 getCurrentPointId(QComboBox *box) const;
DialogTool(const DialogTool &dialog);
const DialogTool &operator=(const DialogTool &dialog);
DialogTool &operator=(const DialogTool &dialog);
};
#endif // DIALOGTOOL_H

View File

@ -19,7 +19,7 @@ VArc::VArc(const VArc &arc): f1(arc.GetF1()), formulaF1(arc.GetFormulaF1()), f2(
idObject(arc.getIdObject()){
}
const VArc &VArc::operator =(const VArc &arc){
VArc &VArc::operator =(const VArc &arc){
this->points = arc.GetDataPoints();
this->f1 = arc.GetF1();
this->formulaF1 = arc.GetFormulaF1();
@ -29,6 +29,8 @@ const VArc &VArc::operator =(const VArc &arc){
this->formulaRadius = arc.GetFormulaRadius();
this->center = arc.GetCenter();
this->mode = arc.getMode();
this->_referens = 0;
this->idObject = arc.getIdObject();
return *this;
}
@ -168,8 +170,8 @@ QVector<QPointF> VArc::SplOfArc(qint32 number) const{
anglF2 = f2 - 90 ;
}
if ( i + 1 == number ){
return VSpline::SplinePoints(GetP1 (), GetP2 (), anglF1, anglF2, 1., 1., 1.);
f1 = f2;
return VSpline::SplinePoints(GetP1 (), GetP2 (), anglF1, anglF2, 1., 1., 1.);
}
}
return QVector<QPointF>();

View File

@ -27,7 +27,7 @@ public:
qreal f1, QString formulaF1, qreal f2 , QString formulaF2,
Draw::Mode mode = Draw::Calculation, qint64 idObject = 0);
VArc(const VArc &arc);
const VArc& operator= (const VArc &arc);
VArc& operator= (const VArc &arc);
/**
* @brief GetF1 повертає початковий кут дуги.
* @return повертає кут в градусах.

View File

@ -234,29 +234,29 @@ QLineF::IntersectType VSpline::CrossingSplLine ( const QLineF &line, QPointF *in
// CutSpline ( length, curFir, curSec );
//}
void VSpline::PutAlongSpl (QPointF &moveP, qreal move ) const{
if ( GetLength () < move ){
qDebug()<<"Довжина більше довжини сплайну.";
qDebug()<<GetLength()<<"<"<<move;
throw "Довжина більше довжини сплайну.";
}
if ( move <= 0 ){
qDebug()<<"Довжина менше дорівнює нулю.";
throw "Довжина менше дорівнює нулю.";
}
qreal t = 0;
if ( move == 0 ){
t = 0;
} else {
t = move / GetLength ();
moveP.setX ( pow ( 1 - t, 3 ) * GetPointP1 ().x () + 3 * t * pow ( 1 - t, 2 ) *
GetP2 ().x () + 3 * t * t * ( 1 - t ) * GetP3 ().x () +
pow ( t, 3 ) * GetPointP4 ().x () );
moveP.setY ( pow ( 1 - t, 3 ) * GetPointP1 ().y () + 3 * t * pow ( 1 - t, 2 ) *
GetP2 ().y () + 3 * t * t * ( 1 - t ) * GetP3 ().y () +
pow ( t, 3 ) * GetPointP4 ().y () );
}
}
//void VSpline::PutAlongSpl (QPointF &moveP, qreal move ) const{
// if ( GetLength () < move ){
// qDebug()<<"Довжина більше довжини сплайну.";
// qDebug()<<GetLength()<<"<"<<move;
// throw "Довжина більше довжини сплайну.";
// }
// if ( move <= 0 ){
// qDebug()<<"Довжина менше дорівнює нулю.";
// throw "Довжина менше дорівнює нулю.";
// }
// qreal t = 0;
// if ( move == 0 ){
// t = 0;
// } else {
// t = move / GetLength ();
// moveP.setX ( pow ( 1 - t, 3 ) * GetPointP1 ().x () + 3 * t * pow ( 1 - t, 2 ) *
// GetP2 ().x () + 3 * t * t * ( 1 - t ) * GetP3 ().x () +
// pow ( t, 3 ) * GetPointP4 ().x () );
// moveP.setY ( pow ( 1 - t, 3 ) * GetPointP1 ().y () + 3 * t * pow ( 1 - t, 2 ) *
// GetP2 ().y () + 3 * t * t * ( 1 - t ) * GetP3 ().y () +
// pow ( t, 3 ) * GetPointP4 ().y () );
// }
//}
QVector<QPointF> VSpline::GetPoints () const{
return GetPoints(GetPointP1().toQPointF(), p2, p3, GetPointP4().toQPointF());
@ -637,7 +637,7 @@ void VSpline::decrementReferens(){
2 - 1 real root + complex roots imaginary part is zero
(i.e. 2 real roots).
*/
qint32 VSpline::Cubic(qreal *x, qreal a, qreal b, qreal c)const{
qint32 VSpline::Cubic(qreal *x, qreal a, qreal b, qreal c){
qreal q,r,r2,q3;
q = (a*a - 3.*b)/9.;
@ -676,56 +676,56 @@ qint32 VSpline::Cubic(qreal *x, qreal a, qreal b, qreal c)const{
}
}
qreal VSpline::calc_t (qreal curve_coord1, qreal curve_coord2, qreal curve_coord3,
qreal curve_coord4, qreal point_coord) const{
qreal P1, P2, P3, P4, Bt;
qreal a, b, c, d, ret_t;
//qreal VSpline::calc_t (qreal curve_coord1, qreal curve_coord2, qreal curve_coord3,
// qreal curve_coord4, qreal point_coord) const{
// qreal P1, P2, P3, P4, Bt;
// qreal a, b, c, d, ret_t;
qreal *t = static_cast<qreal *>(malloc(3*sizeof(qreal)));
P1 = curve_coord1;
P2 = curve_coord2;
P3 = curve_coord3;
P4 = curve_coord4;
Bt = point_coord;
// qreal *t = static_cast<qreal *>(malloc(3*sizeof(qreal)));
// P1 = curve_coord1;
// P2 = curve_coord2;
// P3 = curve_coord3;
// P4 = curve_coord4;
// Bt = point_coord;
a = -P1 + 3*P2 - 3*P3 + P4;
b = 3*P1 - 6*P2 + 3*P3;
c = -3*P1 + 3*P2;
d = -Bt + P1;
// a = -P1 + 3*P2 - 3*P3 + P4;
// b = 3*P1 - 6*P2 + 3*P3;
// c = -3*P1 + 3*P2;
// d = -Bt + P1;
if(Cubic(t, b/a, c/a, d/a) == 3){
ret_t = t[2];
} else {
ret_t = t[0];
}
/*
* Повертається три значення, але експереминтально знайдено що шукане
* значення знаходиться в третьому.
*/
// if(Cubic(t, b/a, c/a, d/a) == 3){
// ret_t = t[2];
// } else {
// ret_t = t[0];
// }
// /*
// * Повертається три значення, але експереминтально знайдено що шукане
// * значення знаходиться в третьому.
// */
free(t);
if(ret_t<0 || ret_t>1){
qDebug()<<"Неправильне значення параметра. фунція calc_t";
throw"Неправильне значення параметра. фунція calc_t";
}
return ret_t;
}
// free(t);
// if(ret_t<0 || ret_t>1){
// qDebug()<<"Неправильне значення параметра. фунція calc_t";
// throw"Неправильне значення параметра. фунція calc_t";
// }
// return ret_t;
//}
/*
* Функція знаходить підходяще значення параметна t якому відповідає точка на сплайні.
*/
qreal VSpline::param_t (QPointF pBt)const{
qreal t_x, t_y;
t_x = calc_t (GetPointP1().x(), p2.x(), p3.x(), GetPointP4().x(), pBt.x());
t_y = calc_t (GetPointP1().y(), p2.y(), p3.y(), GetPointP4().y(), pBt.y());
/*
* Порівнюємо значення по х і по у і визначаємо найбільше. Це значення і
* буде шуканим.
*/
if(t_x>t_y)
return t_x;
else
return t_y;
}
//qreal VSpline::param_t (QPointF pBt)const{
// qreal t_x, t_y;
// t_x = calc_t (GetPointP1().x(), p2.x(), p3.x(), GetPointP4().x(), pBt.x());
// t_y = calc_t (GetPointP1().y(), p2.y(), p3.y(), GetPointP4().y(), pBt.y());
// /*
// * Порівнюємо значення по х і по у і визначаємо найбільше. Це значення і
// * буде шуканим.
// */
// if(t_x>t_y)
// return t_x;
// else
// return t_y;
//}
//void VSpline::Mirror(const QPointF Pmirror){
// QPointF P1 = p1;
@ -779,7 +779,7 @@ void VSpline::setIdObject(const qint64 &value){
idObject = value;
}
const VSpline &VSpline::operator =(const VSpline &spline){
VSpline &VSpline::operator =(const VSpline &spline){
this->p1 = spline.GetP1 ();
this->p2 = spline.GetP2 ();
this->p3 = spline.GetP3 ();

View File

@ -143,7 +143,7 @@ public:
* @param moveP точка яка розміщується на сплайні.
* @param move довжина від початку сплайну.
*/
void PutAlongSpl ( QPointF &moveP, qreal move ) const;
// void PutAlongSpl ( QPointF &moveP, qreal move ) const;
/**
* @brief GetPoints повертає точки з яких складається сплайн.
* @return список точок.
@ -168,7 +168,7 @@ public:
qreal angle2, qreal kAsm1, qreal kAsm2, qreal kCurve);
qint64 getIdObject() const;
void setIdObject(const qint64 &value);
const VSpline &operator=(const VSpline &spl);
VSpline &operator=(const VSpline &spl);
protected:
/**
* @brief GetPoints повертає точки з яких складається сплайн.
@ -254,7 +254,7 @@ private:
* @param c коефіцієнт.
* @return повертає корені рівняння.
*/
qint32 Cubic(qreal *x, qreal a, qreal b, qreal c)const;
static qint32 Cubic(qreal *x, qreal a, qreal b, qreal c);
/**
* @brief calc_t знаходить параметр t якому відповідає точка на сплайні.
* @param curve_coord1 координата Х або У кривої.
@ -264,14 +264,14 @@ private:
* @param point_coord координата Х або У точки на кривій.
* @return
*/
qreal calc_t (qreal curve_coord1, qreal curve_coord2, qreal curve_coord3,
qreal curve_coord4, qreal point_coord)const;
// static qreal calc_t (qreal curve_coord1, qreal curve_coord2, qreal curve_coord3,
// qreal curve_coord4, qreal point_coord)const;
/**
* @brief param_t знаходить підходяще значення параметра t якому відповідає точка на сплайні
* @param pBt точка для якої шукається значення параметра t.
* @return підходяще значення t.
*/
qreal param_t (QPointF pBt)const;
// qreal param_t (QPointF pBt)const;
};
#endif // VSPLINE_H

View File

@ -101,14 +101,14 @@ void VSplinePath::UpdatePoint(qint32 indexSpline, SplinePoint::Position pos, VSp
}
}
VSplinePoint VSplinePath::GetSplinePoint(qint32 indexSpline, SplinePoint::Position pos){
VSplinePoint VSplinePath::GetSplinePoint(qint32 indexSpline, SplinePoint::Position pos) const{
if(indexSpline < 1 || indexSpline > Count()){
throw "Такого сплайну немає.";
}
if(pos == SplinePoint::FirstPoint){
return path[indexSpline-1];
return path.at(indexSpline-1);
} else {
return path[indexSpline];
return path.at(indexSpline);
}
}
@ -133,6 +133,8 @@ VSplinePath &VSplinePath::operator =(const VSplinePath &path){
this->kCurve = path.getKCurve();
this->mode = path.getMode();
this->points = path.GetDataPoints();
this->_referens = 0;
this->idObject = path.getIdObject();
return *this;
}

View File

@ -43,7 +43,7 @@ public:
qreal GetLength() const;
const QMap<qint64, VPointF> *GetDataPoints() const;
void UpdatePoint(qint32 indexSpline, SplinePoint::Position pos, VSplinePoint point);
VSplinePoint GetSplinePoint(qint32 indexSpline, SplinePoint::Position pos);
VSplinePoint GetSplinePoint(qint32 indexSpline, SplinePoint::Position pos) const;
/**
* @brief Clear очищає шлях сплайнів.
*/

View File

@ -88,7 +88,6 @@ void MainWindow::ActionNewDraw(){
dlg->resize(300,100);
dlg->setTextValue(nDraw);
while(1){
bOk = false;
bOk = dlg->exec();
nameDraw = dlg->textValue();
if(!bOk || nameDraw.isEmpty()){
@ -145,7 +144,6 @@ void MainWindow::OptionDraw(){
dlg->resize(300,100);
dlg->setTextValue(nDraw);
while(1){
bOk = false;
bOk = dlg->exec();
nameDraw = dlg->textValue();
if(!bOk || nameDraw.isEmpty()){

View File

@ -8,7 +8,7 @@ VToolLinePoint::VToolLinePoint(VDomDocument *doc, VContainer *data, const qint64
//Лінія, що з'єднує дві точки
QPointF point1 = data->GetPoint(basePointId).toQPointF();
QPointF point2 = data->GetPoint(id).toQPointF();
mainLine = new QGraphicsLineItem(QLineF(point1 - point2, point2 - point2), this);
mainLine = new QGraphicsLineItem(QLineF(point1 - point2, 0), this);
mainLine->setPen(QPen(Qt::black, widthHairLine));
mainLine->setFlag(QGraphicsItem::ItemStacksBehindParent, true);
if(typeLine == "none"){
@ -32,7 +32,7 @@ void VToolLinePoint::RefreshGeometry(){
VToolPoint::RefreshPointGeometry(VDrawTool::data.GetPoint(id));
QPointF point = VDrawTool::data.GetPoint(id).toQPointF();
QPointF basePoint = VDrawTool::data.GetPoint(basePointId).toQPointF();
mainLine->setLine(QLineF(basePoint - point, point - point));
mainLine->setLine(QLineF(basePoint - point, 0));
if(typeLine == "none"){
mainLine->setVisible(false);
} else {

View File

@ -8,7 +8,7 @@ VModelingLinePoint::VModelingLinePoint(VDomDocument *doc, VContainer *data, cons
//Лінія, що з'єднує дві точки
QPointF point1 = data->GetModelingPoint(basePointId).toQPointF();
QPointF point2 = data->GetModelingPoint(id).toQPointF();
mainLine = new QGraphicsLineItem(QLineF(point1 - point2, point2 - point2), this);
mainLine = new QGraphicsLineItem(QLineF(point1 - point2, 0), this);
mainLine->setPen(QPen(Qt::black, widthHairLine));
mainLine->setFlag(QGraphicsItem::ItemStacksBehindParent, true);
if(typeLine == "none"){
@ -22,7 +22,7 @@ void VModelingLinePoint::RefreshGeometry(){
VModelingPoint::RefreshPointGeometry(VModelingTool::data.GetModelingPoint(id));
QPointF point = VModelingTool::data.GetModelingPoint(id).toQPointF();
QPointF basePoint = VModelingTool::data.GetModelingPoint(basePointId).toQPointF();
mainLine->setLine(QLineF(basePoint - point, point - point));
mainLine->setLine(QLineF(basePoint - point, 0));
if(typeLine == "none"){
mainLine->setVisible(false);
} else {

View File

@ -15,7 +15,7 @@ VNodeArc::VNodeArc(VDomDocument *doc, VContainer *data, qint64 id, qint64 idArc,
VNodeArc *VNodeArc::Create(VDomDocument *doc, VContainer *data, qint64 id, qint64 idArc,
Draw::Mode typeobject, Document::Enum parse, Tool::Enum typeCreation){
VNodeArc *arc;
VNodeArc *arc = 0;
if(parse == Document::FullParse){
arc = new VNodeArc(doc, data, id, idArc, typeobject, typeCreation);
doc->AddTool(id, arc);

View File

@ -20,7 +20,7 @@ VNodePoint::VNodePoint(VDomDocument *doc, VContainer *data, qint64 id, qint64 id
VNodePoint *VNodePoint::Create(VDomDocument *doc, VContainer *data, qint64 id, qint64 idPoint,
Draw::Mode typeobject, Document::Enum parse, Tool::Enum typeCreation){
VNodePoint *point;
VNodePoint *point = 0;
if(parse == Document::FullParse){
point = new VNodePoint(doc, data, id, idPoint, typeobject, typeCreation);
doc->AddTool(id, point);

View File

@ -15,7 +15,7 @@ VNodeSpline::VNodeSpline(VDomDocument *doc, VContainer *data, qint64 id, qint64
VNodeSpline *VNodeSpline::Create(VDomDocument *doc, VContainer *data, qint64 id, qint64 idSpline,
Draw::Mode typeobject, Document::Enum parse, Tool::Enum typeCreation){
VNodeSpline *spl;
VNodeSpline *spl = 0;
if(parse == Document::FullParse){
spl = new VNodeSpline(doc, data, id, idSpline, typeobject, typeCreation);
doc->AddTool(id, spl);

View File

@ -17,7 +17,7 @@ VNodeSplinePath::VNodeSplinePath(VDomDocument *doc, VContainer *data, qint64 id,
VNodeSplinePath *VNodeSplinePath::Create(VDomDocument *doc, VContainer *data, qint64 id,
qint64 idSpline, Draw::Mode typeobject, Document::Enum parse,
Tool::Enum typeCreation){
VNodeSplinePath *splPath;
VNodeSplinePath *splPath = 0;
if(parse == Document::FullParse){
splPath = new VNodeSplinePath(doc, data, id, idSpline, typeobject, typeCreation);
doc->AddTool(id, splPath);

View File

@ -7,7 +7,7 @@ VDataTool::VDataTool(VContainer *data, QObject *parent) :
VDataTool::~VDataTool(){
}
const VDataTool &VDataTool::operator =(const VDataTool &tool){
VDataTool &VDataTool::operator =(const VDataTool &tool){
data = tool.getData();
return *this;
}

View File

@ -10,7 +10,7 @@ class VDataTool : public QObject
public:
explicit VDataTool(VContainer *data, QObject *parent = 0);
virtual ~VDataTool();
const VDataTool& operator= (const VDataTool &tool);
VDataTool& operator= (const VDataTool &tool);
VContainer getData() const;
void setData(const VContainer *value);

View File

@ -45,14 +45,8 @@
using a spin box widget.
*/
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Weffc++"
#pragma GCC diagnostic ignored "-Wconversion"
#pragma GCC diagnostic ignored "-Wsign-conversion"
#pragma GCC diagnostic ignored "-Wctor-dtor-privacy"
#include <QtGui>
#include "delegate.h"
#pragma GCC diagnostic pop
#include <QtGui>
#include "delegate.h"
SpinBoxDelegate::SpinBoxDelegate(QObject *parent)
: QItemDelegate(parent)

View File

@ -1,74 +0,0 @@
/****************************************************************************
**
** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal
**
** This file is part of the examples of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:BSD$
** You may use this file under the terms of the BSD license as follows:
**
** "Redistribution and use in source and binary forms, with or without
** modification, are permitted provided that the following conditions are
** met:
** * Redistributions of source code must retain the above copyright
** notice, this list of conditions and the following disclaimer.
** * Redistributions in binary form must reproduce the above copyright
** notice, this list of conditions and the following disclaimer in
** the documentation and/or other materials provided with the
** distribution.
** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names
** of its contributors may be used to endorse or promote products derived
** from this software without specific prior written permission.
**
**
** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
**
** $QT_END_LICENSE$
**
****************************************************************************/
#ifndef DELEGATE_H
#define DELEGATE_H
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Weffc++"
#pragma GCC diagnostic ignored "-Wconversion"
#pragma GCC diagnostic ignored "-Wsign-conversion"
#pragma GCC diagnostic ignored "-Wctor-dtor-privacy"
#include <QItemDelegate>
#include <QModelIndex>
#include <QObject>
#include <QSize>
#include <QSpinBox>
#pragma GCC diagnostic pop
class SpinBoxDelegate : public QItemDelegate
{
Q_OBJECT
public:
SpinBoxDelegate(QObject *parent = 0);
QWidget *createEditor(QWidget *parent, const QStyleOptionViewItem &option,
const QModelIndex &index) const;
void setEditorData(QWidget *editor, const QModelIndex &index) const;
void setModelData(QWidget *editor, QAbstractItemModel *model,
const QModelIndex &index) const;
void updateEditorGeometry(QWidget *editor,
const QStyleOptionViewItem &option, const QModelIndex &index) const;
};
#endif

View File

@ -45,14 +45,8 @@
using a spin box widget.
*/
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Weffc++"
#pragma GCC diagnostic ignored "-Wconversion"
#pragma GCC diagnostic ignored "-Wsign-conversion"
#pragma GCC diagnostic ignored "-Wctor-dtor-privacy"
#include <QtGui>
#include "doubledelegate.h"
#pragma GCC diagnostic pop
#include <QtGui>
#include "doubledelegate.h"
DoubleSpinBoxDelegate::DoubleSpinBoxDelegate(QObject *parent)
: QItemDelegate(parent)