【发布时间】:2014-01-12 02:26:17
【问题描述】:
我已将 qcustomplot.h/.c 文件添加到我的 Qt 项目中。它们位于:“QT_PROJECT_DIR/QCustomPlot/”。
每次我在 Qt Creator 中使用设计器并构建时,都会在 ui_mainwindow.h 中收到此错误:
error: ../../qcustomplot.h: No such file or directory
#include "../../qcustomplot.h"
这当然是真的,因为它位于:“QT_PROJECT_DIR/QCustomPlot/”
如何更改 Qt Designer 自动生成此路径的方式?
如果有帮助,这是我的 .pro:
#-------------------------------------------------
#
# Project created by QtCreator 2014-01-12T00:44:44
#
#-------------------------------------------------
QT += core gui
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets widgets opengl printsupport
TARGET = Test
TEMPLATE = app
SOURCES += main.cpp\
mainwindow.cpp \
QCustomPlot/qcustomplot.cpp
HEADERS += mainwindow.h \
QCustomPlot/qcustomplot.h
FORMS += mainwindow.ui
CONFIG += mobility
MOBILITY =
【问题讨论】:
-
请粘贴更多错误信息。哪个文件试图包含 qcustomplot.h?
-
我是 stackoverflow 的新手,没有足够的“声誉”,我无法向@Shea Belsky 添加评论。我按照他的指示解决了问题。我想他可能在回答中忘记了一步。这是我根据他的一步一步的: 步骤 1:打开包含 qcustomplot 项的 ***.ui 文件。第 2 步:右键单击 qcustomplot 项目并单击“PROMOTED WIDGETS”!步骤 3:双击 QCustomPlot 的路径,然后将其从 ../../customplot 更改为 QCustomPlot/qcustomplot.cpp。就像这样:enter image description here 最后,t
标签: c++ qt qmake qtgui qcustomplot