|
| 1 | +{% extends 'flatpages/docs.html' %} |
| 2 | +{% load i18n %} |
| 3 | + |
| 4 | +{% block content %} |
| 5 | +<div class="responsive-content"> |
| 6 | + <h4>{% trans "Migrate Your Plugin to QGIS 4" %}</h4> |
| 7 | + |
| 8 | + <div class="notification is-info is-light"> |
| 9 | + <span class="icon-text"> |
| 10 | + <span class="icon"><i class="fas fa-info-circle"></i></span> |
| 11 | + <span><strong>{% trans "TL;DR" %}</strong></span> |
| 12 | + </span> |
| 13 | + <p class="mt-1"> |
| 14 | + {% blocktrans trimmed %} |
| 15 | + To make your plugin appear in the |
| 16 | + <a href="/plugins/new_qgis_ready/">QGIS 4 Ready Plugins</a> list, simply set |
| 17 | + <code>qgisMaximumVersion=4.99</code> (or higher) in your <code>metadata.txt</code> |
| 18 | + and remove the deprecated <code>supportsQt6</code> flag. |
| 19 | + {% endblocktrans %} |
| 20 | + </p> |
| 21 | + </div> |
| 22 | + |
| 23 | + <h5>{% trans "Background" %}</h5> |
| 24 | + <p> |
| 25 | + {% blocktrans trimmed %} |
| 26 | + During the QGIS 4 pre-release period, a temporary metadata flag called |
| 27 | + <code>supportsQt6</code> was introduced to let plugin authors signal that their plugin |
| 28 | + was compatible with Qt 6 and QGIS 4. Plugin authors were encouraged to add |
| 29 | + <code>supportsQt6=True</code> to their <code>metadata.txt</code>. |
| 30 | + {% endblocktrans %} |
| 31 | + </p> |
| 32 | + <p> |
| 33 | + {% blocktrans trimmed %} |
| 34 | + Following the changes described in |
| 35 | + <a href="https://github.com/qgis/QGIS/pull/65146" target="_blank" rel="noopener">qgis/QGIS#65146</a> |
| 36 | + and <a href="https://github.com/qgis/QGIS/pull/65168" target="_blank" rel="noopener">qgis/QGIS#65168</a>, |
| 37 | + the <code>supportsQt6</code> flag has been <strong>removed from QGIS core</strong> and is |
| 38 | + <strong>no longer recognised</strong>. Declaring <code>supportsQt6=True</code> in your metadata has |
| 39 | + no effect and plugins that relied solely on this flag to appear in the QGIS 4 plugin list have been |
| 40 | + removed from that list. |
| 41 | + {% endblocktrans %} |
| 42 | + </p> |
| 43 | + |
| 44 | + <h5>{% trans "The New Rule: qgisMaximumVersion" %}</h5> |
| 45 | + <p> |
| 46 | + {% blocktrans trimmed %} |
| 47 | + QGIS 4 compatibility is now determined exclusively by the <code>qgisMaximumVersion</code> field |
| 48 | + in <code class="is-size-7 has-text-weight-semibold">metadata.txt</code>. A plugin version is shown in the |
| 49 | + <a href="/plugins/new_qgis_ready/">QGIS 4 Ready Plugins</a> list when |
| 50 | + <code>qgisMaximumVersion ≥ 4.0</code>. |
| 51 | + {% endblocktrans %} |
| 52 | + </p> |
| 53 | + <p>{% trans "Examples:" %}</p> |
| 54 | + <div class="content"> |
| 55 | + <ul> |
| 56 | + <li> |
| 57 | + <code>qgisMinimumVersion=3.22</code>, <code>qgisMaximumVersion=4.99</code> |
| 58 | + → {% trans "Listed for QGIS 3.22+ <strong>and</strong> QGIS 4.x" %} |
| 59 | + </li> |
| 60 | + <li> |
| 61 | + <code>qgisMinimumVersion=4.0</code>, <code>qgisMaximumVersion=4.99</code> |
| 62 | + → {% trans "Listed for QGIS 4.x only" %} |
| 63 | + </li> |
| 64 | + <li> |
| 65 | + <code>qgisMinimumVersion=3.22</code>, <code>qgisMaximumVersion=3.99</code> |
| 66 | + → {% trans "Not listed (QGIS 3 only)" %} |
| 67 | + </li> |
| 68 | + </ul> |
| 69 | + </div> |
| 70 | + |
| 71 | + <h5>{% trans "How to Update Your Plugin" %}</h5> |
| 72 | + <div class="content"> |
| 73 | + <ol> |
| 74 | + <li> |
| 75 | + <strong>{% trans "Update metadata.txt" %}</strong> |
| 76 | + <p>{% trans "Open your <code>metadata.txt</code> and make the following changes:" %}</p> |
| 77 | + <pre><code>[general] |
| 78 | +# Set qgisMaximumVersion to cover QGIS 4.x |
| 79 | +qgisMaximumVersion=4.99 |
| 80 | + |
| 81 | +# Remove or delete this line — it is no longer used: |
| 82 | +# supportsQt6=True</code></pre> |
| 83 | + </li> |
| 84 | + <li> |
| 85 | + <strong>{% trans "Verify Qt 6 / PyQGIS 4 compatibility" %}</strong> |
| 86 | + <p> |
| 87 | + {% blocktrans trimmed %} |
| 88 | + Before bumping <code>qgisMaximumVersion</code>, make sure your plugin actually works |
| 89 | + with QGIS 4. Key things to check: |
| 90 | + {% endblocktrans %} |
| 91 | + </p> |
| 92 | + <div class="content"> |
| 93 | + <ul> |
| 94 | + <li>{% trans "Replace any deprecated Qt 5-only APIs with their Qt 6 equivalents." %}</li> |
| 95 | + <li>{% trans "Replace <code>PyQt5</code> imports with <code>PyQt6</code> (or use the QGIS-provided compatibility shim)." %}</li> |
| 96 | + <li>{% trans "Test your plugin with a QGIS 4 nightly or release build." %}</li> |
| 97 | + </ul> |
| 98 | + </div> |
| 99 | + </li> |
| 100 | + <li> |
| 101 | + <strong>{% trans "Upload a new version" %}</strong> |
| 102 | + <p> |
| 103 | + {% blocktrans trimmed %} |
| 104 | + Upload the updated plugin package on the |
| 105 | + <a href="/plugins/">QGIS Plugins repository</a>. |
| 106 | + Your plugin will appear in the |
| 107 | + <a href="/plugins/new_qgis_ready/">QGIS 4 Ready Plugins</a> list once the upload |
| 108 | + is approved. |
| 109 | + {% endblocktrans %} |
| 110 | + </p> |
| 111 | + </li> |
| 112 | + </ol> |
| 113 | + </div> |
| 114 | + |
| 115 | + <h5>{% trans "Further Reading" %}</h5> |
| 116 | + <div class="content"> |
| 117 | + <ul> |
| 118 | + <li> |
| 119 | + <a href="https://github.com/qgis/QGIS/wiki/Plugin-migration-to-be-compatible-with-Qt5-and-Qt6" |
| 120 | + target="_blank" rel="noopener"> |
| 121 | + {% trans "QGIS Wiki: Plugin migration to be compatible with Qt5 and Qt6" %} |
| 122 | + </a> |
| 123 | + </li> |
| 124 | + <li> |
| 125 | + <a href="https://github.com/qgis/QGIS/pull/65146" target="_blank" rel="noopener"> |
| 126 | + {% trans "GitHub PR #65146 – Remove supportsQt6 from QGIS core" %} |
| 127 | + </a> |
| 128 | + </li> |
| 129 | + <li> |
| 130 | + <a href="https://github.com/qgis/QGIS-Documentation/pull/10804" target="_blank" rel="noopener"> |
| 131 | + {% trans "QGIS Documentation PR #10804 – Remove outdated supportsQt6 references" %} |
| 132 | + </a> |
| 133 | + </li> |
| 134 | + <li> |
| 135 | + <a href="https://plugins.qgis.org/plugins/new_qgis_ready/"> |
| 136 | + {% trans "QGIS 4 Ready Plugins list" %} |
| 137 | + </a> |
| 138 | + </li> |
| 139 | + </ul> |
| 140 | + </div> |
| 141 | +</div> |
| 142 | +{% endblock %} |
0 commit comments