Qt 4.8
Public Types | Public Functions | Properties | Friends | List of all members
QRuntimeGraphicsSystem Class Reference

#include <qgraphicssystem_runtime_p.h>

Inheritance diagram for QRuntimeGraphicsSystem:
QGraphicsSystem

Public Types

enum  WindowSurfaceDestroyPolicy { DestroyImmediately, DestroyAfterFirstFlush }
 

Public Functions

QPixmapDatacreatePixmapData (QPixmapData::PixelType type) const
 
QWindowSurfacecreateWindowSurface (QWidget *widget) const
 
QString graphicsSystemName () const
 
 QRuntimeGraphicsSystem ()
 
void removePixmapData (QRuntimePixmapData *pixmapData) const
 
void removeWindowSurface (QRuntimeWindowSurface *windowSurface) const
 
void setGraphicsSystem (const QString &name)
 
void setWindowSurfaceDestroyPolicy (WindowSurfaceDestroyPolicy policy)
 
int windowSurfaceDestroyPolicy () const
 
- Public Functions inherited from QGraphicsSystem
virtual QPixmapDatacreatePixmapData (QPixmapData *origin)
 
virtual QGraphicsSystemExplatformExtension ()
 
virtual ~QGraphicsSystem ()
 

Properties

QGraphicsSystemm_graphicsSystem
 
QString m_graphicsSystemName
 
QString m_pendingGraphicsSystemName
 
QList< QRuntimePixmapData * > m_pixmapDatas
 
int m_windowSurfaceDestroyPolicy
 
QList< QRuntimeWindowSurface * > m_windowSurfaces
 

Friends

class QMeeGoGraphicsSystem
 
class QRuntimePixmapData
 
class QRuntimeWindowSurface
 

Additional Inherited Members

- Static Public Functions inherited from QGraphicsSystem
static QPixmapDatacreateDefaultPixmapData (QPixmapData::PixelType type)
 

Detailed Description

Definition at line 141 of file qgraphicssystem_runtime_p.h.

Enumerations

◆ WindowSurfaceDestroyPolicy

Constructors and Destructors

◆ QRuntimeGraphicsSystem()

QRuntimeGraphicsSystem::QRuntimeGraphicsSystem ( )

Definition at line 327 of file qgraphicssystem_runtime.cpp.

