Skip to content

Commit

Permalink
fix about cursor style
Browse files Browse the repository at this point in the history
  • Loading branch information
xland committed Dec 31, 2024
1 parent c2eced3 commit 49d1052
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 1 deletion.
13 changes: 13 additions & 0 deletions App/About.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
#include <QGuiApplication>
#include "About.h"


About::About(QWidget* parent):QWidget(parent)
{
setMouseTracking(true);
setAttribute(Qt::WA_Hover);
setAttribute(Qt::WA_QuitOnClose, false);
QTextEdit* textEdit = new QTextEdit(this);
QString htmlText = R"(<html><head><style>
Expand All @@ -21,3 +25,12 @@ p { line-height: 1.5; }
setFixedSize(500, 160);
show();
}

void About::enterEvent(QEnterEvent* event)
{
QGuiApplication::setOverrideCursor(Qt::ArrowCursor);
}

void About::leaveEvent(QEvent* event)
{
}
3 changes: 3 additions & 0 deletions App/About.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,7 @@ class About : public QWidget {
Q_OBJECT
public:
About(QWidget* parent = nullptr);
protected:
void enterEvent(QEnterEvent* event) override;
void leaveEvent(QEvent* event) override;
};
1 change: 0 additions & 1 deletion App/App.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,6 @@ void App::initConfig()
initHotKey(jsonObject);
initFont(jsonObject);
initTool(jsonObject, lang);
qDebug() << "init tray";
initTray(jsonObject, lang);
initPin(jsonObject, lang);
}
Expand Down

0 comments on commit 49d1052

Please sign in to comment.