this->setModel(model);
// behaviour
- this->setAttribute(Qt::WA_TransparentForMouseEvents);
this->setSelectionMode(QAbstractItemView::NoSelection);
// style
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?)
{
// this will recalculate section sizes
QTableView::dataChanged(topLeft, bottomRight);
-
- this->updateGeometry();
}