Coder Social home page Coder Social logo

easycanvas's Introduction

基于Qt QGraphicsView的简单作图软件

  • 开发环境使用VS2015和Qt5.13,64位。
  • 如果您使用VS的其他版本编译需要自行编译PythonQt

软件绿色版(旧版本)下载地址:

链接:https://pan.baidu.com/s/1r2zKmt4ID_7p0V8Fm7e7cQ 提取码:m6n1

视频演示地址:https://www.bilibili.com/video/BV18K411L7Ca/

新版本 V2.0下载地址:

链接:https://pan.baidu.com/s/1vEJ1T2txrGtSjlBNHip-tg 提取码:94ds

注意:

  1. 这里使用的是64位的FFmpeg库,如果编译的时候报错,请编译成64位的版本或者自行替换成32位的FFMpeg库。

  2. 由于DLL库文件太大,会导致Github仓库克隆失败,可以使用如下链接下载DLL库

链接:https://pan.baidu.com/s/1B9hN8fEKvBQN7X-HqBlLZw 提取码:ubuq

  1. 如果Git仓库克隆失败,可以使用如下链接获取源码,后可直接更新代码。

链接:https://pan.baidu.com/s/1qn-L1Vc3cFSUdf8Rx5YLiA 提取码:0rsf

  1. 源码中未提供Python库环境,如果运行失败可以安装Python3.8。或者将绿色版的 Lib 目录拷贝到生成的程序的可执行文件所在目录。(PythonQt::Init()) 程序闪退,可按此步骤解决。

如果使用VS2019+Qt5.15.1 可以直接下载这个版本 链接:https://pan.baidu.com/s/1B22HTJKUe_f3Qmv_P1Bgbg 提取码:uys6

基本数据组织类图如下: 类图

1. 基本功能

  1. 画布设置,可以修改画布的尺寸、颜色信息
  2. 添加图元
  • 画笔绘制
  • 矩形
  • 椭圆/圆
  • 图片
  • 自定义音频元素
  • 文字

所有的元素可以自由改变尺寸、位置、旋转以及自己的其他属性信息。

  1. 方案管理

    • 新建空画布
    • 保存方案
    • 加载方案
    • 保存为文件
  2. Python命令

    更多命令详见: http://www.feijiblog.com/blog/qteasycanvasv2cmd

  3. 节点树同步显示节点信息

  4. 撤销/重做功能

2. 模块介绍

  • AudioVideoCore 音频解码和播放
  • Utils 公共工具
  • CustomWidgets 自定义基础Widget
  • CustomControls 自定义基本控件
  • NDNodeAttribute 节点和属性定义
  • NodeAttributeControl 属性控件
  • thirdLibs 第三方库
  • EasyCanvas Main App

3. 关于我

作者: 不会飞的纸飞机

个人博客主页: http://www.feijiblog.com

CSDN主页: https://blog.csdn.net/douzhq

easycanvas's People

Contributors

douzhongqiang avatar douzhongqiang666 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

easycanvas's Issues

pythonQT-Qt5-python38的库不能定位程序输入点

环境
系统:win10 企业版,LTSC 1809
编译器:msvc2017_64
Qt版本:5.14.2

问题:编译都通过了,并生成了exe,但是调试运行找不到程序输入点在PythonQt_QtAll-Qt5-Python38,setItemData这个函数定位不了。
然后使用编译好的exe,拷贝到打包好的目录,可以直接运行。

什么原因,是字符编码的问题吗?
所做的更改:所有的pro被我加上了 utf-8 识别,否则会编译失败。

建议:希望作者加个自己的环境介绍,以及推荐的环境。虽不可能多种环境测试,但是做一个环境介绍及推荐环境,可以让别人快速编译使用到源码。

希望支持linux

15:32:41: 为项目EasyCanvas执行步骤 ...
15:32:41: 配置没有改变, 跳过 qmake 步骤。
15:32:41: 正在启动 "/usr/bin/make" -j16

