Results 1 to 1 of 1

Thread: setAutoFilledBackground leads to different result.

  1. #1
    Join Date
    Nov 2011
    Location
    Karlsruhe, Germany
    Posts
    57
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Windows
    Thanks
    10

    Default setAutoFilledBackground leads to different result.

    Hello all,

    while calling setAutoFillBackground() in QLabel and QCheckBox lead to different results in my project.

    here the code of my custom widgets - statictext(QLabel) and checkbox(QCheckbox)

    Qt Code:
    1. void StaticText :: setTransparent(bool bTransparent)
    2. {
    3. setAutoFillBackground(! bTransparent);
    4. }
    5.  
    6. void CheckBox :: setTransparent(bool bTransparent)
    7. {
    8. setAutoFillBackground(! bTransparent);
    9. }
    To copy to clipboard, switch view to plain text mode 

    the attached picture shows the issue:

    bug.png

    why by calling both setAutoFillBackground(true) makes the custom widgets behave differently, in which statictext displays the parents background color and checkbox with a system default light gray?

    PS: please just consider i dont use stylesheet in my project. And im sure i didnt set up their background color somewhere in the project. And they have a same parent widget.

    I am using Qt 4.8.6 under Windows 7

    Thx.


    ---------------------------------------------------------------------------------

    well, the problem is the default backgroundRole() of QLabel and QCheckBox is different, so they took the colors of each color role. Question closed...
    Last edited by cic; 14th May 2014 at 12:43.

Similar Threads

  1. Replies: 10
    Last Post: 5th December 2013, 09:18
  2. Windows 7 Font Magnification leads to printing differences
    By darthczyz in forum Qt Programming
    Replies: 0
    Last Post: 21st April 2012, 03:51
  3. Replies: 4
    Last Post: 22nd May 2010, 05:54
  4. Replies: 6
    Last Post: 17th March 2010, 11:53
  5. Slight change leads to segmentation fault in qt example
    By codemonkey in forum Qt Programming
    Replies: 0
    Last Post: 24th January 2010, 09:10

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
  •  
Qt is a trademark of The Qt Company.