QML DropShadow is very slow

QML DropShadow is an interesting effect that acts in a very simple way. It works fine in my application and produces the following result:

QML DropShadow is very slow

The only disadvantage of DropShadow effect is that is slows down my application from 60 FPS to 30 FPS on Android Phone. The following code demonstrates how I use it with StackView:

import QtQuick 2.7
import QtQuick.Controls 2.1
import QtGraphicalEffects 1.0

ApplicationWindow {
    id: window
    title: appName

    StackView {
        anchors.fill: parent
        id: stack
        initialItem: Item {
            //...
            //further controls goes here
            //...
        }
    }

    DropShadow {
        anchors.fill: stack
        horizontalOffset: 3
        verticalOffset: 3
        radius: 8.0
        samples: 17
        color: "#80000000"
        source: stack
    }
}

So I think it would be better to draw the shadow for all the buttons with Photoshop, for example.

Leave a Reply

Your email address will not be published. Required fields are marked *