AUDIT REPORT Qt5 → Qt6 / QGIS3 → QGIS4
====================================================================================================

1. GLOBAL SUMMARY
----------------------------------------------------------------------------------------------------
Scanned folder              : C:\Users\franc\AppData\Roaming\QGIS\QGIS4\profiles\default\python\plugins\RechercheCommune
Python files found          : 7
Modified files              : 2
Files with fixes            : 8
Files with findings         : 0
Automatic replacements      : 15
Critical findings (ERROR)   : 0
Warnings (WARNING)          : 0

qt_compat source            : C:\Users\franc\AppData\Roaming\QGIS\QGIS4\profiles\default\python\plugins\scan_qt6_compat\qt_compat.py
qt_compat destination       : C:\Users\franc\AppData\Roaming\QGIS\QGIS4\profiles\default\python\plugins\RechercheCommune\qt_compat.py
qt_compat status            : copied

2. QT5 → QT6 STATISTICS
----------------------------------------------------------------------------------------------------
2.1 Automatic replacements by category

  - Centralize lupdate helper: 7
  - QPalette.Base: 3
  - Qt.SolidPattern: 3
  - Fallback TextFormat: 1
  - Fallback TextInteraction: 1
  - QPalette.Active: 1
  - QPalette.Disabled: 1
  - QPalette.Inactive: 1
  - QSizePolicy.Expanding: 1
  - QSizePolicy.Minimum: 1

2.2 Detailed fixes by applied rule

  - Enum/token replacement: 11
  - Add Qt5/Qt6-safe TS generation helper: 7
  - Remove local helper _qt_compat_build_ts_generator_command: 7
  - Ajout import modules qgis.PyQt: 1
  - Fallback TextFormat: 1
  - Fallback TextInteraction: 1
  - Increment metadata version: 1
  - Update metadata block: changelog: 1
  - Update/reposition qgisMaximumVersion: 1
  - Update/reposition supportsQt6: 1

3. REMAINING FINDINGS SUMMARY
----------------------------------------------------------------------------------------------------
No remaining findings.

4. FILE-BY-FILE AUDIT
----------------------------------------------------------------------------------------------------

FILE: __init__.py
====================================================================================================
Applied fixes       : 2
Findings ERROR      : 0
Findings WARNING    : 0

4.1 Applied fixes

Line: 1
Rule: Add Qt5/Qt6-safe TS generation helper
Before:
    [missing helper]
After:
    def _qt_compat_build_ts_generator_command(...): ...

Line: 2
Rule: Remove local helper _qt_compat_build_ts_generator_command
Before:
    def _qt_compat_build_ts_generator_command():
        import shutil
        import sys
        from pathlib import Path
        from qgis.PyQt import QtCore
    
        qt_major = int(QtCore.QT_VERSION_STR.split(".")[0])
    
        if qt_major < 6:
            return [sys.executable, "-m", "PyQt5.pylupdate_main"]
    
        for candidate in ("lupdate", "lupdate6"):
            exe = shutil.which(candidate)
            if exe:
                return [exe]
    
        prefixes = [
            Path(sys.prefix),
            Path(sys.executable).resolve().parent,
            Path(sys.executable).resolve().parent.parent,
        ]
    
        possible = []
        for prefix in prefixes:
            possible.extend([
                prefix / "Library" / "bin" / "lupdate.exe",
                prefix / "bin" / "lupdate.exe",
                prefix / "apps" / "Qt6" / "bin" / "lupdate.exe",
                prefix / "apps" / "qt6" / "bin" / "lupdate.exe",
            ])
    
        for p in possible:
            if p.exists():
                return [str(p)]
    
        raise RuntimeError(
            "No Qt6-compatible lupdate tool was found. "
            "Under QGIS 4, PyQt5.pylupdate_main must not be used."
        )
    
    
After:
    

4.2 Remaining findings

No remaining findings.


FILE: about.py
====================================================================================================
Applied fixes       : 15
Findings ERROR      : 0
Findings WARNING    : 0

4.1 Applied fixes

