mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Merge branch 'tomaz-css' into Qt
Tomaz' code does a much better job of shading the dive list! Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
commit
ff2ce39970
10 changed files with 106 additions and 16 deletions
|
@ -25,6 +25,7 @@
|
|||
#include "../divelist.h"
|
||||
#include "../pref.h"
|
||||
#include "modeldelegates.h"
|
||||
#include "models.h"
|
||||
|
||||
MainWindow::MainWindow() : ui(new Ui::MainWindow()),
|
||||
model(new DiveTripModel(this)),
|
||||
|
@ -33,6 +34,7 @@ MainWindow::MainWindow() : ui(new Ui::MainWindow()),
|
|||
ui->setupUi(this);
|
||||
sortModel->setSourceModel(model);
|
||||
ui->ListWidget->setModel(sortModel);
|
||||
connect(ui->ListWidget, SIGNAL(activated(QModelIndex)), this, SLOT(diveSelected(QModelIndex)));
|
||||
|
||||
/* figure out appropriate widths for the columns. The strings chosen
|
||||
* are somewhat random (but at least we're trying to allow them to be
|
||||
|
@ -70,6 +72,16 @@ MainWindow::MainWindow() : ui(new Ui::MainWindow()),
|
|||
readSettings();
|
||||
}
|
||||
|
||||
void MainWindow::diveSelected(const QModelIndex& index)
|
||||
{
|
||||
struct dive *dive = (struct dive*) index.model()->data(index, TreeItemDT::DIVE_ROLE).value<void*>();
|
||||
|
||||
if (dive)
|
||||
selected_dive = get_index_for_dive(dive);
|
||||
|
||||
// Here should be the code to update the other widgets.
|
||||
}
|
||||
|
||||
void MainWindow::on_actionNew_triggered()
|
||||
{
|
||||
qDebug("actionNew");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue