mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
profile: activate dragging of tooltipitem
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
parent
a527415ac9
commit
4c227aba42
6 changed files with 32 additions and 3 deletions
|
@ -122,7 +122,8 @@ void ProfileView::clear()
|
|||
profileScene->clear();
|
||||
//handles.clear();
|
||||
//gases.clear();
|
||||
tooltip.reset();
|
||||
if (tooltip)
|
||||
tooltip->setVisible(false);
|
||||
empty = true;
|
||||
d = nullptr;
|
||||
dc = 0;
|
||||
|
@ -261,6 +262,11 @@ void ProfileView::wheelEvent(QWheelEvent *event)
|
|||
|
||||
void ProfileView::mousePressEvent(QMouseEvent *event)
|
||||
{
|
||||
// Handle dragging of items
|
||||
ChartView::mousePressEvent(event);
|
||||
if (event->isAccepted())
|
||||
return;
|
||||
|
||||
panning = true;
|
||||
QPointF pos = mapToScene(event->pos());
|
||||
panStart(pos.x(), pos.y());
|
||||
|
@ -268,8 +274,10 @@ void ProfileView::mousePressEvent(QMouseEvent *event)
|
|||
event->accept();
|
||||
}
|
||||
|
||||
void ProfileView::mouseReleaseEvent(QMouseEvent *)
|
||||
void ProfileView::mouseReleaseEvent(QMouseEvent *event)
|
||||
{
|
||||
ChartView::mouseReleaseEvent(event);
|
||||
|
||||
if (panning) {
|
||||
panning = false;
|
||||
unsetCursor();
|
||||
|
@ -282,6 +290,8 @@ void ProfileView::mouseReleaseEvent(QMouseEvent *)
|
|||
|
||||
void ProfileView::mouseMoveEvent(QMouseEvent *event)
|
||||
{
|
||||
ChartView::mouseMoveEvent(event);
|
||||
|
||||
QPointF pos = mapToScene(event->pos());
|
||||
if (panning)
|
||||
pan(pos.x(), pos.y());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue