Hello,
I need for an app to be able to draw simple lines with gradient effect.
After doing some research , i've found in Qt Labs Blog that is possible to set the palette brush on either a painter pen (or a painter brush) using this kind of code :
// Use the QPalette::Button role’s brush entry as a pen
painter
->setPen
(QPen(palette.
button(),
0));
painter->drawLine(rect.topLeft(), rect.topRight());
// Use the QPalette::Button role’s brush entry as a pen
painter->setPen(QPen(palette.button(), 0));
painter->drawLine(rect.topLeft(), rect.topRight());
To copy to clipboard, switch view to plain text mode
What i don't get is how to set the QPalette::Button role’s brush to a gradient.
In Qt Assistant , they say that QPalette::BrightText role can be used as well to draw lines. What are the differences ?
Regards.
Olivier
Bookmarks