Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt
  • Unsolved
Collapse
qtws26_logo

The Qt Event of the Year: Qt World Summit 2026

Save Your Spot >
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Document refresh or script earlier than onCompleted
Qt 6.12 LTS is out! See what's new in the release blog

Document refresh or script earlier than onCompleted

Scheduled Pinned Locked Moved Unsolved General and Desktop
1 Posts 1 Posters 255 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.
  • P Offline
    P Offline
    Phando
    wrote on last edited by Phando
    #1

    My project is an extension to a black box application (Traktor). By black box, I mean a lot of the classes being used are coming from a compiled c++ library (no source available). The files in this project are very long and repetitive. Adding loops for object creation will exponentially cut down on the file complexity.

    Using Repeaters would work, but the objects I am creating are not derived from Item. Is there a way around that?

    Within Component.onCompleted I am able to create objects and get then assigned to the right parents with commands like below

    Qt.createQmlObject('import CSI 1.0; import QtQuick 2.12; ButtonScriptAdapter {name: "'+ "PadFX3" +'"; brightness:1; color:colorToLED(preferences.iFX3Color), module, PadFX3}',
    
    for(var i=1; i<9; i++){
         var obj = Qt.createQmlObject('import CSI 1.0; import QtQuick 2.12; Wire{ from:"'+ surface +'.pads.'+ i +'"; to: "PadFX'+ i +'" }', wiresS1, "PadFX" + i); 
    }
    

    The problem is, it seems Component.onCompleted is too late. After I add my Wire components, is it possible to make the document execute those lines? I feel they are being added to the module correctly, but not getting executed.

    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
    • Unsolved