QTfrontend/selectWeapon.cpp
changeset 644 45454744f240
parent 643 281af1f040fb
child 681 7a20c50988ec
equal deleted inserted replaced
643:281af1f040fb 644:45454744f240
    33 
    33 
    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   hbLayout->setSpacing(1);
       
    39   hbLayout->setMargin(1);
    38   
    40   
    39   QLabel* lbl = new QLabel(this);
    41   QLabel* lbl = new QLabel(this);
    40   lbl->setPixmap(QPixmap::fromImage(getAmmoImage(num)));
    42   lbl->setPixmap(QPixmap::fromImage(getAmmoImage(num)));
    41   lbl->setMaximumWidth(30);
    43   lbl->setMaximumWidth(30);
    42   lbl->setGeometry(0, 0, 30, 30);
    44   lbl->setGeometry(0, 0, 30, 30);
    46   item->setInfinityState(true);
    48   item->setInfinityState(true);
    47   hbLayout->addWidget(item);
    49   hbLayout->addWidget(item);
    48 
    50 
    49   hbLayout->setStretchFactor(lbl, 1);
    51   hbLayout->setStretchFactor(lbl, 1);
    50   hbLayout->setStretchFactor(item, 99);
    52   hbLayout->setStretchFactor(item, 99);
    51   hbLayout->setAlignment(lbl, Qt::AlignLeft | Qt::AlignTop);
    53   hbLayout->setAlignment(lbl, Qt::AlignLeft | Qt::AlignVCenter);
    52   hbLayout->setAlignment(item, Qt::AlignTop);
    54   hbLayout->setAlignment(item, Qt::AlignLeft | Qt::AlignVCenter);
    53 }
    55 }
    54 
    56 
    55 SelWeaponWidget::SelWeaponWidget(QWidget* parent) :
    57 SelWeaponWidget::SelWeaponWidget(QWidget* parent) :
    56 QWidget(parent)
    58 QWidget(parent)
    57 {
    59 {
    58   pLayout=new QGridLayout(this);
    60   pLayout=new QGridLayout(this);
       
    61   pLayout->setSpacing(1);
       
    62   pLayout->setMargin(1);
    59 
    63 
    60   int j=-1;
    64   int j=-1;
    61   for(int i=0; i<19; ++i) {
    65   for(int i=0; i<19; ++i) {
    62     if (i%4==0) ++j;
    66     if (i%4==0) ++j;
    63     SelWeaponItem* swi = new SelWeaponItem(i, this);
    67     SelWeaponItem* swi = new SelWeaponItem(i, this);