PDA

View Full Version : Widget become black in Release mode



navi1084
18th October 2008, 14:07
Hi,
I have developed a custom control which i am placing in a tab diaolog. i have override the paintEvent() in custom control to paint the control to Gray in color. It works fine in Debug mode.
But in Release mode some time it looks Black in color. After some time it turns to Gray.

Can anyone tell me how can i resolve this

wysota
18th October 2008, 15:12
Can we see the code?

aamer4yu
18th October 2008, 22:48
I guess you are using some variable to store color.
Is this variable initialised ???

Kumosan
20th October 2008, 08:59
If I was mean, I'd answer: Don't put production code in assertions. ;)

wysota
20th October 2008, 17:30
If I was mean, I'd answer: Don't put production code in assertions. ;)

It doesn't have to be that. Some platforms fill the whole memory space of a process with zeroes when in debug mode. This does not happen in release mode. Now black is represented by all zeroes (and Qt::black equals 0). Coincidence? Or maybe not? Anyway it does look as an uninitialized value somewhere.

Kumosan
21st October 2008, 09:07
It doesn't have to be that. Some platforms fill the whole memory space of a process with zeroes when in debug mode. This does not happen in release mode. Now black is represented by all zeroes (and Qt::black equals 0). Coincidence? Or maybe not? Anyway it does look as an uninitialized value somewhere.

I know. I wasn't totally serious. :D

When I am serious I'd suspect a wrong setting in QWidget's autoFillBackground property.