Results 1 to 6 of 6

Thread: Widget become black in Release mode

  1. #1
    Join Date
    Aug 2008
    Posts
    134
    Thanks
    10
    Thanked 3 Times in 3 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Widget become black in Release mode

    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

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Widget become black in Release mode

    Can we see the code?

  3. #3
    Join Date
    Oct 2006
    Location
    New Delhi, India
    Posts
    2,467
    Thanks
    8
    Thanked 334 Times in 317 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Widget become black in Release mode

    I guess you are using some variable to store color.
    Is this variable initialised ???

  4. #4
    Join Date
    Aug 2006
    Posts
    221
    Thanks
    3
    Thanked 29 Times in 19 Posts

    Default Re: Widget become black in Release mode

    If I was mean, I'd answer: Don't put production code in assertions.

  5. #5
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Widget become black in Release mode

    Quote Originally Posted by Kumosan View Post
    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.

  6. #6
    Join Date
    Aug 2006
    Posts
    221
    Thanks
    3
    Thanked 29 Times in 19 Posts

    Default Re: Widget become black in Release mode

    Quote Originally Posted by wysota View Post
    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.

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

Similar Threads

  1. Difference between Debug and Release Mode
    By sunil.thaha in forum Qt Programming
    Replies: 2
    Last Post: 5th May 2013, 13:31
  2. QDockWidget inside another widget in the center?
    By Antebios in forum Qt Programming
    Replies: 1
    Last Post: 16th February 2010, 07:06
  3. QMutex is not working in release mode
    By bitChanger in forum Qt Programming
    Replies: 3
    Last Post: 25th April 2007, 13:32
  4. qodbc driver not loaded error in release mode
    By mandal in forum Qt Programming
    Replies: 1
    Last Post: 14th November 2006, 09:42
  5. Release mode issue
    By stevey in forum Qt Programming
    Replies: 2
    Last Post: 8th November 2006, 20:26

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.