[QGIS-Developer] Converting plugins to QGIS 3

Luigi Pirelli luipir at gmail.com
Wed May 10 09:00:11 PDT 2017


this is a slide about plugin porting I'll be presenting to the next
spanish foss4g:
http://slides.com/luigipirelli/desdarrolloplugindeqgis-xi-girona#/17
sorry it's in spanish

about

from PyQt4 import QtGui

or

from PyQt4.QtGui import QDialog

I would prefer the second so to avoid to postpone lib version errors
at pyc time and not at runtime.
it make it simpler to mock or alias a class globally if you need

regards
Luigi Pirelli

**************************************************************************************************
* Boundless QGIS Support/Development: lpirelli AT boundlessgeo DOT com
* LinkedIn: https://www.linkedin.com/in/luigipirelli
* Stackexchange: http://gis.stackexchange.com/users/19667/luigi-pirelli
* GitHub: https://github.com/luipir
* Mastering QGIS 2nd Edition:
* https://www.packtpub.com/big-data-and-business-intelligence/mastering-qgis-second-edition
**************************************************************************************************


On 10 May 2017 at 17:49, C Hamilton <adenaculture at gmail.com> wrote:
> Is it better to do an import as
>
> from PyQt4 import QtGui
>
> and then in the code use QtGui.QDialog
>
> or is it better to use
>
> from PyQt4.QtGui import QDialog
>
> Sorry if this is an obvious question. I have been a C/C++/perl programmer
> for many years, but just started python about a year and a half ago.
>
> Thanks
>
> On Wed, May 10, 2017 at 11:40 AM, Tom Chadwin <tom.chadwin at nnpa.org.uk>
> wrote:
>>
>> Remove the line completely, run the plugin, and then individually add the
>> modules as they show up as errors. It doesn't take too long.
>>
>>
>>
>> -----
>> Buy Pie Spy: Adventures in British pastry 2010-11 on Amazon
>> --
>> View this message in context:
>> http://osgeo-org.1560.x6.nabble.com/QGIS-Developer-Converting-plugins-to-QGIS-3-tp5320059p5320063.html
>> Sent from the QGIS - Developer mailing list archive at Nabble.com.
>> _______________________________________________
>> QGIS-Developer mailing list
>> QGIS-Developer at lists.osgeo.org
>> List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
>> Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer
>
>
>
> _______________________________________________
> QGIS-Developer mailing list
> QGIS-Developer at lists.osgeo.org
> List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
> Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer


More information about the QGIS-Developer mailing list