[Qgis-developer] Re : [Qgis-user] Pyqt4 : which signal is sent when dialog comes to foreground?

Matthias Kuhn matthias at opengis.ch
Tue Mar 31 05:50:33 PDT 2015


You should get a parameter containing the composer that is being deleted
with composerWillBeRemoved signal. Try to use that to infer which
composer has been removed. As the signal name indicates, at the time it
is emitted, the composer is not deleted yet.
As an alternative you may make the connection with Qt.QueuedConnection.
It is possible that with this connection style you will receive the
signal after deletion and are able to continue using your current update
method.

Best
Matthias

On 03/31/2015 02:04 PM, Junior Delaz wrote:
> Matthias,
> Thanks. I just give it a try it and all goes well with composerAdded.
> But not really well with composerWillBeRemoved signal. The first
> deletion in the composer manager does nothing and deleting a second
> composer does remove the first one in my list. and so on...
> My update function should be rewritten I think.  I'll try to see how
> improving it and may (surely) ask again for help (if needed).
>
> While seeking information about composerWillBeRemoved, I found a
> composerRemoved [1] [2] signal (that doesn't appear in the API doc)
> and without being able to use it. :(
> [1]
> https://github.com/qgis/QGIS/blob/master/src/app/composer/qgscomposermanager.cpp
> (line 48
> [2] https://github.com/qgis/QGIS/blob/master/src/app/qgisapp.cpp (line
> 5601)
>
> Another thing that may not be related : what the deletePrintComposers
> function (https://github.com/qgis/QGIS/blob/master/src/app/qgisapp.cpp
> line 5698) is for?
>
> Thanks again for the clue.
>
> 2015-03-31 9:43 GMT+02:00 Matthias Kuhn <matthias at opengis.ch
> <mailto:matthias at opengis.ch>>:
>
>     QgisInterface (iface) has a composerAdded and
>     composerWillBeRemoved signal.
>
>     Did you try to connect to these?
>
>     Best,
>     Matthias
>
>
>     On 03/31/2015 09:34 AM, Junior wrote:
>>     Hi all, Luca
>>     Thanks for answering. But i already have an update function that
>>     I linked to an update list button. I even linked it to the icon
>>     on the toolbar so that when user calls foreground the dialog it's
>>     already updated.
>>     The case I'd like to manage: user can open plugin dialog and
>>     composer manager. The two dialogs are visible (to the eyes) even
>>     though composer manager is the one at foreground. He makes
>>     changes and directly clicked on the plugin dialog. He should
>>     update list but if he forgets and executes, this may lead to bug
>>     I don't want to / can't yet manage.
>>     Reason why I want to ensure that list is always up to date when
>>     he interacts with the dialog
>>
>>     Envoyé depuis mon HTC
>>
>>     ----- Reply message -----
>>     De : "Luca Manganelli" <luca76 at gmail.com> <mailto:luca76 at gmail.com>
>>     Pour :
>>     Cc : "qgis-user at lists.osgeo.org"
>>     <mailto:qgis-user at lists.osgeo.org> <qgis-user at lists.osgeo.org>
>>     <mailto:qgis-user at lists.osgeo.org>, "qgis-developer"
>>     <qgis-developer at lists.osgeo.org>
>>     <mailto:qgis-developer at lists.osgeo.org>
>>     Objet : [Qgis-developer] [Qgis-user] Pyqt4 : which signal is sent
>>     when dialog comes to foreground?
>>     Date : mar., mars 31, 2015 07:56
>>
>>     On Mon, Mar 30, 2015 at 6:12 PM, Junior Delaz <delazj at gmail.com> <mailto:delazj at gmail.com> wrote:
>>     > I've read about defining a custom showEvent function but can't understand
>>     > where to put it and what inside.
>>     > If somebody can give some tips...
>>
>>     You could add a "Update list" button
>>     _______________________________________________
>>     Qgis-developer mailing list
>>     Qgis-developer at lists.osgeo.org <mailto:Qgis-developer at lists.osgeo.org>
>>     http://lists.osgeo.org/mailman/listinfo/qgis-developer
>>
>>
>>     _______________________________________________
>>     Qgis-developer mailing list
>>     Qgis-developer at lists.osgeo.org <mailto:Qgis-developer at lists.osgeo.org>
>>     http://lists.osgeo.org/mailman/listinfo/qgis-developer
>
>
>     _______________________________________________
>     Qgis-developer mailing list
>     Qgis-developer at lists.osgeo.org <mailto:Qgis-developer at lists.osgeo.org>
>     http://lists.osgeo.org/mailman/listinfo/qgis-developer
>
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-developer/attachments/20150331/bf1f03ce/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: OpenPGP digital signature
URL: <http://lists.osgeo.org/pipermail/qgis-developer/attachments/20150331/bf1f03ce/attachment.pgp>


More information about the Qgis-developer mailing list