C2039:“clear“不是“QPainterPath“的成员

这几天编译一套源码,报错:

C2039:“clear“不是“QPainterPath“的成员

于是查看Qt源码

https://github.com/qt/qtbase/blob/v5.13.2/src/gui/painting/qpainterpath.cpp

 https://github.com/qt/qtbase/blob/v5.13.2/src/gui/painting/qpainterpath_p.h

发现clear函数是Qt5.13版本开始新增的。

那Qt 5.12.x版本想编译高版本写的源码,怎么办?

QPainterPath ItemPath;

把ItemPath.clear();

替换为

ItemPath = QPainterPath();

猜你喜欢

转载自blog.csdn.net/libaineu2004/article/details/125314008