ui/qt/model.h

changeset 577
c2e854820922
parent 516
4b31c74666d7
child 579
810b848e2e4f
--- 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 */
 

mercurial