main.cpp
#include <QGuiApplication>
#include <QQuickView>
int main(int argc, char *argv[])
{
QGuiApplication app(argc, argv);
QQuickView *view= new QQuickView;
view->setFlags(Qt::Tool|Qt::WindowStaysOnTopHint|Qt::FramelessWindowHint);
view->setColor(Qt::transparent);
view->show();
view->setSource(QUrl(QStringLiteral("qrc:/main.qml")));
return app.exec();
}
qmlfile:
import QtQuick 2.0
Rectangle {
width: 100
height: 100
color: "#80808080"
Rectangle {
width: 10
height: 10
anchors.centerIn: parent
RotationAnimation on rotation {
duration : 15000
easing.type: Easing.Linear
loops: Animation.Infinite
from: 0
to: 360
}
}
}
The transparent background flickers, but only with an animation. The example is pretty basic, so whats the problem?