QTfrontend/selectWeapon.cpp
changeset 639 69d7ff3ab6f0
parent 631 f7df3889f2ff
child 640 e69b651bb336
equal deleted inserted replaced
638:e1cc516488f2 639:69d7ff3ab6f0
    34 SelWeaponItem::SelWeaponItem(int num, QWidget* parent) :
    34 SelWeaponItem::SelWeaponItem(int num, QWidget* parent) :
    35   QWidget(parent)
    35   QWidget(parent)
    36 {
    36 {
    37   QHBoxLayout* hbLayout = new QHBoxLayout(this);
    37   QHBoxLayout* hbLayout = new QHBoxLayout(this);
    38   
    38   
    39   QLabel* lbl = new QLabel();
    39   QLabel* lbl = new QLabel(this);
    40   lbl->setPixmap(QPixmap::fromImage(getAmmoImage(num)));
    40   lbl->setPixmap(QPixmap::fromImage(getAmmoImage(num)));
    41   
    41   lbl->setMaximumWidth(30);
       
    42   lbl->setGeometry(0, 0, 30, 30);
    42   hbLayout->addWidget(lbl);
    43   hbLayout->addWidget(lbl);
       
    44 
    43   WeaponItem* item=new WeaponItem(QImage(":/res/M2Round2.jpg"), this);
    45   WeaponItem* item=new WeaponItem(QImage(":/res/M2Round2.jpg"), this);
    44   hbLayout->addWidget(item);
    46   hbLayout->addWidget(item);
       
    47 
       
    48   hbLayout->setStretchFactor(lbl, 1);
       
    49   hbLayout->setStretchFactor(item, 99);
       
    50   hbLayout->setAlignment(lbl, Qt::AlignLeft | Qt::AlignTop);
       
    51   //hbLayout->setAlignment(item, Qt::AlignTop);
    45 }
    52 }
    46 
    53 
    47 SelWeaponWidget::SelWeaponWidget(QWidget* parent) :
    54 SelWeaponWidget::SelWeaponWidget(QWidget* parent) :
    48 QWidget(parent)
    55 QWidget(parent)
    49 {
    56 {