资源简介
Qt 开发的绘图软件,功能完善,撤销,恢复,复制粘贴,设置画笔颜色,倒入图片,编辑图片等等
代码片段和文件信息
#include “explainwidget.h“
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#pragma execution_character_set(“utf-8“)
ExplainWidget::ExplainWidget(QWidget* parent) :
QWidget(parent)
{
initUI();
initAnimation();
}
void ExplainWidget::initUI()
{
this->setWindowFlags(Qt::framelessWindowHint);
this->setAttribute(Qt::WA_TranslucentBackground);
this->resize(640 400);
this->widget = new QWidget;
this->widget->close();
this->widget->setstyleSheet(“QWidget{border-image: url(./image/background/background (3).jpg); border-radius:20px;}“);
QGraphicsDropShadowEffect* shadow = new QGraphicsDropShadowEffect(widget);
shadow->setOffset(0 0);
shadow->setColor(QColor(“#FFF0F5“));
shadow->setBlurRadius(20);
QGridLayout* grid_layout = new QGridLayout(this);
grid_layout->addWidget(widget);
grid_layout->setMargin(PADDING);
this->widget->setGraphicsEffect(shadow);
this->setLayout(grid_layout);
QLabel* lb = new QLabel(widget);
lb->setstyleSheet(“border-image:transparency; border-radius:20px; font-size:19px; color:#373641; font-weight:500; font-family:幼圆;“);
lb->move(-80 50);
lb->setText
(“\
快捷键 Ctrl + C 复制选中区域\n\
快捷键 Ctrl + V 粘贴选中区域\n\
快捷键 Ctrl + X 剪切选中区域\n\
快捷键 Ctrl + Z 撤销\n\
快捷键 Ctrl + Y 恢复\n\
快捷键 Delete 删除选中区域\n\
鼠标滚轮 快速调节属性值\n\
\n\
说明 : 右键取消所有绘制状态\n\
说明 : 调节属性值时 滚轮需要悬停到属性栏\n\
说明 : 切换画笔形状也可以使用滚轮\n\
说明 : 橡皮擦的大小取决于线宽\n\
“);
}
void ExplainWidget::initAnimation()
{
setProperty(“angleValue“ 0);
rotateAnimation = new QPropertyAnimation(this “angleValue“);
rotateAnimation->setDuration(ANIMATION_TIME);
rotateAnimation->setEasingCurve(QEasingCurve::OutSine);
rotateAnimation->setStartValue(FOLD_NUM * FLIP_ANGLE - FLIP_ANGLE / 2);
rotateAnimation->setEndValue(0);
connect(rotateAnimation &QPropertyAnimation::valueChanged this &ExplainWidget::valueChanged);
connect(rotateAnimation &QPropertyAnimation::finished this &ExplainWidget::showFinished);
}
void ExplainWidget::show()
{
if (is_show)
{
is_show = false;
QWidget::close();
}
else
{
is_show = true;
QWidget::show();
widget->close();
pixmap = widget->grab();
rotateAnimation->setDirection(QAbstractAnimation::Forward);
disconnect(rotateAnimation &QPropertyAnimation::finished this &QWidget::close);
rotateAnimation->start();
}
}
bool ExplainWidget::close()
{
if (is_show)
{
is_show = false;
QWidget::close();
return true;
}
else
{
is_show = false;
QWidget::close();
return false;
}
}
void ExplainWidget::mousePressEvent(QMouseEvent* event)
{
event->accept();
}
void ExplainWidget::paintEvent(QPaintEvent* event)
{
QPainter pai(this);
pai.setRenderHint(QPainter::Antialiasing true);
int ro
- 上一篇:土狼优化算法
- 下一篇:LORA实现收发,SX1278+STM32F103
相关资源
- VisualStudioUninstaller vs卸载工具
- 组态王驱动开发包3.0.0.7(中文)
- 多窗口后台鼠标连点器
- 使用选择性重传协议实现UDP可靠通信
- VC 获得文件属性 获取文件的创建时
- 读者写者问题(读者优先,写者优先
- vtk QT做的三维地质可视化系统2of2
- 用VC 编写的仿QQ聊天室程序源代码
- Qt局域网聊天软件
- 外点法程序
- 外罚函数程序
- Qt Creator opengl实现四元数鼠标控制轨迹
- QT局域网聊天系统(基于QT5.修改过)
- qt-电子点菜系统
- 推箱子及人工智能寻路C 源代码
- 自己写的航空订票系统c 版--数据结构
- 数据结构实验魔王语言
- MUSIC算法c 实现
- C 餐厅叫号系统(QT平)
- 国际象棋c 完整版
-
ob
jectARX给Auto CAD加工具条 - QT 实现文件下载
- qt图像处理
- 画图程序MFC/VC/VC CRectTracker 串行化
- MFC网络编程实例
- c 课程设计 职工信息管理系统
- VC 游戏编程—附源代码
- IpHlpApi.h&IpHlpApi.lib
- 清华大学 c 郑莉 ppt课件
- c 程序判断离散数学中命题公式
评论
共有 条评论