Qt 4.8
Functions
qgraphicssystemfactory.cpp File Reference
#include "qgraphicssystemfactory_p.h"
#include "qgraphicssystemplugin_p.h"
#include "private/qfactoryloader_p.h"
#include "qmutex.h"
#include "qapplication.h"
#include "qgraphicssystem_raster_p.h"
#include "qgraphicssystem_runtime_p.h"
#include "qdebug.h"

Go to the source code of this file.

Functions

 Q_GLOBAL_STATIC_WITH_ARGS (QFactoryLoader, loader,(QGraphicsSystemFactoryInterface_iid, QLatin1String("/graphicssystems"), Qt::CaseInsensitive)) QGraphicsSystem *QGraphicsSystemFactory
 

Function Documentation

◆ Q_GLOBAL_STATIC_WITH_ARGS()

Q_GLOBAL_STATIC_WITH_ARGS ( QFactoryLoader  ,
loader  ,
(QGraphicsSystemFactoryInterface_iid, QLatin1String("/graphicssystems"), Qt::CaseInsensitive)   
)

Definition at line 55 of file qgraphicssystemfactory.cpp.

60 {
61  QGraphicsSystem *ret = 0;
62  QString system = key.toLower();
63 
64 #if defined (QT_GRAPHICSSYSTEM_OPENGL)
65  if (system.isEmpty()) {
66  system = QLatin1String("opengl");
67  }
68 #elif defined (QT_GRAPHICSSYSTEM_OPENVG) && !defined(Q_CC_NOKIAX86)
69  if (system.isEmpty()) {
70  system = QLatin1String("openvg");
71  }
72 #elif defined (QT_GRAPHICSSYSTEM_RUNTIME)
73  if (system.isEmpty()) {
74  system = QLatin1String("runtime");
75  }
76 #elif defined (QT_GRAPHICSSYSTEM_RASTER) && !defined(Q_WS_WIN) && !defined(Q_OS_SYMBIAN) || defined(Q_WS_X11)
77  if (system.isEmpty()) {
78  system = QLatin1String("raster");
79  }
80 #endif
81 
82  if (system == QLatin1String("raster"))
83  return new QRasterGraphicsSystem;
84  else if (system == QLatin1String("runtime"))
85  return new QRuntimeGraphicsSystem;
86  else if (system.isEmpty() || system == QLatin1String("native"))
87  return 0;
88 
89 #ifndef QT_NO_LIBRARY
90  if (!ret) {
91  if (QGraphicsSystemFactoryInterface *factory = qobject_cast<QGraphicsSystemFactoryInterface*>(loader()->instance(system)))
92  ret = factory->create(system);
93  }
94 #endif
95 
96  if (!ret)
97  qWarning() << "Unable to load graphicssystem" << system;
98 
99  return ret;
100 }
QLatin1String(DBUS_INTERFACE_DBUS))) Q_GLOBAL_STATIC_WITH_ARGS(QString
The QString class provides a Unicode character string.
Definition: qstring.h:83
bool isEmpty() const
Returns true if the string has no characters; otherwise returns false.
Definition: qstring.h:704
Q_CORE_EXPORT void qWarning(const char *,...)
int key