1
votes

Im working on a little program that require a QGroupBox that have inside a QLineEdit. I want to make "invisible" the border of the QGroupBox using:

groupBoxName->setStyleSheet("border:0;");

The problem is that even the QLineEdit inside of it inherit this style. How can I make invisible the QGroupBox border but not the QLineEdit border? Thanks

1
Have you tried QGroupBox::setFlat?m7913d
Yes and it add a line above the widget. Is now my current "solution" but it is not what I was looking for.Marco Damon Akanō
Possible duplicate of QGroupBox borderm7913d

1 Answers

2
votes

Give an object name for the groupbox using setObjectName() function,

group_box->setObjectName("MyBox");

Then you could style it as a css object.

group_box->setStyleSheet("#MyBox{border:0

This will only affect the #MyBox