From a8f324ca68e79f71e3970289493e6ee05556b8cd Mon Sep 17 00:00:00 2001 From: Jaidyn Ann <10477760+JadedCtrl@users.noreply.github.com> Date: Mon, 5 Feb 2024 18:38:42 -0600 Subject: [PATCH] Fix property-setter for strings AKA qt_setstringproperty(). --- main.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/main.cpp b/main.cpp index ebac144..5a7dc4b 100644 --- a/main.cpp +++ b/main.cpp @@ -173,7 +173,7 @@ int qt_message(char *caption, char *text, QWidget *parent, char *b0, char *b1, c } -#define propsetter(name, type, metatype) \ +#define propsetter(name, type, metatype) \ ___bool qt_set ## name ## property(QWidget *w, char *prop, type val) \ { \ const QMetaObject *mo = w->metaObject(); \ @@ -188,12 +188,12 @@ propsetter(int, int, QMetaType::Int) propsetter(float, double, QMetaType::Double) 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(); int i = mo->indexOfProperty(prop); 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)); }