Fix property-setter for strings

AKA qt_setstringproperty().
This commit is contained in:
Jaidyn Ann 2024-02-05 18:38:42 -06:00
parent 1704d392e8
commit a8f324ca68

View File

@ -188,12 +188,12 @@ propsetter(int, int, QMetaType::Int)
propsetter(float, double, QMetaType::Double) propsetter(float, double, QMetaType::Double)
propsetter(char, char, QMetaType::Char) propsetter(char, char, QMetaType::Char)
___bool qt_setstringproperty(QWidget *w, char *prop, const char* val) ___bool qt_setstringproperty(QWidget *w, char *prop, char* val)
{ {
const QMetaObject *mo = w->metaObject(); const QMetaObject *mo = w->metaObject();
int i = mo->indexOfProperty(prop); int i = mo->indexOfProperty(prop);
if(i == -1) return 0; if(i == -1) return 0;
else return mo->property(i).write(w, QVariant(val)); else return mo->property(i).write(w, QVariant((const char*)val));
} }