Qt 4.8
Public Types | Public Functions | List of all members
QGuiPlatformPlugin Class Reference

#include <qguiplatformplugin_p.h>

Inheritance diagram for QGuiPlatformPlugin:
QObject QGuiPlatformPluginInterface QFactoryInterface

Public Types

enum  PlatformHint { PH_ToolButtonStyle, PH_ToolBarIconSize, PH_ItemView_ActivateItemOnSingleClick }
 

Public Functions

virtual void colorDialogDelete (QColorDialog *)
 
virtual void colorDialogSetCurrentColor (QColorDialog *, const QColor &)
 
virtual bool colorDialogSetVisible (QColorDialog *, bool)
 
virtual void fileDialogDelete (QFileDialog *)
 
virtual QString fileDialogDirectory (const QFileDialog *) const
 
virtual QDialog::DialogCode fileDialogResultCode (QFileDialog *)
 
virtual QStringList fileDialogSelectedFiles (const QFileDialog *) const
 
virtual QString fileDialogSelectedNameFilter (const QFileDialog *) const
 
virtual void fileDialogSelectFile (QFileDialog *, const QString &)
 
virtual void fileDialogSelectNameFilter (QFileDialog *, const QString &)
 
virtual void fileDialogSetDirectory (QFileDialog *, const QString &)
 
virtual void fileDialogSetFilter (QFileDialog *)
 
virtual void fileDialogSetNameFilters (QFileDialog *, const QStringList &)
 
virtual bool fileDialogSetVisible (QFileDialog *, bool)
 
virtual QIcon fileSystemIcon (const QFileInfo &)
 
virtual QStringList iconThemeSearchPaths ()
 
virtual QStringList keys () const
 
virtual QPalette palette ()
 
virtual int platformHint (PlatformHint hint)
 
 QGuiPlatformPlugin (QObject *parent=0)
 
virtual QString styleName ()
 
virtual QString systemIconThemeName ()
 
 ~QGuiPlatformPlugin ()
 
- Public Functions inherited from QObject
bool blockSignals (bool b)
 If block is true, signals emitted by this object are blocked (i.e., emitting a signal will not invoke anything connected to it). More...
 
const QObjectListchildren () const
 Returns a list of child objects. More...
 
bool connect (const QObject *sender, const char *signal, const char *member, Qt::ConnectionType type=Qt::AutoConnection) const
 
bool disconnect (const char *signal=0, const QObject *receiver=0, const char *member=0)
 
bool disconnect (const QObject *receiver, const char *member=0)
 
void dumpObjectInfo ()
 Dumps information about signal connections, etc. More...
 
void dumpObjectTree ()
 Dumps a tree of children to the debug output. More...
 
QList< QByteArraydynamicPropertyNames () const
 Returns the names of all properties that were dynamically added to the object using setProperty(). More...
 
virtual bool event (QEvent *)
 This virtual function receives events to an object and should return true if the event e was recognized and processed. More...
 
virtual bool eventFilter (QObject *, QEvent *)
 Filters events if this object has been installed as an event filter for the watched object. More...
 
template<typename T >
findChild (const QString &aName=QString()) const
 Returns the child of this object that can be cast into type T and that is called name, or 0 if there is no such object. More...
 
template<typename T >
QList< T > findChildren (const QString &aName=QString()) const
 Returns all children of this object with the given name that can be cast to type T, or an empty list if there are no such objects. More...
 
template<typename T >
QList< T > findChildren (const QRegExp &re) const
 
bool inherits (const char *classname) const
 Returns true if this object is an instance of a class that inherits className or a QObject subclass that inherits className; otherwise returns false. More...
 
void installEventFilter (QObject *)
 Installs an event filter filterObj on this object. More...
 
bool isWidgetType () const
 Returns true if the object is a widget; otherwise returns false. More...
 
void killTimer (int id)
 Kills the timer with timer identifier, id. More...
 
virtual const QMetaObjectmetaObject () const
 Returns a pointer to the meta-object of this object. More...
 
