diff options
Diffstat (limited to 'src/widgets/itemviews/qabstractitemview.cpp')
-rw-r--r-- | src/widgets/itemviews/qabstractitemview.cpp | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/src/widgets/itemviews/qabstractitemview.cpp b/src/widgets/itemviews/qabstractitemview.cpp index e1e45143b4..59d3ed1d15 100644 --- a/src/widgets/itemviews/qabstractitemview.cpp +++ b/src/widgets/itemviews/qabstractitemview.cpp @@ -940,8 +940,8 @@ void QAbstractItemView::setItemDelegateForRow(int row, QAbstractItemDelegate *de \since 4.2 Returns the item delegate used by this view and model for the given \a row, - or 0 if no delegate has been assigned. You can call itemDelegate() to get a - pointer to the current delegate for a given index. + or \nullptr if no delegate has been assigned. You can call itemDelegate() + to get a pointer to the current delegate for a given index. \sa setItemDelegateForRow(), itemDelegateForColumn(), setItemDelegate() */ @@ -2438,8 +2438,14 @@ void QAbstractItemView::keyPressEvent(QKeyEvent *event) break; case Qt::Key_Space: case Qt::Key_Select: - if (!edit(currentIndex(), AnyKeyPressed, event) && d->selectionModel) - d->selectionModel->select(currentIndex(), selectionCommand(currentIndex(), event)); + if (!edit(currentIndex(), AnyKeyPressed, event)) { + if (d->selectionModel) + d->selectionModel->select(currentIndex(), selectionCommand(currentIndex(), event)); + if (event->key() == Qt::Key_Space) { + keyboardSearch(event->text()); + event->accept(); + } + } #ifdef QT_KEYPAD_NAVIGATION if ( event->key()==Qt::Key_Select ) { // Also do Key_Enter action. @@ -2915,6 +2921,7 @@ void QAbstractItemView::editorDestroyed(QObject *editor) setState(NoState); } +#if QT_DEPRECATED_SINCE(5, 13) /*! \obsolete Sets the horizontal scroll bar's steps per item to \a steps. @@ -2972,6 +2979,7 @@ int QAbstractItemView::verticalStepsPerItem() const { return 1; } +#endif /*! Moves to and selects the item best matching the string \a search. @@ -3205,7 +3213,7 @@ bool QAbstractItemView::isPersistentEditorOpen(const QModelIndex &index) const This function should only be used to display static content within the visible area corresponding to an item of data. If you want to display custom dynamic content or implement a custom editor widget, subclass - QItemDelegate instead. + QStyledItemDelegate instead. \sa {Delegate Classes} */ |