libraries

  • jwwlib
  • libdxfrw:一个免费的C++库,用于读写文本格式或二进制格式的DXF文件(C++ library to read and write DXF/DWG files)
  • muparser:一个跨平台的公式解析库,它可以自定义多参数函数,自定义常量、变量及一元前缀、后缀操作符,二元操作符等,它将公式编译成字节码,所以计算起来非常快

librecad

  • src:源文件

    • action:动作类
    • cmd:命令行
    • lib:各种库
      • actions:处理各种响应事件
      • creation
      • debug
      • engine
      • fileio
      • filter
      • generators
      • gui:界面显示
      • information
      • math
      • modification
      • printing
      • scripting
    • main:启动程序和窗口
    • plugins:插件
    • test
    • ui:界面控制

qc_applicationwindow

 1 /**
2 * Redraws all mdi windows.
3 */
4 void QC_ApplicationWindow::redrawAll()
5 {
6 if (mdiAreaCAD)
7 {
8 foreach (const QC_MDIWindow* win, window_list)
9 {
10 if (win)
11 {
12 QG_GraphicView* gv = win->getGraphicView();
13 if (gv) {gv->redraw();}
14 }
15 }
16 }
17 }

\librecad\src\ui

qg_graphicView

updateGridStatusWidget()

1 /**
2 * Sets the text for the grid status widget in the left bottom corner.
3 */
4 void QG_GraphicView::updateGridStatusWidget(const QString& text)
5 {
6 emit gridStatusChanged(text);
7 }

wheelEvent()

1 /**
2 * mouse wheel event. zooms in/out or scrolls when
3 * shift or ctrl is pressed.
4 */
5 void QG_GraphicView::wheelEvent(QWheelEvent *e) {...}

\librecad\src\lib\gui

rs_graphicview

centerOffsetX()

 1 /**
2 * Centers the drawing in x-direction.
3 */
4 void RS_GraphicView::centerOffsetX() {
5 if (container && !zoomFrozen) {
6 offsetX = (int)(((getWidth()-borderLeft-borderRight)
7 - (container->getSize().x*factor.x))/2.0
8 - (container->getMin().x*factor.x)) + borderLeft;
9 }
10 }

zoomScroll()

 1 /**
2 * Scrolls in the given direction.
3 */
4 void RS_GraphicView::zoomScroll(RS2::Direction direction) {
5 switch (direction) {
6 case RS2::Up:
7 offsetY-=50;
8 break;
9 case RS2::Down:
10 offsetY+=50;
11 break;
12 case RS2::Right:
13 offsetX+=50;
14 break;
15 case RS2::Left:
16 offsetX-=50;
17 break;
18 }
19 adjustOffsetControls();
20 adjustZoomControls();
21 // updateGrid();
22
23 redraw();
24 }

\librecad\src\actions

rs_actiondrawline()

<QCursor>

The QCursor class provides a mouse cursor with an arbitrary shape

<QDockWidget>

The QDockWidget class provides a widget that can be docked inside a QMainWindow or floated as a top-level window on the desktop

参考:

https://blog.csdn.net/Caoyang_He/article/details/80343945

