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. QSlider Customize bug?
QtWS25 Last Chance

QSlider Customize bug?

Scheduled Pinned Locked Moved Solved General and Desktop
4 Posts 1 Posters 2.0k Views
  • 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.
  • M Offline
    M Offline
    minjunkim
    wrote on last edited by minjunkim
    #1

    hi,

    i want to use border-radius

    Below is the result my custom slider

    0_1540802233447_bug.png

    In the second picture, the border-radius does not apply.

    The radius disappear when moved the bar to the right.

    below is my code

    QSlider::groove:horizontal {
    border: 1px solid #262626;
    height: 7px;
    border-radius:4px;
    }

    QSlider::handle:horizontal {
    width: 15px;
    height: 30px;
    margin: -10px -7px;
    border-image: url(:/icons/icons/notification/svg/production/ic_priority_high_24px.svg);
    border-radius:4px;
    }

    QSlider::add-page:horizontal {
    border-radius: 4px;
    background: gray;
    }

    QSlider::sub-page:horizontal {
    border-radius:4px;
    background: red;
    }

    is this qt bug?

    why is this?

    1 Reply Last reply
    0
    • M Offline
      M Offline
      minjunkim
      wrote on last edited by
      #2

      QSlider::add-page:horizontal {
      border-radius: 4px;
      background: gray;
      margin: 0.5px;
      }

      QSlider::sub-page:horizontal {
      border-radius: 4px;
      background: red;
      margin: 0.5px;
      }

      When I apply this, the radius problem disappears but the border is visible on add,sub page.

      1 Reply Last reply
      0
      • M Offline
        M Offline
        minjunkim
        wrote on last edited by minjunkim
        #3

        i solve this problem..

        Some options have been changed and solved.

        but I still don't know why this is happening.

        below is my code

        .QSlider {
        min-height: 34px;
        max-height: 34px;
        }

        .QSlider::groove:horizontal {
        border: 1px solid #262626;
        height: 8px;
        background: #393939;
        margin: 0px 1px;
        border-radius:5px;
        }

        .QSlider::handle:horizontal {
        background:transparent;
        border: 1px solid red;
        width: 15px;
        height: 100px;
        margin: -12px -6px;
        border-radius:5px;
        border-image: url(:/icons/icons/av/svg/production/ic_stop_24px.svg);
        }

        QSlider::add-page:qlineargradient {
        background: lightgrey;
        border-top-right-radius: 5px;
        border-bottom-right-radius: 5px;
        border-top-left-radius: 0px;
        border-bottom-left-radius: 0px;
        }

        QSlider::sub-page:qlineargradient {
        background: blue;
        border-top-right-radius: 0px;
        border-bottom-right-radius: 0px;
        border-top-left-radius: 5px;
        border-bottom-left-radius: 5px;
        }

        result

        0_1540865745504_slider.png

        M 1 Reply Last reply
        0
        • M minjunkim

          i solve this problem..

          Some options have been changed and solved.

          but I still don't know why this is happening.

          below is my code

          .QSlider {
          min-height: 34px;
          max-height: 34px;
          }

          .QSlider::groove:horizontal {
          border: 1px solid #262626;
          height: 8px;
          background: #393939;
          margin: 0px 1px;
          border-radius:5px;
          }

          .QSlider::handle:horizontal {
          background:transparent;
          border: 1px solid red;
          width: 15px;
          height: 100px;
          margin: -12px -6px;
          border-radius:5px;
          border-image: url(:/icons/icons/av/svg/production/ic_stop_24px.svg);
          }

          QSlider::add-page:qlineargradient {
          background: lightgrey;
          border-top-right-radius: 5px;
          border-bottom-right-radius: 5px;
          border-top-left-radius: 0px;
          border-bottom-left-radius: 0px;
          }

          QSlider::sub-page:qlineargradient {
          background: blue;
          border-top-right-radius: 0px;
          border-bottom-right-radius: 0px;
          border-top-left-radius: 5px;
          border-bottom-left-radius: 5px;
          }

          result

          0_1540865745504_slider.png

          M Offline
          M Offline
          minjunkim
          wrote on last edited by
          #4
          This post is deleted!
          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