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. Make a complex application with high performance
Forum Updated to NodeBB v4.3 + New Features

Make a complex application with high performance

Scheduled Pinned Locked Moved Solved QML and Qt Quick
7 Posts 2 Posters 1.6k 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.
  • Q Offline
    Q Offline
    qnope
    wrote on last edited by
    #1

    Hi there.
    I am using qt since few years ago now, and I discovered QtQuick last week.
    I am really surprised by how it is simple to write quickly little program :D.

    So I have few questions. I have an idea to develop applications, and the idea is explained as follow:

    • All GUI Widgets should be developped using QML
    • All little slots could be written in JS
    • Complexe funtion should be write in C++ using QThread

    What do you think about this approach.
    Should we always use threads to have better performance instead of timer because timer is launched in the same thread?
    Do you think should we avoid to use WorkerScript (because it is difficult to share variable between threads and because each thread own his own JS Engine) ?

    Thanks !

    Sorry for my english...

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi and welcome to devnet,

      Before using threads, what complex functions do you have in mind ?

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • Q Offline
        Q Offline
        qnope
        wrote on last edited by
        #3

        Hello and thanks for welcoming :).
        It was just a question, I don't have any project right now, it was just an idea to develop applications later.
        But for example, we could find a function which is going to search something in a database, or a file :). Or compute an equation :).

        Thanks :).

        1 Reply Last reply
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #4

          The usual paradigm is indeed to keep intensive operations in C++ and the GUI in QML. Then you should also analyze what kind of processing you will need. Sending request to a database is likely to essentially trigger work outside the GUI thread anyway since the DBs are usually on remote servers so threads might not be required.

          You should also take into account whether you'll be doing GPU work, that will influence your application's architecture.

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          1 Reply Last reply
          1
          • Q Offline
            Q Offline
            qnope
            wrote on last edited by
            #5

            Hello,
            Thanks for your answer,
            So, you told "DBs are usually on remote servers, so threads might not be required".
            Yes, but when we did the query, it could take a long time, and block the GUI thread, that's why I had the idea to use a thread ^^.

            1 Reply Last reply
            0
            • SGaistS Offline
              SGaistS Offline
              SGaist
              Lifetime Qt Champion
              wrote on last edited by
              #6

              That's the reason of the "might" ;)

              Benchmark and testing should be done to see what's needed for a given application. Qt's asynchronous nature helps to avoid the use of threads for many things.

              Interested in AI ? www.idiap.ch
              Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

              1 Reply Last reply
              1
              • Q Offline
                Q Offline
                qnope
                wrote on last edited by
                #7

                Yeah I see^^.
                Thanks a lot for your answers guy :).

                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