Line: 1
Rule: Add Qt5/Qt6-safe TS generation helper
Before:
    [missing helper]
After:
    def _qt_compat_build_ts_generator_command(...): ...

Line: 2
Rule: Remove local helper _qt_compat_build_ts_generator_command
Before:
    def _qt_compat_build_ts_generator_command():
        import shutil
        import sys
        from pathlib import Path
        from qgis.PyQt import QtCore
    
        qt_major = int(QtCore.QT_VERSION_STR.split(".")[0])
    
        if qt_major < 6:
            return [sys.executable, "-m", "PyQt5.pylupdate_main"]
    
        for candidate in ("lupdate", "lupdate6"):
            exe = shutil.which(candidate)
            if exe:
                return [exe]
    
        prefixes = [
            Path(sys.prefix),
            Path(sys.executable).resolve().parent,
            Path(sys.executable).resolve().parent.parent,
        ]
    
        possible = []
        for prefix in prefixes:
            possible.extend([
                prefix / "Library" / "bin" / "lupdate.exe",
                prefix / "bin" / "lupdate.exe",
                prefix / "apps" / "Qt6" / "bin" / "lupdate.exe",
                prefix / "apps" / "qt6" / "bin" / "lupdate.exe",
            ])
    
        for p in possible:
            if p.exists():
                return [str(p)]
    
        raise RuntimeError(
            "No Qt6-compatible lupdate tool was found. "
            "Under QGIS 4, PyQt5.pylupdate_main must not be used."
        )
    
    
After:
    

Line: 38
Rule: Fallback TextFormat
Before:
    Qt.RichText
After:
    TEXTFORMAT_RICHTEXT

Line: 48
Rule: Enum/token replacement
Before:
    Qt.SolidPattern
After:
    BRUSH_SOLID_PATTERN

Line: 49
Rule: Enum/token replacement
Before:
    QPalette.Active
After:
    PALETTE_ACTIVE

Line: 49
Rule: Enum/token replacement
Before:
    QPalette.Base
After:
    PALETTE_BASE

Line: 52
Rule: Enum/token replacement
Before:
    Qt.SolidPattern
After:
    BRUSH_SOLID_PATTERN

Line: 53
Rule: Enum/token replacement
Before:
    QPalette.Base
After:
    PALETTE_BASE

Line: 53
Rule: Enum/token replacement
Before:
    QPalette.Inactive
After:
    PALETTE_INACTIVE

Line: 56
Rule: Enum/token replacement
Before:
    Qt.SolidPattern
After:
    BRUSH_SOLID_PATTERN

Line: 57
Rule: Enum/token replacement
Before:
    QPalette.Base
After:
    PALETTE_BASE

Line: 57
Rule: Enum/token replacement
Before:
    QPalette.Disabled
After:
    PALETTE_DISABLED

Line: 66
Rule: Fallback TextInteraction
Before:
    Qt.TextBrowserInteraction
After:
    TEXT_BROWSER_INTERACTION

Line: 74
Rule: Enum/token replacement
Before:
    QSizePolicy.Expanding
After:
    SIZEPOLICY_EXPANDING

Line: 74
Rule: Enum/token replacement
Before:
    QSizePolicy.Minimum
After:
    SIZEPOLICY_MINIMUM

4.2 Remaining findings

No remaining findings.


FILE: dlgBox1.py
====================================================================================================
Applied fixes       : 3
Findings ERROR      : 0
Findings WARNING    : 0

4.1 Applied fixes

Line: 1
Rule: Add Qt5/Qt6-safe TS generation helper
Before:
    [missing helper]
After:
    def _qt_compat_build_ts_generator_command(...): ...

Line: 2
Rule: Ajout import modules qgis.PyQt
Before:
    [import qgis.PyQt absent]
After:
    from qgis.PyQt import QtCore

