Go to the documentation of this file.
16 #include <QGridLayout>
38 myTab =
new QTabWidget(
this);
41 QWidget *tab =
new QWidget(
myTab);
64 pl.widget->setProperty(
pl.widgetPropertyName,
myAsset->property(
pl.assetPropertyName));
69 auto widget =
addWidget(label,
new QLabel(
this), !label.isEmpty(), property,
"text");
70 widget->setWordWrap(wrapText);
75 auto widget =
addWidget(label,
new QLineEdit(
this),
true, property,
"text");
77 widget->setReadOnly(readOnly);
85 auto widget =
addWidget(label,
new QTextEdit(
this),
false, property,
"plainText");
87 widget->setReadOnly(readOnly);
95 auto widget =
addWidget(label,
new QCheckBox(
this),
true, property,
"checked");
97 widget->setEnabled(
false);
107 widget->setEnabled(
false);
115 widget->setEnabled(!readOnly);
119 auto widget =
addWidget(label,
new QSpinBox(
this),
true, property,
"value");
120 widget->setMinimum(min);
121 widget->setMaximum(
max);
123 widget->setReadOnly(
true);
133 widget->setEnabled(
false);
143 widget->setEnabled(
false);
155 QWidget *bottomFiller =
new QWidget(
this);
156 bottomFiller->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
164 QObject *widget = sender();
166 if (link.widget == widget) {
168 myAsset->setProperty(link.assetPropertyName, widget->property(link.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)
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)
QMetaObject::Connection myDelete
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)
void addFaceChoice(const QString &label, const char *property, bool readOnly=true, bool allowNone=true)