From 82d8d472b9a63bcb29a75f2617b48cbe39fd22bb Mon Sep 17 00:00:00 2001 From: "Aaron J. Seigo" Date: Tue, 23 Feb 2010 08:19:13 +0000 Subject: [PATCH] rowspan, colspan and alignment svn path=/trunk/KDE/kdebase/runtime/; revision=1094761 --- .../javascript/simplebindings/gridlayout.cpp | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/scriptengines/javascript/simplebindings/gridlayout.cpp b/scriptengines/javascript/simplebindings/gridlayout.cpp index 9143f4bee..ebfed978e 100644 --- a/scriptengines/javascript/simplebindings/gridlayout.cpp +++ b/scriptengines/javascript/simplebindings/gridlayout.cpp @@ -125,7 +125,23 @@ BEGIN_DECLARE_METHOD(QGraphicsGridLayout, addItem) { return eng->undefinedValue(); } - self->addItem(item, ctx->argument(1).toInt32(), ctx->argument(2).toInt32()); + int rowSpan = 1; + int colSpan = 1; + Qt::Alignment alignment = 0; + const int argCount = ctx->argumentCount(); + if (argCount > 3) { + rowSpan = ctx->argument(3).toInt32(); + if (argCount > 4) { + colSpan = ctx->argument(4).toInt32(); + + if (argCount > 5) { + alignment = static_cast(ctx->argument(5).toInt32()); + } + } + } + + self->addItem(item, ctx->argument(1).toInt32(), ctx->argument(2).toInt32(), + rowSpan, colSpan, alignment); return eng->undefinedValue(); } END_DECLARE_METHOD