Re: [PyQt] Strange behavior with new-style signals and slots

2012-04-01 Thread Phil Thompson
On Sun, 01 Apr 2012 13:04:30 +0200, Detlev Offenbach
 wrote:
> Hallo,
> 
> I am observing a strange behavior related to new-style signal and slots.
> Here 
> is the situation.
> 
> My program calls this line twice in a class (via different code paths).
> 
>
self.project.projectPropertiesChanged.connect(self.__projectPropertiesChanged)
> 
> The disconnect is only issued once when the class (the editor) is
closed.
> 
>
self.project.projectPropertiesChanged.disconnect(self.__projectPropertiesChanged)
> 
> If the signal is emitted thereafter, I get a RuntimeError saying, that
the 
> underlying C/C++ object has been destroyed. I suspect, that the Python
> wrapper 
> for the Qt object (here it is a QScintilla object) is still kept alive
by
> some 
> reference counter (possibly caused by the double connection).
> 
> Is this a bug in PyQt/sip or do I have to avoid such a situation?

I can't tell from your description - you need to provide a test case.
Making the same connection twice is technically possible, but sounds like
an application bug to me.

> If the
> later 
> is the case, is it possible to check, if a signal is already connected,
> e.g. 
> something like
> 
>
self.project.projectPropertiesChanged.is_connected(self.__projectPropertiesChanged)
> 
> Another consequence of the double connection is, that the slot is called
> twice 
> when the signal is emitted.

...which is what you would expect.

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


Re: [PyQt] Organize the components in window (Qt-Designer)

2012-04-01 Thread Alfredo Junior
Thank you man.

Now is working as I want.

BR,

Junix
 
Linux user: #262629 (counter.li.org)
ICQ: #99042637


- Original Message -
From: Vincent Vande Vyvre 
To: pyqt@riverbankcomputing.com
Cc: 
Sent: Sunday, April 1, 2012 4:34 AM
Subject: Re: [PyQt] Organize the components in window (Qt-Designer)

Le 01/04/12 05:57, Alfredo Junior a écrit :
> Hi
> I'm creating a Mame(mamedev.org) Front-end in PyQt4 and using Qt-Designer to 
> build my windows.
> This (Qt-Designer) is a little bit new to me and I have a problem to manage 
> the layout components in the window.
> As you can see in a video below, I can't organize the components into the 
> window.
> http://vimeo.com/39561463
> I don't know how to do, because the vertical/horizontal layout there are not 
> some property as max. size, for example.
> I'm not sure if by the video I came to my goal to show you the exactly that I 
> need.
> Thanks for advance.
>
> Junix
> ___
> PyQt mailing list    PyQt@riverbankcomputing.com
> http://www.riverbankcomputing.com/mailman/listinfo/pyqt
>
You must use size policy in your's widgets and place your verticalLayout
and QGraphicsWidget into a horizontalLayout before set the final gridLayout.

Joined an example with the same widgets, take a look at the size policy.

-- 
Vincent V.V.
Oqapy  . Qarte+7
 . PaQager 

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


[PyQt] Another strange observation with new-style signals

2012-04-01 Thread Detlev Offenbach
Hello,

I am observing another strange behavior of my program with new-style signals 
and slots. It seems, that the mechanism takes an excessive amount of time. I 
ran an old version of my program that uses the old-style signals and it is 
noticeably faster. Unfortunately it is difficult to generate a test script to 
show this.

I am using Qt 4.8.1 and latest PyQt4 and sip snapshots.

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


[PyQt] phonon audio volume setting problem

2012-04-01 Thread Stephen Gava

hi there.

i'm using phonon to play some sounds but i can't seem to control the 
audio output volume as i expect to be able to.


i set up phonon like so:

self.sfx_output=Phonon.AudioOutput(Phonon.MusicCategory,self)
self.sfx_player=Phonon.MediaObject(self)
Phonon.createPath(self.sfx_player,self.sfx_output)

and play the sounde source like so:

self.sfx_player.setCurrentSource(sound_source)
self.sfx_player.play()

this works fine, but always plays at the audio outputs full volume of 
1.0 (100%).


if do self.sfx_output.setVolume(0.5), for instance, in my code, then 
self.sfx_output.volume() returns 0.5 as i would expect.


if i then play a sound (as above) it play at full volume still as though 
i didn't set the volume.


to try to debug i attached a function to the audio output's 
'volumeChanged' signal like so:


self.sfx_output.volumeChanged.connect(self.volume_changed)

(the function merely prints the changed volume) and what i find is, 
after setting the volume to what i want, and checking it, as above, as 
soon as i play any sound the volumeChanged signal is emitted and the 
volume is now reported as 1.0 again.


in other words calling self.sfx_player.play() causes self.sfx_output 's 
volume to be reset to 1.0.


how can i make volume changes to the audio output actually work so that 
playing a sound doesn't not reset the output to full volume??


thanks,
stephen.



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


[PyQt] Strange behavior with new-style signals and slots

2012-04-01 Thread Detlev Offenbach
Hallo,

I am observing a strange behavior related to new-style signal and slots. Here 
is the situation.

My program calls this line twice in a class (via different code paths).

self.project.projectPropertiesChanged.connect(self.__projectPropertiesChanged)

The disconnect is only issued once when the class (the editor) is closed.

self.project.projectPropertiesChanged.disconnect(self.__projectPropertiesChanged)

If the signal is emitted thereafter, I get a RuntimeError saying, that the 
underlying C/C++ object has been destroyed. I suspect, that the Python wrapper 
for the Qt object (here it is a QScintilla object) is still kept alive by some 
reference counter (possibly caused by the double connection).

Is this a bug in PyQt/sip or do I have to avoid such a situation? If the later 
is the case, is it possible to check, if a signal is already connected, e.g. 
something like

self.project.projectPropertiesChanged.is_connected(self.__projectPropertiesChanged)

Another consequence of the double connection is, that the slot is called twice 
when the signal is emitted.

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.2 released

2012-04-01 Thread detlev
Hi,

I just uploaded eric 4.5.2. 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 5.2.1 released

2012-04-01 Thread detlev
Hi,

I just uploaded eric 5.2.1. 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


Re: [PyQt] Organize the components in window (Qt-Designer)

2012-04-01 Thread Vincent Vande Vyvre
Le 01/04/12 05:57, Alfredo Junior a écrit :
> Hi
> I'm creating a Mame(mamedev.org) Front-end in PyQt4 and using Qt-Designer to 
> build my windows.
> This (Qt-Designer) is a little bit new to me and I have a problem to manage 
> the layout components in the window.
> As you can see in a video below, I can't organize the components into the 
> window.
> http://vimeo.com/39561463
> I don't know how to do, because the vertical/horizontal layout there are not 
> some property as max. size, for example.
> I'm not sure if by the video I came to my goal to show you the exactly that I 
> need.
> Thanks for advance.
>
> Junix
> ___
> PyQt mailing listPyQt@riverbankcomputing.com
> http://www.riverbankcomputing.com/mailman/listinfo/pyqt
>
You must use size policy in your's widgets and place your verticalLayout
and QGraphicsWidget into a horizontalLayout before set the final gridLayout.

Joined an example with the same widgets, take a look at the size policy.

-- 
Vincent V.V.
Oqapy  . Qarte+7
 . PaQager 


example.ui
Description: application/designer
___
PyQt mailing listPyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt