Marco Damon Akanō
Marco Damon Akanō

Reputation: 55

Qt QGroupBox border

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

Upvotes: 2

Views: 1661

Answers (1)

me_alok
me_alok

Reputation: 251

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

Upvotes: 3

Related Questions