[Qt] Librecad 源码分析的更多相关文章

  1. Qt源码分析之QObject

    原文:http://blog.csdn.net/oowgsoo/article/details/1529284 我感觉oowgsoo兄弟写的分析相当透彻,赞! 1.试验代码: #include < ...

  2. QT源码分析(从QApplication开始)

    QT源码分析 转载自:http://no001.blog.51cto.com/1142339/282130 今天,在给同学讲东西的时候,谈到了Qt源代码的问题,才发现自己对Qt机制的了解是在太少了,而 ...

  3. qt creator源码全方面分析(0)

    本人主攻C++和Qt. 上两天刚研究完Qt install framework(IFW)应用程序安装框架. google没发现有正儿八经的官方文档的翻译,我就进行了翻译哈!! 系列文章具体见:http ...

  4. qt creator源码全方面分析(3-3)

    目录 qtcreatordata.pri 定义stripStaticBase替换函数 设置自定义编译和安装 QMAKE_EXTRA_COMPILERS Adding Compilers 示例1 示例2 ...

  5. qt creator源码全方面分析(3-5)

    目录 qtcreatorlibrary.pri 使用实例 上半部 下半部 结果 qtcreatorlibrary.pri 上一章节,我们介绍了src.pro,这里乘此机会,把src目录下的所有项目文件 ...

  6. Qt update刷新之源码分析(一)

    在做GUI开发时,要让控件刷新,会调用update函数:那么在调用了update函数后,Qt究竟基于什么原理.执行了什么代码使得屏幕上有变化?本文就带大家来探究探究其内部源码. Qt手册中关于QWid ...

  7. Qt Creator 源码学习笔记04,多插件实现原理分析

    阅读本文大概需要 8 分钟 插件听上去很高大上,实际上就是一个个动态库,动态库在不同平台下后缀名不一样,比如在 Windows下以.dll结尾,Linux 下以.so结尾 开发插件其实就是开发一个动态 ...

  8. qt creator源码全方面分析(4-0)

    Qt系统 Qt Creator源码是在Qt对象和框架基础下写的,因此,阅读Qt Creator源码,你首先对Qt得有一定的了解. Qt Core Qt Core特征: The Meta-Object ...

  9. qt creator源码全方面分析(4-2)

    目录 global头文件 global.h xx.h global头文件 插件的本质就是动态链接库,对于库,需要导出符号,供用户导入使用.在qt creator的源码中,存在固定的导入导出模式. gl ...

随机推荐

  1. maven setting.xml 阿里云镜像 没有一句废话

    <?xml version="1.0" encoding="UTF-8"?> <!-- Licensed to the Apache Soft ...

  2. (四)Struts2的Action(深入讲解版)

    Struts2的Action 开发者需要提供大量的Action,并在struts.xml中配置Action.Action类里包含了对用户请求的处理逻辑,因为我们也称Action为业务控制器. 一.编写 ...

  3. 动态的创建Class对象方法及调用方式性能分析

    有了Class对象,能做什么? 创建类的对象:调用Class对象的newInstance()方法 类必须有一个无参数的构造器. 类的构造器的访问权限需要足够. 思考?没有无参的构造器就不能创建对象吗? ...

  4. Leedcode算法专题训练(搜索)

    BFS 广度优先搜索一层一层地进行遍历,每层遍历都是以上一层遍历的结果作为起点,遍历一个距离能访问到的所有节点.需要注意的是,遍历过的节点不能再次被遍历. 第一层: 0 -> {6,2,1,5} ...

  5. 配置Jupyter环境:安装+补全+美化+常用库

    1 Jupyter简介 Jupyter Notebook是一个交互式笔记本,支持运行40多种编程语言,本质是一个Web应用程序,便于创建和共享文学化程序文档,支持实时代码,数学方程,可视化和Markd ...

  6. redhat7.6 更换 centos7 YUM

    使用yum 遇到如下错误. This system is not registered to Red Hat Subscription Management. You can use subscrip ...

  7. Kubernetes 查看node

    // 查看所有节点及labelskubectl get nodes --show-labels 删除节点的labels # 语法 kubectl label nodes <node-name&g ...

  8. NumPy之:数据类型

    目录 简介 数组中的数据类型 类型转换 查看类型 数据溢出 简介 我们知道Python中有4种数字类型,分别是int,float,bool和complex.作为科学计算的NumPy,其数据类型更加的丰 ...

  9. istio1.2.2 安装及使用示例

    前言 本文介绍istio的安装及使用 dashboard,grafana,prometheus,kiali,jaeger的配置示例.演示通过istio的ingressgateway统一访问入口 Ist ...

  10. 鸿蒙HI3516-驱动开发(1.1-LTS)

    代码在:https://gitee.com/kwydm/open-harmony-taurus 目录大致结构 1.驱动开发创建目录://vendor/huawei/hdf/LED/src 新建Make ...