ensure the value passed to stretch is always > 0

svn path=/trunk/KDE/kdebase/runtime/; revision=1110071
This commit is contained in:
Aaron J. Seigo 2010-04-01 19:57:13 +00:00
parent 34faad3c3f
commit 282a4f833e

View File

@ -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<QGraphicsLayoutItem*>();