Ticket #50183: patch-qt5-always-antialias.diff

File patch-qt5-always-antialias.diff, 15.5 KB (added by RJVB (René Bertin), 9 years ago)
  • qt5/style/qtcurve.cpp

    diff --git qt5/style/qtcurve.cpp qt5/style/qtcurve.cpp
    index febcfcf..1e17882 100644
    void Style::drawLines(QPainter *p, const QRect &r, bool horiz, int nLines, int o 
    12801277                drawAaLine(p, x+i, y+offset, x+i, y2-offset);
    12811278        }
    12821279    }
    1283     p->setRenderHint(QPainter::Antialiasing, false);
     1280    p->setRenderHint(QPainter::Antialiasing, QPAINTER_ANTIALIAS_MAYBE_ON);
    12841281}
    12851282
    12861283void Style::drawProgressBevelGradient(QPainter *p, const QRect &origRect, const QStyleOption *option, bool horiz, EAppearance bevApp,
    Style::drawLightBevelReal(QPainter *p, const QRect &rOrig, 
    19141911    }
    19151912    if(plastikMouseOver && (!sunken  || sunkenToggleMo))
    19161913        p->restore();
    1917     p->setRenderHint(QPainter::Antialiasing, false);
     1914    p->setRenderHint(QPainter::Antialiasing, QPAINTER_ANTIALIAS_MAYBE_ON);
    19181915
    19191916    if(doEtch || glowFocus)
    19201917    {
    void Style::drawGlow(QPainter *p, const QRect &r, EWidget w, const QColor *cols) 
    19721969    p->setRenderHint(QPainter::Antialiasing, true);
    19731970    p->setPen(col);
    19741971    p->drawPath(buildPath(r, w, ROUNDED_ALL, qtcGetRadius(&opts, r.width(), r.height(), w, RADIUS_ETCH)));
    1975     p->setRenderHint(QPainter::Antialiasing, false);
     1972    p->setRenderHint(QPainter::Antialiasing, QPAINTER_ANTIALIAS_MAYBE_ON);
    19761973}
    19771974
    19781975void Style::drawEtch(QPainter *p, const QRect &r, const QWidget *widget,  EWidget w, bool raised, int round) const
    void Style::drawEtch(QPainter *p, const QRect &r, const QWidget *widget, EWidge 
    20052002    }
    20062003
    20072004    p->drawPath(br);
    2008     p->setRenderHint(QPainter::Antialiasing, false);
     2005    p->setRenderHint(QPainter::Antialiasing, QPAINTER_ANTIALIAS_MAYBE_ON);
    20092006}
    20102007
    20112008void Style::drawBgndRing(QPainter &painter, int x, int y, int size, int size2, bool isWindow) const
    Style::drawBorder(QPainter *p, const QRect &r, const QStyleOption *option, 
    26012598        p->drawPath(buildPath(r, w, round, qtcGetRadius(&opts, r.width(), r.height(), w, RADIUS_EXTERNAL)));
    26022599    }
    26032600
    2604     p->setRenderHint(QPainter::Antialiasing, false);
     2601    p->setRenderHint(QPainter::Antialiasing, QPAINTER_ANTIALIAS_MAYBE_ON);
    26052602}
    26062603
    26072604void Style::drawMdiControl(QPainter *p, const QStyleOptionTitleBar *titleBar, SubControl sc, const QWidget *widget,
    void Style::drawEntryField(QPainter *p, const QRect &rx, const QWidget *widget, 
    28402837        p->drawPath(buildPath(r.adjusted(1, 1, -1, -1), WIDGET_SCROLLVIEW==w ? w : WIDGET_ENTRY, round,
    28412838                              qtcGetRadius(&opts, r.width()-2, r.height()-2, WIDGET_SCROLLVIEW==w ? w : WIDGET_ENTRY, RADIUS_INTERNAL)));
    28422839    }
    2843     p->setRenderHint(QPainter::Antialiasing, false);
     2840    p->setRenderHint(QPainter::Antialiasing, QPAINTER_ANTIALIAS_MAYBE_ON);
    28442841
    28452842    if(doEtch && opts.etchEntry)
    28462843        drawEtch(p, rx, widget, WIDGET_SCROLLVIEW==w ? w : WIDGET_ENTRY, false);
    void Style::drawSliderHandle(QPainter *p, const QRect &r, const QStyleOptionSlid 
    32603257            path.lineTo(xd+10, yd+9);
    32613258            path.arcTo(xd+10-diameter, yd, diameter, diameter, 0, 90);
    32623259            p->drawPath(path);
    3263             p->setRenderHint(QPainter::Antialiasing, false);
     3260            p->setRenderHint(QPainter::Antialiasing, QPAINTER_ANTIALIAS_MAYBE_ON);
    32643261            if(drawLight)
    32653262            {
    32663263                p->setPen(use[APPEARANCE_DULL_GLASS==opts.sliderAppearance ? 1 : 0]);
    void Style::drawSliderHandle(QPainter *p, const QRect &r, const QStyleOptionSlid 
    32893286            path.lineTo(xd+5, yd);
    32903287            path.lineTo(xd, yd+5);
    32913288            p->drawPath(path);
    3292             p->setRenderHint(QPainter::Antialiasing, false);
     3289            p->setRenderHint(QPainter::Antialiasing, QPAINTER_ANTIALIAS_MAYBE_ON);
    32933290            if(drawLight)
    32943291            {
    32953292                p->setPen(use[APPEARANCE_DULL_GLASS==opts.sliderAppearance ? 1 : 0]);
    void Style::drawSliderHandle(QPainter *p, const QRect &r, const QStyleOptionSlid 
    33183315            path.lineTo(xd, yd+5);
    33193316            path.lineTo(xd+5, yd+10);
    33203317            p->drawPath(path);
    3321             p->setRenderHint(QPainter::Antialiasing, false);
     3318            p->setRenderHint(QPainter::Antialiasing, QPAINTER_ANTIALIAS_MAYBE_ON);
    33223319            if(drawLight)
    33233320            {
    33243321                p->setPen(use[APPEARANCE_DULL_GLASS==opts.sliderAppearance ? 1 : 0]);
    void Style::drawSliderHandle(QPainter *p, const QRect &r, const QStyleOptionSlid 
    33473344            path.lineTo(xd+14, yd+5);
    33483345            path.lineTo(xd+9, yd);
    33493346            p->drawPath(path);
    3350             p->setRenderHint(QPainter::Antialiasing, false);
     3347            p->setRenderHint(QPainter::Antialiasing, QPAINTER_ANTIALIAS_MAYBE_ON);
    33513348            if(drawLight)
    33523349            {
    33533350                p->setPen(use[APPEARANCE_DULL_GLASS==opts.sliderAppearance ? 1 : 0]);
  • qt5/style/qtcurve_api.cpp

    diff --git qt5/style/qtcurve_api.cpp qt5/style/qtcurve_api.cpp
    index 87a927f..f418d10 100644
    bool Style::eventFilter(QObject *object, QEvent *event) 
    11451160                p.setRenderHint(QPainter::Antialiasing, true);
    11461161                p.setPen(use[ORIGINAL_SHADE]);
    11471162                p.drawPath(buildPath(r, WIDGET_OTHER, ROUNDED_ALL, radius));
    1148                 p.setRenderHint(QPainter::Antialiasing, false);
     1163                p.setRenderHint(QPainter::Antialiasing, QPAINTER_ANTIALIAS_MAYBE_ON);
    11491164            }
    11501165            if (!(opts.square&SQUARE_POPUP_MENUS))
    11511166                p.setClipRegion(windowMask(r, opts.round>ROUND_SLIGHT),
    Style::drawControl(ControlElement element, const QStyleOption *option, 
    21202130        painter->translate(0, -1);
    21212131        painter->setPen(use[4]);
    21222132        painter->drawPath(path);
    2123         painter->setRenderHint(QPainter::Antialiasing, false);
     2133        painter->setRenderHint(QPainter::Antialiasing, QPAINTER_ANTIALIAS_MAYBE_ON);
    21242134        if (reverse) {
    21252135            painter->drawLine(r.left() + 50 - 1, r.top(), r.right(), r.top());
    21262136            painter->drawLine(r.left() + 20, r.bottom() - 2,
    Style::drawControl(ControlElement element, const QStyleOption *option, 
    25132523            drawAaLine(painter, r.x() + r.width() - 1, r.y(),
    25142524                       r.x() + r.width() - 1, r.y() + r.height() - 1);
    25152525        }
    2516         painter->setRenderHint(QPainter::Antialiasing, false);
     2526        painter->setRenderHint(QPainter::Antialiasing, QPAINTER_ANTIALIAS_MAYBE_ON);
    25172527        painter->restore();
    25182528        break;
    25192529    }
    Style::drawControl(ControlElement element, const QStyleOption *option, 
    26042614                                                     r.width(), 2), true, true);
    26052615                    }
    26062616                }
    2607                 painter->setRenderHint(QPainter::Antialiasing, false);
     2617                painter->setRenderHint(QPainter::Antialiasing, QPAINTER_ANTIALIAS_MAYBE_ON);
    26082618            } else if (!qtcIsFlat(opts.lvAppearance) && !reverse &&
    26092619                       ((State_Enabled | State_Active) == state ||
    26102620                        State_Enabled == state)) {
    Style::drawControl(ControlElement element, const QStyleOption *option, 
    36833699                        col.setAlphaF(0.5);
    36843700                        painter->setPen(col);
    36853701                        drawAaLine(painter, r.left()+1, r.top()+2, r.right()-1, r.top()+2);
    3686                         painter->setRenderHint(QPainter::Antialiasing, false);
     3702                        painter->setRenderHint(QPainter::Antialiasing, QPAINTER_ANTIALIAS_MAYBE_ON);
    36873703                        painter->setClipRect(QRect(r.x(), r.y(), r.width(), highlightBorder));
    36883704                        drawBorder(painter, r, option, ROUNDED_ALL, m_highlightCols, WIDGET_TAB_TOP, BORDER_FLAT, false, 3);
    36893705                    }
    Style::drawControl(ControlElement element, const QStyleOption *option, 
    37683784                        col.setAlphaF(0.5);
    37693785                        painter->setPen(col);
    37703786                        drawAaLine(painter, r.left()+1, r.bottom()-2, r.right()-1, r.bottom()-2);
    3771                         painter->setRenderHint(QPainter::Antialiasing, false);
     3787                        painter->setRenderHint(QPainter::Antialiasing, QPAINTER_ANTIALIAS_MAYBE_ON);
    37723788                        painter->setClipRect(QRect(r.x(), r.y()+r.height()-highlightBorder, r.width(), r.y()+r.height()-1));
    37733789                        drawBorder(painter, r, option, ROUNDED_ALL, m_highlightCols, WIDGET_TAB_BOT, BORDER_FLAT, false, 3);
    37743790                    }
    Style::drawControl(ControlElement element, const QStyleOption *option, 
    38463862                        col.setAlphaF(0.5);
    38473863                        painter->setPen(col);
    38483864                        drawAaLine(painter, r.left()+2, r.top()+1, r.left()+2, r.bottom()-1);
    3849                         painter->setRenderHint(QPainter::Antialiasing, false);
     3865                        painter->setRenderHint(QPainter::Antialiasing, QPAINTER_ANTIALIAS_MAYBE_ON);
    38503866                        painter->setClipRect(QRect(r.x(), r.y(), highlightBorder, r.height()));
    38513867                        drawBorder(painter, r, option, ROUNDED_ALL, m_highlightCols, WIDGET_TAB_TOP, BORDER_FLAT, false, 3);
    38523868                    }
    Style::drawControl(ControlElement element, const QStyleOption *option, 
    39243940                        col.setAlphaF(0.5);
    39253941                        painter->setPen(col);
    39263942                        drawAaLine(painter, r.right()-2, r.top()+1, r.right()-2, r.bottom()-1);
    3927                         painter->setRenderHint(QPainter::Antialiasing, false);
     3943                        painter->setRenderHint(QPainter::Antialiasing, QPAINTER_ANTIALIAS_MAYBE_ON);
    39283944                        painter->setClipRect(QRect(r.x()+r.width()-highlightBorder, r.y(), r.x()+r.width()-1, r.height()));
    39293945                        drawBorder(painter, r, option, ROUNDED_ALL, m_highlightCols, WIDGET_TAB_TOP, BORDER_FLAT, false, 3);
    39303946                    }
    void Style::drawComplexControl(ComplexControl control, const QStyleOptionComplex 
    52545270                                            ? 6.0
    52555271                                            : 2.0));
    52565272
    5257                 painter->setRenderHint(QPainter::Antialiasing, false);
     5273                painter->setRenderHint(QPainter::Antialiasing, QPAINTER_ANTIALIAS_MAYBE_ON);
    52585274
    52595275                if(addLight)
    52605276                {
    void Style::drawComplexControl(ComplexControl control, const QStyleOptionComplex 
    53075323                }
    53085324            }
    53095325            else
    5310                 painter->setRenderHint(QPainter::Antialiasing, false);
     5326                painter->setRenderHint(QPainter::Antialiasing, QPAINTER_ANTIALIAS_MAYBE_ON);
    53115327
    53125328            if(kwin)
    53135329            {
  • qt5/style/qtcurve_p.h

    diff --git qt5/style/qtcurve_p.h qt5/style/qtcurve_p.h
    index bfc7502..6f2ee31 100644
    bool isA(const QObject *w, const char *type); 
    283286
    284287}
    285288
     289#define QPAINTER_ANTIALIAS_MAYBE_ON true
     290
    286291#endif
  • qt5/style/qtcurve_primitive.cpp

    diff --git qt5/style/qtcurve_primitive.cpp qt5/style/qtcurve_primitive.cpp
    index b5a3204..c014df8 100644
    Style::drawPrimitiveFrame(PrimitiveElement, 
    555560                                    0 : QTC_STD_BORDER];
    556561            }
    557562            border.setAlphaF(1.0);
    558             painter->setRenderHint(QPainter::Antialiasing, false);
     563            painter->setRenderHint(QPainter::Antialiasing, QPAINTER_ANTIALIAS_MAYBE_ON);
    559564            painter->setPen(border);
    560565            drawRect(painter, r);
    561566        } else {
    Style::drawPrimitiveFrame(PrimitiveElement, 
    648653                                               r.height() - 2,
    649654                                               WIDGET_SCROLLVIEW,
    650655                                               RADIUS_INTERNAL)));
    651                     painter->setRenderHint(QPainter::Antialiasing, false);
     656                    painter->setRenderHint(QPainter::Antialiasing, QPAINTER_ANTIALIAS_MAYBE_ON);
    652657                }
    653658                drawBorder(painter, r, &opt,
    654659                           opts.round ? getFrameRound(widget) : ROUND_NONE,
    Style::drawPrimitiveFrameWindow(PrimitiveElement, 
    10421047    }
    10431048    if (opts.round < ROUND_SLIGHT || !isKWin ||
    10441049        (state & QtC_StateKWinNotFull && state & QtC_StateKWin)) {
    1045         painter->setRenderHint(QPainter::Antialiasing, false);
     1050        painter->setRenderHint(QPainter::Antialiasing, QPAINTER_ANTIALIAS_MAYBE_ON);
    10461051        if (addLight) {
    10471052            painter->setPen(light);
    10481053            painter->drawLine(r.x() + 1, r.y(), r.x() + 1,
    Style::drawPrimitiveFrameWindow(PrimitiveElement, 
    10521057        drawRect(painter, r);
    10531058    } else {
    10541059        if (addLight) {
    1055             painter->setRenderHint(QPainter::Antialiasing, false);
     1060            painter->setRenderHint(QPainter::Antialiasing, QPAINTER_ANTIALIAS_MAYBE_ON);
    10561061            painter->setPen(light);
    10571062            painter->drawLine(r.x() + 1, r.y(), r.x() + 1,
    10581063                              r.y() + r.height() -
    Style::drawPrimitiveFrameWindow(PrimitiveElement, 
    10681073            QColor col(opts.windowBorder & WINDOW_BORDER_COLOR_TITLEBAR_ONLY ?
    10691074                       backgroundColors(option)[QTC_STD_BORDER] :
    10701075                       buttonColors(option)[QTC_STD_BORDER]);
    1071             painter->setRenderHint(QPainter::Antialiasing, false);
     1076            painter->setRenderHint(QPainter::Antialiasing, QPAINTER_ANTIALIAS_MAYBE_ON);
    10721077            painter->setPen(col);
    10731078            painter->drawPoint(r.x() + 2, r.y() + r.height() - 3);
    10741079            painter->drawPoint(r.x() + r.width() - 3, r.y() + r.height() - 3);
    Style::drawPrimitiveButton(PrimitiveElement element, const QStyleOption *option, 
    12321237            painter->setPen(cols[isDown ? 0 : 4]);
    12331238            painter->setRenderHint(QPainter::Antialiasing, true);
    12341239            painter->drawPath(path);
    1235             painter->setRenderHint(QPainter::Antialiasing, false);
     1240            painter->setRenderHint(QPainter::Antialiasing, QPAINTER_ANTIALIAS_MAYBE_ON);
    12361241            break;
    12371242        }
    12381243        case IND_COLORED: {
    Style::drawPrimitivePanelMenu(PrimitiveElement, const QStyleOption *option, 
    12621267        painter->setRenderHint(QPainter::Antialiasing, true);
    12631268        painter->setPen(use[ORIGINAL_SHADE]);
    12641269        painter->drawPath(buildPath(r, WIDGET_OTHER, ROUNDED_ALL, radius));
    1265         painter->setRenderHint(QPainter::Antialiasing, false);
     1270        painter->setRenderHint(QPainter::Antialiasing, QPAINTER_ANTIALIAS_MAYBE_ON);
    12661271    }
    12671272    if (!(opts.square & SQUARE_POPUP_MENUS)) {
    12681273        painter->setClipRegion(windowMask(r, opts.round > ROUND_SLIGHT),
    Style::drawPrimitiveIndicatorCheckBox(PrimitiveElement element, 
    17181723                painter->setRenderHint(QPainter::Antialiasing, true);
    17191724                painter->setPen(use[CR_MO_FILL]);
    17201725                drawAaRect(painter, rect.adjusted(1, 1, -1, -1));
    1721                 painter->setRenderHint(QPainter::Antialiasing, false);
     1726                painter->setRenderHint(QPainter::Antialiasing, QPAINTER_ANTIALIAS_MAYBE_ON);
    17221727            } else {
    17231728                painter->setPen(midColor(state & State_Enabled ?
    17241729                                         palette.base().color() :
  • qt5/style/qtcurve_utils.cpp

    diff --git qt5/style/qtcurve_utils.cpp qt5/style/qtcurve_utils.cpp
    index ac516bf..b51db33 100644
    drawDots(QPainter *p, const QRect &r, bool horiz, int nLines, int offset, 
    341341            for(j=0; j<numDots; j++)
    342342                drawAaPoint(p, x+i, y+offset+1+(3*j));
    343343    }
    344     p->setRenderHint(QPainter::Antialiasing, false);
     344    p->setRenderHint(QPainter::Antialiasing, QPAINTER_ANTIALIAS_MAYBE_ON);
    345345}
    346346
    347347bool