PDA

View Full Version : reference problem



high_flyer
2nd October 2006, 12:02
Hi,

I have the following problem:
Here is a class constructor:

MTelemetry(QString sPort,quint16 dataPort,quint16 viewPort,QString logFileName,QString dataServer="localhost",
QString viewServer="localhost",QObject *parent = 0) throw(MException): QThread(parent)
And then, I subclass MTelemtry so:

class MCamCon : public MTelemetry
{
Q_OBJECT
private:

public:
MCamCon(QString sPort,quint16 dataPort,quint16 viewPort=0,QString dataServer="localhost",
QString viewServer="localhost",QObject *parent = 0);

//some code
};


And the implementatio:

MCamCon::MCamCon(QString sPort, quint16 dataPort,quint16 viewPort,QString dataServer,
QString viewServer,QObject *parent)
: MTelemetry(sPort, dataPort, viewPort, dataServer, viewServer, parent)
{
}

The compiler complains:

mcamcon.cpp:25: error: no matching function for call to ‘TM::MTelemetry::MTelemetry(QString&, quint16&, quint16&, QString&, QString&, QObject*&)’
../../Globals/include/mtelemetry.h:198: note: candidates are: TM::MTelemetry::MTelemetry(QString, quint16, quint16, QString, QString, QString, QObject*)


Yet as you can see, I am not passing by reference...

What am I missing here?

Thanks.

wysota
2nd October 2006, 12:52
The candidate has one more QString argument :)

high_flyer
2nd October 2006, 13:13
Doughp... :rolleyes:
Its time for me to take a break....:)
Thanks.