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 return addWidget(label,
new QLabel(
this), !label.isEmpty(), property,
"text");
73 auto widget =
addWidget(label,
new QLineEdit(
this),
true, property,
"text");
75 widget->setReadOnly(readOnly);
83 auto widget =
addWidget(label,
new QTextEdit(
this),
false, property,
"plainText");
85 widget->setReadOnly(readOnly);
93 auto widget =
addWidget(label,
new QCheckBox(
this),
true, property,
"checked");
95 widget->setEnabled(
false);
104 widget->setEnabled(!readOnly);
109 widget->setEnabled(!readOnly);
113 auto widget =
addWidget(label,
new QSpinBox(
this),
true, property,
"value");
114 widget->setMinimum(min);
115 widget->setMaximum(
max);
117 widget->setReadOnly(
true);
127 widget->setEnabled(
false);
137 widget->setEnabled(
false);
149 QWidget *bottomFiller =
new QWidget(
this);
150 bottomFiller->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
158 QObject *widget = sender();
160 if (link.widget == widget) {
162 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)
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)
QLabel * addLabel(const QString &label, const char *property)
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)