[英]Qt: 'Q3DScatter' not recognized even though it is included
I want to show a 3DScatter graph in my main window.我想在主窗口中显示 3DScatter 图。
In my mainwindow.h i have included #include <Q3DScatter>
but when entering 3DScatter scatterGraph;
在我的mainwindow.h 中,我包含了
#include <Q3DScatter>
但在输入3DScatter scatterGraph;
in the public: section of the MainWindow class i get this error message:在public: MainWindow 类的部分中,我收到此错误消息:
error: unknown type name 'Q3DScatter'
Here is what I've already checked:这是我已经检查过的:
#include <Q3DScatter>
#include <Q3DScatter>
没有错误Q3DScatter
and q3dscatter.h
Q3DScatter
和q3dscatter.h
q3dscatter.h
exists classes named Q3DScatterPrivate
and Q3DScatter
q3dscatter.h
存在名为Q3DScatterPrivate
和Q3DScatter
类.pro
file the first line is QT += core gui datavisualization
.pro
文件中,第一行是QT += core gui datavisualization
What am I doing wrong?我究竟做错了什么? The module seems to exist but why can't I create the
Q3DScatter scatterGraph
?该模块似乎存在,但为什么我不能创建
Q3DScatter scatterGraph
?
EDIT: This is the entire error message from the Compile Output:编辑:这是来自编译输出的整个错误消息:
In file included from ../MandelbulbUI/main.cpp:1:0:
../MandelbulbUI/mainwindow.h:26:5: error: ‘Q3DScatter’ does not name a type; did you mean ‘QDate’?
Q3DScatter scatterGraph;
^~~~~~~~~~
QDate
In file included from ../MandelbulbUI/mainwindow.cpp:1:0:
../MandelbulbUI/mainwindow.h:26:5: error: ‘Q3DScatter’ does not name a type; did you mean ‘QDate’?
Q3DScatter scatterGraph;
^~~~~~~~~~
QDate
In file included from moc_mainwindow.cpp:9:0:
../MandelbulbUI/mainwindow.h:26:5: error: ‘Q3DScatter’ does not name a type; did you mean ‘QDate’?
Q3DScatter scatterGraph;
^~~~~~~~~~
QDate
Makefile:1598: recipe for target 'main.o' failed
make: *** [main.o] Error 1
make: *** Waiting for unfinished jobs....
Makefile:1817: recipe for target 'moc_mainwindow.o' failed
make: *** [moc_mainwindow.o] Error 1
Makefile:1805: recipe for target 'mainwindow.o' failed
make: *** [mainwindow.o] Error 1
17:30:54: The process "/usr/bin/make" exited with code 2.
Error while building/deploying project MandelbulbUI (kit: Desktop Qt 5.12.7 GCC 64bit)
When executing step "Make"
A quick look at the headers suggests that Q3DScatter
is declared under the namespace QtDataVisualization
.快速查看标题表明
Q3DScatter
是在命名空间QtDataVisualization
下声明的。 That being the case you need to use...在这种情况下,您需要使用...
QtDataVisualization::Q3DScatter scatterGraph;
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.