chore: 格式化ElaWidgetTools代码
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user