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. QSS border-width transition with rounded corners
Forum Updated to NodeBB v4.3 + New Features

QSS border-width transition with rounded corners

Scheduled Pinned Locked Moved Unsolved General and Desktop
stylesheet
4 Posts 2 Posters 3.7k 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.
  • A Offline
    A Offline
    akonshi
    wrote on last edited by
    #1

    Currently I'm trying to make a QPushButton that only has a border at bottom side and rounded corners on all sides. When using Qt Style Sheets, the transition in the corners is somewhat messed up:

    Current result with QSS

    button->setStyleSheet("QPushButton { background: #2196f3; border: none; border-radius: 16px; color: white; font: 12pt;"
                          "border-bottom: solid; border-bottom-color: #136de0; border-bottom-width: 9px;}"
                          );
    

    But what I want is this:

    Goal

    I archieved this by using QGraphicsDropShadowEffect. However, I assume setting the style once – with pseudo-states – is faster than changing the shadow effect on hover/press/release. Plus, I want to use a real shadow and I can only set one QGraphicsEffect at once.

    After reading CSS Border Spec, I thought, I could get also this effect with Qt Style Sheets. How do have to change my first code to archieve this?

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      Looks like it could be a painting bug in with the style used to render the stylesheet.

      Are you customising anything else on your UI ?

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      A 1 Reply Last reply
      0
      • SGaistS SGaist

        Hi,

        Looks like it could be a painting bug in with the style used to render the stylesheet.

        Are you customising anything else on your UI ?

        A Offline
        A Offline
        akonshi
        wrote on last edited by
        #3

        @SGaist No I am using standard QMainWindow under Win7.

        1 Reply Last reply
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #4

          Looks like a rendering problem of the style used to render widget modified by a stylesheet.

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          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