2019-02-03 18:26:27 +00:00
|
|
|
#ifndef CUSTOMATTRIBUTESTABLE_H
|
|
|
|
#define CUSTOMATTRIBUTESTABLE_H
|
|
|
|
|
2022-07-19 22:56:12 +01:00
|
|
|
#include "events.h"
|
2019-02-03 18:26:27 +00:00
|
|
|
#include <QObject>
|
|
|
|
#include <QFrame>
|
|
|
|
#include <QTableWidget>
|
|
|
|
|
|
|
|
class CustomAttributesTable : public QFrame
|
|
|
|
{
|
2024-01-09 02:06:25 +00:00
|
|
|
Q_OBJECT
|
|
|
|
|
2019-02-03 18:26:27 +00:00
|
|
|
public:
|
2024-01-09 02:06:25 +00:00
|
|
|
explicit CustomAttributesTable(QWidget *parent = nullptr);
|
2019-02-03 18:26:27 +00:00
|
|
|
~CustomAttributesTable();
|
|
|
|
|
2024-01-09 02:06:25 +00:00
|
|
|
QMap<QString, QJsonValue> getAttributes() const;
|
|
|
|
void setAttributes(const QMap<QString, QJsonValue> attributes);
|
|
|
|
bool deleteSelectedAttributes();
|
|
|
|
|
|
|
|
signals:
|
|
|
|
void edited();
|
2022-10-19 00:52:35 +01:00
|
|
|
|
2019-02-03 18:26:27 +00:00
|
|
|
private:
|
|
|
|
QTableWidget *table;
|
2024-01-09 02:06:25 +00:00
|
|
|
QJsonValue pickType(bool * ok = nullptr);
|
|
|
|
void addAttribute(QString key, QJsonValue value, bool init);
|
2019-02-03 18:26:27 +00:00
|
|
|
void resizeVertically();
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif // CUSTOMATTRIBUTESTABLE_H
|