Results 1 to 6 of 6

Thread: The header file 'mainwindow.h' doesn't include <QObject>.

  1. #1
    Join Date
    Mar 2010
    Posts
    92
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60

    Default The header file 'mainwindow.h' doesn't include <QObject>.

    i want build Symbian QTcreator S60 5th like this instruction: http://v16.lscache3.c.youtube.com/vi...be37827648d40d
    or http://labs.trolltech.com/blogs/2009...t-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 ?
    Last edited by nhs_0702; 14th May 2010 at 11:46.

  2. #2
    Join Date
    Mar 2010
    Posts
    92
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60

    Default Re: The header file 'mainwindow.h' doesn't include <QObject>.

    Error linke this: http://discussion.forum.nokia.com/fo...d.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 ?
    Last edited by wysota; 14th May 2010 at 15:51. Reason: removed URL

  3. #3
    Join Date
    Sep 2009
    Location
    UK
    Posts
    2,447
    Thanks
    6
    Thanked 348 Times in 333 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: The header file 'mainwindow.h' doesn't include <QObject>.

    Well, did you do as it says?

  4. #4
    Join Date
    Mar 2010
    Posts
    92
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60

    Default Re: The header file 'mainwindow.h' doesn't include <QObject>.

    Quote Originally Posted by fatjuicymole View Post
    Well, did you do as it says?
    yes,but it cant build

  5. #5
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: The header file 'mainwindow.h' doesn't include <QObject>.

    Quote Originally Posted by nhs_0702 View Post
    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.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  6. #6
    Join Date
    Mar 2010
    Posts
    92
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60

    Default Re: The header file 'mainwindow.h' doesn't include <QObject>.

    Quote Originally Posted by wysota View Post
    Then don't upload rar but something else and strip the size of projects you upload. Link removed, infraction given.
    Qt Code:
    1. #include <QtGui/QApplication>
    2. #include "mainwindow.h"
    3.  
    4. int main(int argc, char *argv[])
    5. {
    6. QApplication a(argc, argv);
    7. MainWindow w;
    8. w.show();
    9. return a.exec();
    10. }
    To copy to clipboard, switch view to plain text mode 
    Qt Code:
    1. #include "mainwindow.h"
    2. #include "ui_mainwindow.h"
    3.  
    4. MainWindow::MainWindow(QWidget *parent) :
    5. QMainWindow(parent),
    6. ui(new Ui::MainWindow)
    7. {
    8. ui->setupUi(this);
    9. }
    10.  
    11. MainWindow::~MainWindow()
    12. {
    13. delete ui;
    14. }
    15.  
    16. void MainWindow::changeEvent(QEvent *e)
    17. {
    18. QMainWindow::changeEvent(e);
    19. switch (e->type()) {
    20. case QEvent::LanguageChange:
    21. ui->retranslateUi(this);
    22. break;
    23. default:
    24. break;
    25. }
    26. }
    27.  
    28. void MainWindow::on_pushButton_clicked()
    29. {
    30. ui->listWidget->addItem(ui->lineEdit->text());
    31. }
    To copy to clipboard, switch view to plain text mode 


    Qt Code:
    1. #ifndef MAINWINDOW_H
    2. #define MAINWINDOW_H
    3. #include <QObject>
    4. #include <QtGui/QMainWindow>
    5.  
    6. namespace Ui {
    7. class MainWindow;
    8. }
    9.  
    10. class MainWindow : public QMainWindow {
    11. Q_OBJECT
    12. public:
    13. MainWindow(QWidget *parent = 0);
    14. ~MainWindow();
    15.  
    16. protected:
    17. void changeEvent(QEvent *e);
    18.  
    19. private:
    20. Ui::MainWindow *ui;
    21.  
    22. private slots:
    23. void on_pushButton_clicked();
    24. };
    25.  
    26. #endif // MAINWINDOW_H
    To copy to clipboard, switch view to plain text mode 


    Qt Code:
    1. #-------------------------------------------------
    2. #
    3. # Project created by QtCreator 2010-05-15T04:29:01
    4. #
    5. #-------------------------------------------------
    6.  
    7. TARGET = CamOnMoiNguoi
    8. TEMPLATE = app
    9.  
    10.  
    11. SOURCES += main.cpp\
    12. mainwindow.cpp
    13.  
    14. HEADERS += mainwindow.h
    15.  
    16. FORMS += mainwindow.ui
    To copy to clipboard, switch view to plain text mode 

Similar Threads

  1. QGraphicsItem doesn't inherit QObject?
    By xyzt in forum Qt Programming
    Replies: 6
    Last Post: 26th September 2011, 14:59
  2. compile to arm+include header
    By nataly in forum Qt Programming
    Replies: 1
    Last Post: 8th November 2009, 12:59
  3. Mingw doesn't find qt include files
    By NineTailFox in forum Newbie
    Replies: 2
    Last Post: 12th November 2008, 08:18
  4. unable to include header file
    By sonia in forum Qt Programming
    Replies: 1
    Last Post: 10th July 2007, 08:56
  5. Replies: 3
    Last Post: 23rd July 2006, 18:02

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.