[PyKDE] Trouble binding code with SIP

Gerard Vermeulen gvermeul at grenoble.cnrs.fr
Mon Oct 13 12:12:00 BST 2003


On Mon, 13 Oct 2003 11:27:56 +0200
Aurélien Gâteau <aurelien at dental-on-line.fr> wrote:

> Hello list
> 
> I'm experimenting trouble binding some code with SIP. The original C++ header 
> code is composed of one namespace (DolSphinx) and a class 
> (DolSphinxListener). Here are some interesting excerpts:
> 
> --- dolsphinx.h ---
> class DolSphinxListener;
> 
> namespace DolSphinx {
>     enum State {Uninitialized, Initializing, Listening, Calibrating, Paused};
> 
>     /* Snipped some functions */
>     
>     DolSphinxListener* listener();
>     void setListener(DolSphinxListener*);
> 
>     State state();
>     
>     State stringToState(const QString&);
>     QString stateToString(State);
> }
> ---

I have encountered other problems with namespace. SIP is not as clever
as a C++ compiler in resolving namespace scopes.  So for instance
     void setListener(DolSphinxListener*);
has to be written as:
     void setListener(DolSphinx::DolSphinxListener*);

Gerard




More information about the PyQt mailing list