Commit graph

9 commits

Author SHA1 Message Date
Tomaz Canabrava
76e1436f68 Better design for the ToolTip Handler.
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-05-08 14:18:27 -07:00
Dirk Hohndel
df01a5d35f Added a bit of documentation on how to use the ToolTips & removed 2 bad-api methods
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-05-07 16:14:15 -07:00
Dirk Hohndel
d590cb9519 Adds real support for ToolTips.
This patch changes the Event drawing so it can display tooltips. It is now
the responsibility of the item to show / hide a tooltip.

A bit of code-refactoring got on here too because I was using only
QGraphicsItem calls and I wanted to use a hover in / hover out event
to show / hide the tooltip.

Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-05-07 16:14:15 -07:00
Tomaz Canabrava
c928b9cb94 Added the first overlay of the tooltips, with some test data.
The tooltips now can:
1 - be moved around the canvas
2 - dynamically expand / retreat when a new tooltip is added.

Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-05-07 16:14:11 -07:00
Tomaz Canabrava
867435442b Plotting the Events done
There are subtle differences, the Cairo version looks
prettier - but that's fixable. I did a small triangle
and a exclamation mark on it. maybe a gradient would
make a good difference there.

this item has a ItemIgnoresTransformation tag, so
scalling, rotating or zooming will not change it's
size.

The tooltips are not yet ported.

Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-05-06 20:30:22 -07:00
Tomaz Canabrava
1b392b35bc Port the plot text method to Qt, also test it by actually plotting something
The plot_text function from the cairo-methods are now ported
on the qt version. this patch moves around some code since
quite defines are already used and I didn't want to reinvent
the whell.

Original code used varargs, but I prefered to change it
, so now it receives just a reference to a QString object
and the string must be constructed before sending,
using the .arg methods.

Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-05-06 13:55:06 -07:00
Tomaz Canabrava
adcae4d913 Added the code to plot the actual Graph.
This version already plots the dive-graph, with the
gradient and all that jazz. One thing that will be
easily spotted is that the size of the line is very
thick - easily changed, I'm just using the default.
As soon as everything is plotted correctly I'll
fix the lines.

Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-05-04 19:55:46 -07:00
Tomaz Canabrava
19048b98e5 Start plotting something.
The first plotting method was removed from profile.c
to profilegraphics.cpp and some conversion ( almost 1 to 1 )
was made so that the code could work.

Since the code is big - this commit has just a part of it
working - it plots the grid. but already works for testing
the resizing of the window and Zooming ( unimplemented )

Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-05-04 19:55:12 -07:00
Tomaz Canabrava
8353d57164 Started the code for the Profile Plotting
This small patch adds a new class - ProfileGraphicsView
it's a QGraphicsView based class that will holds all
graphics-items for the plotting.

The setup is simple, just call ui->ListView->plot( dive )  ( that's
already a ProfileGraphicsView and magic will happen.

Since Im using a QGraphicsView , the size of the canvas doesn't
matter and I'm fixing it at 0,0,100,100. when a resize is done,
the resizeEvent will be called, fitting the scene's rectangle on
the view.

Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-05-04 19:49:52 -07:00