[Qt-interest] Don't understand QWidget::QWidget(QWidget *parent, Qt::WindowFlags f) : QObject(*new QWidgetPrivate, 0)

Kustaa Nyholm Kustaa.Nyholm at planmeca.com
Thu Jul 1 15:40:19 CEST 2010


This is going to expose my ignorance but I don't follow this
from QWidget.cpp:


In the constructor of QWidget

QWidget::QWidget(QWidget *parent, Qt::WindowFlags f) : QObject(*new
QWidgetPrivate, 0)

Several things I don't understand here. QObject only has one constructor
that takes one argument so how the base class QObject is initialized with
two arguments? And why is parent not passed there? And why the derefenring
of the new QWidgetPrivate?

Is this some C++ syntax mystery that I'm no awera of or what....?

br Kusti
 





More information about the Qt-interest-old mailing list