georgie
15th May 2006, 09:21
I want to get a background which fades from white to blue...easy...
QPainter painter;
painter.setPen(Qt::NoPen);
painter.setBackgroundMode(Qt::TransparentMode);
QLinearGradient grad(0, 300, 3000, 3000);
grad.setColorAt(0, Qt::white);
grad.setColorAt(1, Qt::blue);
palette.setBrush(QPalette::Background, grad);
at least I thought it was easy, 'til I realised that my File/Edit menu titles were going black with black text when I rolled over them and when they were open the whole menu became black on black....
the weird thing is, that if I relace that last line with
palette.setBrush(QPalette::Background, Qt::blue);
everything is how you would expect it to be...
I also changed QPalette::Background to QPalette::Window and the exact same thing happened :(
QPainter painter;
painter.setPen(Qt::NoPen);
painter.setBackgroundMode(Qt::TransparentMode);
QLinearGradient grad(0, 300, 3000, 3000);
grad.setColorAt(0, Qt::white);
grad.setColorAt(1, Qt::blue);
palette.setBrush(QPalette::Background, grad);
at least I thought it was easy, 'til I realised that my File/Edit menu titles were going black with black text when I rolled over them and when they were open the whole menu became black on black....
the weird thing is, that if I relace that last line with
palette.setBrush(QPalette::Background, Qt::blue);
everything is how you would expect it to be...
I also changed QPalette::Background to QPalette::Window and the exact same thing happened :(