QListView subclass that integrates with AbstractItemModel and adds UUID-based navigation.
More...
#include <listview.h>
|
|
void | currentSelectionChanged () |
| | Emitted when the current selection changes.
|
| |
| void | currentIndexChanged (const QModelIndex &index) |
| | Emitted when the current index changes.
|
| |
|
| | ListView (QWidget *parent=nullptr) |
| | Construct with an optional parent.
|
| |
| virtual void | setModel (QAbstractItemModel *model) override |
| | Set the model, wrapping it in an internal sort/filter proxy.
|
| |
| virtual QModelIndex | firstIndexOfEntityUuid (const QUuid &uuid) const |
| | Return the first index whose item UUID matches.
|
| |
| virtual QModelIndexList | indexesOfUuid (const QUuid &uuid) const |
| | Return all indexes whose item UUID matches.
|
| |
| virtual void | setCurrentUuid (const QUuid &uuid, ScrollHint scrollHint=EnsureVisible) |
| | Select the item with the given UUID and optionally scroll to it.
|
| |
| AbstractItemModel * | sourceModel () const |
| | Return the underlying AbstractItemModel (without the proxy).
|
| |
| QSortFilterProxyModel * | proxyModel () const |
| | Return the internal sort/filter proxy model.
|
| |
QListView subclass that integrates with AbstractItemModel and adds UUID-based navigation.
ListView automatically wraps the source model in a QSortFilterProxyModel and provides helpers for locating and selecting items by UUID.
Definition at line 17 of file listview.h.
◆ ListView()
| ListView::ListView |
( |
QWidget * |
parent = nullptr | ) |
|
|
explicit |
Construct with an optional parent.
- Parameters
-
| parent | Optional QWidget parent |
◆ currentIndexChanged
| void ListView::currentIndexChanged |
( |
const QModelIndex & |
index | ) |
|
|
signal |
Emitted when the current index changes.
- Parameters
-
| index | The newly current index |
◆ firstIndexOfEntityUuid()
| virtual QModelIndex ListView::firstIndexOfEntityUuid |
( |
const QUuid & |
uuid | ) |
const |
|
virtual |
Return the first index whose item UUID matches.
- Parameters
-
- Returns
- First matching index, or invalid index if not found
◆ indexesOfUuid()
| virtual QModelIndexList ListView::indexesOfUuid |
( |
const QUuid & |
uuid | ) |
const |
|
virtual |
Return all indexes whose item UUID matches.
- Parameters
-
- Returns
- List of matching indexes
◆ proxyModel()
| QSortFilterProxyModel * ListView::proxyModel |
( |
| ) |
const |
|
inline |
Return the internal sort/filter proxy model.
- Returns
- Pointer to the proxy model
Definition at line 65 of file listview.h.
◆ setCurrentUuid()
| virtual void ListView::setCurrentUuid |
( |
const QUuid & |
uuid, |
|
|
ScrollHint |
scrollHint = EnsureVisible |
|
) |
| |
|
virtual |
Select the item with the given UUID and optionally scroll to it.
- Parameters
-
| uuid | UUID of the item to select |
| scrollHint | How to scroll to make the item visible |
◆ setModel()
| virtual void ListView::setModel |
( |
QAbstractItemModel * |
model | ) |
|
|
overridevirtual |
Set the model, wrapping it in an internal sort/filter proxy.
- Parameters
-
◆ sourceModel()
The documentation for this class was generated from the following file: