forked from qt-creator/qt-creator
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:
@@ -13,26 +13,18 @@
|
|||||||
#include <QCheckBox>
|
#include <QCheckBox>
|
||||||
#include <QHBoxLayout>
|
#include <QHBoxLayout>
|
||||||
#include <QLabel>
|
#include <QLabel>
|
||||||
#include <QPainter>
|
|
||||||
#include <QScrollArea>
|
#include <QScrollArea>
|
||||||
#include <QVBoxLayout>
|
#include <QVBoxLayout>
|
||||||
|
|
||||||
using namespace Utils;
|
using namespace Utils;
|
||||||
|
|
||||||
namespace ProjectExplorer {
|
namespace ProjectExplorer::Internal {
|
||||||
namespace {
|
|
||||||
|
|
||||||
const int ABOVE_HEADING_MARGIN = 10;
|
const int ABOVE_HEADING_MARGIN = 10;
|
||||||
const int CONTENTS_MARGIN = 5;
|
const int CONTENTS_MARGIN = 5;
|
||||||
const int BELOW_CONTENTS_MARGIN = 16;
|
const int BELOW_CONTENTS_MARGIN = 16;
|
||||||
|
|
||||||
}
|
PanelsWidget::PanelsWidget(bool addStretch)
|
||||||
|
|
||||||
///
|
|
||||||
// PanelsWidget
|
|
||||||
///
|
|
||||||
|
|
||||||
PanelsWidget::PanelsWidget(QWidget *parent, bool addStretch) : QWidget(parent)
|
|
||||||
{
|
{
|
||||||
m_root = new QWidget(nullptr);
|
m_root = new QWidget(nullptr);
|
||||||
m_root->setFocusPolicy(Qt::NoFocus);
|
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::PanelsWidget(const QString &displayName, QWidget *widget, bool addStretch)
|
||||||
: PanelsWidget(nullptr, addStretch)
|
: PanelsWidget(addStretch)
|
||||||
{
|
{
|
||||||
addPropertiesPanel(displayName);
|
addPropertiesPanel(displayName);
|
||||||
addWidget(widget);
|
addWidget(widget);
|
||||||
}
|
}
|
||||||
|
|
||||||
PanelsWidget::PanelsWidget(const QString &displayName, ProjectSettingsWidget *widget)
|
PanelsWidget::PanelsWidget(const QString &displayName, ProjectSettingsWidget *widget)
|
||||||
: PanelsWidget(nullptr, !widget->expanding())
|
: PanelsWidget(!widget->expanding())
|
||||||
{
|
{
|
||||||
addPropertiesPanel(displayName);
|
addPropertiesPanel(displayName);
|
||||||
addGlobalSettingsProperties(widget);
|
addGlobalSettingsProperties(widget);
|
||||||
@@ -156,4 +148,4 @@ void PanelsWidget::addGlobalSettingsProperties(ProjectSettingsWidget *widget)
|
|||||||
m_layout->addWidget(Layouting::createHr());
|
m_layout->addWidget(Layouting::createHr());
|
||||||
}
|
}
|
||||||
|
|
||||||
} // ProjectExplorer
|
} // ProjectExplorer::Internal
|
||||||
|
@@ -3,36 +3,32 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "projectexplorer_export.h"
|
|
||||||
#include "projectsettingswidget.h"
|
#include "projectsettingswidget.h"
|
||||||
|
|
||||||
#include <QWidget>
|
|
||||||
|
|
||||||
QT_BEGIN_NAMESPACE
|
QT_BEGIN_NAMESPACE
|
||||||
class QVBoxLayout;
|
class QVBoxLayout;
|
||||||
QT_END_NAMESPACE
|
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:
|
public:
|
||||||
explicit PanelsWidget(QWidget *parent = nullptr, bool addStretch = true);
|
|
||||||
PanelsWidget(const QString &displayName, QWidget *widget, bool addStretch = true);
|
PanelsWidget(const QString &displayName, QWidget *widget, bool addStretch = true);
|
||||||
PanelsWidget(const QString &displayName, ProjectSettingsWidget *widget);
|
PanelsWidget(const QString &displayName, ProjectSettingsWidget *widget);
|
||||||
~PanelsWidget() override;
|
~PanelsWidget() final;
|
||||||
|
|
||||||
void addPropertiesPanel(const QString &displayName);
|
|
||||||
void addGlobalSettingsProperties(ProjectSettingsWidget *widget);
|
|
||||||
void addWidget(QWidget *widget);
|
|
||||||
|
|
||||||
static int constexpr PanelVMargin = 14;
|
static int constexpr PanelVMargin = 14;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
void addPropertiesPanel(const QString &displayName);
|
||||||
|
void addGlobalSettingsProperties(ProjectSettingsWidget *widget);
|
||||||
|
void addWidget(QWidget *widget);
|
||||||
|
|
||||||
QVBoxLayout *m_layout;
|
QVBoxLayout *m_layout;
|
||||||
QWidget *m_root;
|
QWidget *m_root;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace ProjectExplorer
|
} // ProjectExplorer::Internal
|
||||||
|
Reference in New Issue
Block a user