PDA

View Full Version : Building QT example



Aman607
12th June 2011, 10:55
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

mvuori
12th June 2011, 11:06
The problem is the line QTM_USE_NAMESPACE. Just remove it.

Aman607
12th June 2011, 13:10
thanks for the reply,I tried removing that line but it is generating more errors.:confused: