[Qt-interest] QML: transparent image

Николай Шатохин n.shatokhin at gmail.com
Wed Aug 10 01:48:34 CEST 2011


Oh, I find solution. I used:

qmlView->setStyleSheet("background-color:transparent;");

2011/8/10 Nicholas Shatokhin <n.shatokhin at gmail.com>

> Hello.
>
> I create a qml file:
>
>  import QtQuick 1.0
>
>  Image {
>     width: 130; height: 100
>     fillMode: Image.PreserveAspectFit
>     smooth: true
>     source: "animation.png"
>
>     RotationAnimation on rotation {
>         loops: Animation.Infinite
>         from: 0
>         to: 360
>         duration: 2000
>     }
>  }
>
> image has a transparent background. Next, I add it to layout:
>
> QDeclarativeView * qmlView = new
> QDeclarativeView(QUrl::fromLocalFile("animation.qml"), this);
>
> mainLayout->addWidget(qmlView);
>
> But image showing in white box. How can I do it transparent (image must be
> showing on form, without background)?
>
> --
> За використання революційного клієнта електронної пошти Opera:
> http://www.opera.com/mail/
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20110810/072863d1/attachment.html 


More information about the Qt-interest-old mailing list