diff --git a/src/gui/painting/qpaintdevice.cpp b/src/gui/painting/qpaintdevice.cpp index 8a0ccfb5f2..c0fd0e644a 100644 --- a/src/gui/painting/qpaintdevice.cpp +++ b/src/gui/painting/qpaintdevice.cpp @@ -43,8 +43,6 @@ QT_BEGIN_NAMESPACE -extern void qt_painter_removePaintDevice(QPaintDevice *); //qpainter.cpp - QPaintDevice::QPaintDevice() { painters = 0; @@ -55,7 +53,6 @@ QPaintDevice::~QPaintDevice() if (paintingActive()) qWarning("QPaintDevice: Cannot destroy paint device that is being " "painted"); - qt_painter_removePaintDevice(this); } diff --git a/src/gui/painting/qpaintdevice_qpa.cpp b/src/gui/painting/qpaintdevice_qpa.cpp index 0d1ca92d45..44e169c14e 100644 --- a/src/gui/painting/qpaintdevice_qpa.cpp +++ b/src/gui/painting/qpaintdevice_qpa.cpp @@ -41,14 +41,11 @@ #include "qpaintdevice.h" #include "qpainter.h" -#include "qwidget.h" #include "qbitmap.h" #include "qapplication.h" QT_BEGIN_NAMESPACE -extern void qt_painter_removePaintDevice(QPaintDevice *); //qpainter.cpp - int QPaintDevice::metric(PaintDeviceMetric m) const { qWarning("QPaintDevice::metrics: Device has no metric information"); diff --git a/src/gui/painting/qpainter.cpp b/src/gui/painting/qpainter.cpp index 929685db53..f974186f58 100644 --- a/src/gui/painting/qpainter.cpp +++ b/src/gui/painting/qpainter.cpp @@ -7370,27 +7370,6 @@ void QPainter::setViewTransformEnabled(bool enable) d->updateMatrix(); } - -struct QPaintDeviceRedirection -{ - QPaintDeviceRedirection() : device(0), replacement(0), internalWidgetRedirectionIndex(-1) {} - QPaintDeviceRedirection(const QPaintDevice *device, QPaintDevice *replacement, - const QPoint& offset, int internalWidgetRedirectionIndex) - : device(device), replacement(replacement), offset(offset), - internalWidgetRedirectionIndex(internalWidgetRedirectionIndex) { } - const QPaintDevice *device; - QPaintDevice *replacement; - QPoint offset; - int internalWidgetRedirectionIndex; - bool operator==(const QPaintDevice *pdev) const { return device == pdev; } - Q_DUMMY_COMPARISON_OPERATOR(QPaintDeviceRedirection) -}; - -typedef QList QPaintDeviceRedirectionList; -Q_GLOBAL_STATIC(QPaintDeviceRedirectionList, globalRedirections) -Q_GLOBAL_STATIC(QMutex, globalRedirectionsMutex) -Q_GLOBAL_STATIC(QAtomicInt, globalRedirectionAtomic) - /*! \threadsafe @@ -7467,36 +7446,6 @@ QPaintDevice *QPainter::redirected(const QPaintDevice *device, QPoint *offset) return 0; } - -void qt_painter_removePaintDevice(QPaintDevice *dev) -{ - if (!globalRedirectionAtomic() || *globalRedirectionAtomic() == 0) - return; - - QMutex *mutex = 0; - QT_TRY { - mutex = globalRedirectionsMutex(); - } QT_CATCH(...) { - // ignore the missing mutex, since we could be called from - // a destructor, and destructors shall not throw - } - QMutexLocker locker(mutex); - QPaintDeviceRedirectionList *redirections = 0; - QT_TRY { - redirections = globalRedirections(); - } QT_CATCH(...) { - // do nothing - code below is safe with redirections being 0. - } - if (redirections) { - for (int i = 0; i < redirections->size(); ) { - if(redirections->at(i) == dev || redirections->at(i).replacement == dev) - redirections->removeAt(i); - else - ++i; - } - } -} - void qt_format_text(const QFont &fnt, const QRectF &_r, int tf, const QString& str, QRectF *brect, int tabstops, int *ta, int tabarraylen,