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 { |