Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. ParticleSystem greatlty consumes CPU when window is covered by other window
Forum Updated to NodeBB v4.3 + New Features

ParticleSystem greatlty consumes CPU when window is covered by other window

Scheduled Pinned Locked Moved QML and Qt Quick
1 Posts 1 Posters 801 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.
  • W Offline
    W Offline
    weiyuemin
    wrote on last edited by
    #1

    I used ParticleSystem in my QtQuick2 program. Normally it has 2% CPU usage. It's okay. But when I move another window to completely cover my QtQuick2 window (which used ParticleSystem), the process uses 25% CPU at once. I use a quad-core CPU, so 25% CPU looks like the program running in a dead loop.

    As long as the QtQuick2 window is not completely covered by the other window, the CPU usage will not rise.

    Is it a bug of Qt? Or there's some property to control this?

    It's easy to reproduce, all my program using ParticleSystem have the same problem, as well as the examples in Qt folders.

    Below is my code:

    @
    import QtQuick 2.0
    import QtQuick.Particles 2.0

    Rectangle {
    width: 1000
    height: 800
    color: "grey"

    ParticleSystem{
    id: particles
    }
    ImageParticle{
    anchors.fill: parent
    system: particles
    source: "pics/particle.png"
    colorVariation: 0.6
    }

    Emitter{
    anchors.fill: parent
    system: particles
    emitRate: 5
    lifeSpan: 2000
    size: 5
    sizeVariation: 2

    acceleration: AngleDirection { angle: 90; angleVariation: 360; magnitude: 20; }
    velocity: AngleDirection { angle: -90; angleVariation: 360; magnitude: 10; }
    }
    }
    @

    I'm on Windows XP, use the default Qt5.0.1 binary in "DOWNLOADS" page (so I use ANGLE).

    BTW,
    In order to avoid high CPU usage, I use a timer repeatedly calling QWindow::isActive(). If it's inactive, then I paused the particle system. But it's not precise. A property indicates whether the window is totally unseen would meet my needs, but I didn't find it in the documents.

    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