douzhongqiang / easycanvas Goto Github PK
View Code? Open in Web Editor NEW基于Qt QGraphicsView的简易画图软件
基于Qt QGraphicsView的简易画图软件
环境
系统:win10 企业版,LTSC 1809
编译器:msvc2017_64
Qt版本:5.14.2
问题:编译都通过了,并生成了exe,但是调试运行找不到程序输入点在PythonQt_QtAll-Qt5-Python38,setItemData这个函数定位不了。
然后使用编译好的exe,拷贝到打包好的目录,可以直接运行。
什么原因,是字符编码的问题吗?
所做的更改:所有的pro被我加上了 utf-8 识别,否则会编译失败。
建议:希望作者加个自己的环境介绍,以及推荐的环境。虽不可能多种环境测试,但是做一个环境介绍及推荐环境,可以让别人快速编译使用到源码。
为什么找了半天都找不到这个文件呢。。。
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;
.\EasyCanvas-master\CustomWidgets\UICustomWidgtes\CustomDialog.cpp:122: error: undefined reference to `DwmExtendFrameIntoClientArea'
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.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.