Getting error 'Could not parse stylesheet of object QGroupBox'
Solved
Qt for Python
-
Hello,
I'm following https://doc.qt.io/qt-6/stylesheet-examples.html#customizing-qgroupbox to tailor a QGroupBox with a few modifications:BIOGENIC_StyleSheet = ''' QGroupBox { background-color: #AA0000); border: 2px #AAAAAA; border-radius: 5px; margin-top: 2ex; /* leave space at the top for the title */ } QGroupBox::title { subcontrol-origin: margin; subcontrol-position: top center; /* position at the top center */ padding: 0 1px; background-color: #FFFFFF; font-size: 16; } '''
The definition of the QGroupBox is done with the following lines:
bio_box = QGroupBox() bio_box.setAlignment(Qt.AlignCenter) bio_box.setStyleSheet(BIOGENIC_StyleSheet) self.biogenic_box = QVBoxLayout() bio_box.setLayout(self.biogenic_box)
followed by the layouts and widgets composing self.biogenic_box. However, it's generating the error:
Could not parse stylesheet of object QGroupBox
I cannot figure out what I'm doing wrong.
Thanks. -
@afernandezody Is there an extra close bracket here:
background-color: #AA0000);
-