porymap/include/ui/customattributestable.h
2024-01-10 12:29:10 -05:00

36 lines
876 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);
void addNewAttribute(QString key, QJsonValue value);
bool deleteSelectedAttributes();
void setDefaultAttribute(QString key, QJsonValue value);
void unsetDefaultAttribute(QString key);
const QStringList restrictedKeyNames; // TODO: Populate
signals:
void edited();
private:
QTableWidget *table;
int addAttribute(QString key, QJsonValue value);
void resizeVertically();
};
#endif // CUSTOMATTRIBUTESTABLE_H