Reputation: 1
I use Qt 4.6.3 and I have a problem.
ui.graphicsView->setRenderHints(QPainter::Antialiasing,false);
but some lines colors changes. what can I do? Please help me.
I think that I cant express myself. I hava a lot of line. When I use this code same line color changes( top of line lighter than bottom of line ) I can t solve this problem.
Upvotes: 0
Views: 4999
Reputation: 10943
QPainter:: Antialiasing, false is necessary to achieve a better quality paint.
sure your problem is in when you paint the lines, whenever you use the painter must save and restore the state.
void Line:: paint (QPainter * painter, const QStyleOptionGraphicsItem * option,
QWidget * widget)
{
painter-> save (); / / save
painter-> setRenderHint (QPainter:: Antialiasing);
painter-> setPen (mypen);
painter-> drawLine (...);
painter-> restore (); / / restore
}
when you make changes in Painter, it could become unstable if not call the methods save() and restore (). good luck
Upvotes: 3