Skip to content

Fix QGIS 4 compatibility: replace removed PyQt6.Qt monolithic import#91

Draft
Copilot wants to merge 4 commits intomainfrom
copilot/fix-qgis-4-compatibility
Draft

Fix QGIS 4 compatibility: replace removed PyQt6.Qt monolithic import#91
Copilot wants to merge 4 commits intomainfrom
copilot/fix-qgis-4-compatibility

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 8, 2026

The plugin fails to load in QGIS 4 because PyQt6.Qt — the monolithic convenience module from PyQt5 — no longer exists in PyQt6.

Change

Replace the invalid import in dlg_settings.py with the correct PyQt6-compatible (and PyQt5-compatible) sub-module:

# Before (breaks QGIS 4 / PyQt6)
from qgis.PyQt.Qt import QUrl

# After
from qgis.PyQt.QtCore import QUrl

QUrl has always resided in QtCore; the old import only worked because PyQt5.Qt re-exported the entire Qt namespace as a shortcut.

Copilot AI linked an issue Apr 8, 2026 that may be closed by this pull request
2 tasks
Copilot AI changed the title [WIP] Fix QGIS 4 support for loopstructural plugin Fix QGIS 4 compatibility: replace removed PyQt6.Qt monolithic import Apr 8, 2026
Copilot AI requested a review from lachlangrose April 8, 2026 04:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

QGIS 4 not supported

2 participants