Files
pineapple-pictures/app/opacityhelper.h

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

28 lines
530 B
C
Raw Normal View History

// SPDX-FileCopyrightText: 2022 Gary Wang <wzc782970009@gmail.com>
//
// SPDX-License-Identifier: MIT
2025-07-23 21:20:34 +08:00
2019-10-06 14:58:01 +08:00
#ifndef OPACITYHELPER_H
#define OPACITYHELPER_H
2025-07-23 21:20:34 +08:00
2019-10-06 14:58:01 +08:00
#include <QWidget>
2025-07-23 21:20:34 +08:00
2019-10-06 14:58:01 +08:00
QT_BEGIN_NAMESPACE
class QGraphicsOpacityEffect;
class QPropertyAnimation;
QT_END_NAMESPACE
2025-07-23 21:20:34 +08:00
2019-10-06 14:58:01 +08:00
class OpacityHelper : QObject
{
public:
OpacityHelper(QWidget * parent);
2025-07-23 21:20:34 +08:00
2019-10-06 14:58:01 +08:00
void setOpacity(qreal opacity, bool animated = true);
2025-07-23 21:20:34 +08:00
2019-10-06 14:58:01 +08:00
protected:
QGraphicsOpacityEffect * m_opacityFx;
QPropertyAnimation * m_opacityAnimation;
};
2025-07-23 21:20:34 +08:00
2019-10-06 14:58:01 +08:00
#endif // OPACITYHELPER_H