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. QStyleOptionProgressBarV2 adding stylesheet , how can it be done ?
Qt 6.11 is out! See what's new in the release blog

QStyleOptionProgressBarV2 adding stylesheet , how can it be done ?

Scheduled Pinned Locked Moved General and Desktop
1 Posts 1 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.
  • U Offline
    U Offline
    umen242
    wrote on last edited by
    #1

    I have ListWidgetItem Deleget , in the paint method i drow progress bar like this :

    @ QStyleOptionProgressBarV2 optionProgress;

            optionProgress.rect = ProgressBarRec;
            optionProgress.maximum = 100;
            optionProgress.minimum = 0;
            optionProgress.progress = 0;
            optionProgress.textVisible = false;
            optionProgress.orientation = Qt::Horizontal;
            QApplication::style()->drawControl(QStyle::CE_ProgressBar, &optionProgress, painter, 0);   
    

    @

    all working great and i see the progressBar , but now i want to style it , and i can't find any way to do it ,
    how do i style QStyleOptionProgressBarV2
    with this :

    @ QProgressBar:horizontal {
    border: 1px solid gray;
    border-radius: 3px;
    background: white;
    padding: 1px;
    }
    QProgressBar::chunk:horizontal {
    background: qlineargradient(x1: 0, y1: 0.5, x2: 1, y2: 0.5, stop: 0 green, stop: 1 white);
    }
    @

    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