Re: [PyQt] Custom C++ types as signal arguments

2013-09-28 Thread David Boddie
On 28 September 2013 14:29:03, Phil Thompson wrote:

> On Tue, 24 Sep 2013 13:24:05 + (UTC), David Boddie 
> 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 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)", 
"\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 listPyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt


Re: [PyQt] Custom C++ types as signal arguments

2013-09-28 Thread Phil Thompson
On Tue, 24 Sep 2013 13:24:05 + (UTC), David Boddie 
wrote:
> I'm running into problems with sip and custom signal arguments. I'm
> probably
> doing something wrong, and I'm hoping that someone might be able to put
me
> on
> the right track.
> 
> I've written a class with this definition:
> 
>   #include 
>   #include 
>   #include 
> 
>   typedef std::vector StringList;
> 
>   class Emitter : public QWidget
>   {
>   Q_OBJECT
> 
>   public:
>   Emitter(QWidget *parent = 0);
>   virtual ~Emitter();
> 
>   signals:
>   void emitStrings(StringList);
>   void emitStr(std::string, std::string);
>   void emitQString(QString);
>   };
> 
> 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 StringList;
> 
>   %MappedType std::string
>   {
>   %TypeHeaderCode
>   #include 
>   %End
> 
>   ...
>   };
> 
>   %MappedType StringList
>   {
>   %TypeHeaderCode
>   #include 
>   #include 
>   #include 
>   typedef std::vector StringList;
>   %End
> 
>   ...
>   };
> 
> It also has this definition for the Emitter class:
> 
>   class Emitter : public QWidget
>   {
>   %TypeHeaderCode
>   #include "Emitter.h"
>   %End
> 
>   public:
> Emitter(QWidget *parent = 0);
> virtual ~Emitter();
> 
>   signals:
> void emitStrings(StringList);
> void emitStr(std::string, std::string);
> void emitQString(QString);
>   };
> 
> This all builds correctly, but the emitStrings signal does not appear to
> work
> correctly, causing a crash when accessed in apparently any way at all.
Even
> evaluating the signal object fails.
> 
> Some elementary debugging indicates that the bound_overload member of
the
> qpycore_pyqtBoundSignal object is zero for this signal, and maybe this
> leads to
> the crash when trying to connect the signal to a slot.
> 
> I'm using PyQt 4.9.1 and sip 4.13.2. I've attached a simple project to
> demonstrate the problem.
> 
> David

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,
Phil
___
PyQt mailing listPyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt


Re: [PyQt] Upcoming Release of PyQt v5.1

2013-09-28 Thread Phil Thompson
On Sat, 28 Sep 2013 12:54:08 +0200, Tomas Sobota  wrote:
> A couple of days ago I downloaded and compiled PyQt-gpl-5.1
> -snapshot-597681874226 on my Linux Mint Debian Edition box.
> 
> The file qmlscene/pluginloader.cpp failed to compile the sentence:
> QVector ucs4 = py_plugin_dir.toUcs4();
> 
> It looked like QVector was not defined, so I fixed the error including
the
> line:
> #include 
> 
> at the start of the file.After that, the file compiled fine.
> 
> Tom

Already fixed.

Phil
___
PyQt mailing listPyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt


[PyQt] ANN: eric 5.3.7 released

2013-09-28 Thread Detlev Offenbach
Hi,

I just uploaded eric 5.3.7. It is a maintenance release fixing some 
bugs. It 
is available via the eric web site.

http://eric-ide.python-projects.org/index.html

Regards,
Detlev
-- 
*Detlev Offenbach*
det...@die-offenbachs.de
___
PyQt mailing listPyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt

[PyQt] ANN: eric 4.5.15 released

2013-09-28 Thread detlev
Hi,

I just uploaded eric 4.5.15. It is a maintenance release fixing some bugs. It 
is available via the eric web site.

http://eric-ide.python-projects.org/index.html

Regards,
Detlev
-- 
Detlev Offenbach
det...@die-offenbachs.de
___
PyQt mailing listPyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt


[PyQt] Upcoming Release of PyQt v5.1

2013-09-28 Thread Tomas Sobota
A couple of days ago I downloaded and compiled PyQt-gpl-5.1
-snapshot-597681874226 on my Linux Mint Debian Edition box.

The file qmlscene/pluginloader.cpp failed to compile the sentence:
QVector ucs4 = py_plugin_dir.toUcs4();

It looked like QVector was not defined, so I fixed the error including the
line:
#include 

at the start of the file.After that, the file compiled fine.

Tom
___
PyQt mailing listPyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt

[PyQt] Upcoming Release of PyQt v5.1

2013-09-28 Thread Phil Thompson
The current PyQt5 snapshot is a release candidate for v5.1. This
includes...

- full support for integration with QML and Quick2
- support for Qt v5.1 including the QtSensors and QtSerialPort modules
- an (almost) complete set of OpenGL 2.0 and OpenGL ES2 bindings
- support for cross-compilation.

Any last minute testing would be appreciated.

I've tested the cross-compilation support for the Raspberry Pi. I haven't
got around to looking at Android yet, and won't do for this release.
Actually building PyQt for Android shouldn't be too difficult (just setting
up a configuration file) but working out all the steps to create and
install a complete Python/Qt5/PyQt5 environment will take some
investigation. If anybody wants to have a go at this then please go ahead.

Phil
___
PyQt mailing listPyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt


[PyQt] PyQt and gevent

2013-09-28 Thread Matias Guijarro

Hi all,

I am using gevent within PyQt4 applications and I am looking after the 
best way to

integrate gevent and Qt.

I used to start a QTimer to run the gevent loop for a short period of 
time every 10
milliseconds, interleaving Qt and gevent event loops in time ; it's a 
very simple approach,

however it is not very efficient.

I tried other techniques like having 2 threads (one for each loop), or 
running processEvents()
in a greenlet, but I was not happy with it - in particular, when calling 
processEvents() in a
greenlet, it doesn't play well with modal dialog boxes for example and I 
also experienced

seg faults...

Finally I decided to try to have a "PyQt backend" for gevent, ie. an 
implementation of the
gevent loop using Qt constructs (QTimer, QSocketNotifier, etc.). I 
didn't find any existing code

so I created a new project yesterday, here is the link to the github page:
https://github.com/mguijarr/qtgevent

I am happy to share it with you, hopefully it can be useful to someone else.

It seems to work for the basic tests I did - but it is far from being 
complete at the moment.

Any help would be appreciated to make it better :)

Cheers,
Matias.










___
PyQt mailing listPyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt