AntiMicroX
Loading...
Searching...
No Matches
flashbuttonwidget.h
Go to the documentation of this file.
1/* antimicrox Gamepad to KB+M event mapper
2 * Copyright (C) 2015 Travis Nickles <nickles.travis@gmail.com>
3 * Copyright (C) 2020 Jagoda Górska <juliagoda.pl@protonmail>
4 *
5 * This program is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation, either version 3 of the License, or
8 * (at your option) any later version.
9
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14
15 * You should have received a copy of the GNU General Public License
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17 */
18
19#ifndef FLASHBUTTONWIDGET_H
20#define FLASHBUTTONWIDGET_H
21
22#include <QPushButton>
23
24class QWidget;
25class QPaintEvent;
26
27class FlashButtonWidget : public QPushButton
28{
31
32 public:
33 explicit FlashButtonWidget(QWidget *parent = nullptr);
34 explicit FlashButtonWidget(bool displayNames, QWidget *parent = nullptr);
35
36 bool isButtonFlashing();
37 void setDisplayNames(bool display);
38 bool isDisplayingNames();
39
40 protected:
41 virtual void paintEvent(QPaintEvent *event);
42 virtual QString generateLabel() = 0;
43 virtual void retranslateUi();
44 bool ifDisplayNames();
45
46 public slots:
47 void refreshLabel();
48 void toggleNameDisplay();
49 virtual void disableFlashes() = 0;
50 virtual void enableFlashes() = 0;
51
52 protected slots:
53 void flash();
54 void unflash();
55
56 private:
57 bool isflashing;
60};
61
62#endif // FLASHBUTTONWIDGET_H
Definition flashbuttonwidget.h:28
bool isDisplayingNames()
Definition flashbuttonwidget.cpp:78
void refreshLabel()
Definition flashbuttonwidget.cpp:60
virtual QString generateLabel()=0
virtual void paintEvent(QPaintEvent *event)
Definition flashbuttonwidget.cpp:80
bool isflashing
Definition flashbuttonwidget.h:30
void setDisplayNames(bool display)
Definition flashbuttonwidget.cpp:76
bool m_displayNames
Definition flashbuttonwidget.h:58
bool isButtonFlashing()
Definition flashbuttonwidget.cpp:68
void unflash()
Definition flashbuttonwidget.cpp:52
virtual void disableFlashes()=0
virtual void enableFlashes()=0
bool leftAlignText
Definition flashbuttonwidget.h:59
void flash()
Definition flashbuttonwidget.cpp:44
virtual void retranslateUi()
Definition flashbuttonwidget.cpp:126
void toggleNameDisplay()
Definition flashbuttonwidget.cpp:70
bool ifDisplayNames()
Definition flashbuttonwidget.cpp:128
Definition joydpadxml.h:27