File indexing completed on 2025-01-12 05:02:02

0001 /*
0002     SPDX-FileCopyrightText: 2007 Fredrik Höglund <fredrik@kde.org>
0003 
0004     SPDX-License-Identifier: LGPL-2.0-or-later
0005 */
0006 
0007 #include <QWidget>
0008 
0009 #include "FontFilterProxyStyle.h"
0010 
0011 namespace KFI
0012 {
0013 CFontFilterProxyStyle::CFontFilterProxyStyle(QWidget *parent)
0014     : QStyle()
0015     , parent(parent)
0016 {
0017     setParent(parent);
0018 }
0019 
0020 QStyle *CFontFilterProxyStyle::style() const
0021 {
0022     return parent->parentWidget()->style();
0023 }
0024 
0025 void CFontFilterProxyStyle::drawComplexControl(ComplexControl control, const QStyleOptionComplex *option, QPainter *painter, const QWidget *widget) const
0026 {
0027     style()->drawComplexControl(control, option, painter, widget);
0028 }
0029 
0030 void CFontFilterProxyStyle::drawControl(ControlElement element, const QStyleOption *option, QPainter *painter, const QWidget *widget) const
0031 {
0032     style()->drawControl(element, option, painter, widget);
0033 }
0034 
0035 void CFontFilterProxyStyle::drawItemPixmap(QPainter *painter, const QRect &rectangle, int alignment, const QPixmap &pixmap) const
0036 {
0037     style()->drawItemPixmap(painter, rectangle, alignment, pixmap);
0038 }
0039 
0040 void CFontFilterProxyStyle::drawItemText(QPainter *painter,
0041                                          const QRect &rectangle,
0042                                          int alignment,
0043                                          const QPalette &palette,
0044                                          bool enabled,
0045                                          const QString &text,
0046                                          QPalette::ColorRole textRole) const
0047 {
0048     style()->drawItemText(painter, rectangle, alignment, palette, enabled, text, textRole);
0049 }
0050 
0051 void CFontFilterProxyStyle::drawPrimitive(PrimitiveElement element, const QStyleOption *option, QPainter *painter, const QWidget *widget) const
0052 {
0053     style()->drawPrimitive(element, option, painter, widget);
0054 }
0055 
0056 QPixmap CFontFilterProxyStyle::generatedIconPixmap(QIcon::Mode iconMode, const QPixmap &pixmap, const QStyleOption *option) const
0057 {
0058     return style()->generatedIconPixmap(iconMode, pixmap, option);
0059 }
0060 
0061 QStyle::SubControl
0062 CFontFilterProxyStyle::hitTestComplexControl(ComplexControl control, const QStyleOptionComplex *option, const QPoint &position, const QWidget *widget) const
0063 {
0064     return style()->hitTestComplexControl(control, option, position, widget);
0065 }
0066 
0067 QRect CFontFilterProxyStyle::itemPixmapRect(const QRect &rectangle, int alignment, const QPixmap &pixmap) const
0068 {
0069     return style()->itemPixmapRect(rectangle, alignment, pixmap);
0070 }
0071 
0072 QRect CFontFilterProxyStyle::itemTextRect(const QFontMetrics &metrics, const QRect &rectangle, int alignment, bool enabled, const QString &text) const
0073 {
0074     return style()->itemTextRect(metrics, rectangle, alignment, enabled, text);
0075 }
0076 
0077 int CFontFilterProxyStyle::pixelMetric(PixelMetric metric, const QStyleOption *option, const QWidget *widget) const
0078 {
0079     return style()->pixelMetric(metric, option, widget);
0080 }
0081 
0082 void CFontFilterProxyStyle::polish(QWidget *widget)
0083 {
0084     style()->polish(widget);
0085 }
0086 
0087 void CFontFilterProxyStyle::polish(QApplication *application)
0088 {
0089     style()->polish(application);
0090 }
0091 
0092 void CFontFilterProxyStyle::polish(QPalette &palette)
0093 {
0094     style()->polish(palette);
0095 }
0096 
0097 QSize CFontFilterProxyStyle::sizeFromContents(ContentsType type, const QStyleOption *option, const QSize &contentsSize, const QWidget *widget) const
0098 {
0099     return style()->sizeFromContents(type, option, contentsSize, widget);
0100 }
0101 
0102 QIcon CFontFilterProxyStyle::standardIcon(StandardPixmap standardIcon, const QStyleOption *option, const QWidget *widget) const
0103 {
0104     return style()->standardIcon(standardIcon, option, widget);
0105 }
0106 
0107 QPixmap CFontFilterProxyStyle::standardPixmap(StandardPixmap standardPixmap, const QStyleOption *option, const QWidget *widget) const
0108 {
0109     return style()->standardPixmap(standardPixmap, option, widget);
0110 }
0111 
0112 QPalette CFontFilterProxyStyle::standardPalette() const
0113 {
0114     return style()->standardPalette();
0115 }
0116 
0117 int CFontFilterProxyStyle::styleHint(StyleHint hint, const QStyleOption *option, const QWidget *widget, QStyleHintReturn *returnData) const
0118 {
0119     return style()->styleHint(hint, option, widget, returnData);
0120 }
0121 
0122 QRect CFontFilterProxyStyle::subControlRect(ComplexControl control, const QStyleOptionComplex *option, SubControl subControl, const QWidget *widget) const
0123 {
0124     return style()->subControlRect(control, option, subControl, widget);
0125 }
0126 
0127 QRect CFontFilterProxyStyle::subElementRect(SubElement element, const QStyleOption *option, const QWidget *widget) const
0128 {
0129     return style()->subElementRect(element, option, widget);
0130 }
0131 
0132 void CFontFilterProxyStyle::unpolish(QWidget *widget)
0133 {
0134     style()->unpolish(widget);
0135 }
0136 
0137 void CFontFilterProxyStyle::unpolish(QApplication *application)
0138 {
0139     style()->unpolish(application);
0140 }
0141 
0142 int CFontFilterProxyStyle::layoutSpacing(QSizePolicy::ControlType control1,
0143                                          QSizePolicy::ControlType control2,
0144                                          Qt::Orientation orientation,
0145                                          const QStyleOption *option,
0146                                          const QWidget *widget) const
0147 {
0148     return style()->layoutSpacing(control1, control2, orientation, option, widget);
0149 }
0150 
0151 }