Line: 3
Rule: Remove local helper _qt_compat_build_ts_generator_command
Before:
    def _qt_compat_build_ts_generator_command():
        import shutil
        import sys
        from pathlib import Path
        from qgis.PyQt import QtCore
    
        qt_major = int(QtCore.QT_VERSION_STR.split(".")[0])
    
        if qt_major < 6:
            return [sys.executable, "-m", "PyQt5.pylupdate_main"]
    
        for candidate in ("lupdate", "lupdate6"):
            exe = shutil.which(candidate)
            if exe:
                return [exe]
    
        prefixes = [
            Path(sys.prefix),
            Path(sys.executable).resolve().parent,
            Path(sys.executable).resolve().parent.parent,
        ]
    
        possible = []
        for prefix in prefixes:
            possible.extend([
                prefix / "Library" / "bin" / "lupdate.exe",
                prefix / "bin" / "lupdate.exe",
                prefix / "apps" / "Qt6" / "bin" / "lupdate.exe",
                prefix / "apps" / "qt6" / "bin" / "lupdate.exe",
            ])
    
        for p in possible:
            if p.exists():
                return [str(p)]
    
        raise RuntimeError(
            "No Qt6-compatible lupdate tool was found. "
            "Under QGIS 4, PyQt5.pylupdate_main must not be used."
        )
    
    
After:
    

4.2 Remaining findings

No remaining findings.


FILE: doAbout.py
====================================================================================================
Applied fixes       : 2
Findings ERROR      : 0
Findings WARNING    : 0

4.1 Applied fixes

Line: 1
Rule: Add Qt5/Qt6-safe TS generation helper
Before:
    [missing helper]
After:
    def _qt_compat_build_ts_generator_command(...): ...

Line: 2
Rule: Remove local helper _qt_compat_build_ts_generator_command
Before:
    def _qt_compat_build_ts_generator_command():
        import shutil
        import sys
        from pathlib import Path
        from qgis.PyQt import QtCore
    
        qt_major = int(QtCore.QT_VERSION_STR.split(".")[0])
    
        if qt_major < 6:
            return [sys.executable, "-m", "PyQt5.pylupdate_main"]
    
        for candidate in ("lupdate", "lupdate6"):
            exe = shutil.which(candidate)
            if exe:
                return [exe]
    
        prefixes = [
            Path(sys.prefix),
            Path(sys.executable).resolve().parent,
            Path(sys.executable).resolve().parent.parent,
        ]
    
        possible = []
        for prefix in prefixes:
            possible.extend([
                prefix / "Library" / "bin" / "lupdate.exe",
                prefix / "bin" / "lupdate.exe",
                prefix / "apps" / "Qt6" / "bin" / "lupdate.exe",
                prefix / "apps" / "qt6" / "bin" / "lupdate.exe",
            ])
    
        for p in possible:
            if p.exists():
                return [str(p)]
    
        raise RuntimeError(
            "No Qt6-compatible lupdate tool was found. "
            "Under QGIS 4, PyQt5.pylupdate_main must not be used."
        )
    
    
After:
    

4.2 Remaining findings

No remaining findings.


FILE: doDlgBox1.py
====================================================================================================
Applied fixes       : 2
Findings ERROR      : 0
Findings WARNING    : 0

4.1 Applied fixes

Line: 1
Rule: Add Qt5/Qt6-safe TS generation helper
Before:
    [missing helper]
After:
    def _qt_compat_build_ts_generator_command(...): ...

Line: 2
Rule: Remove local helper _qt_compat_build_ts_generator_command
Before:
    def _qt_compat_build_ts_generator_command():
        import shutil
        import sys
        from pathlib import Path
        from qgis.PyQt import QtCore
    
        qt_major = int(QtCore.QT_VERSION_STR.split(".")[0])
    
        if qt_major < 6:
            return [sys.executable, "-m", "PyQt5.pylupdate_main"]
    
        for candidate in ("lupdate", "lupdate6"):
            exe = shutil.which(candidate)
            if exe:
                return [exe]
    
        prefixes = [
            Path(sys.prefix),
            Path(sys.executable).resolve().parent,
            Path(sys.executable).resolve().parent.parent,
        ]
    
        possible = []
        for prefix in prefixes:
            possible.extend([
                prefix / "Library" / "bin" / "lupdate.exe",
                prefix / "bin" / "lupdate.exe",
                prefix / "apps" / "Qt6" / "bin" / "lupdate.exe",
                prefix / "apps" / "qt6" / "bin" / "lupdate.exe",
            ])
    
        for p in possible:
            if p.exists():
                return [str(p)]
    
        raise RuntimeError(
            "No Qt6-compatible lupdate tool was found. "
            "Under QGIS 4, PyQt5.pylupdate_main must not be used."
        )
    
    
