[Qt-interest] QLabel color with dark themes
David Boosalis
david.boosalis at gmail.com
Fri Aug 14 02:30:28 CEST 2009
Don't know abou tthe style sheet, but my guess as to why the label as
different views is a function of the parent widget. QLabel inherits
from QWidget, which sets colors according to its QPalette(). So my
guess is that the StatusBar Area has a different palette then
QMainWindow.
On Thu, Aug 13, 2009 at 11:39 AM, Jay L. T. Cornwall<jay at jcornwall.me.uk> wrote:
> Hi,
>
> I use Qt with the qgtkstyle plugin to adopt the GTK theme. With GTK I
> use the Moomex Ultimatum theme which is largely white text on black
> backgrounds.
>
> In my Qt application I construct a QLabel and add it to a QStatusBar.
> This label correctly appears in white. However, if I construct a QLabel
> and add it to a QHBoxLayout, which itself is inside a QMainWindow, the
> text appears in black and cannot be read.
>
> Using the text '<font color="white">Test</font>' makes this label appear
> in white. Why do the colour schemes of the two labels differ according
> to their context? Does Qt have a default stylesheet which makes this so?
>
> (I am aware that dark themes are quite troublesome in Linux.)
>
> --
> Jay L. T. Cornwall
> http://www.jcornwall.me.uk/
> _______________________________________________
> Qt-interest mailing list
> Qt-interest at trolltech.com
> http://lists.trolltech.com/mailman/listinfo/qt-interest
>
More information about the Qt-interest-old
mailing list