Losing style when adding specificity to a Qt stylesheet
问题 Here's my code: const QString STYLE_SHEET = "background-color: rgba(x,x,x,y);" "border: 1px solid gray;" "border-radius: 0px;" "border-top: 1px solid red;" "border-bottom: 1px solid blue;" "border-radius: 0px;"; The SS is applied later in the code like this: QWidget * myWidget; myWidget = new QWidget(parent); myWidget.setObjectName("myWidgetName"); myWidget.setStyleSheet(STYLE_SHEET); It works like a champ except that the borders bleed into a child QFrame. If I add specificity to STYLE_SHEET