tags:

views:

51

answers:

2

The error I am receiving:

g++ -c -g -I/usr/lib/qt-3.3/include TCPEchoServer.cpp
Product.h:22: error: ISO C++ forbids declaration of âQ_Objectâ with no type
Product.h:24: error: expected â;â before âvoidâ
make: *** [TCPEchoServer.o] Error 1

I'm using QT 3.3. What am I missing...? T___T

#include <string>
#include <qtimer.h>
#include "HandleTCPClient.h"
#ifndef PRODUCT_H
#define PRODUCT_H
#include <qobject.h>
#include <qgl.h>

class Handler;

//Define ourselves a product class
class Product
    {

     Q_Object

     void startTimer();

    public:
     Product();

     string seller, itemName, description, highestBidder;
     double price, min, buyingPrice, currentBid;
     int time;
     bool isSold;
     Handler *handler;

     void setHandler(Handler *h);

    public slots:
     void setProductToSold();

    };

#endif
+3  A: 

You are missing the correct case for the macro, it should be Q_OBJECT.

Georg Fritzsche
+2  A: 

And, A QObject should inherit in some way from the class QObject...

Or was this not the case with QT3 ?

shoosh
Yep, it should.
Georg Fritzsche