Carlsberg
15th November 2012, 07:07
setContentsMargins() seems to not have any effect on QStackedLayout.
This code results in no margin:
mainLayout = new QStackedLayout(this);
mainLayout->setContentsMargins(20, 20, 20, 20);
mainLayout->addWidget(image);
mainLayout->addWidget(text);
mainLayout->setCurrentIndex(0);
while this has the correct 20 pixels margin
QVBoxLayout* mainLayout = new QVBoxLayout(this);
mainLayout->setContentsMargins(20, 20, 20, 20);
mainLayout->addWidget(image);
Any idea how I can have the margin on QStackedLayout?
Thanks
This code results in no margin:
mainLayout = new QStackedLayout(this);
mainLayout->setContentsMargins(20, 20, 20, 20);
mainLayout->addWidget(image);
mainLayout->addWidget(text);
mainLayout->setCurrentIndex(0);
while this has the correct 20 pixels margin
QVBoxLayout* mainLayout = new QVBoxLayout(this);
mainLayout->setContentsMargins(20, 20, 20, 20);
mainLayout->addWidget(image);
Any idea how I can have the margin on QStackedLayout?
Thanks