mirror of
https://bitbucket.org/smil3y/kdelibs.git
synced 2025-02-23 18:32:49 +00:00
kdeclarative: implement depth() and hasAlphaChannel() getters for QImage
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
parent
e4a7b266fe
commit
4049764b2f
1 changed files with 16 additions and 0 deletions
|
@ -68,6 +68,20 @@ static QScriptValue imageHeight(QScriptContext *ctx, QScriptEngine *eng)
|
|||
return self->height();
|
||||
}
|
||||
|
||||
static QScriptValue imageDepth(QScriptContext *ctx, QScriptEngine *eng)
|
||||
{
|
||||
Q_UNUSED(eng)
|
||||
DECLARE_SELF(QImage, depth);
|
||||
return self->depth();
|
||||
}
|
||||
|
||||
static QScriptValue imageHasAlphaChannel(QScriptContext *ctx, QScriptEngine *eng)
|
||||
{
|
||||
Q_UNUSED(eng)
|
||||
DECLARE_SELF(QImage, hasAlphaChannel);
|
||||
return self->hasAlphaChannel();
|
||||
}
|
||||
|
||||
QScriptValue constructImageClass(QScriptEngine *eng)
|
||||
{
|
||||
QScriptValue proto = qScriptValueFromValue(eng, QImage());
|
||||
|
@ -76,6 +90,8 @@ QScriptValue constructImageClass(QScriptEngine *eng)
|
|||
proto.setProperty("null", eng->newFunction(imageIsNull), getter);
|
||||
proto.setProperty("width", eng->newFunction(imageWidth), getter);
|
||||
proto.setProperty("height", eng->newFunction(imageHeight), getter);
|
||||
proto.setProperty("depth", eng->newFunction(imageDepth), getter);
|
||||
proto.setProperty("hasAlphaChannel", eng->newFunction(imageHasAlphaChannel), getter);
|
||||
|
||||
QScriptValue ctorFun = eng->newFunction(imageCtor, proto);
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue