Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

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));
    #endif

     sender.show();
     return sender.exec();
    

    }
    @

    Thank you,
    Ran

    [edit: added missing coding tags @ SGaist]


  • Lifetime Qt Champion

    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):

    1. black screen,
    2. Gui (graphic)
    3. No gui at all.

    Thank you,
    Ran


  • Lifetime Qt Champion

    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 :

    1. 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)
    2. Gui (graphic)
    3. 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



  • Was there a reply (seems to be deleted) ?


  • Lifetime Qt Champion

    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


  • Lifetime Qt Champion

    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


  • Lifetime Qt Champion

    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


  • Lifetime Qt Champion

    AFAIK, no there's not. You would have to take a look at QWSServer



  • Hi,

    I think that if it is possible to change the background to transparent, than it should be equal to "no gui" feeling.

    Regards,
    Ran


  • Lifetime Qt Champion

    You can try setting a transparent QBrush with QWSServer::setBackground


Log in to reply