Can I color a layout that is empty?
-
I have a layout that I want to color with white
-
I have a layout that I want to color with white
-
Hi
Can i ask why you want to color an empty layout ? -
@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.
@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 -
@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 */ }
-
@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 */ }
@mrjj it works but the groupBox seems to have border circular and the inside isn't the same color gray of the background
-
@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
and the inside isn't the same color gray of the border, I wanted to say@vale88 I solved, thank you
-
@vale88
and the inside isn't the same color gray of the border, I wanted to say@vale88
Well it was just sample.
i expected you to change colors to what you wanted :)But actaully @J-Hilk's hawk eye spotted the real issue it does work then
QGroupBox { border-color:rgb(117,117,117); background-color:rgb(117,117,117); };
-
@vale88
Well it was just sample.
i expected you to change colors to what you wanted :)But actaully @J-Hilk's hawk eye spotted the real issue it does work then
QGroupBox { border-color:rgb(117,117,117); background-color:rgb(117,117,117); };
But actaully @J-Hilk's hawk eye spotted the real issue it does work then
a skill earend through countless hours of suffering...
I have spend days fighting with the stylesheet, only to learn I had it right in the beginning, but a ; was missing
🙈