自检页面调试完成

This commit is contained in:
xu
2026-09-10 14:10:40 +08:00
parent 0baf228c67
commit 32878a9a80
34 changed files with 595 additions and 1568 deletions
+21
View File
@@ -7,6 +7,9 @@
#include <QWidget>
#include <QTimer>
#include <QVariant>
#include <QColor>
class QApplication;
// ===================== 画布与全局常量 =====================
// 屏幕分辨率(1920×1080 横屏);若部署在更低分辨率屏,可按同一比例整体缩放
@@ -118,6 +121,24 @@ void stopBlink(QWidget* w, const char* prop = "blink");
// 退出/取消按钮预设样式:被选中(悬停/按下/焦点)时红底白字
QString cancelButtonStyle(int fontPx = 60);
// ===================== 按钮焦点光圈 =====================
// 全局事件过滤器:任意 QPushButton 获得焦点时,在其四周加一圈发光(QSS 无法实现光晕)
class ButtonFocusGlow : public QObject
{
Q_OBJECT
public:
explicit ButtonFocusGlow(const QColor& glow = QColor("#3D8BFD"), QObject* parent = nullptr);
protected:
bool eventFilter(QObject* obj, QEvent* ev) override;
private:
QColor m_glow;
};
// 为整个应用安装按钮焦点光圈
void installButtonFocusGlow(QApplication* app);
// 全局 QSS 样式表
QString appStyleSheet();