as we load dives and dives, new DiveEvents will be created
but the transparent pixmap never deleted, also this makes
the transparent pixmap only for the correct event, not for
all of them.
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Some dive computers appear to have heading data in every sample. In order
to avoid a completely cluttered dive profile we no longer show a flag for
every heading event but instead show a basically transparent pixmap (which
is invisible to the user) that allows us to report the heading information
in the tooltip but leaves the profile uncluttered.
Fixes#586
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Turns out we unconditionally set all events as visible when redrawing the
dive - even with a comment that this should take into account if the event
is visible. Oops.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
I know everyone will hate it.
Go ahead. Complain. Call me names.
At least now things are consistent and reproducible.
If you want changes, have your complaint come with a patch to
scripts/whitespace.pl so that we can automate it.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This appears to correctly add the tooltip to the event item, but for some
reason the tooltip isn't displayed for most events.
Still needs more work.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
The events were static on the canvas even if the profile changed its size
because of a toggle of the partial pressure gas. This patch makes events
move on the canvas to their correct place.
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
* ensure include guard to every header
* comment endif guard block
Signed-off-by: Boris Barbulovski <bbarbulovski@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
They should have a newline at the end.
Forward declarations of classes should be 'class'.
Function / method definitions don't end on a ';'
Remove obsolete QStateMachine forward reference.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
The DiveProfileItem contained much of the complexity and
algorithms for almost all line-based items on the canvas,
so I transformed that to a general abstraction and implemented
a new DiveProfileItem that uses it. this should reduce a
bit of code since the implementation of the PP Graphs, Temperature
Cylinder Pressure and maybe a few others will only need to
reimplement the paint() and the modelDataChanged() methods.
The rest is ready.
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Simply pass a event to the item and it will know what
to do. The sad part is that this isn't true yet - there's
quite a bit of boilerplate that a lot of the items are needing,
but the good part is that the boolerplate is the same in
all of the items, which means that I can create a tiny bit
of abstraction to encapsulate it and the code will be
way smaller to setup the items on the canvas.
Right now the items are being correctly placed on the
right places. It doesn't supports hidding / showing yet.
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>