I used scrollArea widget before, that time i created it in designer and to add the widgets into it i did as below
ui->scrollAreaWidgetContents->layout()->addWidget(checkbox);
ui->scrollAreaWidgetContents->layout()->addWidget(ComboOperator);
ui->scrollAreaWidgetContents->layout()->addWidget(checkbox);
ui->scrollAreaWidgetContents->layout()->addWidget(ComboOperator);
To copy to clipboard, switch view to plain text mode
But now i wanted to create one more scroll area programattically(without designer)
I declared as below...
sarea->layout()->addWidget(checkbox);
sarea->layout()->addWidget(ComboOperator);
QScrollArea *sarea=new QScrollArea;
sarea->layout()->addWidget(checkbox);
sarea->layout()->addWidget(ComboOperator);
To copy to clipboard, switch view to plain text mode
And when i tried to put inside it, program was crashing.
Here i didnt get option to use scrollAreaWidgetContents, as it was available in designer....
Please tell me what wrong here...
Bookmarks