update clang-format

This commit is contained in:
朱子楚\zhuzi
2024-06-28 17:09:23 +08:00
parent 1dc726a61a
commit 8d1ee6fc36
52 changed files with 683 additions and 659 deletions

View File

@ -1,31 +1,26 @@
#include "FluHotkey.h"
#include "QGuiApplication"
FluHotkey::FluHotkey(QObject *parent)
: QObject{parent}
{
FluHotkey::FluHotkey(QObject *parent) : QObject{parent} {
_sequence = "";
_isRegistered = false;
connect(this,&FluHotkey::sequenceChanged,this,[=]{
if(_hotkey){
delete _hotkey;
connect(this, &FluHotkey::sequenceChanged, this, [=] {
if (_hotkey) {
delete _hotkey;
_hotkey = nullptr;
}
_hotkey = new QHotkey(QKeySequence(_sequence), true, qApp);
this->isRegistered(_hotkey->isRegistered());
QObject::connect(_hotkey, &QHotkey::activated, qApp, [=](){
Q_EMIT this->activated();
});
QObject::connect(_hotkey, &QHotkey::registeredChanged, qApp, [=](){
this->isRegistered(_hotkey->isRegistered());
});
QObject::connect(_hotkey, &QHotkey::activated, qApp, [=]() { Q_EMIT this->activated(); });
QObject::connect(_hotkey, &QHotkey::registeredChanged, qApp,
[=]() { this->isRegistered(_hotkey->isRegistered()); });
});
}
FluHotkey::~FluHotkey(){
if(_hotkey){
FluHotkey::~FluHotkey() {
if (_hotkey) {
delete _hotkey;
_hotkey = nullptr;
}