Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. EGLFS / QML / Particles // Failed to work when ParticleSystem.running not true on startup
Forum Updated to NodeBB v4.3 + New Features

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

Scheduled Pinned Locked Moved Unsolved Mobile and Embedded
eglfsqmlparticles
2 Posts 2 Posters 957 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • Alias_AliasA Offline
    Alias_AliasA Offline
    Alias_Alias
    wrote on last edited by
    #1

    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

    1 Reply Last reply
    1
    • QtEnthusiast_EmbeddedProgrammerQ Offline
      QtEnthusiast_EmbeddedProgrammerQ Offline
      QtEnthusiast_EmbeddedProgrammer
      wrote on last edited by
      #2

      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

      1 Reply Last reply
      0

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved