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. Low performance of dynamic component creation
Qt 6.11 is out! See what's new in the release blog

Low performance of dynamic component creation

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

    Hello,

    I have a dynamic component creation on my app. This app is design to run on an embedded device. On the computer my app is working perfectly but as soon as it runs on the embedded device the dynamic component creation is slow.

    I do create some kind of pop up window when I click on a button and the pop up shows up only after 1 to 2 seconds after I press the button.

    Is this delay normal ? Is there a way to improve the perfomance or I should go with a visibility change instead ?

    Here is the code I use to create the component

      function createComponent(){
            var component
            component = Qt.createComponent("MyComponent.qml");
            if (component.status === Component.Ready)
                finishCreation(component);
            else
                component.statusChanged.connect(finishCreation);
        }
    
    
        function finishCreation(component){
            var myComponent
            if (component.status === Component.Ready) {
                myComponent= component.createObject(pompage, {"x": 0, "y": 0});
                myComponent.property1= 1
                myComponent.property2= checkbox.checked
                if (myComponent=== null) {
                    // Error Handling
                    console.log("Error creating object");
                }
            } else if (component.status === Component.Error) {
                // Error Handling
                console.log("Error loading component:", component.errorString());
            }
        }
    
    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