qt_demoe/maskwidget/maskwidget.h

50 lines
1.2 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
* 1:,
* 2:,
* 3:
* 4:
* 5:
*/
#include <QWidget>
#ifdef quc
#if (QT_VERSION < QT_VERSION_CHECK(5,7,0))
#include <QtDesigner/QDesignerExportWidget>
#else
#include <QtUiPlugin/QDesignerExportWidget>
#endif
class QDESIGNER_WIDGET_EXPORT MaskWidget : public QWidget
#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;
QWidget *mainWidget; //需要遮罩的主窗体
QStringList dialogNames; //可能弹窗的窗体对象名称集合链表
public Q_SLOTS:
void setMainWidget(QWidget *mainWidget);
void setDialogNames(const QStringList &dialogNames);
void setBgColor(const QColor &bgColor);
void setOpacity(double opacity);
};
#endif // MASKWIDGET_H