I want to get a background which fades from white to blue...easy...
painter.setPen(Qt::NoPen);
painter.setBackgroundMode(Qt::TransparentMode);
grad.setColorAt(0, Qt::white);
grad.setColorAt(1, Qt::blue);
palette.
setBrush(QPalette::Background, grad
);
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);
To copy to clipboard, switch view to plain text mode
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);
palette.setBrush(QPalette::Background, Qt::blue);
To copy to clipboard, switch view to plain text mode
everything is how you would expect it to be...
I also changed QPalette::Background to QPalette::Window and the exact same thing happened
Bookmarks