Skip to content

Commit b26cf40

Browse files
fix: remove duplicate layout parent in SidePanelWidget (flameshot-org#4578)
The widget's layout is set in the member initializer list (line 25) via m_layout(new QVBoxLayout(this)). Passing 'this' to the QHBoxLayout constructor at line 84 tries to set a second layout on the same widget, which Qt rejects with a warning on every capture: QLayout: Attempting to add QLayout "" to SidePanelWidget "", which already has a layout The parent argument is unnecessary since the layout is added to m_layout via addLayout() at line 94. Co-authored-by: Benigno Batista Júnior <benigno@opus-software.com.br>
1 parent eebcc1c commit b26cf40

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/widgets/panel/sidepanelwidget.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ SidePanelWidget::SidePanelWidget(QPixmap* p, QWidget* parent)
8181
m_layout->addWidget(m_colorWheel);
8282
m_layout->addWidget(m_colorHex);
8383

84-
QHBoxLayout* gridHBoxLayout = new QHBoxLayout(this);
84+
QHBoxLayout* gridHBoxLayout = new QHBoxLayout();
8585
m_gridCheck = new QCheckBox(tr("Display grid"), this);
8686
m_gridSizeSpin = new QSpinBox(this);
8787
m_gridSizeSpin->setRange(5, 50);

0 commit comments

Comments
 (0)