Skip to content

Prepare plugin for PyQt6 and QGIS 4#24

Open
merydian wants to merge 4 commits into
enricofer:masterfrom
merydian:qt6
Open

Prepare plugin for PyQt6 and QGIS 4#24
merydian wants to merge 4 commits into
enricofer:masterfrom
merydian:qt6

Conversation

@merydian

@merydian merydian commented Feb 17, 2026

Copy link
Copy Markdown

Will make the plugin usable under QGIS 4. Also includes some refactoring for structure and readability.

Closes #23.

@falkmielke

falkmielke commented Jun 10, 2026

Copy link
Copy Markdown

Updating this plugin for QGIS 4 would be much appreciated.
Much appreciated that this PR goes in several steps and commits.
I attempted using the adjusted code from this PR to locally zip and install the newer version.
However, out of the box, some ui files seemed to be missing:

An errCouldn't load plugin 'changeDataSource' due to an error when calling its classFactory() method 

PyQt6.uic.exceptions.UIFileException: /QGIS/QGIS4/profiles/default/python/plugins/changeDataSource/ui/changeDataSource_dialog_base.ui: invalid Qt Designer file: [Errno 2] No such file or directory: '/QGIS/QGIS4/profiles/default/python/plugins/changeDataSource/ui/changeDataSource_dialog_base.ui' 
Traceback (most recent call last):
  File "/usr/lib/python3.14/site-packages/PyQt6/uic/ui_file.py", line 35, in __init__
    document = ElementTree.parse(ui_file)
  File "/usr/lib/python3.14/xml/etree/ElementTree.py", line 1214, in parse
    tree.parse(source, parser)
    ~~~~~~~~~~^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.14/xml/etree/ElementTree.py", line 566, in parse
    source = open(source, "rb")
FileNotFoundError: [Errno 2] No such file or directory: '/QGIS/QGIS4/profiles/default/python/plugins/changeDataSource/ui/changeDataSource_dialog_base.ui'

Python version: 3.14.5 (main, May 10 2026, 18:26:20) [GCC 16.1.1 20260430] 
QGIS version: 4.0.2-Norrköping Norrköping, exported 

This might just be an issue of me putting the files in the wrong place: I have not developed QGIS plugins ever and was just hoping that a zip of the source folder would install.

Yet I think that the issue is only in the "refactoring" part of the PR.
In my opinion the "refactoring" and the update should have been submitted separately.
I just went back to the first commit in this PR with git checkout e432926 and the plugin works fine: thus, up until that commit, this would be an alternative to #25 .

@falkmielke falkmielke mentioned this pull request Jun 10, 2026
@nicpitsch

Copy link
Copy Markdown

+1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Upgrade to QGIS 4.0

3 participants