Nominate our 2022 Qt Champions!

Need explanation about previous developer code. Why did he do?

  • Hello!
    Got from previous developer project that is containing very poor documentation. I would say nothing about doc. He has been doing this:

    • In QML custom component named Code, included QML component named Events and in it presented the function named View, in parameters contain almost every top level QML component id from every QML object in the project like parameter for function:
    Code {
        Events {
            Component.onCompleted: {
                view = Code.View(
    • Inside of file that contained this function imported almost every piece of JS code:
    .import "object1.js" as object1
    .import "object2.js" as object2
    .import "object3.js" as object3
    .import "object26.js" as object1
    • Inside of function for every object id that passed like parameter defined action that is looking like prototype that is defining relations between each other IDs from parameters:
    function View (Object1,Object2,...,Object26) {
        this.Object1 = new CodeObject1.method(this,Object17,this.Object15);
        this.Object2 = new CodeObject2.method(this,Object17,this.Object15);

    This component loading even before showing the first page of application.
    Basically I understand that is kind of connector between JS-objects inside of QML. But is there any suggestions about why would previous developer do it in this way?

Log in to reply