forked from qt-creator/qt-creator
DAP: Set last chosen preset
Set last activated item in ModelChooser when the debugging is ended. It sets the last chosen preset in debuger menu. It is needed for DAP debugger because it has several presets. Note: Logic should be improved or DAP debugger presets should be combined in one. Change-Id: I043d2fe17ec847db287ee246e1fb4455b3b6d727 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
@@ -143,6 +143,11 @@ public:
|
|||||||
connect(m_engineChooser, &QComboBox::activated, this, [this](int index) {
|
connect(m_engineChooser, &QComboBox::activated, this, [this](int index) {
|
||||||
QModelIndex sourceIndex = m_proxyModel->mapToSource(m_proxyModel->index(index, 0));
|
QModelIndex sourceIndex = m_proxyModel->mapToSource(m_proxyModel->index(index, 0));
|
||||||
emit activated(sourceIndex.row());
|
emit activated(sourceIndex.row());
|
||||||
|
m_lastActivatedIndex = sourceIndex.row();
|
||||||
|
});
|
||||||
|
|
||||||
|
connect(m_proxyModel, &QAbstractItemModel::rowsRemoved, this, [this] {
|
||||||
|
setCurrentIndex(m_lastActivatedIndex);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -188,6 +193,7 @@ private:
|
|||||||
QPointer<EngineTypeFilterProxyModel> m_proxyModel;
|
QPointer<EngineTypeFilterProxyModel> m_proxyModel;
|
||||||
QAbstractItemModel *m_sourceModel;
|
QAbstractItemModel *m_sourceModel;
|
||||||
QString m_enginType;
|
QString m_enginType;
|
||||||
|
int m_lastActivatedIndex = -1;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct PerspectiveItem
|
struct PerspectiveItem
|
||||||
|
Reference in New Issue
Block a user