[Uml-devel] [Bug 283748] Umbrello be run headless to export diagrams

Ralf Habacker ralf.habacker at gmail.com
Wed Mar 14 03:00:11 UTC 2012


https://bugs.kde.org/show_bug.cgi?id=283748

--- Comment #4 from Ralf Habacker <ralf.habacker at gmail.com> ---
(In reply to comment #2)
> (In reply to comment #1)
> > (In reply to comment #0)
> > > Version:           unspecified (using KDE 4.5.5) 
> > > OS:                Linux
> > > 
> > > Umbrello cannot be run on a headless machine to export diagrams because it
> > > appears that it needs the X server, even in the absence of the GUI. I've
> > > observed this happening when shelling into another machine and running the
> > > following command remotely.
> > > 
> > > Reproducible: Didn't try
> > > 
> > > Steps to Reproduce:
> > > $ umbrello --export svg Project.xmi
> > > 
> > > Actual Results:  
> > > umbrello: cannot connect to X server
> > > 
> > At a first look there as some obvious reasons for this:
> > 1. in main.cpp KApplication is created always with Gui enabled - this is
> > easy to fix
> > 2. UMLApp uses several objects like the QPrinter object, which creates a
> > QWidget object. It looks they depend on an X-Server. The question is if it
> > is possible to avoid such object creations or if not if it is possible to
> > use some memory based gui output device to avoid the x-server dependency.
> 
> At a second look: UMLApp depends on KXmlGuiWindow, which initialisation
> raises an error  'QWidget: Cannot create a QWidget when no GUI is being
> used'  in the constructor

The message comes from 

void QWidgetPrivate::init(QWidget *parentWidget, Qt::WindowFlags f)
{
    Q_Q(QWidget);
    if (QApplication::type() == QApplication::Tty)
        qFatal("QWidget: Cannot create a QWidget when no GUI is being used");

which means using KApplication/QApplication without GUI enabled will not work. 

> if it is possible to use some memory based gui output device to avoid the x-server dependency.
The answer to this is Xvfb  - http://en.wikipedia.org/wiki/Xvfb

Xvfb :1 >/dev/null 2>&1 &
DISPLAY=:1 umbrello --export-formats
bmp
bw
dot
eps
epsf
epsi
ico
jp2
jpeg
jpg
pcx
pic
png
ppm
rgb
rgba
sgi
svg
tga
tif
tiff
xbm
xpm
xv

-- 
You are receiving this mail because:
You are the assignee for the bug.




More information about the umbrello-devel mailing list