[ale] QT3 Designer "cannot find pixmap" error

Charles Shapiro hooterpincher at gmail.com
Sat Aug 15 19:45:01 EDT 2009


Anyone using QT3 designer from the Ubuntu "Jaunty Jackalope" repository
("help about" says V 3.3.8b).

I'm workin' through the tutorials (storing up QT-fu for a personal project),
and I've found that the "colorpicker" example doesn't load toolbar images,
even though they show up fine in the designer itself. The stdout for the
program run in terminal mode shows:

QPixmap::fromMimeSource: Cannot find pixmap "filenew" in the mime source
factory
QPixmap::fromMimeSource: Cannot find pixmap "fileopen" in the mime source
factory
QPixmap::fromMimeSource: Cannot find pixmap "filesave" in the mime source
factory
QPixmap::fromMimeSource: Cannot find pixmap "editcut" in the mime source
factory
QPixmap::fromMimeSource: Cannot find pixmap "editcopy" in the mime source
factory
QPixmap::fromMimeSource: Cannot find pixmap "editpaste" in the mime source
factory
QPixmap::fromMimeSource: Cannot find pixmap "searchfind" in the mime source
factory
QPixmap::fromMimeSource: Cannot find pixmap "tabwidget.png" in the mime
source factory
QPixmap::fromMimeSource: Cannot find pixmap "kdeprint_nup1.png" in the mime
source factory
QPixmap::fromMimeSource: Cannot find pixmap "kdeprint_nup4.png" in the mime
source factory
QPixmap::fromMimeSource: Cannot find pixmap "k3iconview.png" in the mime
source factory

The solution is to add the following lines to the "main.cpp" file, before it
instantiates your "colorpicker" object:

  QMimeSourceFactory *myFactory=QMimeSourceFactory::defaultFactory();
  myFactory->setFilePath("images");

This will set the file path properly so that the automagically created
QMimeSourceFactory environment object will find the pixmaps it's looking
for.  I suppose you could put them in your current directory as well, but
that seems like a Sin. You can't put these lines into your
"colorpicker::init()" function because init() gets run at the end of the
automatically generated code in the instantiation function, after the
actions have already (theoretically) received their icons.

Google is silent on this matter, so I'm leaving a breadcrumb here for future
users.


-- CHS
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.ale.org/pipermail/ale/attachments/20090815/bb030ba7/attachment.html 


More information about the Ale mailing list