Re: [PyQt] QApplication.saveStateRequest does not work well with PyQt 4.8

2011-05-20 Thread Phil Thompson
On Fri, 20 May 2011 14:45:35 +0200, Wilbert Berendsen 
wrote:
> Hi,
> 
> In my application ("frescobaldi") (using API 2 for QString and
QVariant),
> if qApp is an QApplication(),
> 
> def saveState(sm):
> pass # code saving state
> 
> qApp.saveStateRequest.connect(saveState)
> 
> yields:
> 
> Object::connect: No such signal
> QApplication::saveStateRequest(QSessionManager)
> Object::connect:  (sender name:   'frescobaldi')
> Traceback (most recent call last):
>   File "./frescobaldi", line 2, in 
> import frescobaldi_app.main
>   File "/home/fede/src/frescobaldi/frescobaldi_app/main.py", line 41, in
> 
> import session  # Initialize QSessionManager support
>   File "/home/fede/src/frescobaldi/frescobaldi_app/session.py", line
> 100, in 
> app.qApp.saveStateRequest.connect(saveState)
> TypeError: connect() failed between saveStateRequest(QSessionManager)
> and unislot()
> 
> So, first QApplication complains, and then PyQt4 errors out.
> 
> On PyQt 4.7 this works well.
> 
> On PyQt4.8 the old way of connecting does work, however:
> 
> QObject.connect(qApp, SIGNAL("saveStateRequest(QSessionManager&)"),
> saveState)
> 
> does work correctly on both PyQt versions (4.7 and 4.8).
> 
> Is this intended?

It's a SIP code generation bug. It's fixed in hg and tonight's snapshot.

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


[PyQt] QApplication.saveStateRequest does not work well with PyQt 4.8

2011-05-20 Thread Wilbert Berendsen
Hi,

In my application ("frescobaldi") (using API 2 for QString and QVariant),
if qApp is an QApplication(),

def saveState(sm):
pass # code saving state

qApp.saveStateRequest.connect(saveState)

yields:

Object::connect: No such signal
QApplication::saveStateRequest(QSessionManager)
Object::connect:  (sender name:   'frescobaldi')
Traceback (most recent call last):
  File "./frescobaldi", line 2, in 
import frescobaldi_app.main
  File "/home/fede/src/frescobaldi/frescobaldi_app/main.py", line 41, in

import session  # Initialize QSessionManager support
  File "/home/fede/src/frescobaldi/frescobaldi_app/session.py", line
100, in 
app.qApp.saveStateRequest.connect(saveState)
TypeError: connect() failed between saveStateRequest(QSessionManager)
and unislot()

So, first QApplication complains, and then PyQt4 errors out.

On PyQt 4.7 this works well.

On PyQt4.8 the old way of connecting does work, however:

QObject.connect(qApp, SIGNAL("saveStateRequest(QSessionManager&)"), saveState)

does work correctly on both PyQt versions (4.7 and 4.8).

Is this intended?

with many regards,
Wilbert Berendsen

-- 
http://www.wilbertberendsen.nl/
"You must be the change you wish to see in the world."
-- Mahatma Gandhi
___
PyQt mailing listPyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt