kernel/qplatformtheme.cpp

Source codeSwitch to Preprocessed file
LineSource CodeCoverage
1/**************************************************************************** -
2** -
3** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). -
4** Contact: http://www.qt-project.org/legal -
5** -
6** This file is part of the QtGui module of the Qt Toolkit. -
7** -
8** $QT_BEGIN_LICENSE:LGPL$ -
9** Commercial License Usage -
10** Licensees holding valid commercial Qt licenses may use this file in -
11** accordance with the commercial license agreement provided with the -
12** Software or, alternatively, in accordance with the terms contained in -
13** a written agreement between you and Digia. For licensing terms and -
14** conditions see http://qt.digia.com/licensing. For further information -
15** use the contact form at http://qt.digia.com/contact-us. -
16** -
17** GNU Lesser General Public License Usage -
18** Alternatively, this file may be used under the terms of the GNU Lesser -
19** General Public License version 2.1 as published by the Free Software -
20** Foundation and appearing in the file LICENSE.LGPL included in the -
21** packaging of this file. Please review the following information to -
22** ensure the GNU Lesser General Public License version 2.1 requirements -
23** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -
24** -
25** In addition, as a special exception, Digia gives you certain additional -
26** rights. These rights are described in the Digia Qt LGPL Exception -
27** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -
28** -
29** GNU General Public License Usage -
30** Alternatively, this file may be used under the terms of the GNU -
31** General Public License version 3.0 as published by the Free Software -
32** Foundation and appearing in the file LICENSE.GPL included in the -
33** packaging of this file. Please review the following information to -
34** ensure the GNU General Public License version 3.0 requirements will be -
35** met: http://www.gnu.org/copyleft/gpl.html. -
36** -
37** -
38** $QT_END_LICENSE$ -
39** -
40****************************************************************************/ -
41 -
42#include "qplatformtheme.h" -
43 -
44#include <QtCore/QVariant> -
45#include <QtCore/QStringList> -
46#include <QtCore/qfileinfo.h> -
47#include <qpalette.h> -
48#include <qtextformat.h> -
49 -
50QT_BEGIN_NAMESPACE -
51 -
52/*! -
53 \class QPlatformTheme -
54 \since 5.0 -
55 \internal -
56 \preliminary -
57 \ingroup qpa -
58 \brief The QPlatformTheme class allows customizing the UI based on themes. -
59 -
60*/ -
61 -
62/*! -
63 \enum QPlatformTheme::ThemeHint -
64 -
65 This enum describes the available theme hints. -
66 -
67 \value CursorFlashTime (int) Cursor flash time in ms, overriding -
68 QPlatformIntegration::styleHint. -
69 -
70 \value KeyboardInputInterval (int) Keyboard input interval in ms, overriding -
71 QPlatformIntegration::styleHint. -
72 -
73 \value MouseDoubleClickInterval (int) Mouse double click interval in ms, -
74 overriding QPlatformIntegration::styleHint. -
75 -
76 \value StartDragDistance (int) Start drag distance, -
77 overriding QPlatformIntegration::styleHint. -
78 -
79 \value StartDragTime (int) Start drag time in ms, -
80 overriding QPlatformIntegration::styleHint. -
81 -
82 \value KeyboardAutoRepeatRate (int) Keyboard auto repeat rate, -
83 overriding QPlatformIntegration::styleHint. -
84 -
85 \value PasswordMaskDelay (int) Pass word mask delay in ms, -
86 overriding QPlatformIntegration::styleHint. -
87 -
88 \value StartDragVelocity (int) Velocity of a drag, -
89 overriding QPlatformIntegration::styleHint. -
90 -
91 \value TextCursorWidth (int) Determines the width of the text cursor. -
92 -
93 \value DropShadow (bool) Determines whether the drop shadow effect for -
94 tooltips or whatsthis is enabled. -
95 -
96 \value MaximumScrollBarDragDistance (int) Determines the value returned by -
97 QStyle::pixelMetric(PM_MaximumDragDistance) -
98 -
99 \value ToolButtonStyle (int) A value representing a Qt::ToolButtonStyle. -
100 -
101 \value ToolBarIconSize Icon size for tool bars. -
102 -
103 \value SystemIconThemeName (QString) Name of the icon theme. -
104 -
105 \value SystemIconFallbackThemeName (QString) Name of the fallback icon theme. -
106 -
107 \value IconThemeSearchPaths (QStringList) Search paths for icons. -
108 -
109 \value ItemViewActivateItemOnSingleClick (bool) Activate items by single click. -
110 -
111 \value StyleNames (QStringList) A list of preferred style names. -
112 -
113 \value WindowAutoPlacement (bool) A boolean value indicating whether Windows -
114 (particularly dialogs) are placed by the system -
115 (see _NET_WM_FULL_PLACEMENT in X11). -
116 -
117 \value DialogButtonBoxLayout (int) An integer representing a -
118 QDialogButtonBox::ButtonLayout value. -
119 -
120 \value DialogButtonBoxButtonsHaveIcons (bool) A boolean value indicating whether -
121 the buttons of a QDialogButtonBox should have icons. -
122 -
123 \value UseFullScreenForPopupMenu (bool) Pop menus can cover the full screen including task bar. -
124 -
125 \value KeyboardScheme (int) An integer value (enum KeyboardSchemes) specifying the -
126 keyboard scheme. -
127 -
128 \value UiEffects (int) A flag value consisting of UiEffect values specifying the enabled UI animations. -
129 -
130 \value SpellCheckUnderlineStyle (int) A QTextCharFormat::UnderlineStyle specifying -
131 the underline style used misspelled words when spell checking. -
132 -
133 \value TabAllWidgets (bool) Whether tab navigation should go through all the widgets or components, -
134 or just through text boxes and list views. This is mostly a Mac feature. -
135 -
136 \sa themeHint(), QStyle::pixelMetric() -
137*/ -
138 -
139QPlatformTheme::~QPlatformTheme() -
140{ -
141 -
142} -
143 -
144bool QPlatformTheme::usePlatformNativeDialog(DialogType type) const -
145{ -
146 Q_UNUSED(type);
never executed (the execution status of this line is deduced): (void)type;;
-
147 return false;
never executed: return false;
0
148} -
149 -
150QPlatformDialogHelper *QPlatformTheme::createPlatformDialogHelper(DialogType type) const -
151{ -
152 Q_UNUSED(type);
executed (the execution status of this line is deduced): (void)type;;
-
153 return 0;
executed: return 0;
Execution Count:194
194
154} -
155 -
156const QPalette *QPlatformTheme::palette(Palette type) const -
157{ -
158 Q_UNUSED(type)
executed (the execution status of this line is deduced): (void)type;
-
159 return 0;
executed: return 0;
Execution Count:1263
1263
160} -
161 -
162const QFont *QPlatformTheme::font(Font type) const -
163{ -
164 Q_UNUSED(type)
never executed (the execution status of this line is deduced): (void)type;
-
165 return 0;
never executed: return 0;
0
166} -
167 -
168QPixmap QPlatformTheme::standardPixmap(StandardPixmap sp, const QSizeF &size) const -
169{ -
170 Q_UNUSED(sp);
never executed (the execution status of this line is deduced): (void)sp;;
-
171 Q_UNUSED(size);
never executed (the execution status of this line is deduced): (void)size;;
-
172 // TODO Should return QCommonStyle pixmaps? -
173 return QPixmap();
never executed: return QPixmap();
0
174} -
175 -
176QPixmap QPlatformTheme::fileIconPixmap(const QFileInfo &fileInfo, const QSizeF &size) const -
177{ -
178 Q_UNUSED(fileInfo);
never executed (the execution status of this line is deduced): (void)fileInfo;;
-
179 Q_UNUSED(size);
never executed (the execution status of this line is deduced): (void)size;;
-
180 // TODO Should return QCommonStyle pixmaps? -
181 return QPixmap();
never executed: return QPixmap();
0
182} -
183 -
184QVariant QPlatformTheme::themeHint(ThemeHint hint) const -
185{ -
186 return QPlatformTheme::defaultThemeHint(hint);
executed: return QPlatformTheme::defaultThemeHint(hint);
Execution Count:38248
38248
187} -
188 -
189QVariant QPlatformTheme::defaultThemeHint(ThemeHint hint) -
190{ -
191 switch (hint) { -
192 case QPlatformTheme::CursorFlashTime: -
193 return QVariant(1000);
executed: return QVariant(1000);
Execution Count:4198
4198
194 case QPlatformTheme::KeyboardInputInterval: -
195 return QVariant(400);
executed: return QVariant(400);
Execution Count:19
19
196 case QPlatformTheme::KeyboardAutoRepeatRate: -
197 return QVariant(30);
never executed: return QVariant(30);
0
198 case QPlatformTheme::MouseDoubleClickInterval: -
199 return QVariant(400);
executed: return QVariant(400);
Execution Count:785
785
200 case QPlatformTheme::StartDragDistance: -
201 return QVariant(10);
executed: return QVariant(10);
Execution Count:9
9
202 case QPlatformTheme::StartDragTime: -
203 return QVariant(500);
never executed: return QVariant(500);
0
204 case QPlatformTheme::PasswordMaskDelay: -
205 return QVariant(int(0));
executed: return QVariant(int(0));
Execution Count:4
4
206 case QPlatformTheme::StartDragVelocity: -
207 return QVariant(int(0)); // no limit
never executed: return QVariant(int(0));
0
208 case QPlatformTheme::UseFullScreenForPopupMenu: -
209 return QVariant(false);
executed: return QVariant(false);
Execution Count:844
844
210 case QPlatformTheme::WindowAutoPlacement: -
211 return QVariant(false);
executed: return QVariant(false);
Execution Count:458
458
212 case QPlatformTheme::DialogButtonBoxLayout: -
213 return QVariant(int(0));
never executed: return QVariant(int(0));
0
214 case QPlatformTheme::DialogButtonBoxButtonsHaveIcons: -
215 return QVariant(false);
never executed: return QVariant(false);
0
216 case QPlatformTheme::ItemViewActivateItemOnSingleClick: -
217 return QVariant(false);
never executed: return QVariant(false);
0
218 case QPlatformTheme::ToolButtonStyle: -
219 return QVariant(int(Qt::ToolButtonIconOnly));
executed: return QVariant(int(Qt::ToolButtonIconOnly));
Execution Count:381
381
220 case QPlatformTheme::ToolBarIconSize: -
221 return QVariant(int(0));
executed: return QVariant(int(0));
Execution Count:69
69
222 case QPlatformTheme::SystemIconThemeName: -
223 case QPlatformTheme::SystemIconFallbackThemeName: -
224 return QVariant(QString());
never executed: return QVariant(QString());
0
225 case QPlatformTheme::IconThemeSearchPaths: -
226 return QVariant(QStringList());
never executed: return QVariant(QStringList());
0
227 case QPlatformTheme::StyleNames: -
228 return QVariant(QStringList());
never executed: return QVariant(QStringList());
0
229 case TextCursorWidth: -
230 return QVariant(1);
executed: return QVariant(1);
Execution Count:1053
1053
231 case DropShadow: -
232 return QVariant(false);
executed: return QVariant(false);
Execution Count:2
2
233 case MaximumScrollBarDragDistance: -
234 return QVariant(-1);
executed: return QVariant(-1);
Execution Count:6
6
235 case KeyboardScheme: -
236 return QVariant(int(WindowsKeyboardScheme));
never executed: return QVariant(int(WindowsKeyboardScheme));
0
237 case UiEffects: -
238 return QVariant(int(0));
executed: return QVariant(int(0));
Execution Count:215
215
239 case SpellCheckUnderlineStyle: -
240 return QVariant(int(QTextCharFormat::SpellCheckUnderline));
never executed: return QVariant(int(QTextCharFormat::SpellCheckUnderline));
0
241 case TabAllWidgets: -
242 return QVariant(true);
executed: return QVariant(true);
Execution Count:1768
1768
243 case IconPixmapSizes: -
244 return QVariant::fromValue(QList<int>());
executed: return QVariant::fromValue(QList<int>());
Execution Count:28437
28437
245 } -
246 return QVariant();
never executed: return QVariant();
0
247} -
248 -
249QPlatformMenuItem *QPlatformTheme::createPlatformMenuItem() const -
250{ -
251 return 0;
never executed: return 0;
0
252} -
253 -
254QPlatformMenu *QPlatformTheme::createPlatformMenu() const -
255{ -
256 return 0;
executed: return 0;
Execution Count:272
272
257} -
258 -
259QPlatformMenuBar *QPlatformTheme::createPlatformMenuBar() const -
260{ -
261 return 0;
executed: return 0;
Execution Count:23
23
262} -
263 -
264#ifndef QT_NO_SYSTEMTRAYICON -
265/*! -
266 Factory function for QSystemTrayIcon. This function will return 0 if the platform -
267 integration does not support creating any system tray icon. -
268*/ -
269QPlatformSystemTrayIcon *QPlatformTheme::createPlatformSystemTrayIcon() const -
270{ -
271 return 0;
never executed: return 0;
0
272} -
273#endif -
274 -
275QT_END_NAMESPACE -
276 -
Source codeSwitch to Preprocessed file

Generated by Squish Coco Non-Commercial