From: Joe P. <joe...@sn...> - 2001-03-05 05:03:35
|
On Sunday 04 March 2001 19:42, David Paschal wrote: > > I get compiler errors when using the default *.xpm array declaration. The > > only way I could make it work was to hand-modify the declaration inside > > each pixmap. It was quite simple to do, but is there a better way to > > #include *.xpm's? It would need to be something that Qt will accept. > > That's unfortunate. What is the exact error you got (perhaps something > about the "static" keyword?), and what specifically did you have to change > to make it work? There are no errors reported during compilation if I change the pixmaps' internal array declarations. Original declaration inside file hpoj_mini.xpm: /* XPM */ static char * hpoj_mini_xpm[] = { <data> }; The 'const' keyword needs to be added to make it work. /* XPM */ static const char * hpoj_mini_xpm[] = { <data> }; This is the error reported if I don't modify the pixmap's array declaration: ... ... ojstatus.cpp: In method `void XojPanel::createInterface()': ojstatus.cpp:160: passing `char **' as argument 1 of `QPixmap::QPixmap(const char **)' adds cv-quals without intervening `const' make: *** [ojstatus.o] Error 1 I'm using gcc-2.95-2. I think the errors may be due to a requirement of Qt. When I use the contents of an #included pixmap, I've been using the internal array name. In the case of hpoj_mini.xpm, this is the line of code: this->setIcon(QPixmap(hpoj_mini_xpm)); For the LCD background pixmap: *lcdPixmap = (QPixmap)hpojlcd_xpm; To avoid causing confusion, I may be able to simply change the modified pixmaps' filenames to indicate that they are a source of data, not regular pixmaps. A name could be changed from 'hpoj_mini.xpm' to 'hpoj_mini_xpm.data' for example. -- Joe |