[QGIS-Developer] Using QgsMapCanvas in a python plugin dialog

Eric Brelsford ebrelsford at gmail.com
Mon Apr 22 16:42:27 PDT 2019


I'm unsuccessfully trying to use a QgsMapCanvas in a python plugin's dialog.

The canvas renders the map, which appears and disappears the first time I
load the dialog. The second time I load the dialog, the map is rendered and
remains. However, I've only accomplished this by using
waitWhileRendering(), which I know is incorrect.

I have posted a minimal plugin on GitHub (
https://github.com/ebrelsford/qgis-map-canvas-test/) demonstrating this
issue. It was created using Plugin Builder. The relevant parts will be the
.ui file:


https://github.com/ebrelsford/qgis-map-canvas-test/blob/master/map_canvas_test_dialog_base.ui#L15

and the dialog python file:


https://github.com/ebrelsford/qgis-map-canvas-test/blob/master/map_canvas_test_dialog.py#L55

Is anyone familiar with what I'm doing wrong here? Or does anyone know
python plugins using QgsMapCanvas in the dialog that I could use as a
reference? I'd appreciate any thoughts you have on it!

eric
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-developer/attachments/20190422/162363fd/attachment.html>


More information about the QGIS-Developer mailing list