Set QFrame frame style with QSS
-
Hi,
I (Qt 5.15.13 and Python 3.12.12) am currently working on a layout that uses a
QFrameto create a border around another layout or a line between two layouts.I know that you can set the design of the
QFrame, as shown in the image in the documentation with e.g.qframe.setFrameStyle(QFrame.Box | QFrame.Plain)and the border's thickness withqframe.setLineWidth(3).I also know that you can alternatively use QSS to set the border thickness and even the color:
qframe.setStyleSheet("QFrame#myqframe {border: 1px solid red}")Now I'm wondering: Is it also possible to set the actual frame style using only QSS? I tried this but it didn't work (didn't display anything):
qframe.setStyleSheet( "QFrame#myqframe {" "frameShape: box;" "frameShadow: raised" "border: 3px solid black" "}") -
Hi,
I (Qt 5.15.13 and Python 3.12.12) am currently working on a layout that uses a
QFrameto create a border around another layout or a line between two layouts.I know that you can set the design of the
QFrame, as shown in the image in the documentation with e.g.qframe.setFrameStyle(QFrame.Box | QFrame.Plain)and the border's thickness withqframe.setLineWidth(3).I also know that you can alternatively use QSS to set the border thickness and even the color:
qframe.setStyleSheet("QFrame#myqframe {border: 1px solid red}")Now I'm wondering: Is it also possible to set the actual frame style using only QSS? I tried this but it didn't work (didn't display anything):
qframe.setStyleSheet( "QFrame#myqframe {" "frameShape: box;" "frameShadow: raised" "border: 3px solid black" "}")@Neph
The reference for QT stylesheets is at https://doc.qt.io/qt-6/stylesheet-reference.html. You will findQFramelisted there. When you follow the links you get to see all the attributes Qt supports. So far as I know neitherframeShapenorframeShadoware supported, and similarly for most others --- Qt only supports very limited subset of the most common ones. -
@Neph
The reference for QT stylesheets is at https://doc.qt.io/qt-6/stylesheet-reference.html. You will findQFramelisted there. When you follow the links you get to see all the attributes Qt supports. So far as I know neitherframeShapenorframeShadoware supported, and similarly for most others --- Qt only supports very limited subset of the most common ones.