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);
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);
setMinimumWidth(400);
auto layout = new QVBoxLayout(this);
- setLayout(layout);
if (previewPlugin) {
auto configurationWidget = previewPlugin->createConfigurationWidget();
auto layout = new QFormLayout(this);
// Otherwise the dialog won't resize when we collapse the KCollapsibleGroupBox.
layout->setSizeConstraint(QLayout::SetFixedSize);
- setLayout(layout);
// create 'Properties' group containing view mode, sorting, sort order and show hidden files
m_viewMode = new QComboBox();
auto additionalInfoBox = new KCollapsibleGroupBox();
additionalInfoBox->setTitle(i18nc("@title:group", "Additional Information"));
- auto innerLayout = new QVBoxLayout();
+ auto innerLayout = new QVBoxLayout(additionalInfoBox);
{
QList<QByteArray> visibleRoles = m_viewProps->visibleRoles();
innerLayout->addWidget(m_listWidget);
}
- additionalInfoBox->setLayout(innerLayout);
-
QHBoxLayout* sortingLayout = new QHBoxLayout();
sortingLayout->setContentsMargins(0, 0, 0, 0);
sortingLayout->addWidget(m_sortOrder);
m_viewProps->setAutoSaveEnabled(false);
auto layout = new QVBoxLayout(this);
- setLayout(layout);
m_label = new QLabel(i18nc("@info:progress", "Counting folders: %1", 0), this);
layout->addWidget(m_label);
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);