1
// We want to access the signals
2
#include <qobjectdefs.h>
8
#include "kscript_ext_qhboxlayout.h"
9
#include "kscript_context.h"
10
#include "kscript_util.h"
15
#define OBJECT ((QHBoxLayout*)object())
17
#define CHECKTYPE( context, v, type ) if ( !checkType( context, v, type ) ) return FALSE;
18
#define RETURN_LEFTEXPR( n, value ) if ( name == n ) { KSValue::Ptr ptr = value; ptr->setMode( KSValue::LeftExpr ); return ptr; }
19
#define RETURN_RIGHTEXPR( n, value ) if ( name == n ) { return value; }
20
#define CHECK_LEFTEXPR( context, name ) if ( context.leftExpr() ) return KSObject::member( context, name );
21
#define SET_PROP( __n, __expr, __t ) if ( name == __n ) { CHECKTYPE( context, v, __t ); __expr; return TRUE; }
23
KSClass_QHBoxLayout::KSClass_QHBoxLayout( KSModule* m, const char* name ) : KSClass_QBoxLayout( m, name )
25
nameSpace()->insert( "QHBoxLayout", new KSValue( (KSBuiltinMethod)&KSObject_QHBoxLayout::ksQHBoxLayout ) );
28
KSScriptObject* KSClass_QHBoxLayout::createObject( KSClass* c )
30
return new KSObject_QHBoxLayout( c );
33
// ------------------------------------------------------
35
KSObject_QHBoxLayout::KSObject_QHBoxLayout( KSClass* c ) : KSObject_QBoxLayout( c )
39
bool KSObject_QHBoxLayout::ksQHBoxLayout( KSContext& context )
41
qDebug("QHBoxLayout\n");
43
if ( !checkDoubleConstructor( context, "QHBoxLayout" ) )
46
QValueList<KSValue::Ptr>& args = context.value()->listValue();
51
if ( args.count() >= 1 )
53
if ( !checkArguments( context, context.value(), "QHBoxLayout::QHBoxLayout", KS_Qt_Object::WidgetType ) )
55
parent = KSObject_QWidget::convert( args[0] );
57
if ( args.count() >= 2 )
59
if ( !checkArguments( context, context.value(), "QHBoxLayout::QHBoxLayout", KS_Qt_Object::StringType ) )
61
name = args[1]->stringValue();
63
if ( args.count() > 2 )
65
KSUtil::tooFewArgumentsError( context, "QHBoxLayout::QHBoxLayout" );
69
setObject( new QHBoxLayout( parent, 6, 6, name.latin1() ) );
74
KSValue::Ptr KSObject_QHBoxLayout::member( KSContext& context, const QString& name )
76
CHECK_LEFTEXPR( context, name );
78
return KS_Qt_Object::member( context, name );
81
bool KSObject_QHBoxLayout::setMember( KSContext& context, const QString& name, const KSValue::Ptr& v )
83
return KS_Qt_Object::setMember( context, name, v );