Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Update: Forum Guidelines & Code of Conduct

    Unsolved QT on toradex VF61 SBC WINCE6.0

    Mobile and Embedded
    2
    12
    2067
    Loading More Posts
    • 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.
    • S
      Shiv last edited by Shiv

      How to run an endless loop in embedded device like a while(1) loop .Since I am using GUI for my display if I use the timer it becomes slow because timer will trigger only in a specified time .

      1 Reply Last reply Reply Quote 0
      • SGaist
        SGaist Lifetime Qt Champion last edited by

        Hi and welcome to devnet,

        What should that endless loop do ?

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

        S 1 Reply Last reply Reply Quote 0
        • S
          Shiv @SGaist last edited by

          @SGaist Hi It will check for certain flags and call function according to it.For example It will read the adc in a thread for battery status and update the GUI icons based on it like that there are many real time activity it has to do.

          1 Reply Last reply Reply Quote 0
          • SGaist
            SGaist Lifetime Qt Champion last edited by

            Then implement that in a QThread subclass so your loop won't interfere with your GUI

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

            S 1 Reply Last reply Reply Quote 0
            • S
              Shiv @SGaist last edited by

              @SGaist Thanks for your suggestion , do you have any examples .See all my widgets are in my mainwindow polling with the thread is not a problem but how i will communicate with my widgets .Since i am learning qt for just a while so don't mistake me if the question is silly.

              1 Reply Last reply Reply Quote 0
              • SGaist
                SGaist Lifetime Qt Champion last edited by

                You can take a look at the Mandelbrot example

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

                S 1 Reply Last reply Reply Quote 0
                • S
                  Shiv @SGaist last edited by

                  @SGaist Thank you, the example is very much related to my requirement and i will try to implement it.In the Mandelbrot example the render thread has a run function but i am unable find where the thread is initiated.I have read the QThread class and checked some examples the QThread will initiate with the start function call which will initiate the override run function .Can you please explain , it will help me to proceed further.

                  1 Reply Last reply Reply Quote 0
                  • SGaist
                    SGaist Lifetime Qt Champion last edited by

                    If you reimplement run, you do all the initialization at the start of the run method before your loop.

                    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 Reply Quote 0
                    • S
                      Shiv last edited by

                      I think you have misunderstood my question or may be i am wrong. I will rephrase my question.

                      • To execute a thread you should call the run function using start method,this is as per QThread class information.

                      • But in the Mandelbrot example I am unable to find that function call.
                        I want know how the thread is started where is the entry point to that thread.

                      Thank You.

                      1 Reply Last reply Reply Quote 0
                      • SGaist
                        SGaist Lifetime Qt Champion last edited by

                        start is called in the render method

                        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 Reply Quote 0
                        • S
                          Shiv last edited by

                          Thank you I got it ..

                          1 Reply Last reply Reply Quote 0
                          • SGaist
                            SGaist Lifetime Qt Champion last edited by

                            You're welcome !

                            In your case you can just start the thread as soon as you need it

                            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 Reply Quote 0
                            • First post
                              Last post