--- a/ui/qt/model.h Sat Apr 19 19:56:09 2025 +0200 +++ b/ui/qt/model.h Sat Apr 19 20:02:23 2025 +0200 @@ -40,5 +40,30 @@ #include <QItemSelectionModel> + +class ListModel : public QAbstractListModel { + Q_OBJECT + + UiObject *obj; + UiVar *var; + ui_getvaluefunc getvalue; + ui_callback callback; + void *userdata; + QListView *view; + +public: + ListModel(UiObject *obj, QListView *view, UiVar *var, ui_getvaluefunc getvalue, ui_callback f, void *userdata); + + int rowCount(const QModelIndex &parent = QModelIndex()) const; + QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const; + +public slots: + void selectionChanged( + const QItemSelection & selected, + const QItemSelection & deselected); +}; + + + #endif /* MODEL_H */