J
Jeff
Its been years since I did C++ and Im unsure what this is about.
I have a QT class Im inheriting from in my .h file:
class Mosfet : Q3CanvasRectangle
{
public:
Mosfet::Mosfet(const QRect &qr, Q3Canvas *canvas);
Mosfet::~Mosfet();
....etc
};
In my .cpp file I have:
Mosfet::Mosfet(const QRect &qr, Q3Canvas *canvas) :
Q3CanvasRectangle(canvas)
{
}
When I compile I get:
Mosfet.cpp: In constructor 'Mosfet::Mosfet(const QRect&,
Q3Canvas*)':
Mosfet.cpp:13: error: no matching function for call to
'Q3CanvasRectangle::Q3CanvasRectangle()'
/opt/qt41/include/Qt/q3canvas.h:565: note: candidates are:
Q3CanvasRectangle::Q3CanvasRectangle(int, int, int, int, Q3Canvas*)
/opt/qt41/include/Qt/q3canvas.h:564: note:
Q3CanvasRectangle::Q3CanvasRectangle(const QRect&, Q3Canvas*)
/opt/qt41/include/Qt/q3canvas.h:563: note:
Q3CanvasRectangle::Q3CanvasRectangle(Q3Canvas*)
/opt/qt41/include/Qt/q3canvas.h:561: note:
Q3CanvasRectangle::Q3CanvasRectangle(const Q3CanvasRectangle&)
My question is, why does the compiler say that there is no matching
function:
Mosfet.cpp:13: error: no matching function for call to
'Q3CanvasRectangle::Q3CanvasRectangle()'
when my initializer list is clearly Q3CanvasRectangle(canvas) ?
It appears to me it doesnt like my init list and is calling a default
ctor,
which of course isnt in the candidates list.
Can someone point out the err in my ways?
Thanks,
Jeff
PS using fedora core 4, gcc version 4.0.2 20051125 (Red Hat 4.0.2-8)
QT 4.1
I have a QT class Im inheriting from in my .h file:
class Mosfet : Q3CanvasRectangle
{
public:
Mosfet::Mosfet(const QRect &qr, Q3Canvas *canvas);
Mosfet::~Mosfet();
....etc
};
In my .cpp file I have:
Mosfet::Mosfet(const QRect &qr, Q3Canvas *canvas) :
Q3CanvasRectangle(canvas)
{
}
When I compile I get:
Mosfet.cpp: In constructor 'Mosfet::Mosfet(const QRect&,
Q3Canvas*)':
Mosfet.cpp:13: error: no matching function for call to
'Q3CanvasRectangle::Q3CanvasRectangle()'
/opt/qt41/include/Qt/q3canvas.h:565: note: candidates are:
Q3CanvasRectangle::Q3CanvasRectangle(int, int, int, int, Q3Canvas*)
/opt/qt41/include/Qt/q3canvas.h:564: note:
Q3CanvasRectangle::Q3CanvasRectangle(const QRect&, Q3Canvas*)
/opt/qt41/include/Qt/q3canvas.h:563: note:
Q3CanvasRectangle::Q3CanvasRectangle(Q3Canvas*)
/opt/qt41/include/Qt/q3canvas.h:561: note:
Q3CanvasRectangle::Q3CanvasRectangle(const Q3CanvasRectangle&)
My question is, why does the compiler say that there is no matching
function:
Mosfet.cpp:13: error: no matching function for call to
'Q3CanvasRectangle::Q3CanvasRectangle()'
when my initializer list is clearly Q3CanvasRectangle(canvas) ?
It appears to me it doesnt like my init list and is calling a default
ctor,
which of course isnt in the candidates list.
Can someone point out the err in my ways?
Thanks,
Jeff
PS using fedora core 4, gcc version 4.0.2 20051125 (Red Hat 4.0.2-8)
QT 4.1