Merge remote-tracking branch 'origin/4.11'

Conflicts:
	src/plugins/designer/codemodelhelpers.cpp

Change-Id: I78906f2fbbfd27d254589a272ebca423b0b80699
This commit is contained in:
Eike Ziller
2019-11-28 08:24:10 +01:00
125 changed files with 2380 additions and 881 deletions

View File

@@ -88,6 +88,8 @@ public:
Qt::ItemFlags flags(int column) const override;
bool setData(int column, const QVariant &, int role) override;
ProjectPanelFactory *factory() const { return m_factory; }
protected:
ProjectPanelFactory *m_factory = nullptr;
QPointer<Project> m_project;
@@ -285,6 +287,13 @@ public:
return activeItem ? activeItem->index() : QModelIndex();
}
TreeItem *itemForProjectPanel(Core::Id panelId)
{
return m_miscItem->findChildAtLevel(1, [panelId](const TreeItem *item){
return static_cast<const MiscSettingsPanelItem *>(item)->factory()->id() == panelId;
});
}
private:
int m_currentChildIndex = 0; // Start with Build & Run.
Project *m_project = nullptr;
@@ -509,6 +518,14 @@ public:
item->setData(0, QVariant(), ItemActivatedDirectlyRole);
}
void activateProjectPanel(Core::Id panelId)
{
if (ProjectItem *projectItem = m_projectsModel.rootItem()->childAt(0)) {
if (TreeItem *item = projectItem->itemForProjectPanel(panelId))
itemActivated(item->index());
}
}
void openContextMenu(const QPoint &pos)
{
QMenu menu;
@@ -618,6 +635,11 @@ ProjectWindow::ProjectWindow()
setContextMenuPolicy(Qt::CustomContextMenu);
}
void ProjectWindow::activateProjectPanel(Core::Id panelId)
{
d->activateProjectPanel(panelId);
}
ProjectWindow::~ProjectWindow() = default;
QSize SelectorDelegate::sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const