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. Need explanation about previous developer code. Why did he do?

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

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

    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(
                    object_id_1,
                    object_id_2,
                    ...,
                    object_id_26);
            }
        }
    }
    
    • 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?

    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