Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-54673

Dynamic creation of Emitter objects cause flickering

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P2: Important
    • Resolution: Fixed
    • Affects Version/s: 5.5.1, 5.6.2, 5.9.0
    • Fix Version/s: 5.13.2
    • Component/s: Quick: Particles
    • Environment:
      Qt 5.5.1, MSVC 2013 64-bit, Windows 10 64-bit
      Qt 5.5.1, GCC 4.9, Android 6.0
      Qt 5.6.2, MinGW 4.9.2 32-bit, Windows 10 64-bit

      Description

      Documentation does not mention dynamic creation of Emitter objects so I assume this behavior is a bug.

      Here is example code that reproduces the problem - pressing anywhere will cause an Emitter to be created. In my environment several first clicks cause flickering (about 20) and then there is no flickering at all.

      import QtQuick 2.5
      import QtQuick.Window 2.2
      import QtQuick.Particles 2.0
      
      Window {
          visible: true
          width: 640
          height: 480
      
          Rectangle {
              id: particle
              width: 30
              height: width
              radius: width / 2
              color: "white"
              visible: false
              Component.onCompleted: {
                  particle.grabToImage(function(result) {
                      particleImage.source = result.url;
                  })
              }
          }
      
          Rectangle {
              anchors.fill: parent
              color: "black"
      
              ParticleSystem {
                  id: particleSystem
                  anchors.fill: parent
      
                  ImageParticle {
                      id: particleImage
                      width: 30; height: 30
                  }
              }
          }
      
          MultiPointTouchArea {
              anchors.fill: parent
              onPressed: {
                  for (var i = 0 ; i < touchPoints.length ; i++)
                      emitterComponent.incubateObject(
                                  particleSystem, {
                                      x: touchPoints[i].x,
                                      y: touchPoints[i].y
                                  })
              }
          }
      
          Component {
              id: emitterComponent
      
              Emitter {
                  emitRate: 10
                  velocity: PointDirection {x: 0; y: 0; xVariation: 200; yVariation: 200;}
                  size: 30
                  Timer {
                      running: true
                      interval: 1000
                      onTriggered: {
                          parent.destroy()
                      }
                  }
              }
          }
      }
      

        Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

            Assignee:
            valentyn.doroshchuk Valentyn Doroshchuk
            Reporter:
            fhazubski Filip Hazubski
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Gerrit Reviews

                There are no open Gerrit changes