After:
    

4.2 Remaining findings

No remaining findings.


FILE: fonctions_localisercommune.py
====================================================================================================
Applied fixes       : 2
Findings ERROR      : 0
Findings WARNING    : 0

4.1 Applied fixes

Line: 1
Rule: Add Qt5/Qt6-safe TS generation helper
Before:
    [missing helper]
After:
    def _qt_compat_build_ts_generator_command(...): ...

Line: 2
Rule: Remove local helper _qt_compat_build_ts_generator_command
Before:
    def _qt_compat_build_ts_generator_command():
        import shutil
        import sys
        from pathlib import Path
        from qgis.PyQt import QtCore
    
        qt_major = int(QtCore.QT_VERSION_STR.split(".")[0])
    
        if qt_major < 6:
            return [sys.executable, "-m", "PyQt5.pylupdate_main"]
    
        for candidate in ("lupdate", "lupdate6"):
            exe = shutil.which(candidate)
            if exe:
                return [exe]
    
        prefixes = [
            Path(sys.prefix),
            Path(sys.executable).resolve().parent,
            Path(sys.executable).resolve().parent.parent,
        ]
    
        possible = []
        for prefix in prefixes:
            possible.extend([
                prefix / "Library" / "bin" / "lupdate.exe",
                prefix / "bin" / "lupdate.exe",
                prefix / "apps" / "Qt6" / "bin" / "lupdate.exe",
                prefix / "apps" / "qt6" / "bin" / "lupdate.exe",
            ])
    
        for p in possible:
            if p.exists():
                return [str(p)]
    
        raise RuntimeError(
            "No Qt6-compatible lupdate tool was found. "
            "Under QGIS 4, PyQt5.pylupdate_main must not be used."
        )
    
    
After:
    

4.2 Remaining findings

No remaining findings.


FILE: metadata.txt
====================================================================================================
Applied fixes       : 4
Findings ERROR      : 0
Findings WARNING    : 0

4.1 Applied fixes

Line: 6
Rule: Update/reposition qgisMaximumVersion
Before:
    qgisMaximumVersion=4.99
After:
    qgisMaximumVersion = 4.99

Line: 7
Rule: Update/reposition supportsQt6
Before:
    supportsQt6=True
After:
    supportsQt6 = True

Line: 10
Rule: Increment metadata version
Before:
    version=6.2
After:
    version = 6.2.1

Line: 20
Rule: Update metadata block: changelog
Before:
    changelog=6.2 Mise en conformité du fonctionnement conjoint Qt5 ou Qt6 (détection automatique)
     6.1.1 Corrections d'erreurs dans le fichier COMMUNE_avec_etendues.csv suite à signalement OFB 69
     6.1 Correction de l'adaptation de l'icone à la résolution de l'écran
     6.0.5 et 6.0.6 Corrections d'erreurs dans le fichier COMMUNE_avec_etendues.csv
     6.0.4 Prise en compte des DOM-TOM
     6.0.3 Au changement du choix de région, sélection automatique du premier département et de la première commune dans la liste alphabétique.
     6.0.2 Ajout de portions de code permettant la conservation du choix de la région, du département et de la commune, d'une session à l'autre.
     6.0.1 Suppression des importations de code inutiles, simplifications de code
     6.0.0 Reprise pour Qgis V3, normalisation UTF-8 et mise à jour 2020 du fichier des communes
