PIValueTreeEdit develop ...
This commit is contained in:
@@ -20,18 +20,25 @@
|
||||
#ifndef pivaluetree_edit_H
|
||||
#define pivaluetree_edit_H
|
||||
|
||||
#include <QWidget>
|
||||
#include <QLabel>
|
||||
#include "pivaluetree.h"
|
||||
#include "qad_piqt_utils_export.h"
|
||||
#include "qicon.h"
|
||||
#include "qmenu.h"
|
||||
|
||||
#include <QLabel>
|
||||
#include <QWidget>
|
||||
|
||||
class QGridLayout;
|
||||
class QToolButton;
|
||||
class PIVariantEdit;
|
||||
namespace Ui {
|
||||
class PIValueTreeEditArray;
|
||||
}
|
||||
class PIValueTreeEditArray;
|
||||
class PIValueTreeEditParameters;
|
||||
} // namespace Ui
|
||||
|
||||
class QAD_PIQT_UTILS_EXPORT PIValueTreeEdit: public QWidget {
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
PIValueTreeEdit(QWidget * parent = nullptr);
|
||||
~PIValueTreeEdit();
|
||||
@@ -43,39 +50,61 @@ public:
|
||||
void setValue(const PIValueTree & v);
|
||||
PIValueTree value() const;
|
||||
|
||||
bool isGroupingEnabled() const { return is_grouping; }
|
||||
void setGroupingEnabled(bool yes);
|
||||
bool isFullEditMode() const { return is_full_edit; }
|
||||
void setFullEditMode(bool yes);
|
||||
|
||||
void rollback();
|
||||
void clear();
|
||||
|
||||
private:
|
||||
void changeEvent(QEvent * e) override;
|
||||
|
||||
void removeAll();
|
||||
void build();
|
||||
void applyValues() const;
|
||||
void actionTriggered(QToolButton * button, const PIString & vn, QAction * a);
|
||||
|
||||
class GridWidgets: public QWidget {
|
||||
public:
|
||||
int rowCount() const {return row_count;}
|
||||
GridWidgets(Ui::PIValueTreeEditParameters * ui_);
|
||||
int rowCount() const { return row_count; }
|
||||
int getRow(QWidget * w) const;
|
||||
void removeRow(int index);
|
||||
void add(QString label, QWidget * w, const QString & comment);
|
||||
void add(QWidget * w);
|
||||
void add(const PIValueTree & vt, QString label, QWidget * w, const QString & comment);
|
||||
void add(const PIValueTree & vt, QWidget * w);
|
||||
int beginRow(const PIValueTree & vt);
|
||||
void rename(QString prev_name, QString new_name);
|
||||
void clear();
|
||||
|
||||
bool create_edit_buttons = false;
|
||||
PIValueTreeEdit * parent;
|
||||
|
||||
private:
|
||||
void simplify();
|
||||
int row_count = 0;
|
||||
|
||||
int row_count = 0;
|
||||
QGridLayout * lay = nullptr;
|
||||
QMenu conf_menu;
|
||||
QWidgetList widgets;
|
||||
QList<QLabel *> labels;
|
||||
QIcon icon_conf;
|
||||
Ui::PIValueTreeEditParameters * ui_params;
|
||||
};
|
||||
|
||||
QWidget * ui_array = nullptr;
|
||||
PIVector<PIVariantEdit*> array_edits;
|
||||
PIMap<PIString, PIVariantEdit*> value_edits;
|
||||
PIMap<PIString, PIValueTreeEdit*> tree_edits;
|
||||
Ui::PIValueTreeEditArray * ui;
|
||||
QWidget * widget_array = nullptr;
|
||||
QDialog * widget_params;
|
||||
PIStringList root_path;
|
||||
PIVector<PIVariantEdit *> array_edits;
|
||||
PIMap<PIString, PIVariantEdit *> value_edits;
|
||||
PIMap<PIString, PIValueTreeEdit *> tree_edits;
|
||||
Ui::PIValueTreeEditArray * ui_array;
|
||||
Ui::PIValueTreeEditParameters * ui_params;
|
||||
GridWidgets * grid = nullptr;
|
||||
mutable PIValueTree source;
|
||||
bool is_grouping = true;
|
||||
|
||||
int last_IDs_count = -1;
|
||||
bool is_grouping = true, is_full_edit = false;
|
||||
};
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user