Disable Qt and Force a full Repaint when the device is waking from Sleep Mode.
- 
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. - 
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. - 
@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.
 - 
Please show the code where you construct it.
Probably it’s your main.cpp. - 
@Axel-Spoerl This is where I construct it.

 - 
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?
 - 
Sure, No problem. I'm using QtMCUs 2.8.1
 - 
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 
QProcessto start the application. In the wrapper listen to the system specific wakeup signal. Upon receipt, restart the application. 
 - 
@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?
 - 
Qt for MCU is a commercial product.
Just contact your account manager, who will help you find a solution with professional services.