[Qgis-developer] Re: python plugin and layer properties window
Marco Hugentobler
marco.hugentobler at sourcepole.ch
Wed Jun 29 05:14:50 EDT 2011
Hi Michael
The composer window is not destroyed on close (only if it is deleted
explicitely in the composer manager).
One possible solution would be to add a signal to the composer window class
which is emited in the close event.
Regards,
Marco
Am Mittwoch, 29. Juni 2011, 09.57:32 schrieb Michael Pfeiffer:
> yes the QMainWindow::destroyed() Signal does work but the problem is it is
> only sending the signal when closing QGIS and not when closing the composer
> Window.
> Here is the code for this:
>
> /beforeList = self.iface.activeComposers()
> comp = self.iface.actionPrintComposer()
> comp.trigger()
> afterList = self.iface.activeComposers()
>
> self.diffList = []
> for item in afterList:
> if not item in beforeList:
> self.diffList.append(item)
>
> self.composerView = self.diffList[0]
> composerWindow = self.composerView.composerWindow()
> print self.composerView.composerWindow()
>
> QObject.connect(composerWindow, SIGNAL("destroyed()"), self.test)
>
> def test(self):
> print "it works"
> /
>
> So I need a kind of signal which is sent when you close the mapcomposer
> window with the x.
> I know that composerView must be still present after closing the
> mapcomposer window for the composer list.
> But where builts QGIS the UI you need for the mapcomposer window?
> And how can I get it for listening on the close Event?
>
> regards,
>
> Michael
>
> --
> View this message in context:
> http://osgeo-org.1803224.n2.nabble.com/python-plugin-and-layer-properties-
> window-tp6383931p6528058.html Sent from the qgis-developer mailing list
> archive at Nabble.com.
> _______________________________________________
> Qgis-developer mailing list
> Qgis-developer at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/qgis-developer
--
Dr. Marco Hugentobler
Sourcepole - Linux & Open Source Solutions
Churerstrasse 22, CH-8808 Pfäffikon SZ, Switzerland
marco.hugentobler at sourcepole.ch http://www.sourcepole.ch
Technical Advisor QGIS Project Steering Committee
More information about the Qgis-developer
mailing list