qplatformthemefactory.cpp

Absolute File Name:/home/qt/qt5_coco/qt5/qtbase/src/gui/kernel/qplatformthemefactory.cpp
Source codeSwitch to Preprocessed file
LineSourceCount
1/****************************************************************************-
2**-
3** Copyright (C) 2015 The Qt Company Ltd.-
4** Contact: http://www.qt.io/licensing/-
5**-
6** This file is part of the QtGui module of the Qt Toolkit.-
7**-
8** $QT_BEGIN_LICENSE:LGPL21$-
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 The Qt Company. For licensing terms-
14** and conditions see http://www.qt.io/terms-conditions. For further-
15** information use the contact form at http://www.qt.io/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 or version 3 as published by the Free-
20** Software Foundation and appearing in the file LICENSE.LGPLv21 and-
21** LICENSE.LGPLv3 included in the packaging of this file. Please review the-
22** following information to ensure the GNU Lesser General Public License-
23** requirements will be met: https://www.gnu.org/licenses/lgpl.html and-
24** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.-
25**-
26** As a special exception, The Qt Company gives you certain additional-
27** rights. These rights are described in The Qt Company LGPL Exception-
28** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.-
29**-
30** $QT_END_LICENSE$-
31**-
32****************************************************************************/-
33-
34#include <qpa/qplatformthemefactory_p.h>-
35#include <qpa/qplatformthemeplugin.h>-
36#include <QDir>-
37#include "private/qfactoryloader_p.h"-
38#include "qmutex.h"-
39-
40#include "qguiapplication.h"-
41#include "qdebug.h"-
42-
43QT_BEGIN_NAMESPACE-
44-
45#ifndef QT_NO_LIBRARY-
46Q_GLOBAL_STATIC_WITH_ARGS(QFactoryLoader, loader,
never executed: end of block
never executed: guard.store(QtGlobalStatic::Destroyed);
never executed: return &holder.value;
guard.load() =...c::InitializedDescription
TRUEnever evaluated
FALSEnever evaluated
0
47 (QPlatformThemeFactoryInterface_iid, QLatin1String("/platformthemes"), Qt::CaseInsensitive))-
48Q_GLOBAL_STATIC_WITH_ARGS(QFactoryLoader, directLoader,
never executed: end of block
never executed: guard.store(QtGlobalStatic::Destroyed);
never executed: return &holder.value;
guard.load() =...c::InitializedDescription
TRUEnever evaluated
FALSEnever evaluated
0
49 (QPlatformThemeFactoryInterface_iid, QLatin1String(""), Qt::CaseInsensitive))-
50#endif-
51-
52QPlatformTheme *QPlatformThemeFactory::create(const QString& key, const QString &platformPluginPath)-
53{-
54 QStringList paramList = key.split(QLatin1Char(':'));-
55 const QString platform = paramList.takeFirst().toLower();-
56-
57#ifndef QT_NO_LIBRARY-
58 // Try loading the plugin from platformPluginPath first:-
59 if (!platformPluginPath.isEmpty()) {
!platformPluginPath.isEmpty()Description
TRUEnever evaluated
FALSEnever evaluated
0
60 QCoreApplication::addLibraryPath(platformPluginPath);-
61 if (QPlatformTheme *ret = qLoadPlugin1<QPlatformTheme, QPlatformThemePlugin>(directLoader(), platform, paramList))
QPlatformTheme...rm, paramList)Description
TRUEnever evaluated
FALSEnever evaluated
0
62 return ret;
never executed: return ret;
0
63 }
never executed: end of block
0
64 if (QPlatformTheme *ret = qLoadPlugin1<QPlatformTheme, QPlatformThemePlugin>(loader(), platform, paramList))
QPlatformTheme...rm, paramList)Description
TRUEnever evaluated
FALSEnever evaluated
0
65 return ret;
never executed: return ret;
0
66#else-
67 Q_UNUSED(key);-
68 Q_UNUSED(platformPluginPath);-
69#endif-
70 return 0;
never executed: return 0;
0
71}-
72-
73/*!-
74 Returns the list of valid keys, i.e. the keys this factory can-
75 create styles for.-
76-
77 \sa create()-
78*/-
79QStringList QPlatformThemeFactory::keys(const QString &platformPluginPath)-
80{-
81#ifndef QT_NO_LIBRARY-
82 QStringList list;-
83-
84 if (!platformPluginPath.isEmpty()) {
!platformPluginPath.isEmpty()Description
TRUEnever evaluated
FALSEnever evaluated
0
85 QCoreApplication::addLibraryPath(platformPluginPath);-
86 list += directLoader()->keyMap().values();-
87 if (!list.isEmpty()) {
!list.isEmpty()Description
TRUEnever evaluated
FALSEnever evaluated
0
88 const QString postFix = QStringLiteral(" (from ")
never executed: return qstring_literal_temp;
0
89 + QDir::toNativeSeparators(platformPluginPath)-
90 + QLatin1Char(')');-
91 const QStringList::iterator end = list.end();-
92 for (QStringList::iterator it = list.begin(); it != end; ++it)
it != endDescription
TRUEnever evaluated
FALSEnever evaluated
0
93 (*it).append(postFix);
never executed: (*it).append(postFix);
0
94 }
never executed: end of block
0
95 }
never executed: end of block
0
96 list += loader()->keyMap().values();-
97 return list;
never executed: return list;
0
98#else-
99 Q_UNUSED(platformPluginPath);-
100 return QStringList();-
101#endif-
102}-
103-
104QT_END_NAMESPACE-
Source codeSwitch to Preprocessed file

Generated by Squish Coco Non-Commercial 4.3.0-BETA-master-30-08-2018-4cb69e9