From 97a28981cce8a6cc076d650068444f100305d74d Mon Sep 17 00:00:00 2001 From: Bas Pape Date: Sat, 20 Apr 2013 23:33:06 +0200 Subject: [PATCH] setAlphaChannel is deprecated in Qt 5. With the default CompositionMode this should work too. --- src/qtui/chatitem.cpp | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/qtui/chatitem.cpp b/src/qtui/chatitem.cpp index d189ff51..2526fa7a 100644 --- a/src/qtui/chatitem.cpp +++ b/src/qtui/chatitem.cpp @@ -509,11 +509,8 @@ void SenderChatItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *op pixmap.fill(Qt::transparent); QPainter pixPainter(&pixmap); layout()->draw(&pixPainter, QPointF(qMax(offset, (qreal)0), 0), additionalFormats()); - pixPainter.end(); // Create alpha channel mask - QPixmap mask(pixmap.size()); - QPainter maskPainter(&mask); QLinearGradient gradient; if (offset < 0) { gradient.setStart(0, 0); @@ -527,8 +524,8 @@ void SenderChatItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *op gradient.setColorAt(0, Qt::white); gradient.setColorAt(1, Qt::black); } - maskPainter.fillRect(0, 0, pixmap.width(), pixmap.height(), gradient); - pixmap.setAlphaChannel(mask); + pixPainter.fillRect(0, 0, pixmap.width(), pixmap.height(), gradient); + pixPainter.end(); painter->drawPixmap(pos(), pixmap); } else { -- 2.20.1