'Cancel' action Cancels editing Cylinders.

Made the default 'Cancel' action correctly cancel
the cylinder edition. This is needed only because
we bypassed the default behavior on Qt that took
care of this, because we wanted to have more control
on how the view would update the items accordingly
with wich one of the cylinders were selected
on the edition pane - the pressure and size of the
cylinders needed to have it's data set, but the Qt
Model/View system *thinks* that cancel-edition is
simply 'do not commit the edition data, then.' wich
would not work with us, because we passed the strange
data already. So, I created a backup data that serves
us very well. When the user cancels, this backup data
is added back on the cylinder, making everything as
it was before.

Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
This commit is contained in:
Tomaz Canabrava 2013-07-18 10:24:02 -03:00
parent 63c33e152e
commit 9b0a44196c
4 changed files with 59 additions and 5 deletions

View file

@ -84,6 +84,8 @@ public:
void clear();
void update();
void setDive(struct dive *d);
cylinder_t *cylinderAt(const QModelIndex& index);
public slots:
void remove(const QModelIndex& index);