Hello all...
I have a dialog whose default size i have set [to some desired value]. After that, i want its resizing disabled. Could anyone please tell how to do that?
Here is a part of the code:
mainLayout->addWidget(headerLabel);
mainLayout->addWidget(onoffGbx());
.....
mainLayout->addStretch();
mainLayout->addLayout(buttonLayout);
resize(380, 420); //here i have fixed the size. i want it to remain the same throughout.
//mainLayout->setSizeConstraint(QLayout::SetFixedSize);
setLayout(mainLayout);
setWindowTitle("Testbed settings");
QVBoxLayout *mainLayout = new QVBoxLayout;
mainLayout->addWidget(headerLabel);
mainLayout->addWidget(onoffGbx());
.....
mainLayout->addStretch();
mainLayout->addLayout(buttonLayout);
resize(380, 420); //here i have fixed the size. i want it to remain the same throughout.
//mainLayout->setSizeConstraint(QLayout::SetFixedSize);
setLayout(mainLayout);
setWindowTitle("Testbed settings");
To copy to clipboard, switch view to plain text mode
I tried mainLayout->setSizeConstraint(QLayout::SetFixedSize); but its changing the size to some default value of its own.
Also, by using mainLayout->addStretch(); can we fix the value of space[gap]? i saw mainLayout->addStretch(1); somewhere in the examples. Whats the significance of '1' there?
Thank you.
Bookmarks