first re-commit.
This commit is contained in:
63
swadjustabledigit.h
Normal file
63
swadjustabledigit.h
Normal file
@@ -0,0 +1,63 @@
|
||||
/***************************************************************************
|
||||
|
||||
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
|
Reference in New Issue
Block a user