PDA

View Full Version : segmentation fault for no apparent reason



rishiraj
12th February 2009, 05:56
Hi,
am making changes to a photogallery which was designed on Qt 3.3

All that I changed in the form till now(which I did using designer) was add a Label 'rotatepic' near the 'Rotate' button.

In the slot rotate() for the 'Rotate' button,I added one extra line-


rotatepic->setPaletteBackgroundColor(QColor(170,255,0));


so that when I click the 'Rotate 'button,the 'rotate' label next to it also changes to the same colour as the 'Rotate' button changes to.But,when I run the program,I get a segmentation fault when I click the 'Rotate' button.

if I comment out the line rotatepic->setPaletteBack....., The 'Rotate' feature works fine.

I have buttons like Next,Previous,Slideshow etc....in whichever button's slot I add the line of code mentioned above,I get a segmentation fault corresponding to that button.If i comment out that line,things work fine.

I can't figure out what's wrong.
Please advice.

Thanks in advance.

rishiraj
12th February 2009, 11:13
Hi,
it's working now.I don't understand why it was showing segmentation fault earlier but,it's working fine for now.