Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

avoid a zillion of "ciitical ... QNSWindow ... active key-value observers" #11265

Merged
merged 1 commit into from
Feb 20, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 13 additions & 6 deletions src/widget/wwidgetgroup.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,8 @@ void WWidgetGroup::setup(const QDomNode& node, const SkinContext& context) {

QLayout* pLayout = nullptr;
QString layout;
bool layoutIsStacked = false;

if (context.hasNodeSelectString(node, "Layout", &layout)) {
if (layout == "vertical") {
pLayout = new QVBoxLayout();
Expand All @@ -129,12 +131,7 @@ void WWidgetGroup::setup(const QDomNode& node, const SkinContext& context) {
auto* pStackedLayout = new QStackedLayout();
pStackedLayout->setStackingMode(QStackedLayout::StackAll);
pLayout = pStackedLayout;
// Adding a zero-size dummy widget as index 0 here before
// any child is added in the xml template works around
// https://bugs.launchpad.net/mixxx/+bug/1627859
QWidget *dummyWidget = new QWidget();
dummyWidget->setFixedSize(0, 0);
pLayout->addWidget(dummyWidget);
layoutIsStacked = true;
}

// Set common layout parameters.
Expand All @@ -152,6 +149,16 @@ void WWidgetGroup::setup(const QDomNode& node, const SkinContext& context) {

if (pLayout) {
setLayout(pLayout);

if (layoutIsStacked) {
// Without this zero-sized dummy widget being added before
// any child widgets, the stacked layout would force-show
// the top item, i.e. ignore the state of its 'visible' connection.
// See https://github.com/mixxxdj/mixxx/issues/8655
QWidget* dummyWidget = new QWidget();
dummyWidget->setFixedSize(0, 0);
pLayout->addWidget(dummyWidget);
}
}
}

Expand Down