Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. General talk
  3. Announcements
  4. QML Thread module
Forum Updated to NodeBB v4.3 + New Features

QML Thread module

Scheduled Pinned Locked Moved Unsolved Announcements
3 Posts 2 Posters 1.3k 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.
  • Everton FonsecaE Offline
    Everton FonsecaE Offline
    Everton Fonseca
    wrote on last edited by A Former User
    #1

    I have developed a module that supports parallel threads in qml, supports object orientation with Item {}, ready for sharing and simple to use, and really very powerful for qml threads.

    //example
    import m7.Threads 1.0

    Thread{

    id: thread
    runnable: "qrc:Runnable.qml"
    threadMap: ThreadMap // map datas
                        {
                          itens: { 'a':1,'b':2 }
                        }
       
    onStarted:{
    
     console.log("Begin process")
    

    }

    //Slot 
    onFromRun:{
    
        var total =  sum
        console.log(total)
          
     }
    

    onFinished:{

      // Runnable is dead
      console.log("End process")
    

    }

     Component.onCompleted: start()
    

    }

    //File Runnable.qml

    import m7.Threads 1.0

    Runnable{

    function run(){

      var sum = a + b
      
       //send to Thread parent signal to slot onFromRun
       toThread({'sum': sum}) 
    

    }

    }

    1 Reply Last reply
    2
    • ? Offline
      ? Offline
      A Former User
      wrote on last edited by
      #2

      Great! Thank you for sharing. Can you post a link to the source code?

      1 Reply Last reply
      2
      • Everton FonsecaE Offline
        Everton FonsecaE Offline
        Everton Fonseca
        wrote on last edited by
        #3

        @Wieland Of course, soon I will pass the link of git to be able to download with the documentation of the module = D

        1 Reply Last reply
        1

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved