Compare the example and your code again. It looks like the problem is just what high_flyer points out. Your code says:
void createHorizontalGroupBox();
void createHorizontalGroupBox();
To copy to clipboard, switch view to plain text mode
while this is more like the example:
createHorizontalGroupBox();
createHorizontalGroupBox();
To copy to clipboard, switch view to plain text mode
Your code declares a new local method. It never defines it and never calls it. Without "void" you actually call the defined method, which creates "horizontalGroupBox", which allows
mainLayout->addWidget(horizontalGroupBox);
mainLayout->addWidget(horizontalGroupBox);
To copy to clipboard, switch view to plain text mode
to run with a good rather than NULL pointer.
Bookmarks