chore: 格式化ElaWidgetTools代码

This commit is contained in:
sleepwithoutbz
2025-09-20 01:39:00 +08:00
parent d2fded145d
commit 4ab391f8a1
394 changed files with 10913 additions and 15860 deletions

View File

@@ -2,27 +2,19 @@
#include <QPainter>
#include <QPropertyAnimation>
ElaMaskWidget::ElaMaskWidget(QWidget* parent)
: QWidget{parent}
{
ElaMaskWidget::ElaMaskWidget(QWidget *parent) : QWidget{parent} {
setObjectName("ElaMaskWidget");
setStyleSheet("#ElaMaskWidget{background-color:transparent;}");
_pMaskAlpha = 0;
}
ElaMaskWidget::~ElaMaskWidget()
{
}
ElaMaskWidget::~ElaMaskWidget() {}
void ElaMaskWidget::doMaskAnimation(int endValue)
{
QPropertyAnimation* opacityAnimation = new QPropertyAnimation(this, "pMaskAlpha");
connect(opacityAnimation, &QPropertyAnimation::valueChanged, this, [=](const QVariant& value) {
update();
});
void ElaMaskWidget::doMaskAnimation(int endValue) {
QPropertyAnimation *opacityAnimation = new QPropertyAnimation(this, "pMaskAlpha");
connect(opacityAnimation, &QPropertyAnimation::valueChanged, this, [=](const QVariant &value) { update(); });
connect(opacityAnimation, &QPropertyAnimation::finished, this, [=]() {
if (endValue == 0)
{
if (endValue == 0) {
setVisible(false);
}
});
@@ -33,8 +25,7 @@ void ElaMaskWidget::doMaskAnimation(int endValue)
opacityAnimation->start(QAbstractAnimation::DeleteWhenStopped);
}
void ElaMaskWidget::paintEvent(QPaintEvent* event)
{
void ElaMaskWidget::paintEvent(QPaintEvent *event) {
QPainter painter(this);
painter.save();
painter.setPen(Qt::NoPen);