mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
QML UI: get add dive closer to being useful
Now we at least start out with the corret date, time and number. This still isn't functional as a lot of the data aren't used and the way you save the data is completely silly, but it's another step in the right direction. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
dc0be271bd
commit
0962b504ce
5 changed files with 9 additions and 6 deletions
|
@ -120,7 +120,7 @@ QHash<int, QByteArray> DiveListModel::roleNames() const
|
|||
}
|
||||
|
||||
// create a new dive. set the current time and add it to the end of the dive list
|
||||
void DiveListModel::startAddDive()
|
||||
QString DiveListModel::startAddDive()
|
||||
{
|
||||
struct dive *d;
|
||||
d = alloc_dive();
|
||||
|
@ -132,6 +132,7 @@ void DiveListModel::startAddDive()
|
|||
d->number = nr;
|
||||
add_single_dive(-1, d);
|
||||
addDive(d);
|
||||
return QString::number(d->id);
|
||||
}
|
||||
|
||||
DiveListModel *DiveListModel::instance()
|
||||
|
|
|
@ -41,7 +41,7 @@ public:
|
|||
int rowCount(const QModelIndex &parent = QModelIndex()) const;
|
||||
QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const;
|
||||
QHash<int, QByteArray> roleNames() const;
|
||||
void startAddDive();
|
||||
QString startAddDive();
|
||||
private:
|
||||
QList<Dive> m_dives;
|
||||
static DiveListModel *m_instance;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue