How to destroy SIGNAL

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

How to destroy SIGNAL

starglider.dev
Hi,
I have a QWidgetGrid that need to response to a double click signal, but sometimes it as the
double grid signal disconnected to allow the user to directly edit the cells, and a itemChanged signal was
implemented, my problem is that I can't delete/destroy de signals according to my needs.

Any help will be great.

Thank you in advance.

 

_______________________________________________
PyQt mailing list    [hidden email]
http://www.riverbankcomputing.com/mailman/listinfo/pyqt
Reply | Threaded
Open this post in threaded view
|

Re: How to destroy SIGNAL

Mark Summerfield-4
On Mon, 15 Nov 2010 21:20:35 +0000
starglider develop <[hidden email]> wrote:

> Hi,
> I have a QWidgetGrid that need to response to a double click signal,
> but sometimes it as the
> double grid signal disconnected to allow the user to directly edit the
> cells, and a itemChanged signal was
> implemented, my problem is that I can't delete/destroy de signals
> according to my needs.
>
> Any help will be great.
>
> Thank you in advance.

Have you tried using QObject.blockSignals()? This doesn't create or
destroy them but stops/starts them being acted upon.

http://www.riverbankcomputing.co.uk/static/Docs/PyQt4/html/qobject.html#blockSignals

And if you really want to delete a signal use QObject.disconnect():

http://www.riverbankcomputing.co.uk/static/Docs/PyQt4/html/qobject.html#disconnect

--
Mark Summerfield, Qtrac Ltd, www.qtrac.eu
    C++, Python, Qt, PyQt - training and consultancy
        "Advanced Qt Programming" - ISBN 0321635906
            http://www.qtrac.eu/aqpbook.html
_______________________________________________
PyQt mailing list    [hidden email]
http://www.riverbankcomputing.com/mailman/listinfo/pyqt
Reply | Threaded
Open this post in threaded view
|

Re: How to destroy SIGNAL

starglider.dev
Hi Mark,
thank you so much for your help.
I use QObject.disconnect(): QObject.disconnect(self.grdMain, SIGNAL("itemDoubleClicked(QTableWidgetItem*)"), self.grdClik)

Your book about PyQt is great, thank you.

regards,
Jorge

On 16 November 2010 08:53, Mark Summerfield <[hidden email]> wrote:
On Mon, 15 Nov 2010 21:20:35 +0000
starglider develop <[hidden email]> wrote:
> Hi,
> I have a QWidgetGrid that need to response to a double click signal,
> but sometimes it as the
> double grid signal disconnected to allow the user to directly edit the
> cells, and a itemChanged signal was
> implemented, my problem is that I can't delete/destroy de signals
> according to my needs.
>
> Any help will be great.
>
> Thank you in advance.

Have you tried using QObject.blockSignals()? This doesn't create or
destroy them but stops/starts them being acted upon.

http://www.riverbankcomputing.co.uk/static/Docs/PyQt4/html/qobject.html#blockSignals

And if you really want to delete a signal use QObject.disconnect():

http://www.riverbankcomputing.co.uk/static/Docs/PyQt4/html/qobject.html#disconnect

--
Mark Summerfield, Qtrac Ltd, www.qtrac.eu
   C++, Python, Qt, PyQt - training and consultancy
       "Advanced Qt Programming" - ISBN 0321635906
           http://www.qtrac.eu/aqpbook.html


_______________________________________________
PyQt mailing list    [hidden email]
http://www.riverbankcomputing.com/mailman/listinfo/pyqt