From ec69b3686749166de13a074ad7f57c63fe5a1b9c Mon Sep 17 00:00:00 2001 From: "Aaron J. Seigo" Date: Fri, 27 Nov 2009 21:15:25 +0000 Subject: [PATCH] clean up api svn path=/trunk/KDE/kdebase/runtime/; revision=1055348 --- .../javascript/simplebindings/linearlayout.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/scriptengines/javascript/simplebindings/linearlayout.cpp b/scriptengines/javascript/simplebindings/linearlayout.cpp index 241462ae4..18786cf23 100644 --- a/scriptengines/javascript/simplebindings/linearlayout.cpp +++ b/scriptengines/javascript/simplebindings/linearlayout.cpp @@ -26,7 +26,7 @@ #include #include "../backportglobal.h" -#include "../appletinterface.h" +#include "appletinterface.h" Q_DECLARE_METATYPE(QScript::Pointer::wrapped_pointer_type) Q_DECLARE_METATYPE(QGraphicsWidget*) @@ -163,8 +163,12 @@ QScriptValue constructLinearLayoutClass(QScriptEngine *eng) { // QScriptValue proto = QScript::wrapGVPointer(eng, new QGraphicsLinearLayout(), ); QScriptValue proto = QScript::wrapPointer(eng, new QGraphicsLinearLayout(), QScript::UserOwnership); - ADD_GET_SET_METHODS(proto, spacing, setSpacing); - ADD_GET_SET_METHODS(proto, orientation, setOrientation); + const QScriptValue::PropertyFlags getter = QScriptValue::PropertyGetter; + const QScriptValue::PropertyFlags setter = QScriptValue::PropertySetter; + proto.setProperty("spacing", eng->newFunction(spacing), getter); + proto.setProperty("spacing", eng->newFunction(setSpacing), setter); + proto.setProperty("orientation", eng->newFunction(orientation), getter); + proto.setProperty("orientation", eng->newFunction(setOrientation), setter); ADD_METHOD(proto, removeAt); ADD_METHOD(proto, addStretch); ADD_METHOD(proto, setStretchFactor);