Qt Gui Application cannot locate QGeometryData namepsace
-
For some reason, my Qt5.0 is not locating the QGeometryData namespace
it displays the following error:
c:\users\jcastillo\documents\convexhull\mainwindow.h:4: error: C1083: Cannot open include file: 'QGeometryData': No such file or directory
I have attached my main, mainwindow.h and .cpp
@//mainwindow.h
#ifndef MAINWINDOW_H
#define MAINWINDOW_H#include <QGeometryData>
#include <QMainWindow>namespace Ui {
class MainWindow;
}class MainWindow : public QMainWindow
{
Q_OBJECTpublic:
explicit MainWindow(QWidget *parent = 0);
~MainWindow();
void ComputeUpperHull();private:
Ui::MainWindow *ui;
QGeometryData top;
};#endif // MAINWINDOW_H
@
@//mainwindow.cpp
#include "mainwindow.h"
#include "ui_mainwindow.h"
#include <QGeometryData>MainWindow::MainWindow(QWidget *parent) :
QMainWindow(parent),
ui(new Ui::MainWindow)
{
ui->setupUi(this);
}MainWindow::~MainWindow()
{
delete ui;
}void MainWindow::ComputeUpperHull()
{
top.appendVertex(QVector3D(0.0, 0.0, 0.0));
top.appendVertex(QVector3D(6.0, 3.6, 0.0)); // (v1 - v0).length() = 7.0
top.appendVertex(QVector3D(10.0, 0.6, 0.0)); // (v2 - v1).length() = 5.0
top.appendVertex(QVector3D(13.0, 3.24, 0.0)); // (v3 - v2).length() = 4.0// generate x (Qt::Horizontal) texture coordinates over the primitive top.generateTextureCoordinates(); // spread over 7 + 5 + 4 = 16 // make a copy translated down, the copy has y texture coordinates all 0 QGeometryData bottom = top.translated(QVector3D(0, 0, -1)); // now modify the top so its y texture coordinates are all 1 for (int i = 0; i < top.count(); ++i) top.texCoordRef(QGL::TextureCoord0).setY(1.0); displayList->addQuadsZipped(top, bottom);
}
@
@//main.cpp
#include <QtGui/QApplication>
#include "mainwindow.h"int main(int argc, char *argv[])
{
QApplication a(argc, argv);MainWindow w; w.ComputeUpperHull(); w.show(); return a.exec();
}
@