5#include <Kanoop/utility/loggingbaseclass.h>
6#include <Kanoop/gui/libkanoopgui.h>
8class QSortFilterProxyModel;
17class LIBKANOOPGUI_EXPORT
ListView :
public QListView,
18 public LoggingBaseClass
32 virtual void setModel(QAbstractItemModel* model)
override;
53 virtual void setCurrentUuid(
const QUuid& uuid, ScrollHint scrollHint = EnsureVisible);
65 QSortFilterProxyModel*
proxyModel()
const {
return _proxyModel; }
69 QSortFilterProxyModel* _proxyModel =
nullptr;
82 void onCurrentSelectionChanged(
const QModelIndex ¤t,
const QModelIndex &previous);
Extended QAbstractItemModel providing EntityMetadata-based item lookup and header management.
QListView subclass that integrates with AbstractItemModel and adds UUID-based navigation.
void currentSelectionChanged()
Emitted when the current selection changes.
void currentIndexChanged(const QModelIndex &index)
Emitted when the current index changes.
virtual QModelIndex firstIndexOfEntityUuid(const QUuid &uuid) const
Return the first index 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.
virtual QModelIndexList indexesOfUuid(const QUuid &uuid) const
Return all indexes whose item UUID matches.
virtual void setModel(QAbstractItemModel *model) override
Set the model, wrapping it in an internal sort/filter proxy.
ListView(QWidget *parent=nullptr)
Construct with an optional parent.