Qt 4.8
Functions
qpaintdevice.cpp File Reference
#include "qpaintdevice.h"

Go to the source code of this file.

Functions

Q_GUI_EXPORT int qt_paint_device_metric (const QPaintDevice *device, QPaintDevice::PaintDeviceMetric metric)
 
void qt_painter_removePaintDevice (QPaintDevice *)
 

Function Documentation

◆ qt_paint_device_metric()

Q_GUI_EXPORT int qt_paint_device_metric ( const QPaintDevice device,
QPaintDevice::PaintDeviceMetric  metric 
)

Definition at line 70 of file qpaintdevice.cpp.

Referenced by QGLWindowSurfaceGLPaintDevice::metric(), and QCustomRasterPaintDevice::metric().

71 {
72  return device->metric(metric);
73 }
virtual int metric(PaintDeviceMetric metric) const

◆ qt_painter_removePaintDevice()

void qt_painter_removePaintDevice ( QPaintDevice )

Definition at line 8419 of file qpainter.cpp.

Referenced by QPaintDevice::~QPaintDevice().

8420 {
8421  if (!globalRedirectionAtomic() || *globalRedirectionAtomic() == 0)
8422  return;
8423 
8424  QMutex *mutex = 0;
8425  QT_TRY {
8426  mutex = globalRedirectionsMutex();
8427  } QT_CATCH(...) {
8428  // ignore the missing mutex, since we could be called from
8429  // a destructor, and destructors shall not throw
8430  }
8431  QMutexLocker locker(mutex);
8432  QPaintDeviceRedirectionList *redirections = 0;
8433  QT_TRY {
8434  redirections = globalRedirections();
8435  } QT_CATCH(...) {
8436  // do nothing - code below is safe with redirections being 0.
8437  }
8438  if (redirections) {
8439  for (int i = 0; i < redirections->size(); ) {
8440  if(redirections->at(i) == dev || redirections->at(i).replacement == dev)
8441  redirections->removeAt(i);
8442  else
8443  ++i;
8444  }
8445  }
8446 }
The QMutex class provides access serialization between threads.
Definition: qmutex.h:60
const T & at(int i) const
Returns the item at index position i in the list.
Definition: qlist.h:468
#define QT_CATCH(A)
Definition: qglobal.h:1537
The QMutexLocker class is a convenience class that simplifies locking and unlocking mutexes...
Definition: qmutex.h:101
int size() const
Returns the number of items in the list.
Definition: qlist.h:137
#define QT_TRY
Definition: qglobal.h:1536
The QList class is a template class that provides lists.
Definition: qdatastream.h:62
void removeAt(int i)
Removes the item at index position i.
Definition: qlist.h:480