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. Simple question about performance troubles
Qt 6.11 is out! See what's new in the release blog

Simple question about performance troubles

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
1 Posts 1 Posters 451 Views
  • 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.
  • defsD Offline
    defsD Offline
    defs
    wrote on last edited by defs
    #1

    I have trouble with this simple application. It will respond very slowly (processor usage is over 90%) if I have background picture or just pure Rectangle (id: background in example bellow) before button, if I comment this background rectangle, application would react quickly, but if I add "enable.layers: true" to root item, slow response would be come back .
    Where is the problem?
    I would like to have background picture and fast response on clicking.
    I am running this example on Raspberry Pi 3.

    
    import QtQuick 2.3
    
    
    Item {
        id: root
        visible: true
        width: 800
        height: 480
    
    
        Rectangle {
            id: background
            anchors.fill: parent
            smooth: true
    
        }
    
        
        Rectangle {
            id: button
            width: 200 ; height: 123
    
            anchors.centerIn: parent
    
            smooth: true
            radius: 8
    
            //color the button with a gradient
            gradient: Gradient {
                GradientStop {
                    position: 1.0
                    color: {
                        if (mouseArea.pressed)
                            return "red"
                        else
                            return "chartreuse"
                    }
                }
                GradientStop {position: 0.0; color: "paleturquoise" }
            }
    
    
            MouseArea {
                id:mouseArea
                anchors.fill: parent
                onPressed: {
                    //handler.turnOn()
                }
                onReleased: {
                   // handler.turnOff()
                }
    
            }
        }
    }
    
    
    
    

    UPDATE: When running this example with qmlviewer from terminal it works fast as expected (in that case have to use "import QtQuick 1.1" instead "2.3". When running with qmlscene from terminal or with QQuickView from C++ this app respond very bad on clicking button,

    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