From 0a70efc7f30d25d07e424cf5cdee22a688ecc7b6 Mon Sep 17 00:00:00 2001 From: "Vogel, Rick" Date: Tue, 25 Jul 2023 14:16:02 +0200 Subject: [PATCH] remove unused files --- playground/levelingsensor/Dashboard.cpp | 125 ------------------------ playground/levelingsensor/MainWindow.h | 16 --- 2 files changed, 141 deletions(-) delete mode 100644 playground/levelingsensor/Dashboard.cpp delete mode 100644 playground/levelingsensor/MainWindow.h diff --git a/playground/levelingsensor/Dashboard.cpp b/playground/levelingsensor/Dashboard.cpp deleted file mode 100644 index 5d960dff..00000000 --- a/playground/levelingsensor/Dashboard.cpp +++ /dev/null @@ -1,125 +0,0 @@ -/****************************************************************************** - * QSkinny - Copyright (C) 2016 Uwe Rathmann - * SPDX-License-Identifier: BSD-3-Clause - *****************************************************************************/ - -#include - -#include - -namespace -{ - class DashboardDial : public Dial - { - public: - DashboardDial( const QString& title, QQuickItem* parent = nullptr ) - : Dial( parent ) - { - setPolishOnResize( true ); - m_label = new QskTextLabel( title, this ); - } - - protected: - void updateLayout() override - { - const auto r = layoutRect(); - - const auto hint = m_label->sizeConstraint(); - - const qreal y = r.y() + 0.6 * r.height() - 0.5 * hint.height(); - const qreal x = r.center().x() - 0.5 * hint.width(); - - m_label->setGeometry( x, y, hint.width(), hint.height() ); - } - - private: - QskTextLabel* m_label; - }; - - class RevCounter : public DashboardDial - { - public: - RevCounter( QQuickItem* parent = nullptr ) - : DashboardDial( "x 1000 min^-1", parent ) - { - setMinimum( 145 ); - setMaximum( 305 ); - setValue( 200 ); - - constexpr int labelsCount = 8; - - QVector< QString > labels; - labels.reserve( labelsCount ); - - for ( int i = 0; i < labelsCount; i++ ) - labels += QString::number( i ); - - setTickLabels( labels ); - } - }; - - class SpeedoMeter : public DashboardDial - { - public: - SpeedoMeter( QQuickItem* parent = nullptr ) - : DashboardDial( "km/h", parent ) - { - setMinimum( -215 ); - setMaximum( 35 ); - setValue( -90 ); - - constexpr int labelsCount = 17; - - QVector< QString > labels; - labels.reserve( labelsCount ); - - for ( int i = 0; i < labelsCount; i++ ) - labels.append( QString::number( i * 10 ) ); - - setTickLabels( labels ); - } - - void updateValue() - { - setValue( value() + std::rand() % 3 - 0.95 ); - } - }; - - class FuelGauge : public DashboardDial - { - public: - FuelGauge( QQuickItem* parent = nullptr ) - : DashboardDial( "fuel", parent ) - { - setMinimum( 195 ); - setMaximum( 345 ); - setValue( 330 ); - - setTickLabels( { "0", "", "1/2", "", "1/1" } ); - } - - void updateValue() - { - setValue( 0.99997 * value() ); - } - }; -} - -Dashboard::Dashboard( QQuickItem* parent ) - : QskLinearBox( Qt::Horizontal, parent ) -{ - (void ) new RevCounter( this ); - auto speedometer = new SpeedoMeter( this ); - auto fuelGauge = new FuelGauge( this ); - - setMargins( 10 ); - setSpacing( 10 ); - - auto timer = new QTimer( this ); - - connect( timer, &QTimer::timeout, speedometer, &SpeedoMeter::updateValue ); - connect( timer, &QTimer::timeout, fuelGauge, &FuelGauge::updateValue ); - - timer->setInterval( 16 ); - timer->start(); -} diff --git a/playground/levelingsensor/MainWindow.h b/playground/levelingsensor/MainWindow.h deleted file mode 100644 index f45b6733..00000000 --- a/playground/levelingsensor/MainWindow.h +++ /dev/null @@ -1,16 +0,0 @@ -/****************************************************************************** - * QSkinny - Copyright (C) 2016 Uwe Rathmann - * SPDX-License-Identifier: BSD-3-Clause - *****************************************************************************/ - -#pragma once - -#include - -class QQuickItem; - -class MainWindow : public QskWindow -{ - public: - MainWindow(); -};