QAction: No such file or directory

怎甘沉沦 提交于 2019-12-22 06:58:34

问题


I'm getting the error

QAction: No such file or directory

when I try to compile a project for plugin (C++ Library template). Weird, because I have a project for my app which also includes this header and there is no error. What might cause this?


回答1:


Make sure that you have the right include paths set up.

If you use QMake the *.pro should contain these settings if you want to include files from QtGui. They should be set by default but some templates may not set them.

CONFIG += qt
QT += gui

If you use another build system then make sure that you either use

#include <QtGui/QAction>

or you add $QTDIR/include/QtGui and not just $QTDIR/include to your include path




回答2:


For me I had some stale moc_ and ui_ files left over from compiling under a different version and configuration of Qt, so removing them solved the problem for me.

rm moc_* ui_* *.o


来源:https://stackoverflow.com/questions/8274514/qaction-no-such-file-or-directory

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!