Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt for MCUs
  4. Disable Qt and Force a full Repaint when the device is waking from Sleep Mode.
Forum Updated to NodeBB v4.3 + New Features

Disable Qt and Force a full Repaint when the device is waking from Sleep Mode.

Scheduled Pinned Locked Moved Unsolved Qt for MCUs
10 Posts 2 Posters 996 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.
  • V Offline
    V Offline
    vignesh_vinayak
    wrote on last edited by vignesh_vinayak
    #1

    Hi Team,

    I'm working on sleep wakeup sequence on our project in that when our device is going to sleep I want to properly disable Qul engine, and when the device is waking i want to initialize Qt from scratch but the problem is i don't know how to disable qul engine. In the Qt documentation itself nothing mentioned regarding disabling the Qt engine. And FYI, Qt is initializing properly when the device is power off -> power on but in our case we are not disabling the power we just put the device to sleep in that i want to disable Qt. kindly help me out.

    Thanks,
    Vignesh.

    1 Reply Last reply
    0
    • Axel SpoerlA Offline
      Axel SpoerlA Offline
      Axel Spoerl
      Moderators
      wrote on last edited by
      #2

      The QML engine itself doesn't have a toggle for anything like a sleep mode as far as I know.
      You have to implement the sleep logic of your application manually, by listening to the appropriate OS notification on DBus, WM_POWERBRODCAST or NSWorkspace. You can hide everything and bring it back on wake up. You can also clear the QML component cashe, even singleton instances. All of that has to be brought back into a consistent state. What you do, depends on your OS and use case.

      Software Engineer
      The Qt Company, Oslo

      1 Reply Last reply
      0
      • V Offline
        V Offline
        vignesh_vinayak
        wrote on last edited by
        #3

        @Axel-Spoerl Thanks for response. I don't want to put Qt engine in sleepmode, i want to completely de-init the Qt engine so that i can initialize everithing from scratch in wakeup and FYI our device is an embedded system which is runnning on RTOS.

        1 Reply Last reply
        0
        • Axel SpoerlA Offline
          Axel SpoerlA Offline
          Axel Spoerl
          Moderators
          wrote on last edited by
          #4

          Please show the code where you construct it.
          Probably it’s your main.cpp.

          Software Engineer
          The Qt Company, Oslo

          1 Reply Last reply
          0
          • V Offline
            V Offline
            vignesh_vinayak
            wrote on last edited by
            #5

            @Axel-Spoerl This is where I construct it.

            image.png

            1 Reply Last reply
            0
            • Axel SpoerlA Offline
              Axel SpoerlA Offline
              Axel Spoerl
              Moderators
              wrote on last edited by
              #6

              I haven’t forgotten about you. Just had other fish to fry. You’re not constructing anything that you can delete while events are still processed. Need to wrap my head around it.

              Which version of Qt are you using?

              Software Engineer
              The Qt Company, Oslo

              1 Reply Last reply
              0
              • V Offline
                V Offline
                vignesh_vinayak
                wrote on last edited by
                #7

                Sure, No problem. I'm using QtMCUs 2.8.1

                1 Reply Last reply
                0
                • Axel SpoerlA Offline
                  Axel SpoerlA Offline
                  Axel Spoerl
                  Moderators
                  wrote on last edited by
                  #8

                  So to recap, this is not about disabling Qt and forcing a full repaint, as the title would suggest.
                  It's about closing the application altogether when the system enters sleep mode, and restarting it upon wakeup.
                  The only way to achieve that in my view is the following:

                  • Re-write your application to listen the sleep mode signal as per the description above. Exit the application, when sleep mode is entered.
                  • Write a wrapper for your application. If in Qt, use QProcess to start the application. In the wrapper listen to the system specific wakeup signal. Upon receipt, restart the application.

                  Software Engineer
                  The Qt Company, Oslo

                  1 Reply Last reply
                  1
                  • V Offline
                    V Offline
                    vignesh_vinayak
                    wrote last edited by
                    #9

                    @Axel-Spoerl The Above mentioned process seems to be done in Regular Qt, but I'm working on QtMCUs for microcontroller. is there any other approach available?

                    1 Reply Last reply
                    0
                    • Axel SpoerlA Offline
                      Axel SpoerlA Offline
                      Axel Spoerl
                      Moderators
                      wrote last edited by
                      #10

                      Qt for MCU is a commercial product.
                      Just contact your account manager, who will help you find a solution with professional services.

                      Software Engineer
                      The Qt Company, Oslo

                      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