330 {
332 
333  if (!qgetenv("QT_DEFAULT_RUNTIME_SYSTEM").isEmpty()) {
334  m_graphicsSystemName = QString::fromLocal8Bit(qgetenv("QT_DEFAULT_RUNTIME_SYSTEM"));
335  } else {
336 #ifdef QT_DEFAULT_RUNTIME_SYSTEM
337  m_graphicsSystemName = QLatin1String(QT_DEFAULT_RUNTIME_SYSTEM);
339 #endif
341  }
342 
343 #ifdef Q_OS_SYMBIAN
345 #endif
346 
348 
350 }
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
QLatin1String(DBUS_INTERFACE_DBUS))) Q_GLOBAL_STATIC_WITH_ARGS(QString
static QGraphicsSystem * create(const QString &)
static bool isEmpty(const char *str)
static bool runtime_graphics_system
static QString graphics_system_name
bool isNull() const
Returns true if this string is null; otherwise returns false.
Definition: qstring.h:505

Functions

◆ createPixmapData()

QPixmapData * QRuntimeGraphicsSystem::createPixmapData ( QPixmapData::PixelType  type) const
virtual

Implements QGraphicsSystem.

Definition at line 353 of file qgraphicssystem_runtime.cpp.

354 {
357 
358  QRuntimePixmapData *rtData = new QRuntimePixmapData(this, type);
359  rtData->m_data = data;
360  m_pixmapDatas << rtData;
361 
362  return rtData;
363 }
int type
Definition: qmetatype.cpp:239
#define Q_ASSERT(cond)
Definition: qglobal.h:1823
static const char * data(const QByteArray &arr)
QList< QRuntimePixmapData * > m_pixmapDatas
virtual QPixmapData * createPixmapData(QPixmapData::PixelType type) const =0

◆ createWindowSurface()

QWindowSurface * QRuntimeGraphicsSystem::createWindowSurface ( QWidget widget) const
virtual

Implements QGraphicsSystem.

Definition at line 365 of file qgraphicssystem_runtime.cpp.

366 {
368  QRuntimeWindowSurface *rtSurface = new QRuntimeWindowSurface(this, widget);
370  widget->setWindowSurface(rtSurface);
371  m_windowSurfaces << rtSurface;
372  return rtSurface;
373 }
void setWindowSurface(QWindowSurface *surface)
Sets the window surface to be the surface specified.
Definition: qwidget.cpp:12774
QList< QRuntimeWindowSurface * > m_windowSurfaces
virtual QWindowSurface * createWindowSurface(QWidget *widget) const =0
#define Q_ASSERT(cond)
Definition: qglobal.h:1823
void reset(T *other=0)
Deletes the existing object it is pointing to if any, and sets its pointer to other.
QScopedPointer< QWindowSurface > m_windowSurface

◆ graphicsSystemName()

QString QRuntimeGraphicsSystem::graphicsSystemName ( ) const
inline

◆ removePixmapData()

void QRuntimeGraphicsSystem::removePixmapData ( QRuntimePixmapData pixmapData) const

Definition at line 416 of file qgraphicssystem_runtime.cpp.

Referenced by QRuntimePixmapData::~QRuntimePixmapData().

417 {
418  int index = m_pixmapDatas.lastIndexOf(pixmapData);
419  m_pixmapDatas.removeAt(index);
420 }
int lastIndexOf(const T &t, int from=-1) const
Returns the index position of the last occurrence of value in the list, searching backward from index...
Definition: qlist.h:862
QList< QRuntimePixmapData * > m_pixmapDatas
quint16 index
void removeAt(int i)
Removes the item at index position i.
Definition: qlist.h:480

◆ removeWindowSurface()

void QRuntimeGraphicsSystem::removeWindowSurface ( QRuntimeWindowSurface windowSurface) const

Definition at line 422 of file qgraphicssystem_runtime.cpp.

Referenced by QRuntimeWindowSurface::~QRuntimeWindowSurface().

423 {
424  int index = m_windowSurfaces.lastIndexOf(windowSurface);
425  m_windowSurfaces.removeAt(index);
426 }
QList< QRuntimeWindowSurface * > m_windowSurfaces
int lastIndexOf(const T &t, int from=-1) const
Returns the index position of the last occurrence of value in the list, searching backward from index...
Definition: qlist.h:862
quint16 index
void removeAt(int i)
Removes the item at index position i.
Definition: qlist.h:480

◆ setGraphicsSystem()

void QRuntimeGraphicsSystem::setGraphicsSystem ( const QString name)

Definition at line 375 of file qgraphicssystem_runtime.cpp.

Referenced by QDeferredGraphicsSystemChange::doChange(), and QApplication::setGraphicsSystem().

376 {
377  if (m_graphicsSystemName == name)
378  return;
379 #ifdef QT_DEBUG
380  qDebug() << "QRuntimeGraphicsSystem::setGraphicsSystem( " << name << " )";
381 #endif
382  QGraphicsSystem *oldSystem = m_graphicsSystem;
385 
387 
389 
390  for (int i = 0; i < m_pixmapDatas.size(); ++i) {
391  QRuntimePixmapData *proxy = m_pixmapDatas.at(i);
393  newData->fromImage(proxy->m_data->toImage(), Qt::NoOpaqueDetection);
394  delete proxy->m_data;
395  proxy->m_data = newData;
396  proxy->readBackInfo();
397  }
398 
399  for (int i = 0; i < m_windowSurfaces.size(); ++i) {
401  QWidget *widget = proxy->m_windowSurface->window();
402 
405 
406  QWindowSurface *newWindowSurface = m_graphicsSystem->createWindowSurface(widget);
407  newWindowSurface->setGeometry(proxy->geometry());
408 
409  proxy->m_windowSurface.reset(newWindowSurface);
410  qt_widget_private(widget)->invalidateBuffer(widget->rect());
411  }
412 
413  delete oldSystem;
414 }
QRect geometry() const
Returns the currently allocated area on the screen.
QScopedPointer< QWindowSurface > m_pendingWindowSurface
QPointer< QWidget > widget
QList< QRuntimeWindowSurface * > m_windowSurfaces
T * take()
Returns the value of the pointer referenced by this object.
The QWidget class is the base class of all user interface objects.
Definition: qwidget.h:150
virtual void setGeometry(const QRect &rect)
Sets the currently allocated area to be the given rect.
The QString class provides a Unicode character string.
Definition: qstring.h:83
virtual QWindowSurface * createWindowSurface(QWidget *widget) const =0
#define Q_ASSERT(cond)
Definition: qglobal.h:1823
Q_CORE_EXPORT void qDebug(const char *,...)
virtual QImage toImage() const =0
static QGraphicsSystem * create(const QString &)
virtual void fromImage(const QImage &image, Qt::ImageConversionFlags flags)=0
const char * name
const T & at(int i) const
Returns the item at index position i in the list.
Definition: qlist.h:468
The QWindowSurface class provides the drawing area for top-level windows.
void reset(T *other=0)
Deletes the existing object it is pointing to if any, and sets its pointer to other.
void invalidateBuffer(const QRegion &)
Invalidates the rgn (in widget&#39;s coordinates) of the backing store, i.e.
QList< QRuntimePixmapData * > m_pixmapDatas
QRect rect
the internal geometry of the widget excluding any window frame
Definition: qwidget.h:168
int size() const
Returns the number of items in the list.
Definition: qlist.h:137
QScopedPointer< QWindowSurface > m_windowSurface
virtual QPixmapData * createPixmapData(QPixmapData::PixelType type) const =0
Q_GUI_EXPORT QWidgetPrivate * qt_widget_private(QWidget *widget)
Definition: qwidget.cpp:12920
QWidget * window() const
Returns a pointer to the top-level window associated with this surface.

◆ setWindowSurfaceDestroyPolicy()

void QRuntimeGraphicsSystem::setWindowSurfaceDestroyPolicy ( WindowSurfaceDestroyPolicy  policy)
inline

Definition at line 163 of file qgraphicssystem_runtime_p.h.

164  {
166  }

◆ windowSurfaceDestroyPolicy()

int QRuntimeGraphicsSystem::windowSurfaceDestroyPolicy ( ) const
inline

Friends and Related Functions

◆ QMeeGoGraphicsSystem

friend class QMeeGoGraphicsSystem
friend

Definition at line 182 of file qgraphicssystem_runtime_p.h.

◆ QRuntimePixmapData

friend class QRuntimePixmapData
friend

Definition at line 180 of file qgraphicssystem_runtime_p.h.

Referenced by createPixmapData().

◆ QRuntimeWindowSurface

Definition at line 181 of file qgraphicssystem_runtime_p.h.

Referenced by createWindowSurface().

Properties

◆ m_graphicsSystem

QGraphicsSystem* QRuntimeGraphicsSystem::m_graphicsSystem
private

◆ m_graphicsSystemName

QString QRuntimeGraphicsSystem::m_graphicsSystemName
private

Definition at line 176 of file qgraphicssystem_runtime_p.h.

Referenced by QRuntimeGraphicsSystem(), and setGraphicsSystem().

◆ m_pendingGraphicsSystemName

QString QRuntimeGraphicsSystem::m_pendingGraphicsSystemName
private

Definition at line 178 of file qgraphicssystem_runtime_p.h.

Referenced by setGraphicsSystem().

◆ m_pixmapDatas

QList<QRuntimePixmapData *> QRuntimeGraphicsSystem::m_pixmapDatas
mutableprivate

◆ m_windowSurfaceDestroyPolicy

int QRuntimeGraphicsSystem::m_windowSurfaceDestroyPolicy
private

Definition at line 172 of file qgraphicssystem_runtime_p.h.

Referenced by QRuntimeGraphicsSystem(), and setGraphicsSystem().

◆ m_windowSurfaces

QList<QRuntimeWindowSurface *> QRuntimeGraphicsSystem::m_windowSurfaces
mutableprivate

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