qt_demoe/widget/maskwidget/maskwidget.h

52 lines
1.3 KiB
C
Raw Normal View History

2019-10-20 02:04:02 +00:00
#ifndef MASKWIDGET_H
#define MASKWIDGET_H
/**
* :feiyangqingyun(QQ:517216493) 2016-12-26
2021-09-13 08:12:35 +00:00
* 1.
* 2.
* 3.
* 4.
* 5.
2019-10-20 02:04:02 +00:00
*/
#include <QWidget>
#ifdef quc
2020-12-24 10:00:09 +00:00
class Q_DECL_EXPORT MaskWidget : public QWidget
2019-10-20 02:04:02 +00:00
#else
class MaskWidget : public QWidget
#endif
{
Q_OBJECT
public:
static MaskWidget *Instance();
explicit MaskWidget(QWidget *parent = 0);
protected:
void showEvent(QShowEvent *);
bool eventFilter(QObject *obj, QEvent *event);
private:
static QScopedPointer<MaskWidget> self;
2021-11-14 05:06:47 +00:00
//需要遮罩的主窗体
QWidget *mainWidget;
//需要弹窗的窗体对象名称集合链表
QStringList dialogNames;
2019-10-20 02:04:02 +00:00
public Q_SLOTS:
2021-11-14 05:06:47 +00:00
//设置需要遮罩的主窗体
2019-10-20 02:04:02 +00:00
void setMainWidget(QWidget *mainWidget);
2021-11-14 05:06:47 +00:00
//设置需要弹窗的窗体对象名称集合链表
2019-10-20 02:04:02 +00:00
void setDialogNames(const QStringList &dialogNames);
2021-11-14 05:06:47 +00:00
//设置遮罩颜色
2019-10-20 02:04:02 +00:00
void setBgColor(const QColor &bgColor);
2021-11-14 05:06:47 +00:00
//设置颜色透明度
2019-10-20 02:04:02 +00:00
void setOpacity(double opacity);
};
#endif // MASKWIDGET_H