Results 1 to 3 of 3

Thread: Building QT example

  1. #1
    Join Date
    Jun 2011
    Posts
    14
    Qt products
    Qt4
    Platforms
    Windows

    Default Building QT example

    HI everyone,I opened the example in "messaging API" from qt help.Open "service action" example and copy/paste all the files in that example.On building that project I recieve the following error 'expected constructor,destructor or type conversion before class'.Kindly help me out everyone
    The code is also written below:

    #ifndef MAINWINDOW_H
    #define MAINWINDOW_H

    #include <QMainWindow>
    //#include <qmessageservice.h>

    class QComboBox;
    class QListView;
    class QTabWidget;
    class QMenuBar;
    class QStackedWidget;

    QTM_USE_NAMESPACE
    class mainwindow : public QMainWindow //This is the error line
    {
    Q_OBJECT

    public:
    mainwindow(QWidget* parent = 0, Qt::WindowFlags f = 0);

    #ifdef _WIN32_WCE
    protected:
    bool eventFilter(QObject* source, QEvent* e);
    #endif

    private slots:
    void serviceStateChanged(QMessageService::State state);
    void viewSelected();

    private:
    QTabWidget* m_tabWidget;
    QMessageService* m_service;
    QStackedWidget* m_widgetStack;
    };

    #endif

  2. #2
    Join Date
    May 2011
    Posts
    239
    Thanks
    4
    Thanked 35 Times in 35 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Symbian S60

    Default Re: Building QT example

    The problem is the line QTM_USE_NAMESPACE. Just remove it.

  3. #3
    Join Date
    Jun 2011
    Posts
    14
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Building QT example

    thanks for the reply,I tried removing that line but it is generating more errors.

Similar Threads

  1. Re-Building Qt on Mac
    By dpatel in forum Qt Programming
    Replies: 0
    Last Post: 18th May 2011, 13:16
  2. Building X11 on Mac
    By wjlyerly in forum Installation and Deployment
    Replies: 1
    Last Post: 14th February 2010, 17:59
  3. Building Qt 4.6 rc
    By eekhoorn12 in forum Installation and Deployment
    Replies: 4
    Last Post: 3rd December 2009, 08:13
  4. Building on OSX
    By sbauer in forum Newbie
    Replies: 4
    Last Post: 4th September 2009, 15:08
  5. building qt statically
    By eleanor in forum Installation and Deployment
    Replies: 7
    Last Post: 9th May 2009, 10:03

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.