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. QPixmap and non X11 environments
Qt 6.11 is out! See what's new in the release blog

QPixmap and non X11 environments

Scheduled Pinned Locked Moved General and Desktop
3 Posts 2 Posters 2.2k 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.
  • X Offline
    X Offline
    xtingray
    wrote on last edited by
    #1

    Hi!
    Just right now I am dealing with an issue very similar to this: http://qt-project.org/forums/viewthread/146

    I need to run some kind of service from a Linux server with no X server installed. My application requires several methods of the QPixmap class, but any time I call loadFromData() then I get a QPixmap exception.

    Of course, to fix the problem I need an X11 server running and the variable DISPLAY well-defined. I understand the solution, but I can't help thinking about this: Is there any other way to deal with image processing from the classic Unix server with no X11 installed at all?

    I would like to read some ideas about how to deal with this problem. Because the QImage/QPixmap APIs are very handy and I don't want to quite using them from my Internet server. Any hints?


    Qt Developer

    1 Reply Last reply
    0
    • M Offline
      M Offline
      msx_br
      wrote on last edited by
      #2

      Why you can't use QImage instead of QPixmap ?

      If you don't want to paint it over a QGraphicsView, i think
      QImage can replace the QPixmap.

      PS: Tupi is great...

      msx_br - Brazil (Netherlands)

      1 Reply Last reply
      0
      • X Offline
        X Offline
        xtingray
        wrote on last edited by
        #3

        My first thought about it was to change all the code related to the problem from QPixmap to QImage, but after several days studying the code, I realized that it would take several weeks of hard work to redefine the whole service (weeks that I don't have).

        Looking for an alternative solution, I decided to try this resource: http://en.wikipedia.org/wiki/Xvfb
        using these commands:

        % /usr/bin/Xvfb :0 -screen 0 1600x1200x24 &
        % export DISPLAY=localhost:0.0
        % xhost localhost
        % /usr/bin/myservice &

        Additionally, I added a rule into my firewall to avoid external connections to the X11 port (6000). And that's it. The service is running and working pretty well :)


        Qt Developer

        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