- fix bug with non-working settings buttons
[buliscores] / src / src / scoretable.cpp
index 3de9573..0bd29e8 100644 (file)
@@ -15,7 +15,6 @@ ScoreTable::ScoreTable(MatchDayModel* model, QWidget *parent) :
     this->setModel(model);
 
     // behaviour
-    this->setAttribute(Qt::WA_TransparentForMouseEvents);
     this->setSelectionMode(QAbstractItemView::NoSelection);
 
     // style
@@ -41,14 +40,13 @@ ScoreTable::ScoreTable(MatchDayModel* model, QWidget *parent) :
 QSize ScoreTable::sizeHint() const
 {
     QSize s;
+    int maxrows = 9;
 
     for (int i = 0; i < horizontalHeader()->count(); i++) {
         s.setWidth(s.width() + horizontalHeader()->sectionSize(i));
     }
-    // add missing few pixels (from borders mabye?)
-    // TODO: find better solution!
-    s.setWidth(s.width());
-    for (int i = 0; i < verticalHeader()->count(); i++) {
+
+    for (int i = 0; i < verticalHeader()->count(), i < maxrows; i++) {
         s.setHeight(s.height() + verticalHeader()->sectionSize(i));
     }
     // add missing few pixels (from borders mabye?)
@@ -62,8 +60,6 @@ void ScoreTable::dataChanged(const QModelIndex &topLeft, const QModelIndex &bott
 {
     // this will recalculate section sizes
     QTableView::dataChanged(topLeft, bottomRight);
-
-    this->updateGeometry();
 }