forked from qt-creator/qt-creator
AdvancedDockingSystem: Add context objects into connections
Change-Id: I564b9ffe6c7809a6d50a172062c52558f3023fc1 Reviewed-by: Henning Gründl <henning.gruendl@qt.io>
This commit is contained in:
@@ -222,7 +222,7 @@ namespace ADS
|
|||||||
floatingWidget = floatingDockContainer = new FloatingDockContainer(m_dockArea);
|
floatingWidget = floatingDockContainer = new FloatingDockContainer(m_dockArea);
|
||||||
} else {
|
} else {
|
||||||
auto w = new FloatingDragPreview(m_dockArea);
|
auto w = new FloatingDragPreview(m_dockArea);
|
||||||
QObject::connect(w, &FloatingDragPreview::draggingCanceled, [=]() {
|
QObject::connect(w, &FloatingDragPreview::draggingCanceled, q, [this] {
|
||||||
m_dragState = DraggingInactive;
|
m_dragState = DraggingInactive;
|
||||||
});
|
});
|
||||||
floatingWidget = w;
|
floatingWidget = w;
|
||||||
|
@@ -74,7 +74,7 @@ WorkspaceNameInputDialog::WorkspaceNameInputDialog(DockManager *manager, QWidget
|
|||||||
m_okButton = buttons->button(QDialogButtonBox::Ok);
|
m_okButton = buttons->button(QDialogButtonBox::Ok);
|
||||||
m_switchToButton = new QPushButton;
|
m_switchToButton = new QPushButton;
|
||||||
buttons->addButton(m_switchToButton, QDialogButtonBox::AcceptRole);
|
buttons->addButton(m_switchToButton, QDialogButtonBox::AcceptRole);
|
||||||
connect(m_switchToButton, &QPushButton::clicked, [this]() { m_usedSwitchTo = true; });
|
connect(m_switchToButton, &QPushButton::clicked, this, [this] { m_usedSwitchTo = true; });
|
||||||
connect(buttons, &QDialogButtonBox::accepted, this, &QDialog::accept);
|
connect(buttons, &QDialogButtonBox::accepted, this, &QDialog::accept);
|
||||||
connect(buttons, &QDialogButtonBox::rejected, this, &QDialog::reject);
|
connect(buttons, &QDialogButtonBox::rejected, this, &QDialog::reject);
|
||||||
|
|
||||||
|
@@ -60,25 +60,19 @@ WorkspaceView::WorkspaceView(DockManager *manager, QWidget *parent)
|
|||||||
m_workspaceModel.index(0, m_workspaceModel.columnCount() - 1));
|
m_workspaceModel.index(0, m_workspaceModel.columnCount() - 1));
|
||||||
selectionModel()->select(firstRow, QItemSelectionModel::QItemSelectionModel::SelectCurrent);
|
selectionModel()->select(firstRow, QItemSelectionModel::QItemSelectionModel::SelectCurrent);
|
||||||
|
|
||||||
connect(this, &Utils::TreeView::activated, [this](const QModelIndex &index) {
|
connect(this, &Utils::TreeView::activated, this, [this](const QModelIndex &index) {
|
||||||
emit workspaceActivated(m_workspaceModel.workspaceAt(index.row()));
|
emit workspaceActivated(m_workspaceModel.workspaceAt(index.row()));
|
||||||
});
|
});
|
||||||
connect(selectionModel(), &QItemSelectionModel::selectionChanged, [this] {
|
connect(selectionModel(), &QItemSelectionModel::selectionChanged, this, [this] {
|
||||||
emit workspacesSelected(selectedWorkspaces());
|
emit workspacesSelected(selectedWorkspaces());
|
||||||
});
|
});
|
||||||
|
|
||||||
connect(&m_workspaceModel,
|
connect(&m_workspaceModel, &WorkspaceModel::workspaceSwitched,
|
||||||
&WorkspaceModel::workspaceSwitched,
|
this, &WorkspaceView::workspaceSwitched);
|
||||||
this,
|
connect(&m_workspaceModel, &WorkspaceModel::modelReset,
|
||||||
&WorkspaceView::workspaceSwitched);
|
this, &WorkspaceView::selectActiveWorkspace);
|
||||||
connect(&m_workspaceModel,
|
connect(&m_workspaceModel, &WorkspaceModel::workspaceCreated,
|
||||||
&WorkspaceModel::modelReset,
|
this, &WorkspaceView::selectWorkspace);
|
||||||
this,
|
|
||||||
&WorkspaceView::selectActiveWorkspace);
|
|
||||||
connect(&m_workspaceModel,
|
|
||||||
&WorkspaceModel::workspaceCreated,
|
|
||||||
this,
|
|
||||||
&WorkspaceView::selectWorkspace);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void WorkspaceView::createNewWorkspace()
|
void WorkspaceView::createNewWorkspace()
|
||||||
|
Reference in New Issue
Block a user