PIValueTreeEdit almost finish fullEditMode
This commit is contained in:
@@ -22,19 +22,19 @@
|
||||
|
||||
#include "pivaluetree.h"
|
||||
#include "qad_piqt_utils_export.h"
|
||||
#include "qicon.h"
|
||||
#include "qmenu.h"
|
||||
|
||||
#include <QIcon>
|
||||
#include <QLabel>
|
||||
#include <QMenu>
|
||||
#include <QWidget>
|
||||
|
||||
class QGridLayout;
|
||||
class QToolButton;
|
||||
class PIVariantEdit;
|
||||
class PIValueTreeEditParameters;
|
||||
namespace Ui {
|
||||
class PIValueTreeEditArray;
|
||||
class PIValueTreeEditParameters;
|
||||
} // namespace Ui
|
||||
}
|
||||
|
||||
class QAD_PIQT_UTILS_EXPORT PIValueTreeEdit: public QWidget {
|
||||
Q_OBJECT
|
||||
@@ -59,51 +59,61 @@ public:
|
||||
void clear();
|
||||
|
||||
private:
|
||||
enum class NewType {
|
||||
Value,
|
||||
Group,
|
||||
Array
|
||||
};
|
||||
|
||||
void changeEvent(QEvent * e) override;
|
||||
|
||||
void removeAll();
|
||||
void build();
|
||||
void applyValues() const;
|
||||
void actionTriggered(QToolButton * button, const PIString & vn, QAction * a);
|
||||
void newRequest(NewType type);
|
||||
PIValueTreeEdit * addTreeEdit(const PIValueTree & vt);
|
||||
void addValueEdit(const PIValueTree & vt);
|
||||
void applyArrayAttributes();
|
||||
|
||||
class GridWidgets: public QWidget {
|
||||
public:
|
||||
GridWidgets(Ui::PIValueTreeEditParameters * ui_);
|
||||
GridWidgets(PIValueTreeEdit * p);
|
||||
~GridWidgets();
|
||||
int rowCount() const { return row_count; }
|
||||
int getRow(QWidget * w) const;
|
||||
void removeRow(int index);
|
||||
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 add(const PIValueTree & vt, QString label, QWidget * w, const QString & comment, bool is_group = false);
|
||||
void add(const PIValueTree & vt, QWidget * w, bool is_group = false);
|
||||
int beginRow(const PIValueTree & vt, bool is_group);
|
||||
void rename(QString prev_name, QString new_name);
|
||||
void clear();
|
||||
void changed();
|
||||
|
||||
bool create_edit_buttons = false;
|
||||
PIValueTreeEdit * parent;
|
||||
QToolButton * button_add;
|
||||
|
||||
private:
|
||||
void simplify();
|
||||
|
||||
int row_count = 0;
|
||||
QGridLayout * lay = nullptr;
|
||||
QMenu conf_menu;
|
||||
PIValueTreeEdit * parent;
|
||||
QMenu menu_group, menu_conf, menu_new;
|
||||
QWidgetList widgets;
|
||||
QList<QLabel *> labels;
|
||||
QIcon icon_conf;
|
||||
Ui::PIValueTreeEditParameters * ui_params;
|
||||
};
|
||||
|
||||
QWidget * widget_array = nullptr;
|
||||
QDialog * widget_params;
|
||||
PIValueTreeEditParameters * 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;
|
||||
int last_IDs_count = -1;
|
||||
bool is_grouping = true, is_full_edit = false;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user