3
« on: August 22, 2016, 08:50:17 pm »
Hello,
I'm trying to run a simple Lime report.
This is the .pro file
QT += core gui sql printsupport xml script
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
TARGET = limeReportTest01
TEMPLATE = app
SOURCES += main.cpp\
limemain.cpp
HEADERS += limemain.h
FORMS += limemain.ui
INCLUDEPATH += "C:\programas\LimeReport-master_1311\limereport"
This is the header file:
#ifndef LIMEMAIN_H
#define LIMEMAIN_H
#include <QMainWindow>
#include <QtSql>
#include <QSqlDatabase>
#include <QDebug>
#include <QMessageBox>
#include <QSqlQuery>
#include "lrreportengine.h"
#include "lrcallbackdatasourceintf.h"
namespace Ui {
class limeMain;
}
class limeMain : public QMainWindow
{
Q_OBJECT
public:
explicit limeMain(QWidget *parent = 0);
~limeMain();
private slots:
void on_pushButton_clicked();
private:
Ui::limeMain *ui;
LimeReport::ReportEngine *report;
};
#endif // LIMEMAIN_H
And the .cpp file:
#include "limemain.h"
#include "ui_limemain.h"
#include <QtSql/QSqlQuery>
#include <QtSql/QSqlRecord>
#include "lrreportengine.h"
#include "lrcallbackdatasourceintf.h"
limeMain::limeMain(QWidget *parent) :
QMainWindow(parent),
ui(new Ui::limeMain)
{
ui->setupUi(this);
QSqlDatabase db;
db = QSqlDatabase::addDatabase("QPSQL");
db.setHostName("localhost");
db.setPort(5432);
db.setDatabaseName("db");
db.setUserName("postgres");
db.setPassword("postgres");
db.open();
if (!db.open())
{
QMessageBox::critical(0, QObject::tr("Database Error"), db.lastError().text());
}
else
{
qDebug()<<"Conexion ok";
}
}
limeMain::~limeMain()
{
delete ui;
}
void limeMain::on_pushButton_clicked()
{
report = new LimeReport::ReportEngine(this);
report->dataManager()->addModel("string_list",stringListModel,true);
report->loadFromFile("File path");
report->previewReport();
//report->printReport();
}
But when i compile, it keeps giving me this error:
C:\qprogramacion\limeReportTest01\limemain.cpp:40: error: undefined reference to `LimeReport::ReportEngine::ReportEngine(QObject*)'
What is missing?
Thanks in advance.