[Qt-interest] Block all signals of ui class

Lucas Pereira Caixeta lpcnew at gmail.com
Wed Jun 30 02:51:31 CEST 2010


 Bool QObject::blockSignals ( bool *block* )

If *block* is true, signals emitted by this object are blocked (i.e.,
emitting a signal will not invoke anything connected to it). If *block* is
false, no such blocking will occur.

The return value is the previous value of
signalsBlocked<http://qobject.html#signalsBlocked>
().

Note that the destroyed <http://qobject.html#destroyed>() signal will be
emitted even if the signals for this object have been blocked.

See also signalsBlocked <http://qobject.html#signalsBlocked>().



Have fun!! [?]

2010/6/29 Tony Rietwyk <tony.rietwyk at rightsoft.com.au>

 Hi Matthias,
>
> Why don't you just change the slots to check for the 0 pointer?  Or add a
> boolean to say when the device is ready.  All of our forms use at least one
> boolean to control the slot execution.
>
> Tony.
>
>
> > I have a widget with many comboboxes and spinboxes which all control
> > settings of a device.
> > This device class however is however a pointer to 0 during
> > contruction.
> > With the use of the 'connectSlotsByName' feature these
> > widgets all send
> > signals during startup which lead to a crash
> > when the device class is accessed.
> >
> > Is there a way to disable all signals of all widgets in the ui class?
> > Setting a blockSignals(true) around all widgets before and after the
> > ui->setupUI(this) does not make much sense to me.
> >
> > Or can I copy the code for the connectSlotsByName feature somewhere ?
> > Then I could get around setting up the connect code for all
> > 20+ widgets.
> >
> > Matthias
>
> _______________________________________________
> Qt-interest mailing list
> Qt-interest at trolltech.com
> http://lists.trolltech.com/mailman/listinfo/qt-interest
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20100629/67f47b3f/attachment.html 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: image/png
Size: 630 bytes
Desc: not available
Url : http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20100629/67f47b3f/attachment.png 


More information about the Qt-interest-old mailing list