Commit 5a1a20f2 authored by Eike Ziller's avatar Eike Ziller

Merge remote-tracking branch 'origin/4.3' into 4.4

Change-Id: Ifb1dcc847ba4b32a79b349955fad5207e402cb7b
parents cdca4bd9 ada14295
......@@ -25,6 +25,8 @@
#include "layoutnodeinstance.h"
#include <QCoreApplication>
namespace QmlDesigner {
namespace Internal {
......
......@@ -28,6 +28,7 @@
#include <enumeration.h>
#include <qmlprivategate.h>
#include <QDebug>
#include <QEvent>
#include <QQmlContext>
#include <QQmlError>
......
......@@ -63,6 +63,7 @@ DEBUGGER_EXPORT void showCannotStartDialog(const QString &toolName);
// Register a tool for a given start mode.
DEBUGGER_EXPORT void registerPerspective(const QByteArray &perspectiveId, const Utils::Perspective *perspective);
DEBUGGER_EXPORT void setPerspectiveEnabled(const QByteArray &perspectiveId, bool enable);
DEBUGGER_EXPORT void registerToolbar(const QByteArray &perspectiveId, const Utils::ToolbarDescription &desc);
DEBUGGER_EXPORT void enableMainWindow(bool on);
......
......@@ -50,6 +50,7 @@
#include <QHBoxLayout>
#include <QMenu>
#include <QStackedWidget>
#include <QStandardItemModel>
#include <QToolButton>
using namespace Debugger;
......@@ -142,6 +143,16 @@ void DebuggerMainWindow::onModeChanged(Core::Id mode)
}
}
void DebuggerMainWindow::setPerspectiveEnabled(const QByteArray &perspectiveId, bool enabled)
{
const int index = m_perspectiveChooser->findData(perspectiveId);
QTC_ASSERT(index != -1, return);
auto model = qobject_cast<QStandardItemModel*>(m_perspectiveChooser->model());
QTC_ASSERT(model, return);
QStandardItem *item = model->item(index, 0);
item->setFlags(enabled ? item->flags() | Qt::ItemIsEnabled : item->flags() & ~Qt::ItemIsEnabled );
}
void DebuggerMainWindow::resetCurrentPerspective()
{
loadPerspectiveHelper(m_currentPerspectiveId, false);
......
......@@ -136,6 +136,8 @@ public:
void onModeChanged(Core::Id mode);
void setPerspectiveEnabled(const QByteArray &perspectiveId, bool enabled);
private:
QDockWidget *registerDockWidget(const QByteArray &dockId, QWidget *widget);
void loadPerspectiveHelper(const QByteArray &perspectiveId, bool fromStoredSettings = true);
......
......@@ -3569,6 +3569,11 @@ void registerPerspective(const QByteArray &perspectiveId, const Perspective *per
dd->m_mainWindow->registerPerspective(perspectiveId, perspective);
}
void setPerspectiveEnabled(const QByteArray &perspectiveId, bool enabled)
{
dd->m_mainWindow->setPerspectiveEnabled(perspectiveId, enabled);
}
void selectPerspective(const QByteArray &perspectiveId)
{
if (dd->m_mainWindow->currentPerspective() == perspectiveId)
......
......@@ -46,6 +46,7 @@ QtcPlugin {
cpp.defines: base.concat([
'QML_BUILD_STATIC_LIB',
'QBS_ENABLE_PROJECT_FILE_UPDATES', // TODO: Take from installed qbscore module
'QBS_INSTALL_DIR="'
+ (project.useExternalQbs
? FileInfo.fromWindowsSeparators(project.qbs_install_dir)
......
......@@ -125,12 +125,12 @@ void QmlJSOutlineWidget::setEditor(QmlJSEditorWidget *editor)
m_filterModel->setSourceModel(m_editor->qmlJsEditorDocument()->outlineModel());
m_treeView->expandAll();
connect(m_editor->qmlJsEditorDocument()->outlineModel(), &QAbstractItemModel::modelAboutToBeReset, [this]() {
if (m_treeView && m_treeView->selectionModel())
connect(m_editor->qmlJsEditorDocument()->outlineModel(), &QAbstractItemModel::modelAboutToBeReset, m_treeView, [this]() {
if (m_treeView->selectionModel())
m_treeView->selectionModel()->blockSignals(true);
});
connect(m_editor->qmlJsEditorDocument()->outlineModel(), &QAbstractItemModel::modelReset, [this]() {
if (m_treeView && m_treeView->selectionModel())
connect(m_editor->qmlJsEditorDocument()->outlineModel(), &QAbstractItemModel::modelReset, m_treeView, [this]() {
if (m_treeView->selectionModel())
m_treeView->selectionModel()->blockSignals(false);
});
......
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