summaryrefslogtreecommitdiffstats
path: root/src/gui/doc/snippets/separations/screenwidget.cpp
diff options
context:
space:
mode:
authorAhmad Samir <[email protected]>2020-11-10 20:30:49 +0200
committerAhmad Samir <[email protected]>2022-10-21 00:57:24 +0200
commitd60aa6a8cf8b020c2ae8e6a8bb45311acce8cab9 (patch)
tree408efaaa372dcddf057e7d89e60730a985956e84 /src/gui/doc/snippets/separations/screenwidget.cpp
parent77eef3291782c967f17d703ca6a00477f7a76b11 (diff)
Layouts docs: pass parent widget in the ctor
This is a follow up from commit 1e904ab342c1aaa; changing more documentation to pass a widget * in the ctor of a layout, rather than creating a parent-less layout then calling setLayout(). Change-Id: I4fc59c6cfa46ccd279a153acd67335a6daf22ff9 Reviewed-by: Jan Arve Sæther <[email protected]>
Diffstat (limited to 'src/gui/doc/snippets/separations/screenwidget.cpp')
-rw-r--r--src/gui/doc/snippets/separations/screenwidget.cpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/gui/doc/snippets/separations/screenwidget.cpp b/src/gui/doc/snippets/separations/screenwidget.cpp
index 87a6c9e605b..223de95962b 100644
--- a/src/gui/doc/snippets/separations/screenwidget.cpp
+++ b/src/gui/doc/snippets/separations/screenwidget.cpp
@@ -61,12 +61,11 @@ ScreenWidget::ScreenWidget(QWidget *parent, QColor initialColor,
connect(colorButton, &QPushButton::clicked, this, &ScreenWidget::setColor);
connect(invertButton, &QPushButton::clicked, this, &ScreenWidget::invertImage);
- QGridLayout *gridLayout = new QGridLayout;
+ QGridLayout *gridLayout = new QGridLayout(this);
gridLayout->addWidget(imageLabel, 0, 0, 1, 2);
gridLayout->addWidget(nameLabel, 1, 0);
gridLayout->addWidget(colorButton, 1, 1);
gridLayout->addWidget(invertButton, 2, 1, 1, 1);
- setLayout(gridLayout);
}
/*!