setAlphaChannel is deprecated in Qt 5.
authorBas Pape <baspape@gmail.com>
Sat, 20 Apr 2013 21:33:06 +0000 (23:33 +0200)
committerManuel Nickschas <sputnick@quassel-irc.org>
Mon, 24 Mar 2014 23:21:25 +0000 (00:21 +0100)
With the default CompositionMode this should work too.

src/qtui/chatitem.cpp

index d189ff5..2526fa7 100644 (file)
@@ -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 {