This is an issue I'm having trouble with for a long time, and usually have a workaround for, but at this time... i can no longer use my workaround.
How do i style a top level widget
I have a .ui file with 2 objects.:
QWidget (MyQWidget)
QListWidget (MyQListWidget)
In my .css file, I just cannot style the QWidget. Say with a simple border or background. Here's what i experimented.
* {border: 1px solid red}
* {border: 1px solid red}
To copy to clipboard, switch view to plain text mode
Works, but obviously gives everything else a border as well
QWidget {border: 1px solid red}
To copy to clipboard, switch view to plain text mode
Works, but gives every QWidget a border as well
#MyQWidget {border: 1px solid red}
#MyQWidget {border: 1px solid red}
To copy to clipboard, switch view to plain text mode
Doesn't work
QWidget #MyQWidget {border: 1px solid red}
QWidget #MyQWidget {border: 1px solid red}
To copy to clipboard, switch view to plain text mode
Doesn't work
QWidget >
#MyQWidget {border: 1px solid red}
QWidget > #MyQWidget {border: 1px solid red}
To copy to clipboard, switch view to plain text mode
Doesn't work
#MyQWidget QWidget {border: 1px solid red}
#MyQWidget QWidget {border: 1px solid red}
To copy to clipboard, switch view to plain text mode
Doesn't work
My usual workaround was just to add another QFrame and give it no margins. Anything below the Toplevel widget i can easily style, but not the top-widget itself.
Can anyone please educate me how to properly style the topwidget?
Bookmarks