Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. QprogressBar minValue and maxvalue changes different color
Forum Updated to NodeBB v4.3 + New Features

QprogressBar minValue and maxvalue changes different color

Scheduled Pinned Locked Moved Unsolved Mobile and Embedded
1 Posts 1 Posters 175 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.
  • B Offline
    B Offline
    benamiar
    wrote on last edited by
    #1

    Hello guys,
    i need to create a QProgressBar where we can choose a range and also the minimim ans the maximum value.
    0_1563469491105_value.jpg
    the white value can change

     setStyleSheet(QString("QProgressBar{background-color: %2; border: 2px solid %2; border-radius: 1px; margin: 0px; text-align: center;}"
                              "Q2ProgressBar:disabled{background-color: %3; border: 2px solid %3; border-radius: 1px; margin: 0px; text-align: center;}"
                          "QProgressBar::chunk{background-color: qlineargradient(x0: 0, x2: 1, stop : 0 %1, stop: %5 %1, stop: 0.%6 %4, stop: 1 %4); margin: 0px}"
                             ).arg(Q2UiColorsLocator::get().getDispText().name(),
                                   Q2UiColorsLocator::get().getDispText().name(),
                                   Q2UiColorsLocator::get().getDisabled().name(),
                                   Q2UiColorsLocator::get().getDispBackground().name())
                                  .arg(min+0.00001)
                                  .arg(((min)+0.00002)));
    
    

    but seems to be like like a diy solution because each time we should add 0.0000001 to not have a gradiant color and also not working 100% so if you have any idea i'll take it thanks so much

    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