<div dir="ltr"><div><div>I am wondering how important it is to import the modules separately. Such as:<br><br>from qgis.core import QGis, QgsCoordinateTransform, QgsRectangle, QgsPoint, QgsGeometry<br><br>Does it really make a difference? I am finding that you have to make sure every part of your code is exercised so that nothing was missed. By doing the above there is more of a chance to have a bug. Perhaps for PyQt4.QtGui it makes sense, but there is less chance to have a python error if you keep.<br><br>from qgis.core import *<br>from PyQt4.QtGui import *<br>from qgis.gui import *<br><br></div>Thoughts?<br><br></div><div>Thanks,<br></div><div><br></div>Calvin<br><div><div><br><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, May 10, 2017 at 12:00 PM, Luigi Pirelli <span dir="ltr"><<a href="mailto:luipir@gmail.com" target="_blank">luipir@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">this is a slide about plugin porting I'll be presenting to the next<br>
spanish foss4g:<br>
<a href="http://slides.com/luigipirelli/desdarrolloplugindeqgis-xi-girona#/17" rel="noreferrer" target="_blank">http://slides.com/<wbr>luigipirelli/<wbr>desdarrolloplugindeqgis-xi-<wbr>girona#/17</a><br>
sorry it's in spanish<br>
<br>
about<br>
<br>
from PyQt4 import QtGui<br>
<br>
or<br>
<br>
from PyQt4.QtGui import QDialog<br>
<br>
I would prefer the second so to avoid to postpone lib version errors<br>
at pyc time and not at runtime.<br>
it make it simpler to mock or alias a class globally if you need<br>
<br>
regards<br>
Luigi Pirelli<br>
<br>
******************************<wbr>******************************<wbr>******************************<wbr>********<br>
* Boundless QGIS Support/Development: lpirelli AT boundlessgeo DOT com<br>
* LinkedIn: <a href="https://www.linkedin.com/in/luigipirelli" rel="noreferrer" target="_blank">https://www.linkedin.com/in/<wbr>luigipirelli</a><br>
* Stackexchange: <a href="http://gis.stackexchange.com/users/19667/luigi-pirelli" rel="noreferrer" target="_blank">http://gis.stackexchange.com/<wbr>users/19667/luigi-pirelli</a><br>
* GitHub: <a href="https://github.com/luipir" rel="noreferrer" target="_blank">https://github.com/luipir</a><br>
* Mastering QGIS 2nd Edition:<br>
* <a href="https://www.packtpub.com/big-data-and-business-intelligence/mastering-qgis-second-edition" rel="noreferrer" target="_blank">https://www.packtpub.com/big-<wbr>data-and-business-<wbr>intelligence/mastering-qgis-<wbr>second-edition</a><br>
******************************<wbr>******************************<wbr>******************************<wbr>********<br></blockquote></div></div></div>