Switch to black screen - how to ?
-
Hello,
I am using QT embedded and already have some simple application.
Is there a simple way to change the gui window to blank screen whenever required ?@
int main(int argc, char *argv[])
{
QApplication app(argc, argv);
Sender sender;
sender.setWindowFlags(Qt::Window | Qt::FramelessWindowHint);#ifdef Q_WS_QWS
QWSServer::setBackground(QBrush(Qt::black));
#endifsender.show(); return sender.exec();
}
@Thank you,
Ran[edit: added missing coding tags @ SGaist]
-
Hi,
The simplest I can see is to either open a frameless widget in fullscreen or hide your GUI and let the background show.
On a side note it's Qt, QT stands for Apple QuickTime
-
Hi,
Thanks for the pointers.
Just to be sure I understand:
To make a black screen, I hide my gui.
But If I want to dissapear all graphic (including background) - without killing the application , how can it be done ?
p.s.
I need to switch in runtime between 3 states (without killing the application):- black screen,
- Gui (graphic)
- No gui at all.
Thank you,
Ran -
So 1 and 3 should be the same ?
-
Hi,
No, I use video blending with the GUI in all cases 1-3 , so what I actually mean is :
- black screen - black screen of gui (your suggestion of showing only the background and hide the widget probably fits here. the background of Qt will hide the video and this is what I need)
- Gui (graphic)
- No gui at all - in this case only the video will be shown on screen, but I don't understand how to hide the background without killing the application.
Thanks!
Ran -
It was a spam reply.
Then number 3 is rather your video fullscreen or am I misunderstanding your ?
-
Yes, it is. It is video full screen without any graphics (without the black background too)
There is the option to kill Qt application and then I see the video layer, but I rather have a better solution if such exist with Qt application still running but not outputing any graphic.
Regards,
Ran -
Something's not clear. Where does that video come from ? How is it displayed ?
-
Hi,
Thank you very much for replies.
The video is using other mechaism, (not fbdev), so that they does not interfer with each other.
I have another application beside the Qt which take cares about controlling the video. The video layer and the graphic layer are seperate, (there blendind of these two layers on screen)
http://processors.wiki.ti.com/index.php/TI81XX_PSP_VPSS_Video_Driver_User_Guide#Architecture
In state 3 above I want to Qt application to be alive, but just not output any graphic (even not the background), and therefore in that state the video application will show the video on screen. This is what is required in state 3 mentioned above.Please tell me if something is still not clear in my question.
Thanks ,
Ran -
Are you using the alpha blending ? If so, why not put your application alpha channel to 0.0 and the video one to 1.0 ?
-
Hi Mad Scientist,
Yes I can do that I suppose (Alpha blending is supported), though I didn't try it yet.
But I wander also if there is a way to just tell Qt to disable all graphic (including background), without killing the Qt application. Is there such an option ?Regards,
Ran -
AFAIK, no there's not. You would have to take a look at QWSServer
-
You can try setting a transparent QBrush with QWSServer::setBackground