dynamic_cast instead qobject_cast.
--HG-- branch : feature
This commit is contained in:
parent
92e0541b12
commit
6669a0a15a
|
@ -78,8 +78,8 @@ public:
|
|||
{
|
||||
throw VExceptionBadId(tr("Can't find object"), id);
|
||||
}
|
||||
//T obj = dynamic_cast<T>(gObj);
|
||||
T obj = qobject_cast<T>(gObj);
|
||||
T obj = dynamic_cast<T>(gObj);
|
||||
//T obj = qobject_cast<T>(gObj);
|
||||
Q_ASSERT(obj != 0);
|
||||
return obj;
|
||||
}
|
||||
|
|
|
@ -42,8 +42,7 @@ class QPainterPath;
|
|||
*/
|
||||
class VArc: public VGObject
|
||||
{
|
||||
Q_OBJECT
|
||||
//Q_DECLARE_TR_FUNCTIONS(VArc)
|
||||
Q_DECLARE_TR_FUNCTIONS(VArc)
|
||||
public:
|
||||
/**
|
||||
* @brief VArc конструктор по замовчуванню.
|
||||
|
|
|
@ -29,18 +29,18 @@
|
|||
#include "vdetail.h"
|
||||
|
||||
VDetail::VDetail()
|
||||
:QObject(), _id(0), nodes(QVector<VNodeDetail>()), name(QString()), mx(0), my(0), supplement(true), closed(true),
|
||||
:_id(0), nodes(QVector<VNodeDetail>()), name(QString()), mx(0), my(0), supplement(true), closed(true),
|
||||
width(10){}
|
||||
|
||||
VDetail::VDetail(const QString &name, const QVector<VNodeDetail> &nodes)
|
||||
:QObject(), _id(0), nodes(QVector<VNodeDetail>()), name(name), mx(0), my(0), supplement(true), closed(true),
|
||||
:_id(0), nodes(QVector<VNodeDetail>()), name(name), mx(0), my(0), supplement(true), closed(true),
|
||||
width(10)
|
||||
{
|
||||
this->nodes = nodes;
|
||||
}
|
||||
|
||||
VDetail::VDetail(const VDetail &detail)
|
||||
:QObject(), _id(0), nodes(detail.getNodes()), name(detail.getName()), mx(detail.getMx()), my(detail.getMy()),
|
||||
:_id(0), nodes(detail.getNodes()), name(detail.getName()), mx(detail.getMx()), my(detail.getMy()),
|
||||
supplement(detail.getSupplement()), closed(detail.getClosed()), width(detail.getWidth()){}
|
||||
|
||||
VDetail &VDetail::operator =(const VDetail &detail)
|
||||
|
|
|
@ -54,9 +54,8 @@ Q_DECLARE_OPERATORS_FOR_FLAGS(Detail::Equidistants)
|
|||
/**
|
||||
* @brief The VDetail class
|
||||
*/
|
||||
class VDetail :public QObject
|
||||
class VDetail
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
/**
|
||||
* @brief VDetail
|
||||
|
|
|
@ -29,17 +29,17 @@
|
|||
#include "vgobject.h"
|
||||
|
||||
VGObject::VGObject()
|
||||
:QObject(), _id(0), type(GObject::Point), idObject(0), _name(QString()), mode(Draw::Calculation)
|
||||
:_id(0), type(GObject::Point), idObject(0), _name(QString()), mode(Draw::Calculation)
|
||||
{
|
||||
}
|
||||
|
||||
VGObject::VGObject(const GObject::Type &type, const qint64 &idObject, const Draw::Draws &mode)
|
||||
:QObject(), _id(0), type(type), idObject(idObject), _name(QString()), mode(mode)
|
||||
:_id(0), type(type), idObject(idObject), _name(QString()), mode(mode)
|
||||
{
|
||||
}
|
||||
|
||||
VGObject::VGObject(const VGObject &obj)
|
||||
:QObject(), _id(obj.id()), type(obj.getType()), idObject(obj.getIdObject()), _name(obj.name()), mode(obj.getMode())
|
||||
:_id(obj.id()), type(obj.getType()), idObject(obj.getIdObject()), _name(obj.name()), mode(obj.getMode())
|
||||
{
|
||||
}
|
||||
|
||||
|
|
|
@ -45,9 +45,8 @@ namespace GObject
|
|||
}
|
||||
Q_DECLARE_OPERATORS_FOR_FLAGS(GObject::Types)
|
||||
|
||||
class VGObject :public QObject
|
||||
class VGObject
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
VGObject();
|
||||
VGObject(const GObject::Type &type, const qint64 &idObject = 0, const Draw::Draws &mode = Draw::Calculation);
|
||||
|
|
|
@ -39,7 +39,6 @@
|
|||
*/
|
||||
class VPointF:public VGObject
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
/**
|
||||
* @brief VPointF creat empty point
|
||||
|
|
|
@ -45,7 +45,6 @@ class QString;
|
|||
*/
|
||||
class VSpline :public VGObject
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
/**
|
||||
* @brief VSpline default constructor
|
||||
|
|
|
@ -51,8 +51,7 @@ Q_DECLARE_OPERATORS_FOR_FLAGS( SplinePoint::Positions )
|
|||
*/
|
||||
class VSplinePath :public VGObject
|
||||
{
|
||||
Q_OBJECT
|
||||
//Q_DECLARE_TR_FUNCTIONS(VSplinePath)
|
||||
Q_DECLARE_TR_FUNCTIONS(VSplinePath)
|
||||
public:
|
||||
/**
|
||||
* @brief VSplinePath конструктор по замовчуванню.
|
||||
|
|
Loading…
Reference in New Issue
Block a user