Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Switch to black screen - how to ?
Forum Updated to NodeBB v4.3 + New Features

Switch to black screen - how to ?

Scheduled Pinned Locked Moved General and Desktop
15 Posts 2 Posters 4.6k 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.
  • R Offline
    R Offline
    ranshalit
    wrote on last edited by
    #1

    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]

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      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

      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
      0
      • R Offline
        R Offline
        ranshalit
        wrote on last edited by
        #3

        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

        1 Reply Last reply
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #4

          So 1 and 3 should be the same ?

          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
          0
          • R Offline
            R Offline
            ranshalit
            wrote on last edited by
            #5

            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

            1 Reply Last reply
            0
            • R Offline
              R Offline
              ranshalit
              wrote on last edited by
              #6

              Was there a reply (seems to be deleted) ?

              1 Reply Last reply
              0
              • SGaistS Offline
                SGaistS Offline
                SGaist
                Lifetime Qt Champion
                wrote on last edited by
                #7

                It was a spam reply.

                Then number 3 is rather your video fullscreen or am I misunderstanding your ?

                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
                0
                • R Offline
                  R Offline
                  ranshalit
                  wrote on last edited by
                  #8

                  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

                  1 Reply Last reply
                  0
                  • SGaistS Offline
                    SGaistS Offline
                    SGaist
                    Lifetime Qt Champion
                    wrote on last edited by
                    #9

                    Something's not clear. Where does that video come from ? How is it displayed ?

                    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
                    0
                    • R Offline
                      R Offline
                      ranshalit
                      wrote on last edited by
                      #10

                      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

                      1 Reply Last reply
                      0
                      • SGaistS Offline
                        SGaistS Offline
                        SGaist
                        Lifetime Qt Champion
                        wrote on last edited by
                        #11

                        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 ?

                        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
                        0
                        • R Offline
                          R Offline
                          ranshalit
                          wrote on last edited by
                          #12

                          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

                          1 Reply Last reply
                          0
                          • SGaistS Offline
                            SGaistS Offline
                            SGaist
                            Lifetime Qt Champion
                            wrote on last edited by
                            #13

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

                            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
                            0
                            • R Offline
                              R Offline
                              ranshalit
                              wrote on last edited by
                              #14

                              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

                              1 Reply Last reply
                              0
                              • SGaistS Offline
                                SGaistS Offline
                                SGaist
                                Lifetime Qt Champion
                                wrote on last edited by
                                #15

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

                                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
                                0

                                • Login

                                • Login or register to search.
                                • First post
                                  Last post
                                0
                                • Categories
                                • Recent
                                • Tags
                                • Popular
                                • Users
                                • Groups
                                • Search
                                • Get Qt Extensions
                                • Unsolved