 |
Crossfire Resources Editor
|
Go to the documentation of this file.
13 #ifndef ASSETWRAPPERPANEL_H
14 #define ASSETWRAPPERPANEL_H
35 void addTab(
const QString &title);
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);
Base class for a panel displaying information about an 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
T * myItem
Item to display.
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)
Panel displaying information about a AssetTWrapper.
AssetWrapperPanel(QWidget *parent)
Base class for all assets that can be displayed or edited by CRE.
AssetTWrapperPanel(QWidget *parent)
Qt model representing all items in CRE, with the exception of experience.
Combobox displaying a list of archetypes, allowing selection and search.
virtual void setAsset(AssetWrapper *asset) override
virtual void updateItem()=0
Called when myItem is updated.
Panel displaying information about an AssetWrapper which is its own wrapped item.
QMetaObject::Connection myDelete
T * myItem
Item to display.
virtual void updateItem()=0
Called when myItem was updated.
QList< PropertyLink > myLinks
Tree displaying assets filtered by whether they use a specific asset or not.
Combobox displaying a list of treasure lists, allowing selection and search.
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)
Base class for assets mapping to a native Crossfire structure.