资源简介
drawcli.zip

代码片段和文件信息
#include “drawobj.h“
#include
#include
#include
#include
#include
#include
static QPainterPath qt_graphicsItem_shapeFromPath(const QPainterPath &path const QPen &pen)
{
// We unfortunately need this hack as QPainterPathStroker will set a width of 1.0
// if we pass a value of 0.0 to QPainterPathStroker::setWidth()
const qreal penWidthZero = qreal(0.00000001);
if (path == QPainterPath() || pen == Qt::NoPen)
return path;
QPainterPathStroker ps;
ps.setCapstyle(pen.capstyle());
if (pen.widthF() <= 0.0)
ps.setWidth(penWidthZero);
else
ps.setWidth(pen.widthF());
ps.setJoinstyle(pen.joinstyle());
ps.setMiterLimit(pen.miterLimit());
QPainterPath p = ps.createStroke(path);
p.addPath(path);
return p;
}
GraphicsItem::GraphicsItem(QGraphicsItem *parent)
:QAbstractGraphicsShapeItem(parent)
{
// QGraphicsDropShadowEffect *effect = new QGraphicsDropShadowEffect;
// effect->setBlurRadius(8);
// setGraphicsEffect(effect);
}
void GraphicsItem::updateGeometry()
{
const QRectF &geom = this->boundingRect();
const int w = SELECTION_HANDLE_SIZE;
const int h = SELECTION_HANDLE_SIZE;
const Handles::iterator hend = m_handles.end();
for (Handles::iterator it = m_handles.begin(); it != hend; ++it) {
SizeHandleRect *hndl = *it;;
switch (hndl->dir()) {
case SizeHandleRect::LeftTop:
hndl->move(geom.x() - w / 2 geom.y() - h / 2);
break;
case SizeHandleRect::Top:
hndl->move(geom.x() + geom.width() / 2 - w / 2 geom.y() - h / 2);
break;
case SizeHandleRect::RightTop:
hndl->move(geom.x() + geom.width() - w / 2 geom.y() - h / 2);
break;
case SizeHandleRect::Right:
hndl->move(geom.x() + geom.width() - w / 2 geom.y() + geom.height() / 2 - h / 2);
break;
case SizeHandleRect::RightBottom:
hndl->move(geom.x() + geom.width() - w / 2 geom.y() + geom.height() - h / 2);
break;
case SizeHandleRect::Bottom:
hndl->move(geom.x() + geom.width() / 2 - w / 2 geom.y() + geom.height() - h / 2);
break;
case SizeHandleRect::LeftBottom:
hndl->move(geom.x() - w / 2 geom.y() + geom.height() - h / 2);
break;
case SizeHandleRect::Left:
hndl->move(geom.x() - w / 2 geom.y() + geom.height() / 2 - h / 2);
break;
case SizeHandleRect::Center:
hndl->move(geom.center().x() - w / 2 geom.center().y() - h / 2);
break;
default:
break;
}
}
}
void GraphicsItem::setState(SelectionHandleState st)
{
const Handles::iterator hend = m_handles.end();
for (Handles::iterator it = m_handles.begin(); it != hend; ++it)
(*it)->setState(st);
}
SizeHandleRect::Direction Graphic
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2015-06-07 19:45 drawcli\
文件 8196 2015-06-07 09:20 drawcli\.DS_Store
目录 0 2015-06-07 20:19 __MACOSX\
目录 0 2015-06-07 20:19 __MACOSX\drawcli\
文件 212 2015-06-07 09:20 __MACOSX\drawcli\._.DS_Store
文件 539 2015-06-07 09:10 drawcli\drawcli.pro
文件 18746 2015-06-07 19:45 drawcli\drawcli.pro.user
文件 18794 2015-06-04 18:00 drawcli\drawcli.pro.user.466b8dd
文件 212 2015-06-04 18:00 __MACOSX\drawcli\._drawcli.pro.user.466b8dd
文件 18556 2015-06-01 08:56 drawcli\drawcli.pro.user.d90e171
文件 212 2015-06-01 08:56 __MACOSX\drawcli\._drawcli.pro.user.d90e171
文件 12084 2015-06-07 19:43 drawcli\drawobj.cpp
文件 2541 2015-06-07 16:17 drawcli\drawobj.h
文件 1260 2015-06-02 13:45 drawcli\drawscene.cpp
文件 212 2015-06-02 13:45 __MACOSX\drawcli\._drawscene.cpp
文件 714 2015-06-02 09:41 drawcli\drawscene.h
文件 212 2015-06-02 09:41 __MACOSX\drawcli\._drawscene.h
文件 12250 2015-06-07 19:36 drawcli\drawtool.cpp
文件 2342 2015-06-06 23:06 drawcli\drawtool.h
目录 0 2015-06-07 09:14 drawcli\image\
文件 8196 2015-06-07 09:20 drawcli\image\.DS_Store
目录 0 2015-06-07 20:19 __MACOSX\drawcli\image\
文件 212 2015-06-07 09:20 __MACOSX\drawcli\image\._.DS_Store
文件 2774 2015-06-03 10:10 drawcli\image\background1.png
文件 212 2015-06-03 10:10 __MACOSX\drawcli\image\._background1.png
文件 114 2013-08-26 04:04 drawcli\image\background2.png
文件 212 2013-08-26 04:04 __MACOSX\drawcli\image\._background2.png
文件 2064 2015-06-06 14:21 drawcli\image\background3.png
文件 177 2015-06-06 14:21 __MACOSX\drawcli\image\._background3.png
文件 96 2013-08-26 04:04 drawcli\image\background4.png
文件 212 2013-08-26 04:04 __MACOSX\drawcli\image\._background4.png
............此处省略42个文件信息
相关资源
- PID_AutoTune_v0.rar
- vspd7.2.308.zip
- 价值2k的H漫画小说系统
- Pythonamp;课堂amp;笔记(高淇amp;400;集第
- ddos压力测试工具99657
- UML建模大全
- 开源1A锂电池充电板TP4056原理图+PCB
- m1卡 ic卡可选择扇区初始化加密软件
- TSCC.exe
- FTP课程设计(服务端+客户端)
- 计算机图形学 边填充算法实现代码
- 电力系统潮流计算程序集合
- oracle数据迁移项目实施方案
- Web Api 通过文件流 文件到本地
- Visio图标-最新最全的网络通信图标库
- Spire API文档
- OpenGL参考手册
- Python中Numpy库最新教程
- SPD博士V5.3.exe
- 直流无刷电机方波驱动 stm32 例程代码
- layui后台管理模板
- 仿知乎界面小程序源代码
- 云平台-阿里云详细介绍
- photoshop经典1000例
- scratch垃圾分类源码(最终版本).sb
- IAR ARM 7.8破解
- TI CCS V5.4 安装步骤及破解文件
- 松下plc FP-XH的驱动
- 局域网硬件信息收集工具
- 加快Windows XP操作系统开机速度
评论
共有 条评论