PDA

View Full Version : The header file 'mainwindow.h' doesn't include <QObject>.



nhs_0702
14th May 2010, 11:19
i want build Symbian QTcreator S60 5th like this instruction: http://v16.lscache3.c.youtube.com/videoplayback?ip=0.0.0.0&sparams=id%2Cexpire%2Cip%2Cipbits%2Citag%2Calgorit hm%2Cburst%2Cfactor%2Coc%3AU0dWSFhQUF9FSkNNNl9QSlR J&fexp=902919%2C900026&algorithm=throttle-factor&itag=34&ipbits=0&burst=40&sver=3&expire=1273852800&key=yt1&signature=6A8B798948B0CA8E9122D48C293559EBEE9A7221 .ACD687F97943308DB0BA7736D73124280BC10696&factor=1.25&id=45be37827648d40d
or http://labs.trolltech.com/blogs/2009/12/03/tutorial-videos-qt-development-for-symbian/
but it error message


C:\Users\BotNetVN\Desktop\CamOnMoiNguoi\moc_mainwi ndow.cpp:12: #error "The header file 'mainwindow.h' doesn't include <QObject>."
ERROR: cpp.EXE failure
make[1]: *** [MAKEFILECAMONMOINGUOI_0XE8E190B0] Error 33

source: <link removed>


why error ?

nhs_0702
14th May 2010, 11:55
Error linke this: http://discussion.forum.nokia.com/forum/showthread.php?t=188893
but i dont found error

source: <url removed>

sorry forums but i cant upload my source file .rar on forums ,can Admintration test upload ?

squidge
14th May 2010, 13:08
Well, did you do as it says?

nhs_0702
14th May 2010, 14:02
Well, did you do as it says?

yes,but it cant build

wysota
14th May 2010, 15:50
sorry forums but i cant upload my source file .rar on forums ,can Admintration test upload ?
Then don't upload rar but something else and strip the size of projects you upload. Link removed, infraction given.

nhs_0702
14th May 2010, 17:02
Then don't upload rar but something else and strip the size of projects you upload. Link removed, infraction given.


#include <QtGui/QApplication>
#include "mainwindow.h"

int main(int argc, char *argv[])
{
QApplication a(argc, argv);
MainWindow w;
w.show();
return a.exec();
}




#include "mainwindow.h"
#include "ui_mainwindow.h"

MainWindow::MainWindow(QWidget *parent) :
QMainWindow(parent),
ui(new Ui::MainWindow)
{
ui->setupUi(this);
}

MainWindow::~MainWindow()
{
delete ui;
}

void MainWindow::changeEvent(QEvent *e)
{
QMainWindow::changeEvent(e);
switch (e->type()) {
case QEvent::LanguageChange:
ui->retranslateUi(this);
break;
default:
break;
}
}

void MainWindow::on_pushButton_clicked()
{
ui->listWidget->addItem(ui->lineEdit->text());
}



#ifndef MAINWINDOW_H
#define MAINWINDOW_H
#include <QObject>
#include <QtGui/QMainWindow>

namespace Ui {
class MainWindow;
}

class MainWindow : public QMainWindow {
Q_OBJECT
public:
MainWindow(QWidget *parent = 0);
~MainWindow();

protected:
void changeEvent(QEvent *e);

private:
Ui::MainWindow *ui;

private slots:
void on_pushButton_clicked();
};

#endif // MAINWINDOW_H





#-------------------------------------------------
#
# Project created by QtCreator 2010-05-15T04:29:01
#
#-------------------------------------------------

TARGET = CamOnMoiNguoi
TEMPLATE = app


SOURCES += main.cpp\
mainwindow.cpp

HEADERS += mainwindow.h

FORMS += mainwindow.ui