Scanframe Modular Application 0.1.0
Loading...
Searching...
No Matches
VariableListView.h
Go to the documentation of this file.
1#pragma once
2#include <QTreeView>
3#include <gii/global.h>
5
6namespace sf
7{
8
9// Forward declaration.
11
16 : public QTreeView
17 , public ObjectExtension
18{
19 Q_OBJECT
20 Q_PROPERTY(int nameLevel READ getNameLevel WRITE setNameLevel)
21 Q_PROPERTY(bool rowCheckbox READ hasRowCheckbox WRITE setRowCheckbox)
22 Q_PROPERTY(bool readOnly READ isReadOnly WRITE setReadOnly)
23
24 public:
29 explicit VariableListView(QWidget* parent = nullptr);
30
34 bool isRequiredProperty(const QString& name) override;
35
41
45 int getNameLevel() const;
46
50 void setNameLevel(int level = -1) const;
51
56 void setRowCheckbox(bool enabled) const;
57
62 bool hasRowCheckbox() const;
63
67 void setColumnResizeMode() const;
68
72 bool isReadOnly() const;
73
77 void setReadOnly(bool flag);
78
79 protected:
86 virtual void handleClipboard(bool flag);
87
92 int editableColumn() const;
93
98 bool editRow() const;
99
104 bool toggleRow();
105
109 void keyPressEvent(QKeyEvent* event) override;
110
114 void initSelection() const;
115
116 private:
117 class Private;
118 Private* _p;
119
120 Q_DISABLE_COPY(VariableListView)
121};
122
123}// namespace sf
ObjectExtension(QObject *object)
Protected constructor only. Inlined so no external libs are need for designer.
List model for a sf::Variable list.
Definition VariableListModel.h:18
VariableListModel * getVariableListModel() const
Gets the sf::VariableListModel attached to this instance.
virtual void handleClipboard(bool flag)
Called on clipboard copy and paste keyboard commands. Used to implement the copy and paste functional...
int nameLevel
Definition VariableListView.h:20
bool rowCheckbox
Definition VariableListView.h:21
bool editRow() const
Edits the selected row when editable.
int editableColumn() const
Gets the first editable column number.
void initSelection() const
Initialize selection of the row.
bool readOnly
Definition VariableListView.h:22
bool hasRowCheckbox() const
Gets if the row selection is enabled. By default, the row selection is enabled.
void setRowCheckbox(bool enabled) const
Enables the selection of rows. The sf::Variable::getData() returns true when selected.
bool isRequiredProperty(const QString &name) override
Overridden from base class.
bool toggleRow()
Toggles the row check box in the view for the current selected row.
VariableListView(QWidget *parent=nullptr)
Constructor.
void setColumnResizeMode() const
Sets the resize mode for the columns based column field assignment.
void setReadOnly(bool flag)
Sets the readonly status of the list.
bool isReadOnly() const
Gets the readonly status of the list.
void keyPressEvent(QKeyEvent *event) override
Overridden from base class.
void setNameLevel(int level=-1) const
Sets the levels of names displayed of the variables in the list.
int getNameLevel() const
Gets the levels of names displayed of the variables in the list.
#define _GII_CLASS
Definition gii/global.h:38
Definition Application.h:10