how to work with XPMs ?

Corp. yA (Zdenek Pizl) pizl at max.af.czu.cz
Tue Aug 24 20:02:50 BST 1999


Hi all,

 i hae problem to add any xpm picture to the project, especially - I
cannot compile this sequence :

 ---------------- snip -------------
  QPixmap *pix_rotate, *pix_scale, *pix_paint;

  pix_paint  = new QPixmap( paint );

  this->bar = new QToolBar("Tool Bar",this);

  this->paintButton = new QToolButton(*pix_paint, "paint pixels", \
                          "... freehand pixel-paint, left mousebutton 
for paint, right mousebutton for clear.", \
                          (QObject *)centralWidget,
SLOT(setPaintTool()), (QToolBar *)bar, "Pencil" );

 when the pixmap paint is like:
/* XPM */
static char*paint[]={
"28 28 5 1",
"b c #949194",
". c #dedade",
"a c #000000",
"c c #ffffff",
"# c #d5d6d5",
"............................",
"............................",
"....#####################.##",
"....#####################.#.",
"....#######################.",
"....#######################.",
"....#######################.",
"....##########aaaa#########.",
"....##########a...a########.",
"....#########a....ab#######.",
"....#########aa..abb#######.",
"....########accaaab########.",
"....########ac..abb########.",
"....#######acc..ab#########.",
"....#######ac..abb#########.",
"....######acc..ab##########.",
"....######ac..abb##########.",
"....######aa..ab###########.",
"....######aaaabb###########.",
"....######aaabb############.",
"....######aabb#############.",
"....######abb##############.",
"....#######b###############.",
"....#######################.",
"....#############.#########.",
"....#######################.",
"....#######################.",
"............................"};


 ---------------- snip -------------

i had included the paint.xpm in main.cpp (where i am trying to create a
toolbar) but compiler has given me a lot error messages :( about using
an ambigious overloaded function QPixmap(const char **), but offered me
the same function as a nearest match ??

(KDEvelop beta 1)

How can i work with XPM pictures in my projects ??

-- 
---------------------------------------------------------------------
          Zdeněk Pižl, (Corp. yA), http://max.af.czu.cz
             mail me only in ISO 8859-2 or in ASCII
---------------------------------------------------------------------
         ... what disk do you want to erase today ?? ...



More information about the KDevelop mailing list