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. Style sheet property for QDial
Qt 6.11 is out! See what's new in the release blog

Style sheet property for QDial

Scheduled Pinned Locked Moved Solved General and Desktop
2 Posts 2 Posters 1.0k Views 1 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.
  • J Offline
    J Offline
    Jaswenth S
    wrote on last edited by
    #1

    I am trying to add CSS for QDial in the .ui file.

    I have added some basic stylesheets (like background-color) but it doesn't reflects on the QDial.
    I think I am missing the actual selector(QDial{property: value} that should be added insted of QDial.
    CSS snippet:

    QDial
        {
            background-color:QLinearGradient( 
                x1: 0.177, y1: 0.004, x2: 0.831, y2: 0.911, 
                stop: 0 white, 
                stop: 0.061 white, 
                stop: 0.066 lightgray, 
                stop: 0.5 #242424, 
                stop: 0.505 #000000,
                stop: 0.827 #040404,
                stop: 0.966 #292929,
                stop: 0.983 #2e2e2e
            );
        }
    

    kindly help me through change the dial using css.
    note: I don't want to use a custom dial as an alternative solution due to my constraint

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

      Hi
      QDial is just a composite QWidget and does not really support style sheets directly.
      https://doc.qt.io/qt-6/stylesheet-reference.html

      However, you can style some elements using QWidget etc as selectors.

      Im not sure you can get the result you want without a custom QDial as seen here
      https://forum.qt.io/topic/62315/design-a-custom-dial

      1 Reply Last reply
      0
      • J Jaswenth S has marked this topic as solved on

      • Login

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