- fix bug with non-working settings buttons
authorDavid Solbach <d@vidsolbach.de>
Wed, 3 Nov 2010 11:17:41 +0000 (12:17 +0100)
committerDavid Solbach <d@vidsolbach.de>
Wed, 3 Nov 2010 11:17:41 +0000 (12:17 +0100)
- some cleanup

src/src/mainwidget.cpp
src/src/matchdaymodel.cpp
src/src/scoretable.cpp
src/src/settingsdialog.ui

index 7f0ca3d..6568518 100644 (file)
@@ -17,7 +17,7 @@ MainWidget::MainWidget(QWidget *parent) :
     m_backend(new BackendKicker(this)),
     m_datamodel(new MatchDayModel(this, m_backend)),
     m_scoretbl(new ScoreTable(m_datamodel)),
-    m_settingsdlg(new SettingsDialog(this)),
+    m_settingsdlg(new SettingsDialog()),
     m_settings(qApp->organizationName(), qApp->applicationName())
 {
     QFont f;
@@ -33,11 +33,11 @@ MainWidget::MainWidget(QWidget *parent) :
     palette.setColor(QPalette::Background, QColor(0, 0, 0, 127));
     palette.setColor(QPalette::Foreground, QColor(255, 255, 255, 127));
     m_statuslbl.setPalette(palette);
-    m_statuslbl.setAttribute(Qt::WA_TransparentForMouseEvents);
     m_statuslbl.setAutoFillBackground(true);
     m_statuslbl.setBackgroundRole(QPalette::Background);
     m_statuslbl.setAlignment(Qt::AlignCenter);
 
+    m_statuslbl.setGeometry(0, 0, 400, 200);
     m_statuslbl.setFont(f);
 
     // table
index 6ed7de7..c29a3ba 100644 (file)
@@ -176,7 +176,7 @@ QVariant MatchDayModel::data(const QModelIndex& index, int role) const
             f.setPixelSize(16);
         } else {
             f.setBold(false);
-            f.setPixelSize(14);
+            f.setPixelSize(16);
         }
 
         return f;
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();
 }
 
 
index 47eb816..82b6eb8 100644 (file)
@@ -7,12 +7,15 @@
     <x>0</x>
     <y>0</y>
     <width>400</width>
-    <height>79</height>
+    <height>85</height>
    </rect>
   </property>
   <property name="windowTitle">
    <string>Choose League</string>
   </property>
+  <property name="modal">
+   <bool>true</bool>
+  </property>
   <layout class="QVBoxLayout" name="verticalLayout">
    <item>
     <widget class="QPushButton" name="rbBL1">