I have a QLabel in my Python/Qt 4.8 GUI, which contains a table. I'd like to style elements of this table with different colours. I realise I can use tags but it seems a little more elegant to use classes and CSS. I want it to look like this:
My HTML looks like this:
Wavelength: | {0:.2f} µm |
Bandwidth: | {1:.2f} µm |
Power: | {2:.1f} mW |
{3:.0f} sec stability: | {4:.1%} rms |
{5:.1%} p2p |
And my CSS like this:
#oldPM {color: #333333}
#spec {color: blue}
#newPM {color: #333333}
But Qt doesn't seem to recognise the class selectors. Is this a fundamental limitation of the Qt styling, or am I doing something wrong? I can get it to change the style of the whole QLabel, using QLabel as a selector, but I want different parts of it to be styled differently.