PDA

View Full Version : Icons missing => segmentation fault



antonio.r.tome
8th March 2006, 15:37
Hi,

after figthing almost a day with a piece of code I made that have already runned fine, but was now giving segmentation fault, I find out that some icons I used were erased (I erased them in a cleanup process). The missing icons (for example in the pushup buttons) lead to a segmentation fault.

Anyone knows how to prevent a segmentation fault when the icons are missing?

I'm using QT4.1 in Open suse

my best regards

António Tomé

dublet
8th March 2006, 15:48
Check all your pointers for NULL. :)

jacek
8th March 2006, 15:58
Maybe you have encountered this bug: http://www.trolltech.com/developer/tasktracker.html?method=entry&id=100119 ?

antonio.r.tome
8th March 2006, 16:11
Maybe you have encountered this bug: http://www.trolltech.com/developer/tasktracker.html?method=entry&id=100119 ?

I really don't know! but every mention to a icon that does not exists makes the proagram crash.
For example the line

quit_confirm_ok->setIcon(QIcon(QString::fromUtf8("tasto_7_architetto_franc_01.png")));

created directly with designer makes a segmentation fault if I erase tasto_7_architetto_franc_01.png

A good behavior would be the program ignoring the icon and using only the the text label when the former is not there.


Is it possible to "scramble" the icon inside the Qt code? to avoid this error?


António Tomé

Bojan
8th March 2006, 16:30
I am not sure what do you mean by "scramble" the icon into Qt Code, but there is The Qt Resource System (http://doc.trolltech.com/4.1/resources.html), which may be of some use.

Bojan