- played around with transparency
[buliscores] / src / scoretable.cpp
index 7b9cbf1..3de9573 100644 (file)
@@ -8,28 +8,33 @@
 ScoreTable::ScoreTable(MatchDayModel* model, QWidget *parent) :
     QTableView(parent)
 {
-    this->setAttribute(Qt::WA_TransparentForMouseEvents);
-    this->setAttribute(Qt::WA_TranslucentBackground);
+    QPalette palette;
 
+    this->hide();
+    // data
     this->setModel(model);
+
+    // behaviour
+    this->setAttribute(Qt::WA_TransparentForMouseEvents);
     this->setSelectionMode(QAbstractItemView::NoSelection);
 
-    this->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
+    // style
+    palette.setColor(QPalette::Background, QColor(0, 0, 0, 200));
 
     this->verticalHeader()->hide();
     this->verticalHeader()->setResizeMode(QHeaderView::ResizeToContents);
     this->verticalHeader()->setMinimumSectionSize(1);
-
     this->horizontalHeader()->hide();
     this->horizontalHeader()->setResizeMode(QHeaderView::ResizeToContents);
     this->horizontalHeader()->setMinimumSectionSize(1);
 
-    qDebug() << "Min VertHeaderSize: " << this->verticalHeader()->minimumSectionSize();
-
     this->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
     this->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
 
-    this->viewport()->setAutoFillBackground(true);
+    this->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
+    this->setAttribute(Qt::WA_TranslucentBackground);
+    this->viewport()->setAttribute(Qt::WA_TranslucentBackground);
+
     this->setShowGrid(false);
 }
 
@@ -61,10 +66,4 @@ void ScoreTable::dataChanged(const QModelIndex &topLeft, const QModelIndex &bott
     this->updateGeometry();
 }
 
-void ScoreTable::mousePressEvent(QMouseEvent* event)
-{
-    MatchDayModel* m = (MatchDayModel*)this->model();
-    m->update();
-}
-