1 /* This file is part of the KDE project
3 Copyright (C) 2007 Fredrik Höglund <fredrik@kde.org>
5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 2 of the License, or
8 (at your option) any later version.
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
21 #include "konqproxystyle.h"
23 #include <QtGui/QWidget>
25 KonqProxyStyle::KonqProxyStyle(QWidget
*parent
)
26 : QStyle(), parent(parent
)
30 QStyle
*KonqProxyStyle::style() const
32 return parent
->parentWidget()->style();
35 void KonqProxyStyle::drawComplexControl(ComplexControl control
, const QStyleOptionComplex
*option
,
36 QPainter
*painter
, const QWidget
*widget
) const
38 style()->drawComplexControl(control
, option
, painter
, widget
);
41 void KonqProxyStyle::drawControl(ControlElement element
, const QStyleOption
*option
, QPainter
*painter
,
42 const QWidget
*widget
) const
44 style()->drawControl(element
, option
, painter
, widget
);
47 void KonqProxyStyle::drawItemPixmap(QPainter
*painter
, const QRect
&rectangle
, int alignment
,
48 const QPixmap
&pixmap
) const
50 style()->drawItemPixmap(painter
, rectangle
, alignment
, pixmap
);
53 void KonqProxyStyle::drawItemText(QPainter
*painter
, const QRect
&rectangle
, int alignment
, const QPalette
&palette
,
54 bool enabled
, const QString
&text
, QPalette::ColorRole textRole
) const
56 style()->drawItemText(painter
, rectangle
, alignment
, palette
, enabled
, text
, textRole
);
59 void KonqProxyStyle::drawPrimitive(PrimitiveElement element
, const QStyleOption
*option
, QPainter
*painter
,
60 const QWidget
*widget
) const
62 style()->drawPrimitive(element
, option
, painter
, widget
);
65 QPixmap
KonqProxyStyle::generatedIconPixmap(QIcon::Mode iconMode
, const QPixmap
&pixmap
,
66 const QStyleOption
*option
) const
68 return style()->generatedIconPixmap(iconMode
, pixmap
, option
);
71 QStyle::SubControl
KonqProxyStyle::hitTestComplexControl(ComplexControl control
, const QStyleOptionComplex
*option
,
72 const QPoint
&position
, const QWidget
*widget
) const
74 return style()->hitTestComplexControl(control
, option
, position
, widget
);
77 QRect
KonqProxyStyle::itemPixmapRect(const QRect
&rectangle
, int alignment
, const QPixmap
&pixmap
) const
79 return style()->itemPixmapRect(rectangle
, alignment
, pixmap
);
82 QRect
KonqProxyStyle::itemTextRect(const QFontMetrics
&metrics
, const QRect
&rectangle
, int alignment
,
83 bool enabled
, const QString
&text
) const
85 return style()->itemTextRect(metrics
, rectangle
, alignment
, enabled
, text
);
88 int KonqProxyStyle::pixelMetric(PixelMetric metric
, const QStyleOption
*option
, const QWidget
*widget
) const
90 return style()->pixelMetric(metric
, option
, widget
);
93 void KonqProxyStyle::polish(QWidget
*widget
)
95 style()->polish(widget
);
98 void KonqProxyStyle::polish(QApplication
*application
)
100 style()->polish(application
);
103 void KonqProxyStyle::polish(QPalette
&palette
)
105 style()->polish(palette
);
108 QSize
KonqProxyStyle::sizeFromContents(ContentsType type
, const QStyleOption
*option
,
109 const QSize
&contentsSize
, const QWidget
*widget
) const
111 return style()->sizeFromContents(type
, option
, contentsSize
, widget
);
114 QIcon
KonqProxyStyle::standardIcon(StandardPixmap standardIcon
, const QStyleOption
*option
,
115 const QWidget
*widget
) const
117 return style()->standardIcon(standardIcon
, option
, widget
);
120 QPixmap
KonqProxyStyle::standardPixmap(StandardPixmap standardPixmap
, const QStyleOption
*option
,
121 const QWidget
*widget
) const
123 return style()->standardPixmap(standardPixmap
, option
, widget
);
126 QPalette
KonqProxyStyle::standardPalette() const
128 return style()->standardPalette();
131 int KonqProxyStyle::styleHint(StyleHint hint
, const QStyleOption
*option
, const QWidget
*widget
,
132 QStyleHintReturn
*returnData
) const
134 return style()->styleHint(hint
, option
, widget
, returnData
);
137 QRect
KonqProxyStyle::subControlRect(ComplexControl control
, const QStyleOptionComplex
*option
,
138 SubControl subControl
, const QWidget
*widget
) const
140 return style()->subControlRect(control
, option
, subControl
, widget
);
143 QRect
KonqProxyStyle::subElementRect(SubElement element
, const QStyleOption
*option
,
144 const QWidget
*widget
) const
146 return style()->subElementRect(element
, option
, widget
);
149 void KonqProxyStyle::unpolish(QWidget
*widget
)
151 style()->unpolish(widget
);
154 void KonqProxyStyle::unpolish(QApplication
*application
)
156 style()->unpolish(application
);