diff --git a/scriptengines/javascript/simplebindings/linearlayout.cpp b/scriptengines/javascript/simplebindings/linearlayout.cpp index 9595bfb88..76fdedd4b 100644 --- a/scriptengines/javascript/simplebindings/linearlayout.cpp +++ b/scriptengines/javascript/simplebindings/linearlayout.cpp @@ -39,7 +39,6 @@ Q_DECLARE_METATYPE(QGraphicsGridLayout*) DECLARE_POINTER_METATYPE(QGraphicsLinearLayout) DECLARE_VOID_NUMBER_METHOD(QGraphicsLinearLayout, removeAt) -DECLARE_VOID_NUMBER_METHOD(QGraphicsLinearLayout, addStretch) DECLARE_VOID_NUMBER_NUMBER_METHOD(QGraphicsLinearLayout, insertStretch) DECLARE_VOID_NUMBER_NUMBER_METHOD(QGraphicsLinearLayout, setItemSpacing) DECLARE_VOID_QUAD_NUMBER_METHOD(QGraphicsLinearLayout, setContentsMargins) @@ -148,6 +147,11 @@ BEGIN_DECLARE_METHOD(QGraphicsLinearLayout, removeItem) { return eng->undefinedValue(); } END_DECLARE_METHOD +BEGIN_DECLARE_METHOD(QGraphicsLinearLayout, addStretch) { + self->addStretch(qMax(1, ctx->argument(0).toInt32())); + return eng->undefinedValue(); +} END_DECLARE_METHOD + BEGIN_DECLARE_METHOD(QGraphicsLinearLayout, setStretchFactor) { QGraphicsLayoutItem *item = ctx->argument(0).toVariant().value();