ProjectExplorer: Un-export PanelsWidget

... and restrict interface to what is used.

Change-Id: Ifbcfcbdcaf5b777ca870a8605dd00039715ca620
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
hjk
2024-12-02 18:02:49 +01:00
parent 4585c8ab8b
commit 743709f31e
2 changed files with 14 additions and 26 deletions

View File

@@ -13,26 +13,18 @@
#include <QCheckBox>
#include <QHBoxLayout>
#include <QLabel>
#include <QPainter>
#include <QScrollArea>
#include <QVBoxLayout>
using namespace Utils;
namespace ProjectExplorer {
namespace {
namespace ProjectExplorer::Internal {
const int ABOVE_HEADING_MARGIN = 10;
const int CONTENTS_MARGIN = 5;
const int BELOW_CONTENTS_MARGIN = 16;
}
///
// PanelsWidget
///
PanelsWidget::PanelsWidget(QWidget *parent, bool addStretch) : QWidget(parent)
PanelsWidget::PanelsWidget(bool addStretch)
{
m_root = new QWidget(nullptr);
m_root->setFocusPolicy(Qt::NoFocus);
@@ -66,14 +58,14 @@ PanelsWidget::PanelsWidget(QWidget *parent, bool addStretch) : QWidget(parent)
}
PanelsWidget::PanelsWidget(const QString &displayName, QWidget *widget, bool addStretch)
: PanelsWidget(nullptr, addStretch)
: PanelsWidget(addStretch)
{
addPropertiesPanel(displayName);
addWidget(widget);
}
PanelsWidget::PanelsWidget(const QString &displayName, ProjectSettingsWidget *widget)
: PanelsWidget(nullptr, !widget->expanding())
: PanelsWidget(!widget->expanding())
{
addPropertiesPanel(displayName);
addGlobalSettingsProperties(widget);
@@ -156,4 +148,4 @@ void PanelsWidget::addGlobalSettingsProperties(ProjectSettingsWidget *widget)
m_layout->addWidget(Layouting::createHr());
}
} // ProjectExplorer
} // ProjectExplorer::Internal

View File

@@ -3,36 +3,32 @@
#pragma once
#include "projectexplorer_export.h"
#include "projectsettingswidget.h"
#include <QWidget>
QT_BEGIN_NAMESPACE
class QVBoxLayout;
QT_END_NAMESPACE
namespace ProjectExplorer {
namespace ProjectExplorer::Internal {
class PROJECTEXPLORER_EXPORT PanelsWidget : public QWidget
class PanelsWidget final : public QWidget
{
Q_OBJECT
explicit PanelsWidget(bool addStretch);
public:
explicit PanelsWidget(QWidget *parent = nullptr, bool addStretch = true);
PanelsWidget(const QString &displayName, QWidget *widget, bool addStretch = true);
PanelsWidget(const QString &displayName, ProjectSettingsWidget *widget);
~PanelsWidget() override;
void addPropertiesPanel(const QString &displayName);
void addGlobalSettingsProperties(ProjectSettingsWidget *widget);
void addWidget(QWidget *widget);
~PanelsWidget() final;
static int constexpr PanelVMargin = 14;
private:
void addPropertiesPanel(const QString &displayName);
void addGlobalSettingsProperties(ProjectSettingsWidget *widget);
void addWidget(QWidget *widget);
QVBoxLayout *m_layout;
QWidget *m_root;
};
} // namespace ProjectExplorer
} // ProjectExplorer::Internal