void moveToThread (QThread *thread)
 Changes the thread affinity for this object and its children. More...
 
QString objectName () const
 
QObjectparent () const
 Returns a pointer to the parent object. More...
 
QVariant property (const char *name) const
 Returns the value of the object's name property. More...
 
Q_INVOKABLE QObject (QObject *parent=0)
 Constructs an object with parent object parent. More...
 
void removeEventFilter (QObject *)
 Removes an event filter object obj from this object. More...
 
void setObjectName (const QString &name)
 
void setParent (QObject *)
 Makes the object a child of parent. More...
 
bool setProperty (const char *name, const QVariant &value)
 Sets the value of the object's name property to value. More...
 
void setUserData (uint id, QObjectUserData *data)
 
bool signalsBlocked () const
 Returns true if signals are blocked; otherwise returns false. More...
 
int startTimer (int interval)
 Starts a timer and returns a timer identifier, or returns zero if it could not start a timer. More...
 
QThreadthread () const
 Returns the thread in which the object lives. More...
 
QObjectUserDatauserData (uint id) const
 
virtual ~QObject ()
 Destroys the object, deleting all its child objects. More...
 
- Public Functions inherited from QFactoryInterface
virtual ~QFactoryInterface ()
 

Additional Inherited Members

- Public Slots inherited from QObject
void deleteLater ()
 Schedules this object for deletion. More...
 
- Signals inherited from QObject
void destroyed (QObject *=0)
 This signal is emitted immediately before the object obj is destroyed, and can not be blocked. More...
 
- Static Public Functions inherited from QObject
static bool connect (const QObject *sender, const char *signal, const QObject *receiver, const char *member, Qt::ConnectionType=Qt::AutoConnection)
 Creates a connection of the given type from the signal in the sender object to the method in the receiver object. More...
 
static bool connect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method, Qt::ConnectionType type=Qt::AutoConnection)
 
static bool disconnect (const QObject *sender, const char *signal, const QObject *receiver, const char *member)
 Disconnects signal in object sender from method in object receiver. More...
 
static bool disconnect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &member)
 
static uint registerUserData ()
 
static QString tr (const char *sourceText, const char *comment=0, int n=-1)
 
static QString trUtf8 (const char *sourceText, const char *comment=0, int n=-1)
 
- Static Public Variables inherited from QObject
static const QMetaObject staticMetaObject
 This variable stores the meta-object for the class. More...
 
- Protected Functions inherited from QObject
virtual void childEvent (QChildEvent *)
 This event handler can be reimplemented in a subclass to receive child events. More...
 
virtual void connectNotify (const char *signal)
 This virtual function is called when something has been connected to signal in this object. More...
 
virtual void customEvent (QEvent *)
 This event handler can be reimplemented in a subclass to receive custom events. More...
 
virtual void disconnectNotify (const char *signal)
 This virtual function is called when something has been disconnected from signal in this object. More...
 
 QObject (QObjectPrivate &dd, QObject *parent=0)
 
int receivers (const char *signal) const
 Returns the number of receivers connected to the signal. More...
 
QObjectsender () const
 Returns a pointer to the object that sent the signal, if called in a slot activated by a signal; otherwise it returns 0. More...
 
int senderSignalIndex () const
 
virtual void timerEvent (QTimerEvent *)
 This event handler can be reimplemented in a subclass to receive timer events for the object. More...
 
- Protected Variables inherited from QObject
QScopedPointer< QObjectDatad_ptr
 
- Static Protected Variables inherited from QObject
static const QMetaObject staticQtMetaObject
 

Detailed Description

Definition at line 81 of file qguiplatformplugin_p.h.

Enumerations

◆ PlatformHint

Constructors and Destructors

◆ QGuiPlatformPlugin()

QGuiPlatformPlugin::QGuiPlatformPlugin ( QObject parent = 0)
explicit

Definition at line 129 of file qguiplatformplugin.cpp.

129 : QObject(parent) {}
Q_INVOKABLE QObject(QObject *parent=0)
Constructs an object with parent object parent.
Definition: qobject.cpp:753

