Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Solved run qml map app on server with no gui

    QML and Qt Quick
    2
    6
    195
    Loading More Posts
    • 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
      Marek last edited by

      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 Reply Quote 0
      • sierdzio
        sierdzio Moderators last edited by

        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 Reply Quote 2
        • M
          Marek @sierdzio last edited by

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

          1 Reply Last reply Reply Quote 0
          • sierdzio
            sierdzio Moderators last edited by

            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 Reply Quote 0
            • M
              Marek @sierdzio last edited by

              @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 Reply Quote 0
              • M
                Marek @sierdzio last edited by

                @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 Reply Quote 1
                • First post
                  Last post