系统更新后,在编译我的程序时,来自QBrush的突然的内存复制警告

时间:2018-08-04 21:14:43

标签: qt gcc

我不知道为什么会这样。但是,每次我使用已安装的几个Qt版本编译应用程序时,都会收到以下警告:

In file included from /home/Qt5.9.2/5.9.2/gcc_64/include/QtGui/qbrush.h:50,
                 from /home/Qt5.9.2/5.9.2/gcc_64/include/QtGui/qpalette.h:46,
                 from /home/Qt5.9.2/5.9.2/gcc_64/include/QtWidgets/qwidget.h:48,
                 from /home/Qt5.9.2/5.9.2/gcc_64/include/QtWidgets/qdesktopwidget.h:44,
                 from /home/Qt5.9.2/5.9.2/gcc_64/include/QtWidgets/QDesktopWidget:1,
                 from ../src/../../CommonClasses/SQLConn/../../CommonClasses/common.h:6,
                 from ../src/../../CommonClasses/SQLConn/dbinterface.h:10,
                 from ../src/../../EyeExperimenter/src/sslclient/sslclient.h:10,
                 from ../src/../../EyeExperimenter/src/sslclient/ssldbclient.h:4,
                 from ../src/sslwrapper.h:6,
                 from ../src/main.cpp:3:
/home/Qt5.9.2/5.9.2/gcc_64/include/QtGui/qtransform.h: In member function ‘QTransform& QTransform::operator=(QTransform&&)’:
/home/Qt5.9.2/5.9.2/gcc_64/include/QtGui/qtransform.h:81:46: warning: ‘void* memcpy(void*, const void*, size_t)’ writing to an object of type ‘class QTransform’ with no trivial copy-assignment; use copy-assignment or copy-initialization instead [-Wclass-memaccess]
     { memcpy(this, &other, sizeof(QTransform)); return *this; }
                                              ^
/home/Qt5.9.2/5.9.2/gcc_64/include/QtGui/qtransform.h:57:20: note: ‘class QTransform’ declared here
 class Q_GUI_EXPORT QTransform

谁能告诉我这个警告是什么,更重要的是,我该如何消除它?从我看到的结果来看,它与系统当前具有的gcc8有关,但是我尝试在QtCreator的Qt Kits配置中破坏编译器,并且警告仍然出现...

1 个答案:

答案 0 :(得分:0)

您使用qmake作为构建系统生成器,然后使用gnu make实际构建东西-Qt Creator只是在命令行上全部键入内容的捷径:)

您可以通过将以下内容添加到>>> my_array = np.array([[np.nan,1,2],[2,3,4],[4,5,6]]) >>> pd.Series(my_array.ravel()).drop_duplicates().values array([nan, 1., 2., 3., 4., 5., 6.]) 文件中,然后在项目上重新运行qmake(例如,删除构建文件夹并重新构建),将相关标志传递给编译器:

.pro