forked from qt-creator/qt-creator
Sessions: Make manager usable again... for Linux
With the change that the activated signal switches to the current session the manager becomes unusable e.g. in Linux/KDE with a single click policy. This is because you can't select a session by mouse any more in order to use one of the delete/rename/etc buttons. Change-Id: I4e81ee21f37fba0b4f456e02e9ce2e9da14c5a88 Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
This commit is contained in:
@@ -53,7 +53,7 @@ void RemoveItemFocusDelegate::paint(QPainter* painter, const QStyleOptionViewIte
|
||||
}
|
||||
|
||||
SessionView::SessionView(QWidget *parent)
|
||||
: QTreeView(parent)
|
||||
: Utils::TreeView(parent)
|
||||
{
|
||||
setItemDelegate(new RemoveItemFocusDelegate(this));
|
||||
setSelectionBehavior(QAbstractItemView::SelectRows);
|
||||
@@ -68,7 +68,7 @@ SessionView::SessionView(QWidget *parent)
|
||||
selectionModel()->select(firstRow, QItemSelectionModel::QItemSelectionModel::
|
||||
SelectCurrent);
|
||||
|
||||
connect(this, &QTreeView::activated, [this](const QModelIndex &index){
|
||||
connect(this, &Utils::TreeView::activated, [this](const QModelIndex &index){
|
||||
emit activated(m_sessionModel.sessionAt(index.row()));
|
||||
});
|
||||
connect(selectionModel(), &QItemSelectionModel::currentRowChanged, [this]
|
||||
@@ -133,7 +133,7 @@ void SessionView::selectSession(const QString &sessionName)
|
||||
|
||||
void SessionView::showEvent(QShowEvent *event)
|
||||
{
|
||||
QTreeView::showEvent(event);
|
||||
Utils::TreeView::showEvent(event);
|
||||
selectActiveSession();
|
||||
setFocus();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user