PIValueTreeEdit individual grouping feature
This commit is contained in:
@@ -30,6 +30,7 @@
|
||||
|
||||
class QGridLayout;
|
||||
class QToolButton;
|
||||
class QTabWidget;
|
||||
class PIVariantEdit;
|
||||
class PIValueTreeEditParameters;
|
||||
class PIValueTreeEditReorder;
|
||||
@@ -39,20 +40,24 @@ class PIValueTreeEditArray;
|
||||
|
||||
class QAD_PIQT_UTILS_EXPORT PIValueTreeEdit: public QWidget {
|
||||
Q_OBJECT
|
||||
Q_ENUMS(Grouping)
|
||||
|
||||
public:
|
||||
PIValueTreeEdit(QWidget * parent = nullptr);
|
||||
~PIValueTreeEdit();
|
||||
|
||||
enum TreeStyle {
|
||||
Label
|
||||
enum Grouping {
|
||||
Indent,
|
||||
Groups,
|
||||
Tabs,
|
||||
Parent = 0xFF
|
||||
};
|
||||
|
||||
void setValue(const PIValueTree & v);
|
||||
PIValueTree value() const;
|
||||
|
||||
bool isGroupingEnabled() const { return is_grouping; }
|
||||
void setGroupingEnabled(bool yes);
|
||||
Grouping grouping() const { return cur_grouping; }
|
||||
void setGrouping(Grouping g);
|
||||
bool isFullEditMode() const { return is_full_edit; }
|
||||
void setFullEditMode(bool yes);
|
||||
|
||||
@@ -79,6 +84,7 @@ private:
|
||||
void applyArrayAttributes();
|
||||
QLabel * newLabel(const PIValueTree & vt);
|
||||
void applyVariantEdit(PIVariantEdit * ve, const PIValueTree & vt);
|
||||
void createTabWidget();
|
||||
|
||||
class GridWidgets: public QWidget {
|
||||
public:
|
||||
@@ -89,11 +95,14 @@ private:
|
||||
void removeRow(int index);
|
||||
void add(const PIValueTree & vt, const PIString & label, QWidget * w, const PIString & comment, bool is_group = false);
|
||||
void add(const PIValueTree & vt, QWidget * w, bool is_group = false);
|
||||
void addRow(QWidget * w);
|
||||
QToolButton * createConfigButton(const PIValueTree & vt, bool is_group);
|
||||
void replace(int row, QWidget * w);
|
||||
void replace(int row, const PIString & label, QWidget * w, const PIString & comment);
|
||||
int beginRow(const PIValueTree & vt, bool is_group);
|
||||
void rename(const PIString & prev_name, const PIString & new_name);
|
||||
void reorder(const PIMap<int, int> & map) { simplify(map); }
|
||||
void simplify(const PIMap<int, int> & map = PIMap<int, int>());
|
||||
void clear();
|
||||
void changed();
|
||||
void retranslate();
|
||||
@@ -103,7 +112,6 @@ private:
|
||||
|
||||
private:
|
||||
int removeRowEdits(int row);
|
||||
void simplify(const PIMap<int, int> & map = PIMap<int, int>());
|
||||
|
||||
int row_count = 0;
|
||||
QGridLayout * lay = nullptr;
|
||||
@@ -114,7 +122,8 @@ private:
|
||||
QIcon icon_conf;
|
||||
};
|
||||
|
||||
QWidget * widget_array = nullptr;
|
||||
QWidget * widget_array = nullptr;
|
||||
PIValueTreeEdit * parent_tree = nullptr;
|
||||
PIValueTreeEditParameters * widget_params;
|
||||
PIValueTreeEditReorder * widget_reorder;
|
||||
PIStringList root_path;
|
||||
@@ -122,10 +131,12 @@ private:
|
||||
PIMap<PIString, PIVariantEdit *> value_edits;
|
||||
PIMap<PIString, PIValueTreeEdit *> tree_edits;
|
||||
PIMap<PIString, QLabel *> comm_labels, label_labels;
|
||||
QTabWidget * tab_widget = nullptr;
|
||||
Ui::PIValueTreeEditArray * ui_array;
|
||||
GridWidgets * grid = nullptr;
|
||||
GridWidgets * grid = nullptr;
|
||||
Grouping cur_grouping = Parent, real_grouping = Indent;
|
||||
mutable PIValueTree source, current;
|
||||
bool is_grouping = true, is_full_edit = false;
|
||||
bool is_full_edit = false;
|
||||
};
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user