• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdelibs API Reference
  • KDE Home
  • Contact Us
 

KDEUI

  • sources
  • kde-4.12
  • kdelibs
  • kdeui
  • widgets
kdeuiwidgetsproxystyle.cpp
Go to the documentation of this file.
1 /* This file is part of the KDE libraries
2 
3  Copyright (C) 2007 Fredrik Höglund <fredrik@kde.org>
4 
5  This library is free software; you can redistribute it and/or
6  modify it under the terms of the GNU Lesser General Public
7  License (LGPL) as published by the Free Software Foundation;
8  either version 2 of the License, or (at your option) any later
9  version.
10 
11  This library is distributed in the hope that it will be useful,
12  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  Lesser General Public License for more details.
15 
16  You should have received a copy of the GNU Lesser General Public License
17  along with this library; see the file COPYING.LIB. If not, write to
18  the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
19  Boston, MA 02110-1301, USA.
20 */
21 
22 #include "kdeuiwidgetsproxystyle_p.h"
23 
24 #include <QtGui/QApplication>
25 #include <QtGui/QWidget>
26 #include <QtGui/QWindowsStyle>
27 
28 KdeUiProxyStyle::KdeUiProxyStyle(QWidget *referenceWidget)
29  : QStyle(), m_referenceWidget(referenceWidget)
30 {
31 }
32 
33 KdeUiProxyStyle::~KdeUiProxyStyle()
34 {
35 }
36 
37 QStyle *KdeUiProxyStyle::style() const
38 {
39  QStyle* baseStyle;
40  if (m_referenceWidget && m_referenceWidget->parentWidget()) {
41  baseStyle = m_referenceWidget->parentWidget()->style();
42  } else {
43  baseStyle = QApplication::style();
44  }
45  return baseStyle;
46 }
47 
48 void KdeUiProxyStyle::drawComplexControl(ComplexControl control, const QStyleOptionComplex *option,
49  QPainter *painter, const QWidget *widget) const
50 {
51  style()->drawComplexControl(control, option, painter, widget);
52 }
53 
54 void KdeUiProxyStyle::drawControl(ControlElement element, const QStyleOption *option, QPainter *painter,
55  const QWidget *widget) const
56 {
57  style()->drawControl(element, option, painter, widget);
58 }
59 
60 void KdeUiProxyStyle::drawItemPixmap(QPainter *painter, const QRect &rectangle, int alignment,
61  const QPixmap &pixmap) const
62 {
63  style()->drawItemPixmap(painter, rectangle, alignment, pixmap);
64 }
65 
66 void KdeUiProxyStyle::drawItemText(QPainter *painter, const QRect &rectangle, int alignment, const QPalette &palette,
67  bool enabled, const QString &text, QPalette::ColorRole textRole) const
68 {
69  style()->drawItemText(painter, rectangle, alignment, palette, enabled, text, textRole);
70 }
71 
72 void KdeUiProxyStyle::drawPrimitive(PrimitiveElement element, const QStyleOption *option, QPainter *painter,
73  const QWidget *widget) const
74 {
75  style()->drawPrimitive(element, option, painter, widget);
76 }
77 
78 QPixmap KdeUiProxyStyle::generatedIconPixmap(QIcon::Mode iconMode, const QPixmap &pixmap,
79  const QStyleOption *option) const
80 {
81  return style()->generatedIconPixmap(iconMode, pixmap, option);
82 }
83 
84 QStyle::SubControl KdeUiProxyStyle::hitTestComplexControl(ComplexControl control, const QStyleOptionComplex *option,
85  const QPoint &position, const QWidget *widget) const
86 {
87  return style()->hitTestComplexControl(control, option, position, widget);
88 }
89 
90 QRect KdeUiProxyStyle::itemPixmapRect(const QRect &rectangle, int alignment, const QPixmap &pixmap) const
91 {
92  return style()->itemPixmapRect(rectangle, alignment, pixmap);
93 }
94 
95 QRect KdeUiProxyStyle::itemTextRect(const QFontMetrics &metrics, const QRect &rectangle, int alignment,
96  bool enabled, const QString &text) const
97 {
98  return style()->itemTextRect(metrics, rectangle, alignment, enabled, text);
99 }
100 
101 int KdeUiProxyStyle::pixelMetric(PixelMetric metric, const QStyleOption *option, const QWidget *widget) const
102 {
103  return style()->pixelMetric(metric, option, widget);
104 }
105 
106 void KdeUiProxyStyle::polish(QWidget *widget)
107 {
108  style()->polish(widget);
109 }
110 
111 void KdeUiProxyStyle::polish(QApplication *application)
112 {
113  style()->polish(application);
114 }
115 
116 void KdeUiProxyStyle::polish(QPalette &palette)
117 {
118  style()->polish(palette);
119 }
120 
121 QSize KdeUiProxyStyle::sizeFromContents(ContentsType type, const QStyleOption *option,
122  const QSize &contentsSize, const QWidget *widget) const
123 {
124  return style()->sizeFromContents(type, option, contentsSize, widget);
125 }
126 
127 QIcon KdeUiProxyStyle::standardIcon(StandardPixmap standardIcon, const QStyleOption *option,
128  const QWidget *widget) const
129 {
130  return style()->standardIcon(standardIcon, option, widget);
131 }
132 
133 QPixmap KdeUiProxyStyle::standardPixmap(StandardPixmap standardPixmap, const QStyleOption *option,
134  const QWidget *widget) const
135 {
136  return style()->standardPixmap(standardPixmap, option, widget);
137 }
138 
139 QPalette KdeUiProxyStyle::standardPalette() const
140 {
141  return style()->standardPalette();
142 }
143 
144 int KdeUiProxyStyle::styleHint(StyleHint hint, const QStyleOption *option, const QWidget *widget,
145  QStyleHintReturn *returnData) const
146 {
147  return style()->styleHint(hint, option, widget, returnData);
148 }
149 
150 QRect KdeUiProxyStyle::subControlRect(ComplexControl control, const QStyleOptionComplex *option,
151  SubControl subControl, const QWidget *widget) const
152 {
153  return style()->subControlRect(control, option, subControl, widget);
154 }
155 
156 QRect KdeUiProxyStyle::subElementRect(SubElement element, const QStyleOption *option,
157  const QWidget *widget) const
158 {
159  return style()->subElementRect(element, option, widget);
160 }
161 
162 void KdeUiProxyStyle::unpolish(QWidget *widget)
163 {
164  style()->unpolish(widget);
165 }
166 
167 void KdeUiProxyStyle::unpolish(QApplication *application)
168 {
169  style()->unpolish(application);
170 }
171 
QApplication
QWidget
QString
metric
float metric(float dx, float dy)
Definition: kgesture.cpp:26
QPoint
QRect
standardPalette
static const uchar standardPalette[][4]
Definition: kcolorcombo.cpp:138
QSize
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:49:14 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

KDEUI

Skip menu "KDEUI"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Modules
  • Related Pages

kdelibs API Reference

Skip menu "kdelibs API Reference"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDEWebKit
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  • kjsembed
  •   WTF
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • Nepomuk
  • Nepomuk-Core
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal