forked from qt-creator/qt-creator
fix: [session] The default
session can be deleted and renamed
When opening the session manager for the first time, the default session can be deleted and renamed. The default session is selected during construction, and the active session is selected in the showEvent. If the active session is the default session, the selectionChanged signal won't be triggered, which leads to the default session being able to be deleted and renamed. Change-Id: I2186d02e93bcd3243f3ccf76645c19224f3d32db Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
@@ -50,11 +50,6 @@ SessionView::SessionView(QWidget *parent)
|
||||
// Ensure that the full session name is visible.
|
||||
header()->setSectionResizeMode(0, QHeaderView::ResizeToContents);
|
||||
|
||||
QItemSelection firstRow(m_sessionModel.index(0,0), m_sessionModel.index(
|
||||
0, m_sessionModel.columnCount() - 1));
|
||||
selectionModel()->select(firstRow, QItemSelectionModel::QItemSelectionModel::
|
||||
SelectCurrent);
|
||||
|
||||
connect(this, &Utils::TreeView::activated, this, [this](const QModelIndex &index){
|
||||
emit sessionActivated(m_sessionModel.sessionAt(index.row()));
|
||||
});
|
||||
|
Reference in New Issue
Block a user