Include last method (addCornerAnchors()) to js bindings

THe last commit left out this very important function that is a convenience 
function.


svn path=/trunk/KDE/kdebase/runtime/; revision=1046056
This commit is contained in:
Artur Duque de Souza 2009-11-07 11:46:58 +00:00
parent abcc5a4ea2
commit dbc0337ba2
2 changed files with 23 additions and 0 deletions

View File

@ -46,6 +46,7 @@ class AppletInterface : public QObject
Q_ENUMS(AspectRatioMode)
Q_ENUMS(QtOrientation)
Q_ENUMS(QtAnchorPoint)
Q_ENUMS(QtCorner)
Q_ENUMS(QtSizePolicy)
Q_ENUMS(QtAlignment)
Q_PROPERTY(QString activeConfig WRITE setActiveConfig READ activeConfig)
@ -113,6 +114,13 @@ enum QtAnchorPoint {
QtAnchorVerticalCenter = Qt::AnchorVerticalCenter
};
enum QtCorner {
QtTopLeftCorner = Qt::TopLeftCorner,
QtTopRightCorner = Qt::TopRightCorner,
QtBottomLeftCorner = Qt::BottomLeftCorner,
QtBottomRightCorner = Qt::BottomRightCorner
};
enum QtSizePolicy {
QSizePolicyFixed = QSizePolicy::Fixed,
QSizePolicyMinimum = QSizePolicy::Minimum,

View File

@ -106,6 +106,20 @@ BEGIN_DECLARE_METHOD(QGraphicsAnchorLayout, anchor) {
return eng->newQObject(anchor, QScriptEngine::QtOwnership);
} END_DECLARE_METHOD
BEGIN_DECLARE_METHOD(QGraphicsAnchorLayout, addCornerAnchors) {
QGraphicsLayoutItem *item1 = convertToLayoutItem(ctx, 0);
QGraphicsLayoutItem *item2 = convertToLayoutItem(ctx, 2);
if (!item1 || !item2) {
return eng->undefinedValue();
}
self->addCornerAnchors(item1, static_cast<Qt::Corner>(ctx->argument(1).toInt32()),
item2, static_cast<Qt::Corner>(ctx->argument(3).toInt32()));
return eng->undefinedValue();
} END_DECLARE_METHOD
BEGIN_DECLARE_METHOD(QGraphicsAnchorLayout, addAnchors) {
QGraphicsLayoutItem *item1 = convertToLayoutItem(ctx, 0);
QGraphicsLayoutItem *item2 = convertToLayoutItem(ctx, 1);
@ -144,6 +158,7 @@ QScriptValue constructAnchorLayoutClass(QScriptEngine *eng)
ADD_METHOD(proto, addAnchor);
ADD_METHOD(proto, anchor);
ADD_METHOD(proto, addAnchors);
ADD_METHOD(proto, addCornerAnchors);
ADD_METHOD(proto, toString);
QScript::registerPointerMetaType<QGraphicsAnchorLayout>(eng, proto);