[Interest] QDatastream, QMap, QImage serialization

Michael Jackson mike.jackson at bluequartz.net
Thu May 24 21:57:03 CEST 2018


On 5/24/18, 3:53 PM, "Michael Jackson" <mike.jackson at bluequartz.net> wrote:

    On 5/22/18, 3:18 PM, "Interest on behalf of Thiago Macieira" <interest-bounces+mike.jackson=bluequartz.net at qt-project.org on behalf of thiago.macieira at intel.com> wrote:
    
        On Tuesday, 22 May 2018 15:38:00 -03 Michael Jackson wrote:
        > If it is a raster only then _why_ is it in QtGUI? There is no reason for it
        > to depend on anything in GUI if there are no accelerated bits of code or
        > any other codes (I'm sure I am wrong there) that depend on a windowing
        > system?
        
        Nothing in QtGui depends on the windowing system. Those bits live in the QPA 
        plugin or in a separate library loaded by that plugin. This is the third time 
        I've said so in this thread, including the email you replied to.
        
        QtGui is the library that provides the foundation for all graphical and user-
        interface functionality. It *integrates* with the windowing system of your 
        choice by way of a semi-private extension API known as QPA (Qt Platform 
        Abstraction). One of those windowing systems is the "offscreen" one, which 
        connects to no WS server: effectively, a command-line application.
        
        > Bottom Line: I have a reasonable use-case where I need to "draw" into a
        > "Canvas" from a command line app.
        
        Use QtGui.
        
        -- 
        Thiago Macieira - thiago.macieira (AT) intel.com
          Software Architect - Intel Open Source Technology Center
      
    Ok, You told me. Multiple times even. So let me try this in a practical manner. I re-enabled one of our unit tests that uses QImage which means I have to link it against QtGui. Done. It compiles. Great. The unit test attempts to run and I get the following:

QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to '/tmp/runtime-buildbot'
qt.qpa.screen: QXcbConnection: Could not connect to display 
Could not connect to any X display.

The top part of the code is:

  // Instantiate the QGuiApplication that we need to get the current path and load plugins.
  QGuiApplication app(argc, argv);
  QGuiApplication::setOrganizationName("Your Company");
  QGuiApplication::setOrganizationDomain("Your Domain");
  QGuiApplication::setApplicationName("");

The I try some QImage testing.

The same kind of result I also see on macOS. The "user" running our build not is NOT logged in. The test from above was on a Ubuntu 16.04 system running the precompiled Qt 5.10.1 binary from http://download.qt.io.

So what, _exactly_, am I missing. Is there a platform plugin that I need to force load in these situations?

--
Mike Jackson

    
    





More information about the Interest mailing list