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:
Berthold Stoeger 2023-05-20 14:27:20 +02:00
parent 7eecc85464
commit 75886dd4d6
25 changed files with 322 additions and 76 deletions

View file

@ -1,12 +1,15 @@
// SPDX-License-Identifier: GPL-2.0
#include "profile-widget/ruleritem.h"
#include "profile-widget/profilewidget2.h"
#include "core/settings/qPrefTechnicalDetails.h"
#include <qgraphicssceneevent.h>
#include "core/profile.h"
#include <QFont>
#include <QFontMetrics>
#include <QGraphicsScene>
#include <QGraphicsSceneEvent>
#include <QGraphicsView>
RulerNodeItem2::RulerNodeItem2() :
pInfo(NULL),
idx(-1),
@ -77,18 +80,16 @@ RulerItem2::RulerItem2() : pInfo(NULL),
textItemBack->setPen(QColor(Qt::white));
textItemBack->setFlag(QGraphicsItem::ItemIgnoresTransformations);
setPen(QPen(QColor(Qt::black), 0.0));
#ifndef SUBSURFACE_MOBILE
connect(qPrefTechnicalDetails::instance(), &qPrefTechnicalDetails::rulergraphChanged, this, &RulerItem2::settingsChanged);
#endif
}
void RulerItem2::settingsChanged(bool value)
{
ProfileWidget2 *profWidget = NULL;
if (scene() && scene()->views().count())
profWidget = qobject_cast<ProfileWidget2 *>(scene()->views().first());
//ProfileWidget2 *profWidget = NULL;
//if (scene() && scene()->views().count())
//profWidget = qobject_cast<ProfileWidget2 *>(scene()->views().first());
setVisible( (profWidget && profWidget->currentState == ProfileWidget2::PROFILE) ? value : false);
//setVisible( (profWidget && profWidget->currentState == ProfileWidget2::PROFILE) ? value : false);
}
void RulerItem2::recalculate()