◆ ~QGuiPlatformPlugin()

QGuiPlatformPlugin::~QGuiPlatformPlugin ( )

Definition at line 130 of file qguiplatformplugin.cpp.

130 {}

Functions

◆ colorDialogDelete()

virtual void QGuiPlatformPlugin::colorDialogDelete ( QColorDialog )
inlinevirtual

Definition at line 113 of file qguiplatformplugin_p.h.

Referenced by QColorDialog::~QColorDialog().

113 {}

◆ colorDialogSetCurrentColor()

virtual void QGuiPlatformPlugin::colorDialogSetCurrentColor ( QColorDialog ,
const QColor  
)
inlinevirtual

Definition at line 115 of file qguiplatformplugin_p.h.

Referenced by QColorDialog::setCurrentColor().

115 {}

◆ colorDialogSetVisible()

virtual bool QGuiPlatformPlugin::colorDialogSetVisible ( QColorDialog ,
bool   
)
inlinevirtual

Definition at line 114 of file qguiplatformplugin_p.h.

114 { return false; }

◆ fileDialogDelete()

virtual void QGuiPlatformPlugin::fileDialogDelete ( QFileDialog )
inlinevirtual

Definition at line 101 of file qguiplatformplugin_p.h.

Referenced by QFileDialogPrivate::rootPath().

101 {}

◆ fileDialogDirectory()

virtual QString QGuiPlatformPlugin::fileDialogDirectory ( const QFileDialog ) const
inlinevirtual

Definition at line 105 of file qguiplatformplugin_p.h.

Referenced by QFileDialogPrivate::rootPath().

105 { return QString(); }
The QString class provides a Unicode character string.
Definition: qstring.h:83

◆ fileDialogResultCode()

virtual QDialog::DialogCode QGuiPlatformPlugin::fileDialogResultCode ( QFileDialog )
inlinevirtual

Definition at line 103 of file qguiplatformplugin_p.h.

Referenced by QFileDialogPrivate::rootPath().

103 { return QDialog::Rejected; }

◆ fileDialogSelectedFiles()

virtual QStringList QGuiPlatformPlugin::fileDialogSelectedFiles ( const QFileDialog ) const
inlinevirtual

Definition at line 107 of file qguiplatformplugin_p.h.

Referenced by QFileDialogPrivate::rootPath().

107 { return QStringList(); }
The QStringList class provides a list of strings.
Definition: qstringlist.h:66

◆ fileDialogSelectedNameFilter()

virtual QString QGuiPlatformPlugin::fileDialogSelectedNameFilter ( const QFileDialog ) const
inlinevirtual

Definition at line 111 of file qguiplatformplugin_p.h.

Referenced by QFileDialogPrivate::rootPath().

111 { return QString(); }
The QString class provides a Unicode character string.
Definition: qstring.h:83

◆ fileDialogSelectFile()

virtual void QGuiPlatformPlugin::fileDialogSelectFile ( QFileDialog ,
const QString  
)
inlinevirtual

Definition at line 106 of file qguiplatformplugin_p.h.

Referenced by QFileDialogPrivate::rootPath().

106 {}

◆ fileDialogSelectNameFilter()

virtual void QGuiPlatformPlugin::fileDialogSelectNameFilter ( QFileDialog ,
const QString  
)
inlinevirtual

Definition at line 110 of file qguiplatformplugin_p.h.

Referenced by QFileDialogPrivate::rootPath().

110 {}

◆ fileDialogSetDirectory()

virtual void QGuiPlatformPlugin::fileDialogSetDirectory ( QFileDialog ,
const QString  
)
inlinevirtual

Definition at line 104 of file qguiplatformplugin_p.h.

Referenced by QFileDialogPrivate::rootPath().

104 {}

◆ fileDialogSetFilter()

virtual void QGuiPlatformPlugin::fileDialogSetFilter ( QFileDialog )
inlinevirtual

Definition at line 108 of file qguiplatformplugin_p.h.

Referenced by QFileDialogPrivate::rootPath().

