From 1d64b9bb10e90a0c6a1053a3a41614caf0e0f8e4 Mon Sep 17 00:00:00 2001 From: Ahmad Samir Date: Thu, 3 Dec 2020 20:06:11 +0200 Subject: 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. --- src/views/dolphinview.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'src/views/dolphinview.cpp') diff --git a/src/views/dolphinview.cpp b/src/views/dolphinview.cpp index ef346b3e4..71c16bf46 100644 --- a/src/views/dolphinview.cpp +++ b/src/views/dolphinview.cpp @@ -140,9 +140,8 @@ DolphinView::DolphinView(const QUrl& url, QWidget* parent) : m_placeholderLabel->setGraphicsEffect(effect); // Set initial text and visibility updatePlaceholderLabel(); - // Add a new layout to hold it and put it in the layout - auto *centeringLayout = new QVBoxLayout(this); - m_container->setLayout(centeringLayout); + + auto *centeringLayout = new QVBoxLayout(m_container); centeringLayout->addWidget(m_placeholderLabel); centeringLayout->setAlignment(m_placeholderLabel, Qt::AlignCenter); -- cgit v1.3