<html>
<head>
<meta http-equiv="content-type" content="text/html;
charset=ISO-8859-1">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<meta http-equiv="CONTENT-TYPE" content="text/html;
charset=ISO-8859-1">
Hi all,<br>
<br>
I'm running QGIS 2.0.1 on Ubuntu 12.04, 64 bits (installed with
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
behind the QGIS main window.<br>
I'd like it to come back in front of the screen when the composer is
closed by user.<br>
<br>
After several web searchs and tests, it seems that the following
function works :<br>
<br>
<i>def operationOnTop(self): </i><i><br>
</i><i> self.raise_() </i><i><br>
</i><i> self.activateWindow()</i><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>
<i>QgsComposerView.composerViewHide.connect(self.operationOnTop)</i><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
« connect » attribute, right ?<br>
<br>
* Trying with the old « connect » way :<br>
<br>
<i>self.connect(QgsComposerView(),
QtCore.SIGNAL('composerViewHide'), self.operationOnTop)</i><br>
<br>
My plugin doesn't crash during loading, but nothing happens when I
close the composer.<br>
I've added « print 'operationOnTop' » to the end of the function, to
test its loading. Apparently, the signal is not catched, as I have
no 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>
<i>class OperationDialog(QtGui.QDialog): </i><i><br>
</i><i> def __init__(self, iface): </i><i><br>
</i><i> QtGui.QDialog.__init__(self) </i><i><br>
</i><i> self.ui = Ui_operation() </i><i><br>
</i><i> self.ui.setupUi(self) </i><i><br>
</i><i> self.iface = iface </i><i><br>
</i><i> self.canvas = self.iface.mapCanvas()</i><i><br>
</i><i> …</i><i><br>
</i><i>
QgsComposerView.composerViewHide.connect(self.operationOnTop)</i><i><br>
</i><i> </i><br>
Should I put it in the function which creates the composer?<br>
<title></title>
<meta name="GENERATOR" content="LibreOffice 3.5 (Linux)">
<style type="text/css">
<!--
@page { margin: 2cm }
P { margin-bottom: 0.21cm }
-->
</style><br>
<br>
<br>
<div class="moz-signature">-- <br>
<style><!--
.moz-txt-sig, .moz-signature {
opacity: inherit !important;
}
--></style>
<meta http-equiv="content-type" content="text/html;
charset=ISO-8859-1">
<br>
<div class="moz-signature">-- <br>
<meta http-equiv="content-type" content="text/html;
charset=ISO-8859-1">
<br>
<div class="moz-signature">--------------------------- <br>
<div class="moz-signature">
<meta http-equiv="content-type" content="text/html;
charset=ISO-8859-1">
<title></title>
<br>
<div class="moz-signature">
<table border="0" cellpadding="2" cellspacing="2"
height="206" 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>
<td valign="top" width="300">
<p style="border: 2.60pt double #808080; padding:
0.05cm"><br>
</p>
</td>
</tr>
<tr>
<td height="100" valign="top" width="65"><br>
</td>
<td valign="top"><small><i><font color="#999999">Pour
le respect de l'environnement, n'imprimez ce
message qu'en cas de nécessité !</font></i></small></td>
<td valign="top"><br>
</td>
</tr>
</tbody>
</table>
<br>
</div>
</div>
</div>
</div>
</div>
</body>
</html>