Qt 4.8
Functions
qguiplatformplugin.cpp File Reference
#include "qguiplatformplugin_p.h"
#include <qdebug.h>
#include <qfile.h>
#include <qdir.h>
#include <qsettings.h>
#include "private/qfactoryloader_p.h"
#include "qstylefactory.h"
#include "qapplication.h"
#include "qplatformdefs.h"
#include "qicon.h"
#include "qguifunctions_wince.h"
#include <private/qkde_p.h>
#include <private/qgtkstyle_p.h>
#include <private/qt_x11_p.h>

Go to the source code of this file.

Functions

QGuiPlatformPluginqt_guiPlatformPlugin ()
 Return (an construct if necesseray) the Gui Platform plugin. More...
 
bool qt_wince_is_mobile ()
 
bool qt_wince_is_pocket_pc ()
 
bool qt_wince_is_smartphone ()
 

Function Documentation

◆ qt_guiPlatformPlugin()

QGuiPlatformPlugin* qt_guiPlatformPlugin ( )

Return (an construct if necesseray) the Gui Platform plugin.

Warning
This function is not part of the public interface.

The plugin key to be loaded is inside the QT_PLATFORM_PLUGIN environment variable. If it is not set, it will be the DESKTOP_SESSION on X11.

If no plugin can be loaded, the default one is returned.

Definition at line 82 of file qguiplatformplugin.cpp.

Referenced by QGuiPlatformPlugin::colorDialogSetCurrentColor(), QApplicationPrivate::desktopStyleKey(), QIconLoader::ensureInitialized(), QFileIconProvider::icon(), QCommonStyle::pixelMetric(), QFileDialogPrivate::rootPath(), QColorDialog::setCurrentColor(), QColorDialog::setVisible(), QCommonStyle::styleHint(), QIconLoader::themeSearchPaths(), QIconLoader::updateSystemTheme(), QApplicationPrivate::x11_apply_settings(), and QColorDialog::~QColorDialog().

83 {
84  static QGuiPlatformPlugin *plugin;
85  if (!plugin)
86  {
87 #ifndef QT_NO_LIBRARY
88 
89  QString key = QString::fromLocal8Bit(qgetenv("QT_PLATFORM_PLUGIN"));
90 #ifdef Q_WS_X11
91  if (key.isEmpty()) {
92  switch(X11->desktopEnvironment) {
93  case DE_KDE:
94  key = QString::fromLatin1("kde");
95  break;
96  default:
97  key = QString::fromLocal8Bit(qgetenv("DESKTOP_SESSION"));
98  break;
99  }
100  }
101 #endif
102 
105  plugin = qobject_cast<QGuiPlatformPlugin *>(loader.instance(key));
106  }
107 #endif // QT_NO_LIBRARY
108 
109  if(!plugin) {
110  static QGuiPlatformPlugin def;
111  plugin = &def;
112  }
113  }
114  return plugin;
115 }
Q_CORE_EXPORT QByteArray qgetenv(const char *varName)
static QString fromLocal8Bit(const char *, int size=-1)
Returns a QString initialized with the first size characters of the 8-bit string str.
Definition: qstring.cpp:4245
#define QGuiPlatformPluginInterface_iid
QLatin1String(DBUS_INTERFACE_DBUS))) Q_GLOBAL_STATIC_WITH_ARGS(QString
The QString class provides a Unicode character string.
Definition: qstring.h:83
T * qobject_cast(QObject *object)
Definition: qobject.h:375
#define X11
Definition: qt_x11_p.h:724
bool isEmpty() const
Returns true if the string has no characters; otherwise returns false.
Definition: qstring.h:704
static QString fromLatin1(const char *, int size=-1)
Returns a QString initialized with the first size characters of the Latin-1 string str...
Definition: qstring.cpp:4188
int key
static bool desktopSettingsAware()
Returns true if Qt is set to use the system&#39;s standard colors, fonts, etc.

◆ qt_wince_is_mobile()

bool qt_wince_is_mobile ( )

Definition at line 296 of file qguifunctions_wince.cpp.

296  {
298 }
bool qt_wince_is_pocket_pc()
bool qt_wince_is_smartphone()

◆ qt_wince_is_pocket_pc()

bool qt_wince_is_pocket_pc ( )

Definition at line 289 of file qguifunctions_wince.cpp.

Referenced by QGuiPlatformPlugin::styleName().

289  {
290  return qt_wince_is_platform(QString::fromLatin1("PocketPC"));
291 }
bool qt_wince_is_platform(const QString &platformString)
static QString fromLatin1(const char *, int size=-1)
Returns a QString initialized with the first size characters of the Latin-1 string str...
Definition: qstring.cpp:4188

◆ qt_wince_is_smartphone()

bool qt_wince_is_smartphone ( )

Definition at line 293 of file qguifunctions_wince.cpp.

Referenced by QGuiPlatformPlugin::styleName().

293  {
294  return qt_wince_is_platform(QString::fromLatin1("Smartphone"));
295 }
bool qt_wince_is_platform(const QString &platformString)
static QString fromLatin1(const char *, int size=-1)
Returns a QString initialized with the first size characters of the Latin-1 string str...
Definition: qstring.cpp:4188