Files
raDIYo/swadjustabledigit.h
2025-08-05 22:36:00 +02:00

64 lines
1.4 KiB
C++

/***************************************************************************
source::worx raDIYo
Copyright © 2020-2022 c.holzheuer
chris@sourceworx.org
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
***************************************************************************/
#ifndef SWADJUSTABLEDIGIT_H
#define SWADJUSTABLEDIGIT_H
#include <QTimer>
#include <swflipdigit.h>
#include <swdialwidget.h>
/**
* @brief Erweiterte 'SWFlipDigit', die sich auch mit der Maus einstellen
* lässt.
*/
class SWAdjustableDigit : public SWFlipDigit
{
Q_OBJECT
public:
explicit SWAdjustableDigit( QWidget* parent = nullptr );
virtual ~SWAdjustableDigit() = default;
void setValue( int n ) override;
signals:
void valueOverflow( int value );
void valueChanged( int newValue );
// fulfill interface of SWDialAdapter
void clicked();
protected:
void mousePressEvent( QMouseEvent* event ) override;
void mouseMoveEvent( QMouseEvent* event ) override;
void mouseReleaseEvent( QMouseEvent* event ) override;
void timerEvent( QTimerEvent* event ) override;
bool _waiting = false;
int _delta = 0;
int _timerID = -1;
int _posY = -1;
};
#endif // SWADJUSTABLEDIGIT_H