[prev in list] [next in list] [prev in thread] [next in thread] 

List:       pykde
Subject:    Re: [PyQt] Custom C++ types as signal arguments
From:       David Boddie <davidb () met ! no>
Date:       2013-09-28 13:31:41
Message-ID: 1808247355.721443.1380375101679.JavaMail.root () imap1b
[Download RAW message or body]

On 28 September 2013 14:29:03, Phil Thompson wrote:

> On Tue, 24 Sep 2013 13:24:05 +0000 (UTC), David Boddie <davidb at met.no>
> wrote:

> > My sip wrapper starts with a typedef for the StringList type and
> > %MappedType
> > implementations for std::string and StringList:
> 
> Remove this typedef...
> 
> >   typedef std::vector<std::string> StringList;

[...]

> SIP should probably complain about the typedef as you are effectively
> providing two definitions for StringList.
> 
> Also in the current snapshot at least, you get a sensible exception.

Thanks for the correction - it works! In fact, removing the StringList
type altogether appears to work, which puts me back in the position I
started in, but with working code. The typedef was originally put in as
a workaround for the crash and because I had noticed that the emitStrings
signal was defined in the generated C++ code with "unknown-type":

  /* Define this type's PyQt4 signals. */
  static const pyqt4QtSignal pyqt4_signals_Emitter[] = {
      {"emitQString(QString)", "\1Emitter.emitQString[QString]", 0},
      {"emitStr(std::string,std::string)", "\1Emitter.emitStr[string, string]", 0},
      {"emitStrings(std::vector<std::string>)", "\1Emitter.emitStrings[unknown-type]", 0},
      {0, 0, 0}
  };

I'll try this out again on Monday and see what, if anything, I've been
doing differently.

Thanks again for the help.

David
_______________________________________________
PyQt mailing list    PyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic