[Qgis-developer] Connecting composer closure with another window focus
vincent.damoy at espaces-naturels.fr
Mon Dec 16 06:02:56 PST 2013
I'm running QGIS 2.0.1 on Ubuntu 12.04, 64 bits (installed with
I've created a form, which shows a composer when I click on a button.
This form stays active while the composer is showed, but is located
behind the QGIS main window.
I'd like it to come back in front of the screen when the composer is
closed by user.
After several web searchs and tests, it seems that the following
function works :
/def operationOnTop(self): //
// self.raise_() //
My problem is to connect a « composer closed » signal with this function.
I think the signal should be QgsComposerView.composerViewHide. I'm right ?
* I tried to connect it with the above slot :
But QGIS returns :
AttributeError: 'PyQt4.QtCore.pyqtSignal' object has no attribute 'connect'
I can't understand this error message : all signals should have
« connect » attribute, right ?
* Trying with the old « connect » way :
My plugin doesn't crash during loading, but nothing happens when I close
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.
Can you see what I've missed in each case ?
Any help would be greatly appreciated.
PS : I've tried to make the connection in the class constructor :
/class OperationDialog(QtGui.QDialog): //
//def __init__(self, iface): //
//self.ui = Ui_operation() //
//self.iface = iface //
//self.canvas = self.iface.mapCanvas()//
Should I put it in the function which creates the composer?
Vincent Damoy - Responsable SIG
Conservatoire d'Espaces Naturels du Nord et du Pas-de-Calais
152 bd de Paris - 62190 Lillers
Tél : 03.21.54.75.00 - Fax : 03.21.54.56.07
/*Pour adhérer au Conservatoire :*
/Pour le respect de l'environnement, n'imprimez ce message qu'en cas de
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Qgis-developer