Re: QProgressBar stylesheet in visal studio
Hi,
I'm trying to set a custom stylesheet (exactly this) for a QProgressBar via Visual Studio.
I used that piece of CSS Code to set the stylesheet, but QProgressBar doesn't have a "setStyleSheet" method, so I don't know what to do with it. How does configure a style for it "by hand" (not using QDesigner)?
Added after 20 minutes:
Isolved it.
Visual Studio was going crazy and did not recognize setStyleSheet as a valid method. Now it works fine.
Re: QProgressBar stylesheet in visal studio
Use QApplication::setStyleSheet()
Code:
qApp->setStyleSheet("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);"
"}"