Results 1 to 4 of 4

Thread: Problem with widget stylesheets in 4.5.3 on Linux

  1. #1
    Join Date
    May 2009
    Posts
    16
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Problem with widget stylesheets in 4.5.3 on Linux

    Greets!

    I'm having a bit of issue trying to create a label with a transparent background using a stylesheet. Everything seems to work, except I get a weird radial gradient that I didn't ask for...

    Qt Code:
    1. testLabel = new QLabel("Hello, world!");
    2. testLabel->setStyleSheet(
    3. "background-color: rgba(255, 255, 255, 0%);"
    4. "font-size: 20px;"
    5. );
    6. addWidget(testLabel);
    To copy to clipboard, switch view to plain text mode 

    I've attached an image that shows what I'm talking about.

    Any idea where that gradient is coming from and how I can get rid of it? It appears to happen on buttons too.
    Attached Images Attached Images

  2. #2
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,714
    Thanks
    21
    Thanked 418 Times in 411 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: Problem with widget stylesheets in 4.5.3 on Linux

    Actually looks cool!

    But seriously, are you using any other style sheets, on a higher level, that maybe implement this gradient on the label?
    ==========================signature=============== ==================
    S.O.L.I.D principles (use them!):
    https://en.wikipedia.org/wiki/SOLID_...iented_design)

    Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.

  3. #3
    Join Date
    Feb 2008
    Posts
    4
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: Problem with widget stylesheets in 4.5.3 on Linux

    Does it come from some from using some funky style on your app?

    Try starting it in a different style and see if it still happens:

    ./yourapp -style plastique

  4. #4
    Join Date
    May 2009
    Posts
    16
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Problem with widget stylesheets in 4.5.3 on Linux

    Yeah, that was the problem. I'm running KDE 4, and I'm using the Oxygen widget style.

    Note below that I'm now setting the widget's style to QWindowsStyle, which is very basic, which seems to work.

    Qt Code:
    1. QWindowsStyle * WindowsStyle = new QWindowsStyle;
    2. testLabel = new QLabel("Hello, world!");
    3. testLabel->setStyleSheet(
    4. "background-color: rgba(255, 255, 255, 0%);"
    5. "font-size: 20px;"
    6. );
    7. testLabel->setStyle(WindowsStyle);
    8. addWidget(testLabel);
    To copy to clipboard, switch view to plain text mode 

    Thanks!

    Bart

Similar Threads

  1. Replies: 3
    Last Post: 12th April 2006, 08:20
  2. Problem reimplementing QSpinBox in a custom widget
    By hvengel in forum Qt Programming
    Replies: 1
    Last Post: 30th March 2006, 08:12
  3. Problem with custom widget
    By jnana in forum Qt Programming
    Replies: 3
    Last Post: 15th March 2006, 11:55
  4. Widget resizing problem
    By fwohlfert in forum Qt Programming
    Replies: 3
    Last Post: 23rd February 2006, 08:16
  5. Replies: 7
    Last Post: 3rd February 2006, 10:20

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.