Qt-interest Archive, January 2007
What i'm making wrong?
Message 1 in thread
Hello!
I'm trying to create successor of QSvgRenderer.
shiva_svg_renderer.h:
#ifndef shiva_svg_renderer_H
#define shiva_svg_renderer_H
#include <QSvgRenderer>
class shiva_svg_renderer :
public QSvgRenderer
{
public:
shiva_svg_renderer(QObject *parent=0);
shiva_svg_renderer(const QString &filename, QObject *parent=0);
shiva_svg_renderer(const QByteArray &contents, QObject *parent=0);
~shiva_svg_renderer();
};
#endif
shiva_svg_renderer.cpp:
#include "shiva_svg_renderer.h"
shiva_svg_renderer::shiva_svg_renderer(QObject *parent=0):QSvgRenderer(parent)
{
}
shiva_svg_renderer::shiva_svg_renderer(const QString &filename, QObject *parent=0):QSvgRenderer(filename,parent)
{
}
shiva_svg_renderer::shiva_svg_renderer(const QByteArray &contents, QObject *parent=0):QSvgRenderer(contents,parent)
{
}
shiva_svg_renderer::~shiva_svg_renderer()
{
}
when compiling, i receive error:
.\shiva_svg_renderer.cpp(3) : error C2572: 'shiva_svg_renderer::shiva_svg_renderer' : redefinition of default parameter : parameter 1
n:\c++\shiva_svg\shiva_svg_renderer.h(10) : see declaration of 'shiva_svg_renderer::shiva_svg_renderer'
what is wrong?
--
[ signature omitted ]
Message 2 in thread
Nikulin Sergey schrieb:
> shiva_svg_renderer(QObject *parent=0);
>
> shiva_svg_renderer::shiva_svg_renderer(QObject *parent=0):QSvgRenderer(parent)
> {
> }
>
> when compiling, i receive error:
>
> .\shiva_svg_renderer.cpp(3) : error C2572: 'shiva_svg_renderer::shiva_svg_renderer' : redefinition of default parameter : parameter 1
> n:\c++\shiva_svg\shiva_svg_renderer.h(10) : see declaration of 'shiva_svg_renderer::shiva_svg_renderer'
>
> what is wrong?
Default values to parameters may be given in the declaration of a
method, but not in the definition. Read: Delete the '0' from your
constructor implementation.
Martin
--
[ signature omitted ]
Message 3 in thread
In your constructors you've put parent=0 in both the header and the
..cpp.
Take the '=0' out of the .cpp.
Sam Dutton
SAM DUTTON
SENIOR SITE DEVELOPER
200 GRAY'S INN ROAD
LONDON
WC1X 8XZ
UNITED KINGDOM
T +44 (0)20 7430 4496
F
E SAM.DUTTON@xxxxxxxxx
WWW.ITN.CO.UK
-----Original Message-----
From: Nikulin Sergey [mailto:mb0@xxxxx]
Sent: Tuesday 23 January 2007 14:21
To: Qt Interest List
Subject: What i'm making wrong?
Hello!
I'm trying to create successor of QSvgRenderer.
shiva_svg_renderer.h:
#ifndef shiva_svg_renderer_H
#define shiva_svg_renderer_H
#include <QSvgRenderer>
class shiva_svg_renderer :
public QSvgRenderer
{
public:
shiva_svg_renderer(QObject *parent=0);
shiva_svg_renderer(const QString &filename, QObject *parent=0);
shiva_svg_renderer(const QByteArray &contents, QObject *parent=0);
~shiva_svg_renderer();
};
#endif
shiva_svg_renderer.cpp:
#include "shiva_svg_renderer.h"
shiva_svg_renderer::shiva_svg_renderer(QObject
*parent=0):QSvgRenderer(parent) { }
shiva_svg_renderer::shiva_svg_renderer(const QString &filename, QObject
*parent=0):QSvgRenderer(filename,parent)
{
}
shiva_svg_renderer::shiva_svg_renderer(const QByteArray &contents,
QObject *parent=0):QSvgRenderer(contents,parent)
{
}
shiva_svg_renderer::~shiva_svg_renderer()
{
}
when compiling, i receive error:
..\shiva_svg_renderer.cpp(3) : error C2572:
'shiva_svg_renderer::shiva_svg_renderer' : redefinition of default
parameter : parameter 1
n:\c++\shiva_svg\shiva_svg_renderer.h(10) : see declaration of
'shiva_svg_renderer::shiva_svg_renderer'
what is wrong?
--
[ signature omitted ]