can i "stylesheet" the "QGroupBox" on windows to draw a darker outline?
Solved
General and Desktop
-
it's so lite it's quite difficult to see:
-
that worked!
-
@davecotter
I don't know for sure, but https://doc.qt.io/qt-5/stylesheet-examples.html#customizing-qgroupbox shows e.g.QGroupBox {border: 2px solid gray;}
so try playing with that? -
Hi @davecotter
Yes, Its possible.
ui->groupBox->setStyleSheet("QGroupBox {" "background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #E0E0E0, stop: 1 #FFFFFF);" "border: 2px solid gray;" "border-radius: 5px;" "margin-top: 1ex;" "}");
All the best.
-
using style sheet, i can't for the life of me get the "GroupBox" text to draw ABOVE the group box line, it's always INSIDE, obscuring the first thing inside the box.
-
Hi @davecotter
Did you check the documentation link shared by @JonB
Refer :
- Customizing QGroupBox :
QGroupBox::title { }
Below is sample code & Output.
ui->groupBox->setStyleSheet("QGroupBox {" "background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #E0E0E0, stop: 1 #FFFFFF);" "border: 2px solid gray;" "border-radius: 5px;" "margin-top: 10ex;" "}" "QGroupBox::title {" "subcontrol-origin: margin;" "padding: 5 0px;" "}");
All the best.
- Customizing QGroupBox :
-
that worked!