After:
    changelog = 6.2.1 : Mise en conformité conjointe Qgis3/Qgis4 - Plugin scan_qt6_compat
     6.2 Mise en conformité du fonctionnement conjoint Qt5 ou Qt6 (détection automatique)
     6.1.1 Corrections d'erreurs dans le fichier COMMUNE_avec_etendues.csv suite à signalement OFB 69
     6.1 Correction de l'adaptation de l'icone à la résolution de l'écran
     6.0.5 et 6.0.6 Corrections d'erreurs dans le fichier COMMUNE_avec_etendues.csv
     6.0.4 Prise en compte des DOM-TOM
     6.0.3 Au changement du choix de région, sélection automatique du premier département et de la première commune dans la liste alphabétique.
     6.0.2 Ajout de portions de code permettant la conservation du choix de la région, du département et de la commune, d'une session à l'autre.
     6.0.1 Suppression des importations de code inutiles, simplifications de code
     6.0.0 Reprise pour Qgis V3, normalisation UTF-8 et mise à jour 2020 du fichier des communes

4.2 Remaining findings

No remaining findings.


FILE: RechercheCommune.py
====================================================================================================
Applied fixes       : 2
Findings ERROR      : 0
Findings WARNING    : 0

4.1 Applied fixes

Line: 1
Rule: Add Qt5/Qt6-safe TS generation helper
Before:
    [missing helper]
After:
    def _qt_compat_build_ts_generator_command(...): ...

Line: 2
Rule: Remove local helper _qt_compat_build_ts_generator_command
Before:
    def _qt_compat_build_ts_generator_command():
        import shutil
        import sys
        from pathlib import Path
        from qgis.PyQt import QtCore
    
        qt_major = int(QtCore.QT_VERSION_STR.split(".")[0])
    
        if qt_major < 6:
            return [sys.executable, "-m", "PyQt5.pylupdate_main"]
    
        for candidate in ("lupdate", "lupdate6"):
            exe = shutil.which(candidate)
            if exe:
                return [exe]
    
        prefixes = [
            Path(sys.prefix),
            Path(sys.executable).resolve().parent,
            Path(sys.executable).resolve().parent.parent,
        ]
    
        possible = []
        for prefix in prefixes:
            possible.extend([
                prefix / "Library" / "bin" / "lupdate.exe",
                prefix / "bin" / "lupdate.exe",
                prefix / "apps" / "Qt6" / "bin" / "lupdate.exe",
                prefix / "apps" / "qt6" / "bin" / "lupdate.exe",
            ])
    
        for p in possible:
            if p.exists():
                return [str(p)]
    
        raise RuntimeError(
            "No Qt6-compatible lupdate tool was found. "
            "Under QGIS 4, PyQt5.pylupdate_main must not be used."
        )
    
    
After:
    

4.2 Remaining findings

No remaining findings.


5. ANNEX - COMPACT REPLACEMENTS SUMMARY
----------------------------------------------------------------------------------------------------

Centralize lupdate helper : 7 -> remove local _qt_compat_build_ts_generator_command
Fallback TextFormat : 1 -> Qt.RichText -> TEXTFORMAT_RICHTEXT
Fallback TextInteraction : 1 -> Qt.TextBrowserInteraction -> TEXT_BROWSER_INTERACTION
QPalette.Active : 1 -> PALETTE_ACTIVE
QPalette.Base : 3 -> PALETTE_BASE
QPalette.Disabled : 1 -> PALETTE_DISABLED
QPalette.Inactive : 1 -> PALETTE_INACTIVE
QSizePolicy.Expanding : 1 -> SIZEPOLICY_EXPANDING
QSizePolicy.Minimum : 1 -> SIZEPOLICY_MINIMUM
Qt.SolidPattern : 3 -> BRUSH_SOLID_PATTERN


====================================================================================================
PLUGIN RELOAD
====================================================================================================
Plugin reloaded: RechercheCommune
Python code was reloaded.
Plugin marked as enabled in QSettings: RechercheCommune
Plugin manager metadata reloaded. Close and reopen the Plugins window if it is already open.
UI refresh: processEvents OK | Main window refresh OK | Plugin manager interface update failed: 'QgsPluginManagerInterface' object has no attribute 'update'
If the Plugins window is already open, close and reopen it.
A QGIS restart may still be required for some fields in the plugin manager.
