porymap/include/ui/customattributestable.h
2024-01-08 21:15:46 -05:00

31 lines
709 B
C++

#ifndef CUSTOMATTRIBUTESTABLE_H
#define CUSTOMATTRIBUTESTABLE_H
#include "events.h"
#include <QObject>
#include <QFrame>
#include <QTableWidget>
class CustomAttributesTable : public QFrame
{
Q_OBJECT
public:
explicit CustomAttributesTable(QWidget *parent = nullptr);
~CustomAttributesTable();
QMap<QString, QJsonValue> getAttributes() const;
void setAttributes(const QMap<QString, QJsonValue> attributes);
bool deleteSelectedAttributes();
signals:
void edited();
private:
QTableWidget *table;
QJsonValue pickType(bool * ok = nullptr);
void addAttribute(QString key, QJsonValue value, bool init);
void resizeVertically();
};
#endif // CUSTOMATTRIBUTESTABLE_H