0

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?

ManuelSchneid3r
  • 15,850
  • 12
  • 65
  • 103

2 Answers2

0

Short answer: Set the environment variable to QSG_RENDER_LOOP=basic

Long answer: I dont know the exact internals. The Qmlscene is rendered by multiple threads when QSG_RENDER_LOOP=threaded is set. But some drivers fail in rendering smooth animations. Hence for untested systems (x11,mesa) initially QSG_RENDER_LOOP was set to basic. Since 5.5 threaded is the default.

ManuelSchneid3r
  • 15,850
  • 12
  • 65
  • 103
0

Try "view->setFlags(Qt::SplashScreen)" Maybe solve this issue, but the window can't be resized and moved. It doesn't make sense, but it is.