forked from Mirrors/openclonk
Qt Editor: Improve display of object delegate
parent
1151016b56
commit
68358c0f87
|
@ -1143,6 +1143,19 @@ QWidget *C4PropertyDelegateObject::CreateEditor(const class C4PropertyDelegateFa
|
|||
return C4PropertyDelegateEnum::CreateEditor(parent_delegate, parent, option, by_selection);
|
||||
}
|
||||
|
||||
QString C4PropertyDelegateObject::GetDisplayString(const C4Value &v, class C4Object *obj) const
|
||||
{
|
||||
C4Object *vobj = v.getObj();
|
||||
if (vobj)
|
||||
{
|
||||
C4RefCntPointer<C4String> s = GetObjectEntryString(vobj);
|
||||
return QString(s->GetCStr());
|
||||
}
|
||||
else
|
||||
{
|
||||
return QString(v.GetDataString().getData());
|
||||
}
|
||||
}
|
||||
|
||||
C4PropertyDelegateBool::C4PropertyDelegateBool(const C4PropertyDelegateFactory *factory, C4PropList *props)
|
||||
: C4PropertyDelegateEnum(factory, props)
|
||||
|
|
|
@ -331,6 +331,7 @@ public:
|
|||
C4PropertyDelegateObject(const C4PropertyDelegateFactory *factory, C4PropList *props);
|
||||
|
||||
QWidget *CreateEditor(const class C4PropertyDelegateFactory *parent_delegate, QWidget *parent, const QStyleOptionViewItem &option, bool by_selection) const override;
|
||||
QString GetDisplayString(const C4Value &v, class C4Object *obj) const override;
|
||||
};
|
||||
|
||||
// true or false
|
||||
|
|
Loading…
Reference in New Issue