sizeHint for items Widget
authordisplacer
Mon, 10 Dec 2007 23:09:43 +0000
changeset 643 281af1f040fb
parent 642 3178a83c7043
child 644 45454744f240
sizeHint for items Widget
QTfrontend/itemNum.cpp
QTfrontend/itemNum.h
QTfrontend/selectWeapon.cpp
--- a/QTfrontend/itemNum.cpp	Mon Dec 10 22:55:14 2007 +0000
+++ b/QTfrontend/itemNum.cpp	Mon Dec 10 23:09:43 2007 +0000
@@ -55,6 +55,11 @@
   repaint();
 }
 
+QSize ItemNum::sizeHint () const
+{
+  return QSize((maxItems+1)*12, 32);
+}
+
 void ItemNum::paintEvent(QPaintEvent* event)
 {
   QPainter painter(this);
--- a/QTfrontend/itemNum.h	Mon Dec 10 22:55:14 2007 +0000
+++ b/QTfrontend/itemNum.h	Mon Dec 10 23:09:43 2007 +0000
@@ -31,6 +31,7 @@
 
   protected:
     ItemNum(const QImage& im, QWidget * parent, unsigned char min=2, unsigned char max=8);
+    virtual QSize sizeHint () const;
     virtual ~ItemNum()=0;
     
     bool nonInteractive;
--- a/QTfrontend/selectWeapon.cpp	Mon Dec 10 22:55:14 2007 +0000
+++ b/QTfrontend/selectWeapon.cpp	Mon Dec 10 23:09:43 2007 +0000
@@ -49,7 +49,7 @@
   hbLayout->setStretchFactor(lbl, 1);
   hbLayout->setStretchFactor(item, 99);
   hbLayout->setAlignment(lbl, Qt::AlignLeft | Qt::AlignTop);
-  //hbLayout->setAlignment(item, Qt::AlignTop);
+  hbLayout->setAlignment(item, Qt::AlignTop);
 }
 
 SelWeaponWidget::SelWeaponWidget(QWidget* parent) :