Solved Can I color a layout that is empty?
-
I have a layout that I want to color with white
-
@vale88 A layout is not a widget and cannot be colored. You will need to put a widget into this layout and color the widget instead.
-
Hi
Can i ask why you want to color an empty layout ? -
@jsulm ok, I'm coloring the groupBox inside, I colored the background of the groupBox, now I want to colore the border, but in this way:
ui->groupBox_3->setStyleSheet("QGroupBox: { border: 2px solid gray; }");
the groupBox becomes transparent without the color inside also -
Hi
Combine both stylesheets to one so you both set color and also background. -
@mrjj I wrote:
ui->groupBox_3->setStyleSheet("QGroupBox: { border-color:rgb(117,117,117); background-color:rgb(117,117,117)}");
but It doesn't work, the groupBox becomes Transparent -
@vale88
It does work but you have to specify moreQGroupBox { 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; /* leave space at the top for the title */ }
-
@vale88 you're missing a
;
at the end.
It makes a difference ;) -
@mrjj it works but the groupBox seems to have border circular and the inside isn't the same color gray of the background
-
@vale88
and the inside isn't the same color gray of the border, I wanted to say -
@vale88 I solved, thank you
-
-