summaryrefslogtreecommitdiffstats
path: root/qt-ui/mainwindow.cpp
diff options
context:
space:
mode:
authorGravatar Tomaz Canabrava <tcanabrava@kde.org>2013-04-27 12:27:27 -0300
committerGravatar Tomaz Canabrava <tcanabrava@kde.org>2013-04-27 12:27:27 -0300
commit2f4d6bbe535a195046b4746fd3a771087ee4a6c4 (patch)
tree60e7e1ea1cdb4518402f90bd0476915fb7f4742d /qt-ui/mainwindow.cpp
parent1d0d42f861fc3a658eb22b99ba58616d716e095e (diff)
downloadsubsurface-2f4d6bbe535a195046b4746fd3a771087ee4a6c4.tar.gz
Added support for showing the Stars on the DiveTable
For the stars on the dive table I had to rework a bit my StarRating widget, because it used a pixmap for each widget that were created. Not it uses only 2 pixmaps: the active and inactive ones. A new file was created named modeldelegates(h, cpp) that should hold all delegates of the models. For the GTK / C folks, a 'Delegate' ia s way to bypass the default behavior of the view that's displaying the data. I also added the code to display the stars if no delegate is set ( good for debugging. ) Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Diffstat (limited to 'qt-ui/mainwindow.cpp')
-rw-r--r--qt-ui/mainwindow.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/qt-ui/mainwindow.cpp b/qt-ui/mainwindow.cpp
index 8cdc60193..4c4143e98 100644
--- a/qt-ui/mainwindow.cpp
+++ b/qt-ui/mainwindow.cpp
@@ -20,7 +20,7 @@
#include "../dive.h"
#include "../divelist.h"
#include "../pref.h"
-
+#include "modeldelegates.h"
MainWindow::MainWindow() : ui(new Ui::MainWindow()),
model(new DiveTripModel(this)),
@@ -69,6 +69,7 @@ void MainWindow::on_actionOpen_triggered()
model->deleteLater();
model = new DiveTripModel(this);
sortModel->setSourceModel(model);
+ ui->ListWidget->setItemDelegateForColumn(DiveTripModel::RATING, new StarWidgetsDelegate());
}
void MainWindow::on_actionSave_triggered()