diff options
Diffstat (limited to 'src/gui')
-rw-r--r-- | src/gui/image/qpixmap.cpp | 8 | ||||
-rw-r--r-- | src/gui/image/qpixmapfilter.cpp | 15 | ||||
-rw-r--r-- | src/gui/text/qstatictext.cpp | 5 |
3 files changed, 21 insertions, 7 deletions
diff --git a/src/gui/image/qpixmap.cpp b/src/gui/image/qpixmap.cpp index 66a861d..1e502bd 100644 --- a/src/gui/image/qpixmap.cpp +++ b/src/gui/image/qpixmap.cpp @@ -1177,8 +1177,12 @@ Qt::HANDLE QPixmap::handle() const { #if defined(Q_WS_X11) const QPixmapData *pd = pixmapData(); - if (pd && pd->classId() == QPixmapData::X11Class) - return static_cast<const QX11PixmapData*>(pd)->handle(); + if (pd) { + if (pd->classId() == QPixmapData::X11Class) + return static_cast<const QX11PixmapData*>(pd)->handle(); + else + qWarning("QPixmap::handle(): Pixmap is not an X11 class pixmap"); + } #endif return 0; } diff --git a/src/gui/image/qpixmapfilter.cpp b/src/gui/image/qpixmapfilter.cpp index 70770c4..26bffcc 100644 --- a/src/gui/image/qpixmapfilter.cpp +++ b/src/gui/image/qpixmapfilter.cpp @@ -764,10 +764,17 @@ void expblur(QImage &img, qreal radius, bool improvedQuality = false, int transp } if (transposed == 0) { - qt_memrotate90(reinterpret_cast<const quint32*>(temp.bits()), - temp.width(), temp.height(), temp.bytesPerLine(), - reinterpret_cast<quint32*>(img.bits()), - img.bytesPerLine()); + if (img.depth() == 8) { + qt_memrotate90(reinterpret_cast<const quint8*>(temp.bits()), + temp.width(), temp.height(), temp.bytesPerLine(), + reinterpret_cast<quint8*>(img.bits()), + img.bytesPerLine()); + } else { + qt_memrotate90(reinterpret_cast<const quint32*>(temp.bits()), + temp.width(), temp.height(), temp.bytesPerLine(), + reinterpret_cast<quint32*>(img.bits()), + img.bytesPerLine()); + } } else { img = temp; } diff --git a/src/gui/text/qstatictext.cpp b/src/gui/text/qstatictext.cpp index 7a5dec4..9506006 100644 --- a/src/gui/text/qstatictext.cpp +++ b/src/gui/text/qstatictext.cpp @@ -43,6 +43,7 @@ #include "qstatictext_p.h" #include <private/qtextengine_p.h> #include <private/qfontengine_p.h> +#include <qabstracttextdocumentlayout.h> #include <QtGui/qapplication.h> @@ -654,7 +655,9 @@ void QStaticTextPrivate::paintText(const QPointF &topLeftPosition, QPainter *p) p->save(); p->translate(topLeftPosition); - document.drawContents(p); + QAbstractTextDocumentLayout::PaintContext ctx; + ctx.palette.setColor(QPalette::Text, p->pen().color()); + document.documentLayout()->draw(p, ctx); p->restore(); if (textWidth >= 0.0) |