diff options
| author | Ahmad Samir <[email protected]> | 2020-12-03 20:06:11 +0200 |
|---|---|---|
| committer | Ahmad Samir <[email protected]> | 2020-12-03 19:50:04 +0000 |
| commit | 1d64b9bb10e90a0c6a1053a3a41614caf0e0f8e4 (patch) | |
| tree | 604d650c815330b50d1193c65f82a6777ad7c3ed /src/search | |
| parent | 134464177513cba0bb5e2f64875688f70e9a622b (diff) | |
DolphinView: set the parent of layout in the ctor
This silences a runtime warning:
QLayout: Attempting to add QLayout "" to DolphinView "", which already
has a layout
Remove redudant setLayout() calls, passing a parent widget to the
Q*BoxLayout ctor sets that layout as the top-level layout for that widget.
Diffstat (limited to 'src/search')
| -rw-r--r-- | src/search/dolphinsearchbox.cpp | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/src/search/dolphinsearchbox.cpp b/src/search/dolphinsearchbox.cpp index 16f12b989..9143ddcb7 100644 --- a/src/search/dolphinsearchbox.cpp +++ b/src/search/dolphinsearchbox.cpp @@ -416,8 +416,12 @@ void DolphinSearchBox::init() m_facetsWidget->layout()->setSpacing(Dolphin::LAYOUT_SPACING_SMALL); connect(m_facetsWidget, &DolphinFacetsWidget::facetChanged, this, &DolphinSearchBox::slotFacetChanged); + // Put the options into a QScrollArea. This prevents increasing the view width + // in case that not enough width for the options is available. + QWidget* optionsContainer = new QWidget(this); + // Apply layout for the options - QHBoxLayout* optionsLayout = new QHBoxLayout(); + QHBoxLayout* optionsLayout = new QHBoxLayout(optionsContainer); optionsLayout->setContentsMargins(0, 0, 0, 0); optionsLayout->setSpacing(Dolphin::LAYOUT_SPACING_SMALL); optionsLayout->addWidget(m_fileNameButton); @@ -429,11 +433,6 @@ void DolphinSearchBox::init() optionsLayout->addWidget(moreSearchToolsButton); optionsLayout->addStretch(1); - // Put the options into a QScrollArea. This prevents increasing the view width - // in case that not enough width for the options is available. - QWidget* optionsContainer = new QWidget(this); - optionsContainer->setLayout(optionsLayout); - m_optionsScrollArea = new QScrollArea(this); m_optionsScrollArea->setFrameShape(QFrame::NoFrame); m_optionsScrollArea->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff); |