108 {}

◆ fileDialogSetNameFilters()

virtual void QGuiPlatformPlugin::fileDialogSetNameFilters ( QFileDialog ,
const QStringList  
)
inlinevirtual

Definition at line 109 of file qguiplatformplugin_p.h.

Referenced by QFileDialogPrivate::rootPath().

109 {}

◆ fileDialogSetVisible()

virtual bool QGuiPlatformPlugin::fileDialogSetVisible ( QFileDialog ,
bool   
)
inlinevirtual

Definition at line 102 of file qguiplatformplugin_p.h.

Referenced by QFileDialogPrivate::rootPath().

102 { return false; }

◆ fileSystemIcon()

QIcon QGuiPlatformPlugin::fileSystemIcon ( const QFileInfo )
virtual

Definition at line 267 of file qguiplatformplugin.cpp.

Referenced by QFileIconProvider::icon().

268 {
269  return QIcon();
270 }
The QIcon class provides scalable icons in different modes and states.
Definition: qicon.h:60

◆ iconThemeSearchPaths()

QStringList QGuiPlatformPlugin::iconThemeSearchPaths ( )
virtual

Definition at line 227 of file qguiplatformplugin.cpp.

Referenced by QIconLoader::themeSearchPaths().

228 {
229  QStringList paths;
230 #if defined(Q_WS_X11)
231  QString xdgDirString = QFile::decodeName(getenv("XDG_DATA_DIRS"));
232  if (xdgDirString.isEmpty())
233  xdgDirString = QLatin1String("/usr/local/share/:/usr/share/");
234 
235  QStringList xdgDirs = xdgDirString.split(QLatin1Char(':'));
236 
237  for (int i = 0 ; i < xdgDirs.size() ; ++i) {
238  QDir dir(xdgDirs[i]);
239  if (dir.exists())
240  paths.append(dir.path() + QLatin1String("/icons"));
241  }
242  if (X11->desktopEnvironment == DE_KDE) {
243  paths << QLatin1Char(':') + QKde::kdeHome() + QLatin1String("/share/icons");
244  QStringList kdeDirs = QFile::decodeName(getenv("KDEDIRS")).split(QLatin1Char(':'));
245  for (int i = 0 ; i< kdeDirs.count() ; ++i) {
246  QDir dir(QLatin1Char(':') + kdeDirs.at(i) + QLatin1String("/share/icons"));
247  if (dir.exists())
248  paths.append(dir.path());
249  }
250  }
251 
252  // Add home directory first in search path
253  QDir homeDir(QDir::homePath() + QLatin1String("/.icons"));
254  if (homeDir.exists())
255  paths.prepend(homeDir.path());
256 #endif
257 
258 #if defined(Q_WS_WIN)
259  paths.append(qApp->applicationDirPath() + QLatin1String("/icons"));
260 #elif defined(Q_WS_MAC)
261  paths.append(qApp->applicationDirPath() + QLatin1String("/../Resources/icons"));
262 #endif
263  return paths;
264 }
The QDir class provides access to directory structures and their contents.
Definition: qdir.h:58
QLatin1String(DBUS_INTERFACE_DBUS))) Q_GLOBAL_STATIC_WITH_ARGS(QString
int count(const T &t) const
Returns the number of occurrences of value in the list.
Definition: qlist.h:891
The QString class provides a Unicode character string.
Definition: qstring.h:83
#define X11
Definition: qt_x11_p.h:724
static QString decodeName(const QByteArray &localFileName)
This does the reverse of QFile::encodeName() using localFileName.
Definition: qfile.cpp:552
void append(const T &t)
Inserts value at the end of the list.
Definition: qlist.h:507
bool isEmpty() const
Returns true if the string has no characters; otherwise returns false.
Definition: qstring.h:704
#define qApp
void prepend(const T &t)
Inserts value at the beginning of the list.
Definition: qlist.h:541
const T & at(int i) const
Returns the item at index position i in the list.
Definition: qlist.h:468
The QStringList class provides a list of strings.
Definition: qstringlist.h:66
int size() const
Returns the number of items in the list.
Definition: qlist.h:137
QString kdeHome()
Definition: qkde.cpp:59
QStringList split(const QString &sep, SplitBehavior behavior=KeepEmptyParts, Qt::CaseSensitivity cs=Qt::CaseSensitive) const Q_REQUIRED_RESULT
Splits the string into substrings wherever sep occurs, and returns the list of those strings...
Definition: qstring.cpp:6526
The QLatin1Char class provides an 8-bit ASCII/Latin-1 character.
Definition: qchar.h:55
static QString homePath()
Returns the absolute path of the user&#39;s home directory.
Definition: qdir.cpp:1942

◆ keys()

virtual QStringList QGuiPlatformPlugin::keys ( ) const
inlinevirtual

Implements QFactoryInterface.

Definition at line 89 of file qguiplatformplugin_p.h.

89 { return QStringList() << QLatin1String("default"); };
QLatin1String(DBUS_INTERFACE_DBUS))) Q_GLOBAL_STATIC_WITH_ARGS(QString
The QStringList class provides a list of strings.
Definition: qstringlist.h:66

◆ palette()

QPalette QGuiPlatformPlugin::palette ( )
virtual

Definition at line 194 of file qguiplatformplugin.cpp.

195 {
196 #ifdef Q_WS_X11
197  if (QApplication::desktopSettingsAware() && X11->desktopEnvironment == DE_KDE)
198  return QKde::kdePalette();
199 #endif
200 
201  return QPalette();
202 }
#define X11
Definition: qt_x11_p.h:724
QPalette kdePalette()
Definition: qkde.cpp:100
static bool desktopSettingsAware()
Returns true if Qt is set to use the system&#39;s standard colors, fonts, etc.
The QPalette class contains color groups for each widget state.
Definition: qpalette.h:61

◆ platformHint()

int QGuiPlatformPlugin::platformHint ( PlatformHint  hint)
virtual

Definition at line 273 of file qguiplatformplugin.cpp.

Referenced by QCommonStyle::pixelMetric(), and QCommonStyle::styleHint().

274 {
275  int ret = 0;
276  switch(hint)
277  {
278  case PH_ToolButtonStyle:
280 #ifdef Q_WS_X11
281  if (X11->desktopEnvironment == DE_KDE && X11->desktopVersion >= 4
283  ret = QKde::kdeToolButtonStyle();
284  }
285 #endif
286  break;
287  case PH_ToolBarIconSize:
288 #ifdef Q_WS_X11
289  if (X11->desktopEnvironment == DE_KDE && X11->desktopVersion >= 4
291  ret = QKde::kdeToolBarIconSize();
292  }
293 #endif
294  //by default keep ret = 0 so QCommonStyle will use the style default
295  break;
296  default:
297  break;
298  }
299  return ret;
300 }
#define X11
Definition: qt_x11_p.h:724
int kdeToolButtonStyle()
Definition: qkde.cpp:145
static bool desktopSettingsAware()
Returns true if Qt is set to use the system&#39;s standard colors, fonts, etc.
int kdeToolBarIconSize()
Definition: qkde.cpp:161

◆ styleName()

QString QGuiPlatformPlugin::styleName ( )
virtual

Definition at line 134 of file qguiplatformplugin.cpp.

Referenced by QApplicationPrivate::desktopStyleKey(), and QApplicationPrivate::x11_apply_settings().

135 {
136 #if defined(Q_WS_WIN) && defined(Q_WS_WINCE)
138  return QLatin1String("WindowsMobile");
139  else
140  return QLatin1String("WindowsCE");
141 #elif defined(Q_WS_WIN)
144  return QLatin1String("WindowsVista");
146  && (QSysInfo::WindowsVersion & QSysInfo::WV_NT_based)))
147  return QLatin1String("WindowsXP");
148  else
149  return QLatin1String("Windows"); // default styles for Windows
150 #elif defined(Q_WS_X11) && defined(Q_OS_SOLARIS)
151  return QLatin1String("CDE"); // default style for X11 on Solaris
152 #elif defined(Q_WS_S60)
153  return QLatin1String("S60"); // default style for Symbian with S60
154 #elif defined(Q_OS_SYMBIAN)
155  return QLatin1String("Windows"); // default style for Symbian without S60
156 #elif defined(Q_WS_X11) && defined(Q_OS_IRIX)
157  return QLatin1String("SGI"); // default style for X11 on IRIX
158 #elif defined(Q_WS_QWS) || defined(Q_WS_QPA)
159  return QLatin1String("Plastique"); // default style for X11 and small devices
160 #elif defined(Q_WS_MAC)
161  return QLatin1String("Macintosh"); // default style for all Mac's
162 #elif defined(Q_WS_X11)
163  QString stylename;
164  switch(X11->desktopEnvironment) {
165  case DE_KDE:
166  stylename = QKde::kdeStyle();
167  break;
168  case DE_GNOME: {
169  QStringList availableStyles = QStyleFactory::keys();
170  // Set QGtkStyle for GNOME if available
171  QString gtkStyleKey = QString::fromLatin1("GTK+");
172  if (availableStyles.contains(gtkStyleKey)) {
173  stylename = gtkStyleKey;
174  break;
175  }
176  if (X11->use_xrender)
177  stylename = QLatin1String("cleanlooks");
178  else
179  stylename = QLatin1String("windows");
180  break;
181  }
182  case DE_CDE:
183  stylename = QLatin1String("cde");
184  break;
185  default:
186  // Don't do anything
187  break;
188  }
189  return stylename;
190 #endif
191 }
bool qt_wince_is_pocket_pc()
QString kdeStyle()
Definition: qkde.cpp:127
QLatin1String(DBUS_INTERFACE_DBUS))) Q_GLOBAL_STATIC_WITH_ARGS(QString
static const WinVersion WindowsVersion
the version of the Windows operating system on which the application is run (Windows only) ...
Definition: qglobal.h:1613
The QString class provides a Unicode character string.
Definition: qstring.h:83
#define X11
Definition: qt_x11_p.h:724
static QStringList keys()
Returns the list of valid keys, i.e.
The QStringList class provides a list of strings.
Definition: qstringlist.h:66
QBool contains(const QString &str, Qt::CaseSensitivity cs=Qt::CaseSensitive) const
Returns true if the list contains the string str; otherwise returns false.
Definition: qstringlist.h:172
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
bool qt_wince_is_smartphone()

◆ systemIconThemeName()

QString QGuiPlatformPlugin::systemIconThemeName ( )
virtual

Definition at line 205 of file qguiplatformplugin.cpp.

Referenced by QIconLoader::ensureInitialized(), and QIconLoader::updateSystemTheme().

206 {
207  QString result;
208 #ifdef Q_WS_X11
209  if (X11->desktopEnvironment == DE_GNOME) {
210 #ifndef QT_NO_STYLE_GTK
212 #endif
213  if (result.isEmpty()) {
214  result = QString::fromLatin1("gnome");
215  }
216  } else if (X11->desktopEnvironment == DE_KDE) {
217  result = X11->desktopVersion >= 4 ? QString::fromLatin1("oxygen") : QString::fromLatin1("crystalsvg");
218  QSettings settings(QKde::kdeHome() + QLatin1String("/share/config/kdeglobals"), QSettings::IniFormat);
219  settings.beginGroup(QLatin1String("Icons"));
220  result = settings.value(QLatin1String("Theme"), result).toString();
221  }
222 #endif
223  return result;
224 }
The QSettings class provides persistent platform-independent application settings.
Definition: qsettings.h:73
QLatin1String(DBUS_INTERFACE_DBUS))) Q_GLOBAL_STATIC_WITH_ARGS(QString
The QString class provides a Unicode character string.
Definition: qstring.h:83
#define X11
Definition: qt_x11_p.h:724
static QString getIconThemeName()
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
QString kdeHome()
Definition: qkde.cpp:59

The documentation for this class was generated from the following files: