[QGIS-Developer] PyQt and QGIS

Etienne Trimaille etienne.trimaille at gmail.com
Wed Sep 4 01:03:22 PDT 2019


Hi,

You should try:
from qgis.gui import QgsFileWidget
It's in the GUI library: https://qgis.org/api/classQgsFileWidget.html

For PyCharm on Ubuntu, I used the normal launcher. Then I have setup a venv
called "QGIS3" that I can use in all my plugins and project related to
QGIS. In the venv, I added
/home/etienne/dev/qgis/build/master/output/python
to my interpreter paths. It works well for autocompletation. You may need
to restart pycharm and/or to force PyCharm to scan these libraries.

Le mar. 3 sept. 2019 à 18:04, Shane Carey <careyshan at gmail.com> a écrit :

> Thanks Mario,
>
> I'm on Ubuntu.
> Cheers
> Le gach dea ghui,
> *Shane Carey*
> *GIS and Data Solutions Consultant*
>
>
> On Tue, Sep 3, 2019 at 4:21 PM Mario Baranzini <mario at opengis.ch> wrote:
>
>> Hi Shane,
>> are you using Linux or other systems?
>>
>> Here there are my notes on how to configure PyCharm for pyqgis
>> development from when I used PyCharm and Gnome:
>> https://marioba.gitlab.io/blog/post/2018-04-12-pyqgis-autocompletion-pycharm/
>>
>> I Hope that helps.
>>
>> Cheers
>> Mario
>>
>>
>>
>>
>> *03 September 2019 16:53 Shane Carey <careyshan at gmail.com
>> <careyshan at gmail.com>> wrote:*
>>
>> Hi all,
>> For a few days now, I have been trying to setup PyQt and QGIS without
>> much success. So I have tried to create a ui using QT designer and from
>> there create my python file using pyuic5:
>> When I go to run it in PyCharm, I get the following:
>> No module named 'qgsfilewidget'
>>
>> And the error is coming from:
>> from qgsfilewidget import QgsFileWidget
>>
>> Could some please tell me how to setup PyCharm with QGIS please as I am
>> unable to find anything useful on google.
>>
>> Thanks
>> Le gach dea ghui,
>> *Shane Carey*
>> *GIS and Data Solutions Consultant*
>> <>
>>
>>
>> _______________________________________________
> 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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-developer/attachments/20190904/40813366/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Screenshot from 2019-09-04 10-01-24.png
Type: image/png
Size: 65066 bytes
Desc: not available
URL: <http://lists.osgeo.org/pipermail/qgis-developer/attachments/20190904/40813366/attachment-0001.png>


More information about the QGIS-Developer mailing list