[pyqt5toqt6] Warn on compiled resource usage

This commit is contained in:
Nyall Dawson 2024-02-20 14:52:53 +10:00
parent b369f1e1b0
commit c4342425eb

View File

@ -327,6 +327,11 @@ def fix_file(filename: str, qgis3_compat: bool) -> int:
for name in node.names:
if name.name in import_warnings:
print(f'{filename}: {import_warnings[name.name]}')
if name.name == 'resources_rc':
sys.stderr.write(
f'{filename}:{_node.lineno}:{_node.col_offset} WARNING: support for compiled resources '
'is removed in Qt6. Directly load icon resources by file path and load UI fields using '
'uic.loadUiType by file path instead.\n')
if _node.module == 'qgis.PyQt.Qt':
extra_imports['qgis.PyQt.QtCore'].update({'Qt'})
removed_imports['qgis.PyQt.Qt'].update({'Qt'})