Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Breeze style disobeys some style options
Forum Updated to NodeBB v4.3 + New Features

Breeze style disobeys some style options

Scheduled Pinned Locked Moved Solved General and Desktop
3 Posts 3 Posters 448 Views 2 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • E Offline
    E Offline
    Ewan Green
    wrote on last edited by
    #1

    The code in question:

      void paintEvent(QPaintEvent *) {
        if (isHovered) {
          QPainter p(this);
          QStyleOptionButton styleOption;
          styleOption.initFrom(this);
          isPressed ? styleOption.state = QStyle::State_Sunken
                    : styleOption.state = QStyle::State_Raised;
          style()->drawControl(QStyle::CE_PushButton, &styleOption, &p, this);
        }
      }
    

    What I get with Fusion:

    1.gif

    What I get with Breeze (you'll just have to trust that I'm clicking here...):
    2.gif

    What's the deal with that? I've noticed that Breeze also does some custom stuff like halfway using the QPalette (sometimes it will use its signature light blue even in places where the "highlight" color role is set differently). Is there another API that I can use to paint my stuff to look like a button, and it would actually work? The widget is not a child of QPushButton or QAbstractButton. Just QWidget.

    Ewan Green

    RokeJulianLockhartR 1 Reply Last reply
    0
    • Christian EhrlicherC Offline
      Christian EhrlicherC Offline
      Christian Ehrlicher
      Lifetime Qt Champion
      wrote on last edited by
      #2

      The only way is to either try to fix the style by providing patches to KDE (and hope it gets accepted) or write your own style derived from Breeze.

      Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
      Visit the Qt Academy at https://academy.qt.io/catalog

      1 Reply Last reply
      2
      • E Ewan Green

        The code in question:

          void paintEvent(QPaintEvent *) {
            if (isHovered) {
              QPainter p(this);
              QStyleOptionButton styleOption;
              styleOption.initFrom(this);
              isPressed ? styleOption.state = QStyle::State_Sunken
                        : styleOption.state = QStyle::State_Raised;
              style()->drawControl(QStyle::CE_PushButton, &styleOption, &p, this);
            }
          }
        

        What I get with Fusion:

        1.gif

        What I get with Breeze (you'll just have to trust that I'm clicking here...):
        2.gif

        What's the deal with that? I've noticed that Breeze also does some custom stuff like halfway using the QPalette (sometimes it will use its signature light blue even in places where the "highlight" color role is set differently). Is there another API that I can use to paint my stuff to look like a button, and it would actually work? The widget is not a child of QPushButton or QAbstractButton. Just QWidget.

        RokeJulianLockhartR Offline
        RokeJulianLockhartR Offline
        RokeJulianLockhart
        wrote on last edited by
        #3

        Breeze also does some custom stuff like halfway using the QPalette (sometimes it will use its signature light blue even in places where the "highlight" color role is set differently).

        @Ewan-Green, that's deliberate: Breeze uses KColorScheme to supersede the QPalette. It's because in KDE4, the palette wasn't sufficient. There is an effort to port it to the palette, but I've yet to ascertain whether it's even tracked (beyond, perhaps Union).

        Irrespective, did you ever report this, or did it remediate itself? If the former, have you the URI?

        When using a forum, remember to tag the person you are responding to, in case they are not subscribed to the thread.

        1 Reply Last reply
        0

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved