Files
0417_QT_code/APP/APP_KeyButton.h

34 lines
794 B
C
Raw Normal View History

2026-03-26 10:45:29 +08:00
#pragma once
#include "APP/APP_KeypadModel.h"
#include <QtGui/QColor>
#include <QtWidgets/QPushButton>
namespace APP {
class APP_KeyButton : public QPushButton
{
public:
explicit APP_KeyButton(const APP_KeyInfo& KeyInfo, QWidget* parent = nullptr);
void App_Func_SetLatched(bool IsLatched);
void App_Func_SetPressed(bool IsPressed);
2026-04-17 16:25:19 +08:00
void App_Func_SetHintText(const QString& HintText);
2026-03-26 10:45:29 +08:00
protected:
void paintEvent(QPaintEvent* event) override;
private:
QColor App_Func_GetAccentColor() const;
QColor App_Func_GetBackgroundColor() const;
QColor App_Func_GetBorderColor() const;
QColor App_Func_GetTextColor() const;
APP_KeyInfo appKeyInfo;
2026-04-17 16:25:19 +08:00
QString appHintText;
2026-03-26 10:45:29 +08:00
bool appIsLatched = false;
bool appIsPressed = false;
};
} // namespace APP