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. Run Qt widget app on linux with no GUI
QtWS25 Last Chance

Run Qt widget app on linux with no GUI

Scheduled Pinned Locked Moved Unsolved General and Desktop
linuxconsolewidgets
26 Posts 8 Posters 23.9k Views
  • 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.
  • B Offline
    B Offline
    Bremenpl
    wrote on 19 Oct 2016, 22:41 last edited by
    #1

    Hello there,
    I am using latest QT 5.7 on Debian x64. I was wondering either it is possible to somehow run the QT widget app on the system where the GUI environment is off? I remember that there was a QT embedded version with own framebuffer. But here the gui is installed it is just off (console mode). So could a Qt 5.7 widget app open on top of console instead of graphical user interface? This is needed for a PC that has only one task- to run the Qt app and nothing else, thats why I want to turn the whole system background off.
    I would appreciate all help regarding this topic.

    lprzenioslo.zut.edu.pl

    1 Reply Last reply
    0
    • P Offline
      P Offline
      p3c0
      Moderators
      wrote on 20 Oct 2016, 06:16 last edited by
      #2

      Hi @Bremenpl
      If the X Server and the Window manager is running in the background I dont see any problem in running the application provided all the Qt application dependencies are satisfied.

      157

      1 Reply Last reply
      2
      • B Offline
        B Offline
        Bremenpl
        wrote on 20 Oct 2016, 06:51 last edited by
        #3

        Do you know how to keep the X server and window manager running while in console mode on Linux?

        lprzenioslo.zut.edu.pl

        J 1 Reply Last reply 20 Oct 2016, 06:56
        0
        • B Bremenpl
          20 Oct 2016, 06:51

          Do you know how to keep the X server and window manager running while in console mode on Linux?

          J Offline
          J Offline
          jsulm
          Lifetime Qt Champion
          wrote on 20 Oct 2016, 06:56 last edited by
          #4

          @Bremenpl Usually you can switch to text console from X server pressing Strg-Alt-F1 (or F2-F6). To go back to the X server you then press Alt-F7.

          https://forum.qt.io/topic/113070/qt-code-of-conduct

          1 Reply Last reply
          1
          • P Offline
            P Offline
            p3c0
            Moderators
            wrote on 20 Oct 2016, 06:57 last edited by
            #5

            @Bremenpl Since you said you have installed "GUI" I hope the X is already running in the background.
            Fire this at your console:

            ps ax | grep -i "/usr/bin/X"
            

            157

            1 Reply Last reply
            2
            • B Offline
              B Offline
              Bremenpl
              wrote on 20 Oct 2016, 07:02 last edited by
              #6

              Output:

                872 tty7     Ssl+   0:01 /usr/bin/X :0 -seat seat0 -auth /var/run/lightdm/root/:0 -nolisten tcp vt7 -novtswitch
               1692 ?        S      0:00 /usr/bin/xprop -root -spy
               1722 pts/0    S+     0:00 grep -i /usr/bin/X
              
              

              Yes when I switch to text mode with ctrl alt F1 and run the app I get "aborted" in return.

              lprzenioslo.zut.edu.pl

              1 Reply Last reply
              0
              • P Offline
                P Offline
                p3c0
                Moderators
                wrote on 20 Oct 2016, 07:09 last edited by p3c0
                #7

                @Bremenpl Tt says X server is using tty7 (it is by default) so you can run applications only on tty7 and not tty1 (which you did by pressing CTRL+ALT+F1 and launching the app)

                Now the question is what is running at tty7 ? What does it display when you press CTRL+ALT+F7 ? Since you have disabled GUI is it blank ?

                157

                1 Reply Last reply
                3
                • B Offline
                  B Offline
                  Bremenpl
                  wrote on 20 Oct 2016, 07:17 last edited by Bremenpl
                  #8

                  Ok now I understand. Yes on F7 there is my regular gui and on F1 pure console. My question is- How can I qun qt application being in pure console? I havent disabled anything by hand yet, I just switched context F1-F7

                  lprzenioslo.zut.edu.pl

                  P 1 Reply Last reply 20 Oct 2016, 07:26
                  0
                  • T Offline
                    T Offline
                    tomma
                    wrote on 20 Oct 2016, 07:22 last edited by
                    #9

                    You can try to run using minimal or offscreen platform-plugin. http://doc.qt.io/qt-5/qguiapplication.html#platformName-prop .

                    1 Reply Last reply
                    0
                    • M Offline
                      M Offline
                      m.sue
                      wrote on 20 Oct 2016, 07:23 last edited by
                      #10

                      Hi,

                      if the GUI app does not need user interaction you can try to run it with option --platform offscreen on the command line. Then the app will run without visible GUI. You will need to have the offscreen platform plugin in-place, of course.
                      -Michael.

                      1 Reply Last reply
                      0
                      • B Offline
                        B Offline
                        Bremenpl
                        wrote on 20 Oct 2016, 07:25 last edited by Bremenpl
                        #11

                        No, no thats not the case. I Need full GUI Widget functionality with user interaction. I Just want the whole operating system GUI background to be gone. So the user can only use the QT app when using a the PC. When PC starts there should be just command line without gui and after a while script would turn on my Qt application (thats graphical and needs user interaction).

                        I Recall in Qt embedded I had to add -qws parameter to do this, but there was no GUI at all from the system. The app itself had GUI.

                        lprzenioslo.zut.edu.pl

                        1 Reply Last reply
                        0
                        • B Bremenpl
                          20 Oct 2016, 07:17

                          Ok now I understand. Yes on F7 there is my regular gui and on F1 pure console. My question is- How can I qun qt application being in pure console? I havent disabled anything by hand yet, I just switched context F1-F7

                          P Offline
                          P Offline
                          p3c0
                          Moderators
                          wrote on 20 Oct 2016, 07:26 last edited by p3c0
                          #12

                          Or you can just disable the fancy items loaded by the GUI and directly boot to your application by putting it into a startup script.
                          Also disable the extra unwanted tty's and keep tty7 default

                          157

                          1 Reply Last reply
                          2
                          • B Offline
                            B Offline
                            Bremenpl
                            wrote on 20 Oct 2016, 07:30 last edited by Bremenpl
                            #13

                            Yes thats exacly what I need, and by disabling fancy stuff I wanted to disable whole OS gui. tty7 is default for now. So the scenario is like this:

                            1. PC starts with only console mode
                            2. Script turns on the QT GUI application in full screen mode.

                            Would this be possible: http://doc.qt.io/qt-5/embedded-linux.html#linuxfb ?

                            lprzenioslo.zut.edu.pl

                            1 Reply Last reply
                            0
                            • P Offline
                              P Offline
                              p3c0
                              Moderators
                              wrote on 20 Oct 2016, 07:35 last edited by p3c0
                              #14

                              @Bremenpl Usually for these kind of applications (can say kiosk mode) people start with a minimal OS and a minimal light weight window manager so that OS customizations become easier.

                              157

                              1 Reply Last reply
                              1
                              • B Offline
                                B Offline
                                Bremenpl
                                wrote on 20 Oct 2016, 07:38 last edited by
                                #15

                                Thats exaclt what i mean- Kiosk mode. But my os is quite lightweight. I can make it lighter even, but the point is I dont know how to turn the app on in console mode in any OS for now :P.

                                lprzenioslo.zut.edu.pl

                                1 Reply Last reply
                                0
                                • P Offline
                                  P Offline
                                  p3c0
                                  Moderators
                                  wrote on 20 Oct 2016, 07:47 last edited by p3c0
                                  #16

                                  @Bremenpl

                                  but the point is I dont know how to turn the app on in console mode in any OS

                                  As said earlier boot to default tty where X is running, launch the app in fullscreen mode through startup scripts.
                                  Or you can try the linuxfb mode so that you own the framebuffer but then you get no window manager functionalities for eg. alt-tab switch or window decorations

                                  157

                                  1 Reply Last reply
                                  1
                                  • B Offline
                                    B Offline
                                    Bremenpl
                                    wrote on 20 Oct 2016, 07:52 last edited by
                                    #17

                                    So in short words, there is no way in linux to hide the whole OS GUI but still be able to run selected apps with GUI? One has to use own frame buffer?

                                    lprzenioslo.zut.edu.pl

                                    1 Reply Last reply
                                    0
                                    • P Offline
                                      P Offline
                                      p3c0
                                      Moderators
                                      wrote on 20 Oct 2016, 08:00 last edited by p3c0
                                      #18

                                      @Bremenpl

                                      So in short words, there is no way in linux to hide the whole OS GUI but still be able to run selected apps with GUI?

                                      Yes there is. The most easiest is to use the minimal OS so customizations becomes easy. Donot install anything else but a bare minimal window manager so that the user gets a feel that only your application is running on top.

                                      157

                                      B 1 Reply Last reply 20 Oct 2016, 08:05
                                      0
                                      • P p3c0
                                        20 Oct 2016, 08:00

                                        @Bremenpl

                                        So in short words, there is no way in linux to hide the whole OS GUI but still be able to run selected apps with GUI?

                                        Yes there is. The most easiest is to use the minimal OS so customizations becomes easy. Donot install anything else but a bare minimal window manager so that the user gets a feel that only your application is running on top.

                                        B Offline
                                        B Offline
                                        Bremenpl
                                        wrote on 20 Oct 2016, 08:05 last edited by
                                        #19

                                        @p3c0 So lets say I install Debian without any GUI and then I just install lightDM or OpenBox?

                                        lprzenioslo.zut.edu.pl

                                        1 Reply Last reply
                                        0
                                        • P Offline
                                          P Offline
                                          p3c0
                                          Moderators
                                          wrote on 20 Oct 2016, 08:07 last edited by
                                          #20

                                          @Bremenpl Right. Or Fluxbox.

                                          157

                                          1 Reply Last reply
                                          2

                                          1/26

                                          19 Oct 2016, 22:41

                                          • Login

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