<html>
<head>
<meta content="text/html; charset=windows-1252"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<div class="moz-cite-prefix">Thanks a lot Bernhard for your answer.<br>
This was the solution! <br>
Instead of <br>
<br>
<i> composerView = diffList[0]</i><i><br>
</i><i> composition = self.composerView.composition()</i><i><br>
</i><i> </i><i>
composerView.composerViewHide.connect(self.operationOnTop)</i><i>
</i><i><br>
</i><br>
I tried<br>
<br>
<i> <b>self.</b>composerView = diffList[0]</i><i><br>
</i><i> <b>self.</b>composition = <b>self.</b>composerView.composition()</i><i><br>
</i><i> </i><i> <b>self.</b>composerView.composerViewHide.connect(self.operationOnTop)</i><i>
</i><i><br>
</i>
<div class="moz-signature"><br>
And now it works!! The signal is connected with the
operationOnTop function, and my form comes back in front of the
main QGIS window after the composer closure.<br>
Thank you very much!<br>
Best regards<br>
Vincent</div>
<div class="moz-signature">
<style><!--
.moz-txt-sig, .moz-signature {
opacity: inherit !important;
}
--></style>
<meta http-equiv="content-type" content="text/html;
charset=windows-1252">
<br>
<div class="moz-signature">-- <br>
<meta http-equiv="content-type" content="text/html;
charset=windows-1252">
<br>
<div class="moz-signature">--------------------------- <br>
<div class="moz-signature">
<meta http-equiv="content-type" content="text/html;
charset=windows-1252">
<title></title>
<br>
<div class="moz-signature">
<table border="0" cellpadding="2" cellspacing="2"
height="114" width="818">
<tbody>
<tr>
<td colspan="2" rowspan="1" valign="top"
width="200">Vincent Damoy - Responsable SIG<br>
Conservatoire d'Espaces Naturels du Nord et du
Pas-de-Calais<br>
152 bd de Paris - 62190 Lillers<br>
Tél : 03.21.54.75.00 - Fax : 03.21.54.56.07<br>
<small><font color="#009900"><i><b>Pour adhérer
au Conservatoire :</b> <a
class="moz-txt-link-abbreviated"
href="http://www.cen-npdc.org/nous-rejoindre/adherent.html">www.cen-npdc.org/nous-rejoindre/adherent.html</a></i></font></small></td>
</tr>
</tbody>
</table>
<br>
</div>
</div>
</div>
</div>
</div>
Le 16/12/2013 15:17, Bernhard Ströbl a écrit :<br>
</div>
<blockquote cite="mid:52AF0B91.4050905@jena.de" type="cite">Hi,
<br>
<br>
I often had the problem that connecting to a signal did not work,
too. My solution always was to make the object which throws the
signal an object of the class
<br>
so instead of
<br>
QgsComposerView....
<br>
try
<br>
self.QgsComposerView....
<br>
<br>
I have no idea if this is generally true neither can did I
investigate why it worked in my cases
<br>
<br>
Bernhard
<br>
<br>
Am 16.12.2013 15:02, schrieb Vincent Damoy:
<br>
<blockquote type="cite">Hi all,
<br>
<br>
I'm running QGIS 2.0.1 on Ubuntu 12.04, 64 bits (installed with
<br>
ubuntugis-unstable repository).
<br>
<br>
I've created a form, which shows a composer when I click on a
button.
<br>
This form stays active while the composer is showed, but is
located
<br>
behind the QGIS main window.
<br>
I'd like it to come back in front of the screen when the
composer is
<br>
closed by user.
<br>
<br>
After several web searchs and tests, it seems that the following
<br>
function works :
<br>
<br>
/def operationOnTop(self): //
<br>
//self.raise_() //
<br>
//self.activateWindow()/
<br>
<br>
My problem is to connect a « composer closed » signal with this
function.
<br>
I think the signal should be QgsComposerView.composerViewHide.
I'm right ?
<br>
<br>
* I tried to connect it with the above slot :
<br>
<br>
/QgsComposerView.composerViewHide.connect(self.operationOnTop)/
<br>
<br>
But QGIS returns :
<br>
AttributeError: 'PyQt4.QtCore.pyqtSignal' object has no
attribute 'connect'
<br>
I can't understand this error message : all signals should have
«
<br>
connect » attribute, right ?
<br>
<br>
* Trying with the old « connect » way :
<br>
<br>
/self.connect(QgsComposerView(),
QtCore.SIGNAL('composerViewHide'),
<br>
self.operationOnTop)/
<br>
<br>
My plugin doesn't crash during loading, but nothing happens when
I close
<br>
the composer.
<br>
I've added « print 'operationOnTop' » to the end of the
function, to
<br>
test its loading. Apparently, the signal is not catched, as I
have no
<br>
return in the Python pannel.
<br>
<br>
Can you see what I've missed in each case ?
<br>
<br>
Any help would be greatly appreciated.
<br>
Kind regards
<br>
<br>
<br>
PS : I've tried to make the connection in the class constructor
:
<br>
<br>
/class OperationDialog(QtGui.QDialog): //
<br>
//def __init__(self, iface): //
<br>
//QtGui.QDialog.__init__(self) //
<br>
//self.ui = Ui_operation() //
<br>
//self.ui.setupUi(self) //
<br>
//self.iface = iface //
<br>
//self.canvas = self.iface.mapCanvas()//
<br>
//…//
<br>
//QgsComposerView.composerViewHide.connect(self.operationOnTop)//
<br>
///
<br>
Should I put it in the function which creates the composer?
<br>
<br>
<br>
<br>
--
<br>
<br>
--
<br>
<br>
---------------------------
<br>
<br>
Vincent Damoy - Responsable SIG
<br>
Conservatoire d'Espaces Naturels du Nord et du Pas-de-Calais
<br>
152 bd de Paris - 62190 Lillers
<br>
Tél : 03.21.54.75.00 - Fax : 03.21.54.56.07
<br>
/*Pour adhérer au Conservatoire :*
<br>
<a class="moz-txt-link-abbreviated" href="http://www.cen-npdc.org/nous-rejoindre/adherent.html/">www.cen-npdc.org/nous-rejoindre/adherent.html/</a> <br>
<br>
<br>
<br>
/Pour le respect de l'environnement, n'imprimez ce message
qu'en cas de
<br>
nécessité !/ <br>
<br>
<br>
<br>
<br>
__________ Information from ESET Mail Security, version of virus
<br>
signature database 9178 (20131216) __________
<br>
<br>
The message was checked by ESET Mail Security.
<br>
<a class="moz-txt-link-freetext" href="http://www.eset.com">http://www.eset.com</a>
<br>
<br>
<br>
_______________________________________________
<br>
Qgis-developer mailing list
<br>
<a class="moz-txt-link-abbreviated" href="mailto:Qgis-developer@lists.osgeo.org">Qgis-developer@lists.osgeo.org</a>
<br>
<a class="moz-txt-link-freetext" href="http://lists.osgeo.org/mailman/listinfo/qgis-developer">http://lists.osgeo.org/mailman/listinfo/qgis-developer</a>
<br>
<br>
<br>
__________ Information from ESET Mail Security, version of virus
signature database 9178 (20131216) __________
<br>
<br>
The message was checked by ESET Mail Security.
<br>
<a class="moz-txt-link-freetext" href="http://www.eset.com">http://www.eset.com</a>
<br>
<br>
</blockquote>
<br>
<br>
<br>
__________ Information from ESET Mail Security, version of virus
signature database 9178 (20131216) __________
<br>
<br>
The message was checked by ESET Mail Security.
<br>
<a class="moz-txt-link-freetext" href="http://www.eset.com">http://www.eset.com</a>
<br>
<br>
<br>
_______________________________________________
<br>
Qgis-developer mailing list
<br>
<a class="moz-txt-link-abbreviated" href="mailto:Qgis-developer@lists.osgeo.org">Qgis-developer@lists.osgeo.org</a>
<br>
<a class="moz-txt-link-freetext" href="http://lists.osgeo.org/mailman/listinfo/qgis-developer">http://lists.osgeo.org/mailman/listinfo/qgis-developer</a>
<br>
<br>
</blockquote>
<br>
</body>
</html>