Thoughts on Bug 717

Tomaz Canabrava tcanabrava at kde.org
Fri Nov 21 08:19:11 PST 2014


On Fri, Nov 21, 2014 at 2:09 PM, John Van Ostrand <john at vanostrand.com>
wrote:

> On Fri, Nov 21, 2014 at 10:57 AM, Tomaz Canabrava <tcanabrava at kde.org>
> wrote:
>
>> This actually seems Nice for every kind of graph besides the main one.
>> Did you managed to do it in a good way? ( we have three graphics items
>> associated with a graph, all of them should move.)
>> Em 21/11/2014 13:51, "John Van Ostrand" <john at vanostrand.com> escreveu:
>>
>> On Fri, Nov 21, 2014 at 10:48 AM, Tomaz Canabrava <tcanabrava at kde.org>
>>> wrote:
>>>
>>>> What do you mean by move the graph out of the way?
>>>> Em 21/11/2014 13:47, "John Van Ostrand" <john at vanostrand.com> escreveu:
>>>>
>>>>> To address the position of the temperature graph on the dive profile
>>>>> window how about allowing the user to move the graph out of the way?
>>>>>
>>>>> --
>>>>> John Van Ostrand
>>>>> At large on sabbatical
>>>>>
>>>>>
>>>>> _______________________________________________
>>>>> subsurface mailing list
>>>>> subsurface at subsurface-divelog.org
>>>>> http://lists.subsurface-divelog.org/cgi-bin/mailman/listinfo/subsurface
>>>>>
>>>>>
>>>
>>> Allowing the user to click on the temperature graph and drag the graph
>>> up or down so they can see detail on the dive profile.
>>>
>>> --
>>> John Van Ostrand
>>> At large on sabbatical
>>>
>>>
> I'm not completely happy about how it was done but it was a minimally
> invasive method. I'd be open to ideas on how to do it better.
>
> The work is done inside the temperatureItem where the pos() is 0,0
> (relative to temeratiureAxis I thnk). That's what's being adjusted so it
> may end up negative. It would seem more obvious to adjust it relative to
> the scene but that was more invasive. If we wanted the ability to move most
> of the other items maybe there is a way to do it in the scene object where
> access to that coordinate system is easier. I'm still trying to figure out
> how to work with objects and Qt and how ProfileWidget2 works.
>
> The patch also does nothing to store where the item is graphed so that it
> would remain positioned after a restart. And there needs to be some way of
> making sure it isn't positioned off-scene which is harder to do when not
> referencing the scene.
>

I'm the one that created 99% of that code, so I'm the best one to answer
that. :)
The positions are done in a very dumb way right now, we can save / restore
the positions using the Settings but for now, this just doesn't work.

How the Graphics works:

Each Graphics has a few necessary components:

Horizontal Axis
Vertical Axis
Data Model ( like a spreadsheet table - almost all data from subsurface
comes from the same model )
Column on the Model for the Horizontal Axis data
Column on the Model for the Vertical Axis data

then the H/V axis maps the positions for the Data Model and plots it on
screen on the paint() method.

The Horizontal Axis of almost all items is the time line, and is visible
The Vertical Axis for most of the items are invisible, but they are there -
I need it to specify the size of the graph.

So, a good way to make things work:

on mouseHoverEvent() of the graphics: Make the item 'selected', paint with
a stronger pen or something.
on mouseHoverOut() of the graphics: Make the Axis Invisible, revert to
defaults
on mouseClick() of the graphics: Make it pseudo-movable
on mouseMove() of the graphics: move the Vertical Axis and the Graphics
on mouseRelease() of the graphics: make it un-movable again.

All those methods can be added to any graphic.



> --
> John Van Ostrand
> At large on sabbatical
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.subsurface-divelog.org/pipermail/subsurface/attachments/20141121/f8b0497f/attachment-0001.html>


More information about the subsurface mailing list