Commit f1c6163e authored by Eike Ziller's avatar Eike Ziller
Browse files

TreeViewComboBox: Fix home and end keys in presence of unselectable items



Change-Id: I33ba7677571c4b813c9dc7779f61ad7287826733
Task-number: QTCREATORBUG-13314
Reviewed-by: default avatarDaniel Teske <daniel.teske@digia.com>
parent bf3c55be
......@@ -111,12 +111,12 @@ void TreeViewComboBox::keyPressEvent(QKeyEvent *e)
setCurrentIndex(indexBelow(m_view->currentIndex()));
} else if (e->key() == Qt::Key_Home) {
QModelIndex index = m_view->model()->index(0, 0);
if (index.isValid() && !model()->flags(index) & Qt::ItemIsSelectable)
if (index.isValid() && !(model()->flags(index) & Qt::ItemIsSelectable))
index = indexBelow(index);
setCurrentIndex(index);
} else if (e->key() == Qt::Key_End) {
QModelIndex index = lastIndex(m_view->rootIndex());
if (index.isValid() && !model()->flags(index) & Qt::ItemIsSelectable)
if (index.isValid() && !(model()->flags(index) & Qt::ItemIsSelectable))
index = indexAbove(index);
setCurrentIndex(index);
} else {
......
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