EGLFS / QML / Particles // Failed to work when ParticleSystem.running not true on startup



  • Hello,

    We maybe have found a bug, but we are not sure...

    We are working with the Beagle Bone Black and QT5 (Version 5.6; OpenGL) is working fine. Only the ParticleSystem is not working as intended. For that we have created a minimal application to show the problem:

    We start the program (-platform eglfs) with the following code:

    Main:

    #include <QApplication>
    #include <QQmlApplicationEngine>
    
    int main(int argc, char *argv[])
    {
        QApplication app(argc, argv);
    
        QQmlApplicationEngine engine;
        engine.load(QUrl(QStringLiteral("qrc:/main.qml")));
    
        return app.exec();
    }
    
    

    QML:

    import QtQuick 2.5
    import QtQuick.Controls 1.4
    import QtQuick.Particles 2.0
    
    ApplicationWindow {
        visible: true
        width: 480
        height: 272
        color: "black"
        title: qsTr("Hello World")
    
        property bool particleSystem_Visualization_emitter_enabled: true
        property bool particleSystem_Visualization_system_running: false
    
        menuBar: MenuBar {
            Menu {
                title: qsTr("File")
                MenuItem {
                    text: qsTr("&Open")
                    onTriggered: console.log("Open action triggered");
                }
                MenuItem {
                    text: qsTr("Exit")
                    onTriggered: Qt.quit();
                }
            }
        }
    
        Label {
            text: qsTr("Hello World")
            anchors.centerIn: parent
        }
            ParticleSystem {
                id: particleSystem_Visualization
                running: particleSystem_Visualization_system_running
                ImageParticle {
                    color: "cyan"
                    system: particleSystem_Visualization
                    alpha: 0
                    SequentialAnimation on color {
                        loops: Animation.Infinite
                        ColorAnimation {
                            from: "magenta"
                            to: "cyan"
                            duration: 1000
                        }
                        ColorAnimation {
                            from: "cyan"
                            to: "magenta"
                            duration: 2000
                        }
                    }
                    colorVariation: 0.5
                    source: "qrc:///particleresources/star.png"
                }
                Emitter {
                    id: trailsStars
                    system: particleSystem_Visualization
                    enabled: particleSystem_Visualization_emitter_enabled
                    emitRate: 100
                    lifeSpan: 2200
                    y: point1.y
                    x: point1.x
                    velocity: PointDirection {xVariation: 4; yVariation: 4;}
                    acceleration: PointDirection {xVariation: 10; yVariation: 10;}
                    velocityFromMovement: 8
                    size: 22
                    sizeVariation: 4
                }
            }
            //Touch
            MultiPointTouchArea {
                id: multi_point_touch_area
                //anchors.fill: parent
                x: 0
                y: 0
                width: 1920
                height: 272
                mouseEnabled: true
                focus: true
                touchPoints: [
                    TouchPoint { id: point1 },
                    TouchPoint { id: point2 },
                    TouchPoint { id: point3 },
                    TouchPoint { id: point4 },
                    TouchPoint { id: point5 }
                ]
    
                Keys.onLeftPressed: {
    
                    if (particleSystem_Visualization_system_running === true){
                        particleSystem_Visualization_system_running = false
                    }else{
                        particleSystem_Visualization_system_running = true
                    }
                    console.log("left pressed...", " particleSystem_Visualization_system_running=", particleSystem_Visualization_system_running);
                }
                Keys.onRightPressed: {
    
                    if (particleSystem_Visualization_emitter_enabled === true){
                        particleSystem_Visualization_emitter_enabled = false
                    }else{
                        particleSystem_Visualization_emitter_enabled = true
                    }
                    console.log("right pressed...", "particleSystem_Visualization_emitter_enabled=", particleSystem_Visualization_emitter_enabled);
                }
    
    
            }
    }
    
    

    When the following variable is set to false for the startup, the ParticleSystem does not emit particles at all.

        property bool particleSystem_Visualization_system_running: false
    

    When it is set to true for the startup, it is emitting correctly. You can use the prepared keys to test.

    The intention behind it: We noticed a massive workload, when thousands of the ParticleSystems are running from the startup and only the emitters are modified. Hence, we would like to start the ParticleSystem and corresponding emitters together, when they are intended to work.

    Working on a desktop platform (xcb), it does not matter if "particleSystem_Visualization_syste_running" is set to true or false for the startup.

    Now, we do not know:
    - Is it a qt bug?
    - Is it a driver bug?
    - Or is it a opengl bug?

    A workaround is to initially set all "particleSystem_Visualization_syste_running" to true for the startup and switch them then off. This sadly results in a poor startup performance.

    We appreciate your help.

    Best,
    Alias_Alias



  • Hi.

    I can reproduce this unwanted behaviour.
    It seems to be an error, but I am not sure.

    Hopefully, a solution is found soon.
    I am interested in this, too.

    QtEnthusiast_And_EmbeddedProgrammer


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.