yhkylin-backup-tools/kybackup/component/pixmaplabel.h

38 lines
775 B
C
Raw Normal View History

2022-03-02 11:24:54 +08:00
#ifndef PIXMAPLABEL_H
#define PIXMAPLABEL_H
#include <QLabel>
#include <QSize>
class PixmapLabel : public QLabel
{
Q_OBJECT
public:
explicit PixmapLabel(QWidget *parent = nullptr);
~PixmapLabel();
// 设置深浅主题分别展示的图片
void setLightAndDarkPixmap(const QString &light, const QString &dark);
// 设置跟随主题图标
void setUkuiIconSchema(const QString &schema, QSize size = QSize(24, 24));
private slots:
void on_styleNameChanged(bool isDark);
void on_themeIconChanged();
private:
// 浅色背景时显示图
QString m_light;
// 深色背景时显示图
QString m_dark;
// 主题图标
QString m_iconTheme;
// 主题图标大小
QSize m_iconSize;
};
#endif // PIXMAPLABEL_H