LMMS/lmms — pull request #737 by diizy (2014-05-18 13:28:09+00:00)
Title: Knob: make knob line/arc colours CSS-stylable

Ok, so: according to Qt documentation it should be possible to set widget properties in the CSS based on the value of a qproperty, and I initially thought it would be possible to set the colours of the knob based on its knobnum-property.

Alas, no matter what I tried (and I tried _lots_ of things) this just doesn't seem to work. It seems like the properties just won't get applied properly, no matter what. I tried getting the knob to reload the stylesheet after the knobnum property was set, no effect... tried reloading the style... tried setting object names based on the knobnum property and even that didn't work. Tried changing the knobnum to an integer property in case the type isn't registered or recognized properly... still nothing.

So at this point the only thing I could think of was creating separate qproperties for each knobtype. So I removed the existing lineColor/arcColor properties and just added a pair of those properties for each knobtype. It's an ugly, convoluted and hackish solution, but it's the only one that seems to be working. If anyone can figure out a better, cleaner solution that works, be my guest...