mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
profile: render profile on desktop via QtQuick
This breaks all dynamic features, including animations, zooming tooltips, planner-handles, etc. They will have to be converted one-by-one to QtQuick, which will be a major pain, as the ProfileView is destroyed by Qt6 on reparenting. This means that the view cannot store any persistent state. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
parent
7eecc85464
commit
75886dd4d6
25 changed files with 322 additions and 76 deletions
|
@ -1,6 +1,5 @@
|
|||
// SPDX-License-Identifier: GPL-2.0
|
||||
#include "divehandler.h"
|
||||
#include "profilewidget2.h"
|
||||
#include "profilescene.h"
|
||||
#include "core/dive.h"
|
||||
#include "core/gettextfromc.h"
|
||||
|
@ -22,8 +21,9 @@ DiveHandler::DiveHandler(const struct dive *d, int currentDcNr) : dive(d), dcNr(
|
|||
|
||||
int DiveHandler::parentIndex()
|
||||
{
|
||||
ProfileWidget2 *view = qobject_cast<ProfileWidget2 *>(scene()->views().first());
|
||||
return view->handleIndex(this);
|
||||
//ProfileWidget2 *view = qobject_cast<ProfileWidget2 *>(scene()->views().first());
|
||||
//return view->handleIndex(this);
|
||||
return 0; // FIXME
|
||||
}
|
||||
|
||||
void DiveHandler::contextMenuEvent(QGraphicsSceneContextMenuEvent *event)
|
||||
|
@ -54,19 +54,17 @@ void DiveHandler::contextMenuEvent(QGraphicsSceneContextMenuEvent *event)
|
|||
|
||||
void DiveHandler::selfRemove()
|
||||
{
|
||||
#ifndef SUBSURFACE_MOBILE
|
||||
setSelected(true);
|
||||
ProfileWidget2 *view = qobject_cast<ProfileWidget2 *>(scene()->views().first());
|
||||
view->keyDeleteAction();
|
||||
#endif
|
||||
//ProfileWidget2 *view = qobject_cast<ProfileWidget2 *>(scene()->views().first());
|
||||
//view->keyDeleteAction();
|
||||
}
|
||||
|
||||
void DiveHandler::changeGas()
|
||||
{
|
||||
ProfileWidget2 *view = qobject_cast<ProfileWidget2 *>(scene()->views().first());
|
||||
QAction *action = qobject_cast<QAction *>(sender());
|
||||
//ProfileWidget2 *view = qobject_cast<ProfileWidget2 *>(scene()->views().first());
|
||||
//QAction *action = qobject_cast<QAction *>(sender());
|
||||
|
||||
view->changeGas(parentIndex(), action->data().toInt());
|
||||
//view->changeGas(parentIndex(), action->data().toInt());
|
||||
}
|
||||
|
||||
void DiveHandler::mouseMoveEvent(QGraphicsSceneMouseEvent *event)
|
||||
|
@ -75,9 +73,9 @@ void DiveHandler::mouseMoveEvent(QGraphicsSceneMouseEvent *event)
|
|||
return;
|
||||
t.start();
|
||||
|
||||
ProfileWidget2 *view = qobject_cast<ProfileWidget2*>(scene()->views().first());
|
||||
if(!view->profileScene->pointOnProfile(event->scenePos()))
|
||||
return;
|
||||
//ProfileWidget2 *view = qobject_cast<ProfileWidget2*>(scene()->views().first());
|
||||
//if(!view->profileScene->pointOnProfile(event->scenePos()))
|
||||
//return;
|
||||
|
||||
QGraphicsEllipseItem::mouseMoveEvent(event);
|
||||
emit moved();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue