fix: issue with playing team list vertically collapsing
authorsheepluva
Thu, 03 May 2012 01:18:29 +0200
changeset 7005 19cddb42326f
parent 7003 e118ee168577
child 7008 25563f054ef3
fix: issue with playing team list vertically collapsing
QTfrontend/ui/widget/frameTeam.cpp
QTfrontend/ui/widget/frameTeam.h
--- a/QTfrontend/ui/widget/frameTeam.cpp	Wed May 02 21:45:55 2012 +0200
+++ b/QTfrontend/ui/widget/frameTeam.cpp	Thu May 03 01:18:29 2012 +0200
@@ -41,6 +41,7 @@
         availableColors.push_back(QColor(colors[i++]));
 
     resetColors();
+    this->setSizePolicy(QSizePolicy::Maximum, QSizePolicy::Fixed);
 }
 
 void FrameTeams::setInteractivity(bool interactive)
@@ -89,6 +90,8 @@
     mainLayout.removeWidget(it.value());
     it.value()->deleteLater();
     teamToWidget.erase(it);
+    QResizeEvent* pevent=new QResizeEvent(parentWidget()->size(), parentWidget()->size());
+    QCoreApplication::postEvent(parentWidget(), pevent);
 }
 
 void FrameTeams::resetTeams()
@@ -99,6 +102,8 @@
         it.value()->deleteLater();
         teamToWidget.erase(it++);
     }
+    QResizeEvent* pevent=new QResizeEvent(parentWidget()->size(), parentWidget()->size());
+    QCoreApplication::postEvent(parentWidget(), pevent);
 }
 
 void FrameTeams::setHHNum(const HWTeam& team)
@@ -132,3 +137,8 @@
 {
     emit teamColorChanged(team);
 }
+
+QSize FrameTeams::sizeHint() const
+{
+    return QSize(-1, teamToWidget.size() * 39 + 9);
+}
--- a/QTfrontend/ui/widget/frameTeam.h	Wed May 02 21:45:55 2012 +0200
+++ b/QTfrontend/ui/widget/frameTeam.h	Thu May 03 01:18:29 2012 +0200
@@ -43,6 +43,7 @@
         void setTeamColor(const HWTeam& team);
         void setInteractivity(bool interactive);
         QColor getNextColor() const;
+        QSize sizeHint() const;
 
     signals:
         void teamColorChanged(const HWTeam&);