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. Using Qt Quick as a base platform

Using Qt Quick as a base platform

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
8 Posts 3 Posters 613 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.
  • JamshidJ Offline
    JamshidJ Offline
    Jamshid
    wrote on last edited by
    #1

    Hi,
    Currently I'm working on a project that will run on Linux and has a great GUI with lot's of back end functions like reading from serial port and CAN bus.
    I'm learning QML now for doing this job.
    My question is this: Am I in the right way for this project??
    if so, what aspects of Qt should I learn?
    like threading and connecting threads to the QML GUI ,I guess.
    Thank you.

    aha_1980A 1 Reply Last reply
    0
    • JamshidJ Jamshid

      Hi,
      Currently I'm working on a project that will run on Linux and has a great GUI with lot's of back end functions like reading from serial port and CAN bus.
      I'm learning QML now for doing this job.
      My question is this: Am I in the right way for this project??
      if so, what aspects of Qt should I learn?
      like threading and connecting threads to the QML GUI ,I guess.
      Thank you.

      aha_1980A Offline
      aha_1980A Offline
      aha_1980
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi @Jamshid,

      neither CAN bus nor serial ports require threads if you use Qt signals&slots.

      However, a solid C++ background is needed to do the low-level communication, plus Qt core concepts like QObject and signals&slots.

      QML/JS should be used for the UI mostly.

      Regards

      Qt has to stay free or it will die.

      1 Reply Last reply
      0
      • JamshidJ Offline
        JamshidJ Offline
        Jamshid
        wrote on last edited by
        #3

        Thanks @aha_1980
        So you mean I don't need to learn threads or something like these?
        or extending QML with C++?
        I thought for using serial port or CAN bus I need to have a thread for reading data and managing them.
        I'm confused, because I'm new to Qt.

        aha_1980A 1 Reply Last reply
        0
        • JamshidJ Jamshid

          Thanks @aha_1980
          So you mean I don't need to learn threads or something like these?
          or extending QML with C++?
          I thought for using serial port or CAN bus I need to have a thread for reading data and managing them.
          I'm confused, because I'm new to Qt.

          aha_1980A Offline
          aha_1980A Offline
          aha_1980
          Lifetime Qt Champion
          wrote on last edited by
          #4

          @Jamshid

          So you mean I don't need to learn threads or something like these?

          You can learn them, but for 99% of tasks you don't need them. And if you use threads, you need to use them right to don't shoot yourself in the foot.

          or extending QML with C++?

          That seems more interesting for you.

          I thought for using serial port or CAN bus I need to have a thread for reading data and managing them.

          As said, most likely not.

          I'm confused, because I'm new to Qt.

          Then you should learn the basics I told you above. You will need them everyday.

          Regards

          Qt has to stay free or it will die.

          JamshidJ 1 Reply Last reply
          0
          • aha_1980A aha_1980

            @Jamshid

            So you mean I don't need to learn threads or something like these?

            You can learn them, but for 99% of tasks you don't need them. And if you use threads, you need to use them right to don't shoot yourself in the foot.

            or extending QML with C++?

            That seems more interesting for you.

            I thought for using serial port or CAN bus I need to have a thread for reading data and managing them.

            As said, most likely not.

            I'm confused, because I'm new to Qt.

            Then you should learn the basics I told you above. You will need them everyday.

            Regards

            JamshidJ Offline
            JamshidJ Offline
            Jamshid
            wrote on last edited by Jamshid
            #5

            @aha_1980

            That seems more interesting for you.

            I thought for using serial port or CAN bus I need to have a thread for reading data and managing them.

            https://forum.qt.io/topic/48442/qt-quick-qml-read-data-over-serial-port-and-show-on-gui
            I have read this topic and therefore I thought to use threads and extending QML with C++ for using serial port.
            May you send me an example? I have no idea.
            In fact I'm a C# developer right now.

            Regards

            jsulmJ 1 Reply Last reply
            0
            • JamshidJ Jamshid

              @aha_1980

              That seems more interesting for you.

              I thought for using serial port or CAN bus I need to have a thread for reading data and managing them.

              https://forum.qt.io/topic/48442/qt-quick-qml-read-data-over-serial-port-and-show-on-gui
              I have read this topic and therefore I thought to use threads and extending QML with C++ for using serial port.
              May you send me an example? I have no idea.
              In fact I'm a C# developer right now.

              Regards

              jsulmJ Offline
              jsulmJ Offline
              jsulm
              Lifetime Qt Champion
              wrote on last edited by
              #6

              @Jamshid QSerialPort has an asynchronous API as most other Qt classes.
              See https://doc.qt.io/qt-5/qserialport.html
              Using asynchronous API does not require another thread as they do not block your main thread.

              https://forum.qt.io/topic/113070/qt-code-of-conduct

              JamshidJ 1 Reply Last reply
              1
              • jsulmJ jsulm

                @Jamshid QSerialPort has an asynchronous API as most other Qt classes.
                See https://doc.qt.io/qt-5/qserialport.html
                Using asynchronous API does not require another thread as they do not block your main thread.

                JamshidJ Offline
                JamshidJ Offline
                Jamshid
                wrote on last edited by
                #7

                @jsulm
                Thanks,
                And also CAN bus?
                If I had some processing, the UI does not freeze?
                I should process my data in UI thread, Am I right?
                In my project I have a lot to do and I'm worry about that.

                jsulmJ 1 Reply Last reply
                0
                • JamshidJ Jamshid

                  @jsulm
                  Thanks,
                  And also CAN bus?
                  If I had some processing, the UI does not freeze?
                  I should process my data in UI thread, Am I right?
                  In my project I have a lot to do and I'm worry about that.

                  jsulmJ Offline
                  jsulmJ Offline
                  jsulm
                  Lifetime Qt Champion
                  wrote on last edited by jsulm
                  #8

                  @Jamshid said in Using Qt Quick as a base platform:

                  If I had some processing, the UI does not freeze?
                  I should process my data in UI thread, Am I right?

                  This depends on the amount of processing you need to do. If it's too much for main thread to stay responsive then you need to move the processing to another thread. I suggest to first test with single thread.

                  https://forum.qt.io/topic/113070/qt-code-of-conduct

                  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