PDA

View Full Version : Build problems



Seema Rao
27th April 2006, 08:39
I have written a sample that uses a .bmp file as its back ground image. Image's size is almost 2.0 MB. I have specified it in ".qrc" file. But while building the sample, particularly compiling the qrc_sample.cpp it hangs and build process is never completed. Here is the code I have written,

QPixmap pixmap;
pixmap.load("images/fully.bmp");
palette.setBrush((this)->backgroundRole(), QBrush(pixmap));
(this)->setPalette(palette);

// here is the listing in sample.qrc
<file>images/fully.bmp</file>

Is their any limitation on the size of files that are used in qrc or its a bug ? Is their any work around possible ? I just tweaked into qrc_sample.cpp and it was around 1,32,685 lines. Am I doing anything wrong here?
Thanks in advance,
Seema Rao

guilugi
27th April 2006, 09:42
Are you sure your .qrc file is in the good directory ?

It should be like this :

qrc_sample.qrc
qrc_sample.cpp <generated by compiler>
images/
|_ fully.bmp

By the way, in your code..to load the pixmap from resource, you have to do like this :
pixmap.load(":/images/fully.bmp");

Don't forget the ':/' before the path !

Guilugi.

Seema Rao
27th April 2006, 10:24
Hi I tried the way you have indicated but It still hangs both on Linux and Mac. I dont know why? here is the compilation row,

/usr/local/Trolltech/Qt-4.0.1/bin/rcc -name menus sample.qrc -o qrc_sample.cpp
g++ -c -pipe -g -Wall -W -D_REENTRANT -DQT_CORE_LIB -DQT_GUI_LIB -DQT_SHARED -I/usr/local/Trolltech/Qt-4.0.1/mkspecs/linux-g++ -I. -I/usr/local/Trolltech/Qt-4.0.1/include/QtGui -I/usr/local/Trolltech/Qt-4.0.1/include/QtCore -I/usr/local/Trolltech/Qt-4.0.1/include -I. -I. -I. -o qrc_sample.o qrc_sample.cpp

It hangs here ---

munna
27th April 2006, 10:53
It is probably not hanging but taking too long to compile 1,32,685 lines of code.
Why dont you convert the bmp to png and then try.