Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. run qml map app on server with no gui
Forum Updated to NodeBB v4.3 + New Features

run qml map app on server with no gui

Scheduled Pinned Locked Moved Solved QML and Qt Quick
6 Posts 2 Posters 523 Views 3 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.
  • M Offline
    M Offline
    Marek
    wrote on last edited by
    #1

    Hi
    I need to grab map image with route displayed on it and save this as a picture. It needs to be done by server application, so I have created another app and I'm running it inside QProcess of the server.
    The problem is that if I run this process on Linux server without GUI I have this error:
    "qt.qpa.screen: QXcbConnection: Could not connect to display \nCould not connect to any X display.\n"

    Has anyone some idea how to make it work, except for installing GUI on a server?

    Best Regards
    Marek

    1 Reply Last reply
    0
    • sierdzioS Offline
      sierdzioS Offline
      sierdzio
      Moderators
      wrote on last edited by
      #2

      Run your app with -platform offscreen flag. I'm not sure if it will allow you to actually grab an image of the scene (most probably not).

      (Z(:^

      M 1 Reply Last reply
      2
      • sierdzioS sierdzio

        Run your app with -platform offscreen flag. I'm not sure if it will allow you to actually grab an image of the scene (most probably not).

        M Offline
        M Offline
        Marek
        wrote on last edited by
        #3

        @sierdzio thanks for answer
        It runs but generates empty images,
        there is an error:
        QOpenGLContext is NULL!
        :(

        1 Reply Last reply
        0
        • sierdzioS Offline
          sierdzioS Offline
          sierdzio
          Moderators
          wrote on last edited by
          #4

          So, you need the GUI stuff (or at least OpenGL) installed. Mind you, it does not mean that you need to have a display attached, it can still be a headless server. I think ;-)

          (Z(:^

          M 2 Replies Last reply
          0
          • sierdzioS sierdzio

            So, you need the GUI stuff (or at least OpenGL) installed. Mind you, it does not mean that you need to have a display attached, it can still be a headless server. I think ;-)

            M Offline
            M Offline
            Marek
            wrote on last edited by
            #5

            @sierdzio
            I ran my program with this flag on my Laptop which has xserver, and pictures are blank, so I imagine I would need xserver installed on my Linux server

            1 Reply Last reply
            0
            • sierdzioS sierdzio

              So, you need the GUI stuff (or at least OpenGL) installed. Mind you, it does not mean that you need to have a display attached, it can still be a headless server. I think ;-)

              M Offline
              M Offline
              Marek
              wrote on last edited by
              #6

              @sierdzio anyway, the answer for this problem i static images from mapbox API (if you need eg. to draw a route taken by a car)
              Best,
              Marek

              1 Reply Last reply
              1

              • Login

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