-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathimagetoolbase.cpp
More file actions
48 lines (42 loc) · 1.25 KB
/
Copy pathimagetoolbase.cpp
File metadata and controls
48 lines (42 loc) · 1.25 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#include "imagetoolbase.h"
#include "processobject.h"
#include <QApplication>
#include <QDebug>
ImageToolBase::ImageToolBase(QWidget *parent)//初始化各组件属性
: QWidget(parent)
, m_qMovePos(QPoint(-1, -1))
, m_pScreen(nullptr)
, m_pFullScreen(nullptr)
, m_pBackgroundScreen(nullptr)
, m_pButtonTool(nullptr)
, m_bLight(true)
, m_bCut(false)
, m_bInit(false)
, m_pParent(parent)
{
this->setWindowFlags(Qt::FramelessWindowHint);
setAutoFillBackground(true);//自动填充背景
QPalette pal = palette();//颜色组
pal.setColor(QPalette::Background,Qt::transparent);//背景颜色透明
setPalette(pal);
setWindowOpacity(1);
setAttribute(Qt::WA_TranslucentBackground);
//添加自定义类控制
setAttribute(Qt::WA_StyledBackground,true);
}
ImageToolBase::~ImageToolBase()
{
}
void ImageToolBase::SetLightState(QString state)//设置灯光范围
{
this->setProperty("State", state);
this->setStyle(QApplication::style());
}
void ImageToolBase::SetMaskLayerColor(QColor color)//设置遮罩层颜色
{
MaskLayerColor = color;
}
QColor ImageToolBase::GetMaskLayerColor() const//获取遮罩层颜色
{
return MaskLayerColor;
}