Go to the documentation of this file.
13 #ifndef ASSETWRAPPERPANEL_H
14 #define ASSETWRAPPERPANEL_H
39 QLabel *
addLabel(
const QString &label,
const char *property,
bool wrapText =
false);
40 QLineEdit *
addLineEdit(
const QString &label,
const char *property,
bool readOnly =
true);
41 QTextEdit *
addTextEdit(
const QString &label,
const char *property,
bool readOnly =
true);
42 QCheckBox *
addCheckBox(
const QString &label,
const char *property,
bool readOnly =
true);
43 void addFaceChoice(
const QString &label,
const char *property,
bool readOnly =
true,
bool allowNone =
true);
44 void addQuestChoice(
const QString &label,
const char *property,
bool readOnly =
true,
bool allowNone =
true);
45 QSpinBox *
addSpinBox(
const QString &label,
const char *property,
int min = 0,
int max = 100,
bool readOnly =
true);
64 T *
addWidget(
const QString &label, T *widget,
bool sideBySide,
const char *property,
const char *widgetProperty) {
66 if (!label.isEmpty()) {
67 myLayout->addWidget(
new QLabel(label,
this),
line, 0, 1, sideBySide ? 1 : 2);
73 myLayout->addWidget(widget,
line, sideBySide ? 1 : 0, 1, sideBySide ? 1 : 2);
75 myLinks.append({property, widget, widgetProperty});
99 myItem = aw ? aw->wrappedItem() :
nullptr;
119 myItem =
dynamic_cast<T *
>(asset);
const char * widgetPropertyName
QTextEdit * addTextEdit(const QString &label, const char *property, bool readOnly=true)
void addTab(const QString &title)
QLineEdit * addLineEdit(const QString &label, const char *property, bool readOnly=true)
virtual void setAsset(AssetWrapper *asset) override
AssetUseTree * addAssetUseTree(const QString &label, AssetModel *assets, const char *property)
void addQuestChoice(const QString &label, const char *property, bool readOnly=true, bool allowNone=true)
QLabel * addLabel(const QString &label, const char *property, bool wrapText=false)
QSpinBox * addSpinBox(const QString &label, const char *property, int min=0, int max=100, bool readOnly=true)
virtual ~AssetWrapperPanel()
QMetaObject::Connection myChanged
ArchetypeComboBox * addArchetype(const QString &label, const char *property, bool readOnly=false, bool allowNone=true)
AssetWrapperPanel(QWidget *parent)
AssetTWrapperPanel(QWidget *parent)
virtual void setAsset(AssetWrapper *asset) override
virtual void updateItem()=0
QMetaObject::Connection myDelete
virtual void updateItem()=0
QList< PropertyLink > myLinks
T * addWidget(const QString &label, T *widget, bool sideBySide, const char *property, const char *widgetProperty)
TreasureListComboBox * addTreasureList(const QString &label, const char *property, bool readOnly=true, bool allowNone=true)
virtual void setAsset(AssetWrapper *item)
QCheckBox * addCheckBox(const QString &label, const char *property, bool readOnly=true)
AssetSWrapperPanel(QWidget *parent)
const char * assetPropertyName
void addFaceChoice(const QString &label, const char *property, bool readOnly=true, bool allowNone=true)