Qt 4.8
Classes | Macros | Functions
qguiplatformplugin_p.h File Reference
#include <QtCore/qplugin.h>
#include <QtCore/qfactoryinterface.h>
#include <QtGui/qdialog.h>

Go to the source code of this file.

Classes

class  QGuiPlatformPlugin
 
struct  QGuiPlatformPluginInterface
 

Macros

#define QGuiPlatformPluginInterface_iid   "com.nokia.qt.QGuiPlatformPluginInterface"
 

Functions

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

Macro Definition Documentation

◆ QGuiPlatformPluginInterface_iid

#define QGuiPlatformPluginInterface_iid   "com.nokia.qt.QGuiPlatformPluginInterface"

Definition at line 77 of file qguiplatformplugin_p.h.

Referenced by qt_guiPlatformPlugin().

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.