[Interest] Running as nobody, generating images

Konstantin Tokarev annulen at yandex.ru
Thu Feb 9 15:18:50 CET 2012



09.02.2012, 18:00, "Harri Pasanen" <harri at mpaja.com>:
> On 02/09/2012 02:43 PM, Andreas Pakulat wrote:
>
>>  On 09.02.12 14:26:34, Harri Pasanen wrote:
>>>  On 02/09/2012 11:10 AM, Andreas Pakulat wrote:
>>>>  On 09.02.12 10:14:59, Harri Pasanen wrote:
>>>>>  Picking your collective brain here...
>>>>>
>>>>>  I'm trying to do some batch style image processing with a Qt app, using
>>>>>  QImage.
>>>>>  As QCoreApplication / console everything compiled, but silently failed
>>>>>  at runtime.
>>>>>  ...
>>>>  Sounds like you're using QPixmap, that one is a native GUI pixmap and
>>>>  hence requires a GUI application that connects to whatever draws the GUI
>>>>  on your device (X11 on Linux). If you just want to paint something on a
>>>>  png, simply use QImage only and then you can go back to
>>>>  QCoreApplication.
>>>>
>>>>  Andreas
>>>  No, I'm using QImage, actually doing drawText on it, and that does not work.
>>>  Fonts are probably provided by the underlying window system, perhaps that
>>>  is the problem?
>>  At least on Linux that is the case yes, no idea wether its possible to
>>>   provide font's and font-rendering to Qt without requiring the platforms
>>  GUI layer to be up and running.
>
> Yes, fonts were my problem.  QFont requires QApplication.

You should be able to create QApplication without running X11 using constructor

QApplication::QApplication ( int & argc, char ** argv, bool GUIenabled )

If that fails, you can try to use Xvfb instead of "real" X server.

-- 
Regards,
Konstantin



More information about the Interest mailing list