diff options
Diffstat (limited to 'src/modeling/qmodelingobject.cpp')
-rw-r--r-- | src/modeling/qmodelingobject.cpp | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/src/modeling/qmodelingobject.cpp b/src/modeling/qmodelingobject.cpp index 2ead4b37..231edf32 100644 --- a/src/modeling/qmodelingobject.cpp +++ b/src/modeling/qmodelingobject.cpp @@ -5,11 +5,9 @@ QModelingObjectPrivate::~QModelingObjectPrivate() { } -QModelingObject::QModelingObject(bool create_d_ptr) : - d_ptr(0) +QModelingObject::QModelingObject() : + d_ptr(new QModelingObjectPrivate) { - if (create_d_ptr) - set_d_ptr(new QModelingObjectPrivate); } QModelingObject::~QModelingObject() @@ -17,9 +15,12 @@ QModelingObject::~QModelingObject() delete d_ptr; } -void QModelingObject::set_d_ptr(QModelingObjectPrivate *d_ptr) +QObject *QModelingObject::asQObject() const +{ + return &d_ptr->object; +} + +QModelingObject::QModelingObject(QModelingObjectPrivate *dd) : + d_ptr(dd) { - Q_ASSERT_X(!this->d_ptr, "QModelingObject::set_d_ptr", "d_ptr already set !"); - this->d_ptr = d_ptr; - d_ptr->q_ptr = this; } |