setContentsMargins() seems to not have any effect on QStackedLayout.
This code results in no margin:
mainLayout->setContentsMargins(20, 20, 20, 20);
mainLayout->addWidget(image);
mainLayout->addWidget(text);
mainLayout->setCurrentIndex(0);
mainLayout = new QStackedLayout(this);
mainLayout->setContentsMargins(20, 20, 20, 20);
mainLayout->addWidget(image);
mainLayout->addWidget(text);
mainLayout->setCurrentIndex(0);
To copy to clipboard, switch view to plain text mode
while this has the correct 20 pixels margin
mainLayout->setContentsMargins(20, 20, 20, 20);
mainLayout->addWidget(image);
QVBoxLayout* mainLayout = new QVBoxLayout(this);
mainLayout->setContentsMargins(20, 20, 20, 20);
mainLayout->addWidget(image);
To copy to clipboard, switch view to plain text mode
Any idea how I can have the margin on QStackedLayout?
Thanks
Bookmarks