Migrate Your Plugin to QGIS 4

TL;DR

To make your plugin appear in the QGIS 4 Ready Plugins list, simply set qgisMaximumVersion=4.99 (or higher) in your metadata.txt.

Updating Plugin Code for QGIS 4

QGIS 4 uses Qt 6 which requires code changes in plugins. See the QGIS wiki page Plugin migration to be compatible with Qt5 and Qt6 for details, tips and tools.

The rest of this page is not about Python code changes, but describes how to get your plugin listed as QGIS 4 compatible in the plugin repository.

Compatibility by Version Range

QGIS version compatibility is determined simply from the range given by the qgisMinimumVersion and the qgisMaximumVersion (optional) fields in metadata.txt. If qgisMaximumVersion is not set, then compability is assumed up to end of the major version line set by qgisMinimumVersion. A plugin version is shown in the QGIS 4 Ready Plugins list if the qgisMinimumVersion is ≥4.0 or the qgisMaximumVersion field is ≥4.0. To mark a QGIS 3 compatible plugin to be QGIS 4 as well, keep the existing qgisMinimumVersion=3.xx and add qgisMaximumVersion=4.99.

Examples:

  • qgisMinimumVersion=3.22, qgisMaximumVersion=4.99 → Listed for QGIS 3.22+ and QGIS 4.x
  • qgisMinimumVersion=4.0, qgisMaximumVersion=4.99 → Listed for QGIS 4.x only
  • qgisMinimumVersion=3.22, qgisMaximumVersion=3.99 → Not listed for QGIS 4 (QGIS 3 only)
Deprecated Temporary supportsQt6=True Flag

During the QGIS 4 pre-release period, a temporary metadata flag called supportsQt6 was introduced to let plugin authors signal that their plugin was compatible with Qt 6 and QGIS 4. Plugin authors were encouraged to add supportsQt6=True to their metadata.txt.

Following the changes described in qgis/QGIS#65146 and qgis/QGIS#65168, the supportsQt6 flag has been removed from QGIS core and is no longer recognised. Declaring supportsQt6=True in your metadata has no effect and plugins that relied solely on this flag to appear in the QGIS 4 plugin list have been removed from that list.

How to Update Your Plugin
  1. Update metadata.txt

    Open your metadata.txt and make the following changes:

    [general]
    # Set qgisMaximumVersion to cover QGIS 4.x
    qgisMaximumVersion=4.99
    
    # Remove or delete this line — it is no longer used:
    # supportsQt6=True
  2. Verify Qt 6 / PyQGIS 4 compatibility

    Before bumping your plugin's compatibility to QGIS 4, make sure it actually works with QGIS 4. Key things to check:

    • Replace any deprecated Qt 5-only APIs with their Qt 6 equivalents.
    • Replace PyQt5 imports with PyQt6 (or better yet, use the QGIS-provided qgis.PyQt compatibility shim).
    • Test your plugin with a QGIS 4 nightly or release build.

    You can find helpful tips and helper tools on the QGIS wiki page Plugin migration to be compatible with Qt5 and Qt6

  3. Upload a new version

    Upload the updated plugin package on the QGIS Plugins repository. Your plugin will appear in the QGIS 4 Ready Plugins list once the upload is approved.

Further Reading

QGIS sustaining members

Flagship membership


Flagship membership


Large membership


Large membership


Large membership


Large membership


Large membership


Large membership


Large membership


Large membership


Large membership


Large membership