Commit b83837de authored by hjk's avatar hjk
Browse files

ProjectWindow: Some code cosmetics



Mainly remove unneeded stuff from the header. No functional changes,

Change-Id: I1dfcc97a0aeeca46a3b8891a97a805efea6cb349
Reviewed-by: Tobias Hunger's avatarTobias Hunger <tobias.hunger@qt.io>
parent 6526e28b
......@@ -478,7 +478,7 @@ ProjectWindow::ProjectWindow()
{
setBackgroundRole(QPalette::Base);
m_selectorModel = new SelectorModel(this, [this](QWidget *panel) { setPanel(panel); });
auto selectorModel = new SelectorModel(this, [this](QWidget *panel) { setPanel(panel); });
auto styledBar = new StyledBar; // The black blob on top of the side bar
styledBar->setObjectName("ProjectModeStyledBar");
......@@ -491,16 +491,16 @@ ProjectWindow::ProjectWindow()
auto innerLayout = new QVBoxLayout;
innerLayout->setSpacing(10);
innerLayout->setContentsMargins(14, innerLayout->spacing(), 14, 0);
innerLayout->addWidget(m_selectorModel->m_projectSelection);
innerLayout->addWidget(m_selectorModel->m_selectorTree);
innerLayout->addWidget(selectorModel->m_projectSelection);
innerLayout->addWidget(selectorModel->m_selectorTree);
auto selectorLayout = new QVBoxLayout(selectorView);
selectorLayout->setContentsMargins(0, 0, 0, 0);
selectorLayout->addWidget(styledBar);
selectorLayout->addLayout(innerLayout);
m_selectorDock = addDockForWidget(selectorView, true);
addDockWidget(Qt::LeftDockWidgetArea, m_selectorDock);
auto selectorDock = addDockForWidget(selectorView, true);
addDockWidget(Qt::LeftDockWidgetArea, selectorDock);
}
void ProjectWindow::contextMenuEvent(QContextMenuEvent *event)
......@@ -550,6 +550,5 @@ void SelectorDelegate::paint(QPainter *painter, const QStyleOptionViewItem &opti
QStyledItemDelegate::paint(painter, opt, index);
}
} // namespace Internal
} // namespace ProjectExplorer
......@@ -27,26 +27,11 @@
#include "projectexplorer_export.h"
#include <QPointer>
#include <QWidget>
#include <utils/fancymainwindow.h>
QT_BEGIN_NAMESPACE
class QComboBox;
QT_END_NAMESPACE
namespace ProjectExplorer {
class Project;
class Target;
namespace Internal {
class SelectorModel;
class SelectorTree;
class ProjectItem;
enum {
ContextMenuItemAdderRole // To augment a context menu, data has a QMenu*
= Qt::UserRole + 1,
......@@ -70,11 +55,7 @@ public:
private:
void contextMenuEvent(QContextMenuEvent *event) override;
void openContextMenu(const QPoint &pos);
void setPanel(QWidget *panel);
SelectorModel *m_selectorModel;
QDockWidget *m_selectorDock;
};
} // namespace Internal
......
......@@ -32,6 +32,9 @@
#include <QCoreApplication>
namespace ProjectExplorer {
class Target;
namespace Internal {
class TargetItem;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment