PySide2 and string based style for quick testing...
-
wrote on 10 Oct 2019, 05:42 last edited by
Hey
How can I properly do this ? :
style = """ { background-color : rgba(64,64,64,255); }; QLabel { color: rgb(50, 50, 50); font-size: 11px; background-color: rgba(188, 188, 188, 50); border: 1px solid rgba(188, 188, 188, 250); } ; QSpinBox { color: rgb(50, 50, 50); font-size: 11px; background-color: rgba(255, 188, 20, 50); }; """ model = QGraphicsScene() view = QGraphicsView() view.setStyleSheet(style)
It seems to not work as is
TIA
-
Hi
Not even when " is on same line/ no newline?s = """ this is a very long string if I had the energy to type more and more ...""" or s = ("this is a very" "long string too" "for sure ..." )
-
Hey
How can I properly do this ? :
style = """ { background-color : rgba(64,64,64,255); }; QLabel { color: rgb(50, 50, 50); font-size: 11px; background-color: rgba(188, 188, 188, 50); border: 1px solid rgba(188, 188, 188, 250); } ; QSpinBox { color: rgb(50, 50, 50); font-size: 11px; background-color: rgba(255, 188, 20, 50); }; """ model = QGraphicsScene() view = QGraphicsView() view.setStyleSheet(style)
It seems to not work as is
TIA
wrote on 10 Oct 2019, 07:10 last edited by@Dariusz
I cannot spot anything wrong in your multi-line string. However, what are the} ;
s? I don't recall there being any semi-colons after the close curly braces, these are not programming statements. Are they interfering with the behaviour? -
@Dariusz
I cannot spot anything wrong in your multi-line string. However, what are the} ;
s? I don't recall there being any semi-colons after the close curly braces, these are not programming statements. Are they interfering with the behaviour? -
Hi,
What exactly doesn't work ?
-
wrote on 15 Oct 2019, 18:44 last edited by
I had to replace this :
style = """ { background-color : rgba(64,64,64,255); };
With either:
style = """ *{ background-color : rgba(64,64,64,255); };
Or
style = """ QWidget { background-color : rgba(64,64,64,255); };
And then it works :- )
4/6