~ubuntu-branches/ubuntu/quantal/psi/quantal

« back to all changes in this revision

Viewing changes to src/pixmaputil.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Jan Niehusmann
  • Date: 2008-04-14 18:57:30 UTC
  • mfrom: (2.1.9 hardy)
  • Revision ID: james.westby@ubuntu.com-20080414185730-528re3zp0m2hdlhi
Tags: 0.11-8
* added CONFIG -= link_prl to .pro files and removed dependencies
  which are made unnecessary by this change
* Fix segfault when closing last chat tab with qt4.4
  (This is from upstream svn, rev. 1101) (Closes: Bug#476122)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#include "pixmaputil.h"
 
2
 
 
3
#include <QBitmap>
 
4
#include <QImage>
 
5
 
 
6
QPixmap PixmapUtil::createTransparentPixmap(int width, int height)
 
7
{
 
8
        // Now there's third alternative:
 
9
        // QPainter p(&pixmap);
 
10
        // p.fillRect(pixmap.rect(), Qt::transparent);
 
11
#if 1
 
12
        QPixmap pix(width, height);
 
13
        QBitmap mask(width, height);
 
14
        pix.fill();
 
15
        mask.clear();
 
16
        pix.setMask(mask);
 
17
#else
 
18
        QImage img(width, height, QImage::Format_ARGB32);
 
19
        img.fill(0x00000000);
 
20
        QPixmap pix = QPixmap::fromImage(img);
 
21
#endif
 
22
        return pix;
 
23
}