| Trolltech Home | Qt-interest Home | Recent Threads | All Threads | Author | Date | |
| All threads index page 1 | |
hi all, this is my first post on this list. i need to compile a small app that uses QImage, but does not have access to X. it has no gui elements. i've tried eliminating the linker switches ' -lXext' and '-lX11' from Makefile, and the app links and runs fine in a shell where X is available, but in the required context i still get the error "Must construct a QApplication before a QPaintDevice". can anybody suggest a workaround. tomorrow, i will port the app to use ImageMagick, but i still need a solution... jp(a)day-one.com cheers jono ** -- [ signature omitted ]
On 03.09.07 10:19:48, jono wrote: > i need to compile a small app that uses QImage, but does not have access to X. > it has no gui elements. > > i've tried eliminating the linker switches ' -lXext' and '-lX11' from > Makefile, and the app links and runs fine in a shell where X is available, but > in the required context i still get the error "Must construct a QApplication > before a QPaintDevice". > can anybody suggest a workaround. tomorrow, i will port the app to use > ImageMagick, but i still need a solution... There is none, you can't use any class from QtGui without an XServer running. Andreas -- [ signature omitted ]
On 03.09.07 10:55:05, jono wrote: > Andreas Pakulat wrote: > >On 03.09.07 10:19:48, jono wrote: > > > >>i need to compile a small app that uses QImage, but does not have access to > >>X. it has no gui elements. > >> > >>i've tried eliminating the linker switches ' -lXext' and '-lX11' from > >>Makefile, and the app links and runs fine in a shell where X is available, > >>but in the required context i still get the error "Must construct a > >>QApplication before a QPaintDevice". can anybody suggest a workaround. > >>tomorrow, i will port the app to use ImageMagick, but i still need a > >>solution... > >> > > > >There is none, you can't use any class from QtGui without an XServer > >running. > > > > thanks Andreas. thats what i feared. > btw, i assume you by 'any class from QtGui' you mean 'any class from Qt'... > or, if not, what distinguishes QImage as a gui class? I guess you're using Qt3 then? (In Qt4 there are separete modules and thus separate libraries for core-non-x11 apps and gui-apps, and QImage is part of the gui library) And please keep the discussion on the list. Andreas -- [ signature omitted ]
On 9/2/07, Andreas Pakulat <apaku@xxxxxx> wrote: > On 03.09.07 10:19:48, jono wrote: > > i need to compile a small app that uses QImage, but does not have access to X. > > it has no gui elements. > > > > i've tried eliminating the linker switches ' -lXext' and '-lX11' from > > Makefile, and the app links and runs fine in a shell where X is available, but > > in the required context i still get the error "Must construct a QApplication > > before a QPaintDevice". > > can anybody suggest a workaround. tomorrow, i will port the app to use > > ImageMagick, but i still need a solution... > > There is none, you can't use any class from QtGui without an XServer > running. Trolltech Labs suggests otherwise. Here's an example Qt CGI program which uses QImage and QPainter to render text: http://labs.trolltech.com/blogs/2006/12/20/whats-this-cgi/ -- [ signature omitted ]
On 02.09.07 22:55:18, Andrew Medico wrote: > On 9/2/07, Andreas Pakulat <apaku@xxxxxx> wrote: > > On 03.09.07 10:19:48, jono wrote: > > > i need to compile a small app that uses QImage, but does not have access to X. > > > it has no gui elements. > > > > > > i've tried eliminating the linker switches ' -lXext' and '-lX11' from > > > Makefile, and the app links and runs fine in a shell where X is available, but > > > in the required context i still get the error "Must construct a QApplication > > > before a QPaintDevice". > > > can anybody suggest a workaround. tomorrow, i will port the app to use > > > ImageMagick, but i still need a solution... > > > > There is none, you can't use any class from QtGui without an XServer > > running. > > Trolltech Labs suggests otherwise. Here's an example Qt CGI program > which uses QImage and QPainter to render text: > http://labs.trolltech.com/blogs/2006/12/20/whats-this-cgi/ Ok, I'm wrong about Qt4 (I thought you'd still need an X11 connection for QApplication to work, learn something new every day). But the OP uses Qt3 anyway, so my statement is still true for the OP :) Andreas -- [ signature omitted ]
On Monday 03 September 2007 10.55:53 Andreas Pakulat wrote: > On 02.09.07 22:55:18, Andrew Medico wrote: > > On 9/2/07, Andreas Pakulat <apaku@xxxxxx> wrote: > > > On 03.09.07 10:19:48, jono wrote: > > > > i need to compile a small app that uses QImage, but does not have > > > > access to X. it has no gui elements. > > > > > > > > i've tried eliminating the linker switches ' -lXext' and '-lX11' > > > > from Makefile, and the app links and runs fine in a shell where X is > > > > available, but in the required context i still get the error "Must > > > > construct a QApplication before a QPaintDevice". > > > > can anybody suggest a workaround. tomorrow, i will port the app to > > > > use ImageMagick, but i still need a solution... > > > > > > There is none, you can't use any class from QtGui without an XServer > > > running. > > > > Trolltech Labs suggests otherwise. Here's an example Qt CGI program > > which uses QImage and QPainter to render text: > > http://labs.trolltech.com/blogs/2006/12/20/whats-this-cgi/ > > Ok, I'm wrong about Qt4 (I thought you'd still need an X11 connection > for QApplication to work, learn something new every day). But the OP > uses Qt3 anyway, so my statement is still true for the OP :) > > Andreas If avoiding use of X11, wouldn't it be more easy with Qt/Embedded(as The OP uses Qt3) ? No need of X11 and graphic elements are still accessible :-) Samuel -- [ signature omitted ]
Hi, > There is none, you can't use any class from QtGui without an XServer > running. I'm not sure about Qimage, will have to check. Note however the question was about removing the X11 link dependency, which is hard even in Qt 4, since QImage lives in libQtGui. Concerning "one can't use any class from QtGui without an XServer running": this is easier and actually does work for some of the classes as far as I can remember. -- [ signature omitted ]
> i need to compile a small app that uses QImage, but does not have access > to X. it has no gui elements. > > i've tried eliminating the linker switches ' -lXext' and '-lX11' from > Makefile, and the app links and runs fine in a shell where X is > available, but in the required context i still get the error "Must > construct a QApplication before a QPaintDevice". > > can anybody suggest a workaround. tomorrow, i will port the app to use > ImageMagick, but i still need a solution... Hello, A viable technique is the use of Xvfb. -- [ signature omitted ]
Attachment:
signature.asc
Description: This is a digitally signed message part.
El Lunes 03 Septiembre 2007, Werner Van Belle escribiÃ: > > i need to compile a small app that uses QImage, but does not have access > > to X. it has no gui elements. > > > > i've tried eliminating the linker switches ' -lXext' and '-lX11' from > > Makefile, and the app links and runs fine in a shell where X is > > available, but in the required context i still get the error "Must > > construct a QApplication before a QPaintDevice". > > > > can anybody suggest a workaround. tomorrow, i will port the app to use > > ImageMagick, but i still need a solution... > > Hello, > > A viable technique is the use of Xvfb. Perhaps: http://labs.trolltech.com/blogs/2006/12/20/whats-this-cgi/ Or compiling with QTopia for framebuffer perhaps... My two pense, Lisandro. -- [ signature omitted ]
Attachment:
signature.asc
Description: This is a digitally signed message part.