some layout tune
authordisplacer
Mon, 10 Dec 2007 22:05:50 +0000
changeset 639 69d7ff3ab6f0
parent 638 e1cc516488f2
child 640 e69b651bb336
some layout tune
QTfrontend/selectWeapon.cpp
--- a/QTfrontend/selectWeapon.cpp	Sun Dec 09 17:16:15 2007 +0000
+++ b/QTfrontend/selectWeapon.cpp	Mon Dec 10 22:05:50 2007 +0000
@@ -36,12 +36,19 @@
 {
   QHBoxLayout* hbLayout = new QHBoxLayout(this);
   
-  QLabel* lbl = new QLabel();
+  QLabel* lbl = new QLabel(this);
   lbl->setPixmap(QPixmap::fromImage(getAmmoImage(num)));
-  
+  lbl->setMaximumWidth(30);
+  lbl->setGeometry(0, 0, 30, 30);
   hbLayout->addWidget(lbl);
+
   WeaponItem* item=new WeaponItem(QImage(":/res/M2Round2.jpg"), this);
   hbLayout->addWidget(item);
+
+  hbLayout->setStretchFactor(lbl, 1);
+  hbLayout->setStretchFactor(item, 99);
+  hbLayout->setAlignment(lbl, Qt::AlignLeft | Qt::AlignTop);
+  //hbLayout->setAlignment(item, Qt::AlignTop);
 }
 
 SelWeaponWidget::SelWeaponWidget(QWidget* parent) :