我创建了一个自定义小部件插件。该插件与 Qt Creator 集成得很好,但是当我编译程序时,我收到了这个错误:
“test.h:没有这样的文件或目录”
其中 test.h 是自定义小部件的名称。我究竟做错了什么?这是应用程序的 *.pro 文件:
TEMPLATE = app
SOURCES += main.cpp \
mainwindow.cpp
HEADERS += mainwindow.h
FORMS += mainwindow.ui
这是插件的 *.pro 文件:
CONFIG += designer plugin debug_and_release
TARGET = $$qtLibraryTarget(testplugin)
TEMPLATE = lib
HEADERS = testplugin.h
SOURCES = testplugin.cpp
RESOURCES = icons.qrc
target.path = $$[QT_INSTALL_PLUGINS]/designer
INSTALLS += target
include(test.pri)