Scanframe Modular Application 0.1.0
Loading...
Searching...
No Matches
test-ListViewWindow.h
Go to the documentation of this file.
1#pragma once
2#include <QMainWindow>
5#include <misc/qt/ListModel.h>
6
7QT_BEGIN_NAMESPACE
8
9namespace Ui
10{
11class ListViewWindow;
12}
13
14QT_END_NAMESPACE
15
16using namespace sf;
17
18class ListViewWindow : public QMainWindow
19{
20 Q_OBJECT
21
22 public:
23 explicit ListViewWindow(QWidget* parent = nullptr);
24
25 ~ListViewWindow() override;
26
27 void storeState(bool read);
28
30
31 void getListData(const QModelIndex& index, int role, QVariant& data);
32
33 void setListData(const QModelIndex& index, int role, const QVariant& data);
34
35 void popupMenu(const QModelIndex& index, const QPoint& pos);
36
37 void rowChanged(int current, int previous);
38
39 void insertRow();
40
41 void removeRow();
42
43 void moveRowUp();
44
46
47 void debugCall();
48
49 private:
50 Ui::ListViewWindow* ui;
51
54 struct Data
55 {
56 QString name;
57 int image{0};
58 double amount{0.0};
59 QString description;
60 bool selected{false};
61 };
62
63 // Vector for managing the data.
64 QList<Data> _data;
65 // List model class.
66 ListModel* _listModel;
68
69 QList<Data> _dataSource;
70 ConfigStore _configStore;
71};
void rowChanged(int current, int previous)
void popupMenu(const QModelIndex &index, const QPoint &pos)
void setListData(const QModelIndex &index, int role, const QVariant &data)
~ListViewWindow() override
void getListData(const QModelIndex &index, int role, QVariant &data)
void storeState(bool read)
ListViewWindow(QWidget *parent=nullptr)
void moveRowDown()
void createColumns()
Definition ApplicationPropertyPage.h:7
Definition Application.h:10