mirror of
https://invent.kde.org/system/dolphin
synced 2024-10-28 03:21:56 +00:00
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.
This commit is contained in:
parent
1344641775
commit
1d64b9bb10
|
@ -416,8 +416,12 @@ void DolphinSearchBox::init()
|
||||||
m_facetsWidget->layout()->setSpacing(Dolphin::LAYOUT_SPACING_SMALL);
|
m_facetsWidget->layout()->setSpacing(Dolphin::LAYOUT_SPACING_SMALL);
|
||||||
connect(m_facetsWidget, &DolphinFacetsWidget::facetChanged, this, &DolphinSearchBox::slotFacetChanged);
|
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
|
// Apply layout for the options
|
||||||
QHBoxLayout* optionsLayout = new QHBoxLayout();
|
QHBoxLayout* optionsLayout = new QHBoxLayout(optionsContainer);
|
||||||
optionsLayout->setContentsMargins(0, 0, 0, 0);
|
optionsLayout->setContentsMargins(0, 0, 0, 0);
|
||||||
optionsLayout->setSpacing(Dolphin::LAYOUT_SPACING_SMALL);
|
optionsLayout->setSpacing(Dolphin::LAYOUT_SPACING_SMALL);
|
||||||
optionsLayout->addWidget(m_fileNameButton);
|
optionsLayout->addWidget(m_fileNameButton);
|
||||||
|
@ -429,11 +433,6 @@ void DolphinSearchBox::init()
|
||||||
optionsLayout->addWidget(moreSearchToolsButton);
|
optionsLayout->addWidget(moreSearchToolsButton);
|
||||||
optionsLayout->addStretch(1);
|
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 = new QScrollArea(this);
|
||||||
m_optionsScrollArea->setFrameShape(QFrame::NoFrame);
|
m_optionsScrollArea->setFrameShape(QFrame::NoFrame);
|
||||||
m_optionsScrollArea->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
|
m_optionsScrollArea->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
|
||||||
|
|
|
@ -38,7 +38,6 @@ ConfigurePreviewPluginDialog::ConfigurePreviewPluginDialog(const QString& plugin
|
||||||
setMinimumWidth(400);
|
setMinimumWidth(400);
|
||||||
|
|
||||||
auto layout = new QVBoxLayout(this);
|
auto layout = new QVBoxLayout(this);
|
||||||
setLayout(layout);
|
|
||||||
|
|
||||||
if (previewPlugin) {
|
if (previewPlugin) {
|
||||||
auto configurationWidget = previewPlugin->createConfigurationWidget();
|
auto configurationWidget = previewPlugin->createConfigurationWidget();
|
||||||
|
|
|
@ -64,7 +64,6 @@ ViewPropertiesDialog::ViewPropertiesDialog(DolphinView* dolphinView) :
|
||||||
auto layout = new QFormLayout(this);
|
auto layout = new QFormLayout(this);
|
||||||
// Otherwise the dialog won't resize when we collapse the KCollapsibleGroupBox.
|
// Otherwise the dialog won't resize when we collapse the KCollapsibleGroupBox.
|
||||||
layout->setSizeConstraint(QLayout::SetFixedSize);
|
layout->setSizeConstraint(QLayout::SetFixedSize);
|
||||||
setLayout(layout);
|
|
||||||
|
|
||||||
// create 'Properties' group containing view mode, sorting, sort order and show hidden files
|
// create 'Properties' group containing view mode, sorting, sort order and show hidden files
|
||||||
m_viewMode = new QComboBox();
|
m_viewMode = new QComboBox();
|
||||||
|
@ -89,7 +88,7 @@ ViewPropertiesDialog::ViewPropertiesDialog(DolphinView* dolphinView) :
|
||||||
|
|
||||||
auto additionalInfoBox = new KCollapsibleGroupBox();
|
auto additionalInfoBox = new KCollapsibleGroupBox();
|
||||||
additionalInfoBox->setTitle(i18nc("@title:group", "Additional Information"));
|
additionalInfoBox->setTitle(i18nc("@title:group", "Additional Information"));
|
||||||
auto innerLayout = new QVBoxLayout();
|
auto innerLayout = new QVBoxLayout(additionalInfoBox);
|
||||||
|
|
||||||
{
|
{
|
||||||
QList<QByteArray> visibleRoles = m_viewProps->visibleRoles();
|
QList<QByteArray> visibleRoles = m_viewProps->visibleRoles();
|
||||||
|
@ -133,8 +132,6 @@ ViewPropertiesDialog::ViewPropertiesDialog(DolphinView* dolphinView) :
|
||||||
innerLayout->addWidget(m_listWidget);
|
innerLayout->addWidget(m_listWidget);
|
||||||
}
|
}
|
||||||
|
|
||||||
additionalInfoBox->setLayout(innerLayout);
|
|
||||||
|
|
||||||
QHBoxLayout* sortingLayout = new QHBoxLayout();
|
QHBoxLayout* sortingLayout = new QHBoxLayout();
|
||||||
sortingLayout->setContentsMargins(0, 0, 0, 0);
|
sortingLayout->setContentsMargins(0, 0, 0, 0);
|
||||||
sortingLayout->addWidget(m_sortOrder);
|
sortingLayout->addWidget(m_sortOrder);
|
||||||
|
|
|
@ -44,7 +44,6 @@ ViewPropsProgressInfo::ViewPropsProgressInfo(QWidget* parent,
|
||||||
m_viewProps->setAutoSaveEnabled(false);
|
m_viewProps->setAutoSaveEnabled(false);
|
||||||
|
|
||||||
auto layout = new QVBoxLayout(this);
|
auto layout = new QVBoxLayout(this);
|
||||||
setLayout(layout);
|
|
||||||
|
|
||||||
m_label = new QLabel(i18nc("@info:progress", "Counting folders: %1", 0), this);
|
m_label = new QLabel(i18nc("@info:progress", "Counting folders: %1", 0), this);
|
||||||
layout->addWidget(m_label);
|
layout->addWidget(m_label);
|
||||||
|
|
|
@ -140,9 +140,8 @@ DolphinView::DolphinView(const QUrl& url, QWidget* parent) :
|
||||||
m_placeholderLabel->setGraphicsEffect(effect);
|
m_placeholderLabel->setGraphicsEffect(effect);
|
||||||
// Set initial text and visibility
|
// Set initial text and visibility
|
||||||
updatePlaceholderLabel();
|
updatePlaceholderLabel();
|
||||||
// Add a new layout to hold it and put it in the layout
|
|
||||||
auto *centeringLayout = new QVBoxLayout(this);
|
auto *centeringLayout = new QVBoxLayout(m_container);
|
||||||
m_container->setLayout(centeringLayout);
|
|
||||||
centeringLayout->addWidget(m_placeholderLabel);
|
centeringLayout->addWidget(m_placeholderLabel);
|
||||||
centeringLayout->setAlignment(m_placeholderLabel, Qt::AlignCenter);
|
centeringLayout->setAlignment(m_placeholderLabel, Qt::AlignCenter);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue