mask applied
authordisplacer
Thu, 06 Dec 2007 20:25:32 +0000
changeset 630 38338573e09a
parent 629 fb03a39a10ff
child 631 f7df3889f2ff
mask applied
QTfrontend/selectWeapon.cpp
--- a/QTfrontend/selectWeapon.cpp	Thu Dec 06 20:02:01 2007 +0000
+++ b/QTfrontend/selectWeapon.cpp	Thu Dec 06 20:25:32 2007 +0000
@@ -23,6 +23,7 @@
 #include <QGridLayout>
 #include <QHBoxLayout>
 #include <QLabel>
+#include <QBitmap>
 
 QImage getAmmoImage(int num)
 {
@@ -35,8 +36,10 @@
 {
   QHBoxLayout* hbLayout = new QHBoxLayout(this);
   
-  QLabel* lbl = new QLabel("1");
-  lbl->setPixmap(QPixmap::fromImage(getAmmoImage(num)));
+  QLabel* lbl = new QLabel();
+  QPixmap px(QPixmap::fromImage(getAmmoImage(num)));
+  px.setMask(px.createMaskFromColor(QColor(0,0,0)));
+  lbl->setPixmap(px);
   
   hbLayout->addWidget(lbl);
   WeaponItem* item=new WeaponItem(QImage(":/res/M2Round2.jpg"), this);