cd CustomWidgets/ && ( test -e Makefile || /opt/Qt5.14.2/5.14.2/gcc_64/bin/qmake -o Makefile /home/hokori/Documents/QtProj/EasyCanvas/CustomWidgets/CustomWidgets.pro -spec linux-g++ CONFIG+=debug CONFIG+=qml_debug ) && /usr/bin/make -f Makefile 
make[1]: Entering directory '/home/hokori/Documents/QtProj/EasyCanvas/build/build-EasyCanvas-Qt_5_14_2_gcc_64-Debug/CustomWidgets'
g++ -c -pipe -g -std=gnu++11 -Wall -Wextra -D_REENTRANT -fPIC -DCUSTOMWIDGETS_LIBRARY -DQT_DEPRECATED_WARNINGS -DQT_QML_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -I../../../CustomWidgets -I. -I/opt/Qt5.14.2/5.14.2/gcc_64/include -I/opt/Qt5.14.2/5.14.2/gcc_64/include/QtWidgets -I/opt/Qt5.14.2/5.14.2/gcc_64/include/QtGui -I/opt/Qt5.14.2/5.14.2/gcc_64/include/QtCore -I../../../CustomWidgets/temp -isystem /usr/include/libdrm -I/opt/Qt5.14.2/5.14.2/gcc_64/mkspecs/linux-g++ -o ../../../CustomWidgets/temp/CustomDialog.o ../../../CustomWidgets/UICustomWidgtes/CustomDialog.cpp
../../../CustomWidgets/UICustomWidgtes/CustomDialog.cpp:9:10: fatal error: windowsx.h: No such file or directory
 #include <windowsx.h>
          ^~~~~~~~~~~~
compilation terminated.
Makefile:1594: recipe for target '../../../CustomWidgets/temp/CustomDialog.o' failed
make[1]: Leaving directory '/home/hokori/Documents/QtProj/EasyCanvas/build/build-EasyCanvas-Qt_5_14_2_gcc_64-Debug/CustomWidgets'
Makefile:54: recipe for target 'sub-CustomWidgets-make_first-ordered' failed
make[1]: *** [../../../CustomWidgets/temp/CustomDialog.o] Error 1
make: *** [sub-CustomWidgets-make_first-ordered] Error 2
15:32:41: 进程"/usr/bin/make"退出,退出代码 2 。
Error while building/deploying project EasyCanvas (kit: Qt 5.14.2 (gcc_64))
When executing step "Make"
15:32:41: Elapsed time: 00:00.

m_pCurrentOper 内存泄漏问题解决

EasyCanvasCore/UICanvas/UICanvasView.cpp b/EasyCanvasCore/UICanvas/UICanvasView.h 中 m_pCurrentOper 指针存在内存泄漏

建议如下修改:

diff --git a/EasyCanvasCore/UICanvas/UICanvasView.cpp b/EasyCanvasCore/UICanvas/UICanvasView.cpp
index b936367..9ff3fc6 100644
--- a/EasyCanvasCore/UICanvas/UICanvasView.cpp
+++ b/EasyCanvasCore/UICanvas/UICanvasView.cpp
@@ -87,7 +87,8 @@ void UICanvasView::setSelectedRect(const QRect& rect)
 
 void UICanvasView::setCurrentOperator(UICanvasOperBase* canvasOper)
 {
-    m_pCurrentOper = canvasOper;
+    m_pCurrentOper.reset();
+    m_pCurrentOper = std::make_shared<UICanvasOperBase>(canvasOper);
 }
 
 void UICanvasView::mousePressEvent(QMouseEvent* event)
diff --git a/EasyCanvasCore/UICanvas/UICanvasView.h b/EasyCanvasCore/UICanvas/UICanvasView.h
index da69da5..bd575cb 100644
--- a/EasyCanvasCore/UICanvas/UICanvasView.h
+++ b/EasyCanvasCore/UICanvas/UICanvasView.h
@@ -4,6 +4,7 @@
 #include <QGraphicsView>
 #include <QGraphicsScene>
 #include "easycanvascore_global.h"
+#include <memory>
 
 class UICanvasOperBase;
 class UICanvasPathItem;
@@ -82,7 +83,7 @@ private:
     UICanvasScene* m_pScene = nullptr;
 
     UICanvasPathItem* m_pathItem = nullptr;
-    UICanvasOperBase* m_pCurrentOper = nullptr;
+    std::shared_ptr<UICanvasOperBase> m_pCurrentOper(nullptr);
 
     // 选中矩形相关
     bool m_isSelectedRectVisible = false;

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.