Important: Please read the Qt Code of Conduct -

[Solved] Changing the color of a QFrame

  • I've got several lines (which turn out to be QFrames) in my application. Since the background is close to black, these lines have to be a lighter color. I've been looking into ways to change the color, and the only thing I came up with is setPallette, but this doesn't seem to be what I'm looking for. How do I change the color of these lines?

  • There is no direct way to set the line color (something like "setColor(foo)" does not exist). You either do need to change the palette, or use CSS style sheets. The latter is usually simpler and slightly slower.

Log in to reply