raDIYo 0.4
swbuttongroup.h
1/***************************************************************************
2
3 source::worx raDIYo
4 Copyright © 2020-2022 c.holzheuer
5 c.holzheuer@sourceworx.org
6
7 This program is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 2 of the License, or
10 (at your option) any later version.
11
12***************************************************************************/
13
14
15#ifndef SWBUTTONGROUP_H
16#define SWBUTTONGROUP_H
17
18
19#include <QWidget>
20#include <QPushButton>
21#include <QButtonGroup>
22#include <QMap>
23
24class SWButtonGroup : public QButtonGroup // public SWABstractDialBuddy
25{
26
27 Q_OBJECT
28
29public:
30
31 explicit SWButtonGroup( QWidget* parent = nullptr );
32 virtual ~SWButtonGroup();
33
34 void addKeyButton( QPushButton* button, int ID, const QString& key );
35 void shiftHover( bool forward );
36
37public slots:
38
39 void onDialClicked();
40 void onDialValueChanged( int value );
41
42 void onButtonClicked( QAbstractButton* button );
43 //void addToggleButton( SWToggleButton *button, int id, const QString& name );
44
45signals:
46
48 void idSelected( int newID );
49
50protected:
51
52 void unHover( int buttonID );
53
54 //int _value = -1;
55 int _curID = -1;
56
57 //QString _lstStyleSheet;
58 QMap<int,QString> _buttonKeys;
59
60};
61
62#endif // SWBUTTONGROUP_H
void onDialValueChanged(int value)
von aussen
void idSelected(int newID)
Das ist identisch zu idClicked, das gibts aber im 'alten' Qt5 auf dem RasPI nicht.
void onDialClicked()
von aussen
void unHover(int buttonID)
Button 'ent-hovern', also das Hover-Icon entfernen.
void shiftHover(bool forward)
Schiebt den 'Hover'-Anzeigestatus zum nächsten Button innerhalb der Buttongroup.