porymap/include/ui/customattributestable.h

37 lines
876 B
C
Raw Normal View History

#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);
2024-01-10 17:29:10 +00:00
void addNewAttribute(QString key, QJsonValue value);
bool deleteSelectedAttributes();
2024-01-09 22:03:07 +00:00
void setDefaultAttribute(QString key, QJsonValue value);
void unsetDefaultAttribute(QString key);
const QStringList restrictedKeyNames; // TODO: Populate
signals:
void edited();
private:
QTableWidget *table;
2024-01-10 17:29:10 +00:00
int addAttribute(QString key, QJsonValue value);
void resizeVertically();
};
#endif // CUSTOMATTRIBUTESTABLE_H