PDA

View Full Version : question about constructor initializers from qt's example



FS Lover
31st May 2009, 16:51
As you probably know, qt installation has some good extensive examples within.
I am reading them from the beginning.
and again I have a question about the code of the Tree Model Completer example.
that example has a MainWindow class that has the following private properties:


QTreeView *treeView;
QComboBox *caseCombo;
QComboBox *modeCombo;
QLabel *contentsLabel;
TreeModelCompleter *completer;
QLineEdit *lineEdit;

and MainWindow's constructor implementation is:


MainWindow::MainWindow(QWidget *parent)
: QMainWindow(parent), completer(0), lineEdit(0)
{
...
}

I removed the constructor's body. it's long and you can check it yourself in your installation.

as you see, only 'completer' and 'lineEdit' member variables are initialized in the constructor initializing section.
my question is, why are only these two variables initialized this way and not any other variables?