diff options
author | Berthold Stoeger <bstoeger@mail.tuwien.ac.at> | 2018-07-14 17:40:24 +0200 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2018-07-18 09:06:37 -0700 |
commit | c5f66c5538d149aaab92316096070fcb01cf8f1b (patch) | |
tree | ddc208dac40450a9c7791ca8218d9772c3ea450d /cmake | |
parent | 8ff7314b219d2eab85f7777e470091a76cf25107 (diff) | |
download | subsurface-c5f66c5538d149aaab92316096070fcb01cf8f1b.tar.gz |
Dive media: transport dive-id in drag'n'drop events
9efb56e2d43161d952efb444d1f13d87bfdd45b5 introduced rather complex
logic for picture drag'n'drop events onto the profile. Among other
things, the code had to check whether the picture actually belongs
to the displayed dive.
This can be simplified by transporting the dive-id in the drag'n'drop
event structure. The flow goes like this:
DivePictureModel--(1)-->DivePictureWidget--(2)-->ProfileWidget
For (1), we can use the Qt::UserRole role. This was used to transport
the picture-offset, but this is not needed anymore since ProfileWidget
was decoupled from DivePictureModel.
For (2), we simply replace the "position" value, which was never used.
Why would the receiver care which pixel was pressed in the media-tab?
This commit also contains a minor cleanup in DivePictureWidget:
QListView::mousePressEvent(event) was called in both branches of an
if and can therefore be removed from the if. This is so trivial,
that it doesn't warrant its own commit.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Diffstat (limited to 'cmake')
0 files changed, 0 insertions, 0 deletions