Skip to content

Commit 1a3beec

Browse files
authored
Merge pull request #288 from kannes/improve-qgis4-migration
Correctly document compatibility rules for QGIS 4 plugin migration
2 parents 642fe39 + fa2af1e commit 1a3beec

File tree

1 file changed

+64
-22
lines changed

1 file changed

+64
-22
lines changed

qgis-app/templates/flatpages/docs_migrate_qgis4.html

Lines changed: 64 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -14,40 +14,47 @@ <h4>{% trans "Migrate Your Plugin to QGIS 4" %}</h4>
1414
{% blocktrans trimmed %}
1515
To make your plugin appear in the
1616
<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.
17+
<code>qgisMaximumVersion=4.99</code> (or higher) in your <code>metadata.txt</code>.
1918
{% endblocktrans %}
2019
</p>
2120
</div>
2221

23-
<h5>{% trans "Background" %}</h5>
22+
<h5>{% trans "Updating Plugin Code for QGIS 4" %}</h5>
2423
<p>
2524
{% 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>.
25+
QGIS 4 uses Qt 6 which requires code changes in plugins. See the
26+
<a href="https://github.com/qgis/QGIS/wiki/"
27+
target="_blank" rel="noopener">
28+
QGIS wiki
29+
</a>
30+
page
31+
<a href="https://github.com/qgis/QGIS/wiki/Plugin-migration-to-be-compatible-with-Qt5-and-Qt6"
32+
target="_blank" rel="noopener">
33+
Plugin migration to be compatible with Qt5 and Qt6
34+
</a>
35+
for details, tips and tools.
3036
{% endblocktrans %}
3137
</p>
3238
<p>
3339
{% 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.
40+
The rest of <em>this</em> page is not about Python code changes, but describes
41+
how to get your plugin listed as QGIS 4 compatible in the plugin repository.
4142
{% endblocktrans %}
4243
</p>
4344

44-
<h5>{% trans "The New Rule: qgisMaximumVersion" %}</h5>
45+
<h5>{% trans "Compatibility by Version Range" %}</h5>
4546
<p>
4647
{% 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 &ge; 4.0</code>.
48+
QGIS version compatibility is determined simply from the range given by the
49+
<code>qgisMinimumVersion</code> and the <code>qgisMaximumVersion</code> (optional) fields
50+
in <code class="is-size-7 has-text-weight-semibold">metadata.txt</code>.
51+
If <code>qgisMaximumVersion</code> is not set, then compability is assumed up to end of the
52+
<em>major version</em> line set by <code>qgisMinimumVersion</code>.
53+
A plugin version is shown in the <a href="/plugins/new_qgis_ready/">QGIS 4 Ready Plugins</a>
54+
list if the <code>qgisMinimumVersion</code> is <code>&ge;4.0</code> or the
55+
<code>qgisMaximumVersion</code> field is <code>&ge;4.0</code>.
56+
To mark a QGIS 3 compatible plugin to be QGIS 4 as well, keep the existing
57+
<code>qgisMinimumVersion=3.xx</code> and add <code>qgisMaximumVersion=4.99</code>.
5158
{% endblocktrans %}
5259
</p>
5360
<p>{% trans "Examples:" %}</p>
@@ -63,10 +70,31 @@ <h5>{% trans "The New Rule: qgisMaximumVersion" %}</h5>
6370
</li>
6471
<li>
6572
<code>qgisMinimumVersion=3.22</code>, <code>qgisMaximumVersion=3.99</code>
66-
&rarr; {% trans "Not listed (QGIS 3 only)" %}
73+
&rarr; {% trans "Not listed for QGIS 4 (QGIS 3 only)" %}
6774
</li>
6875
</ul>
6976
</div>
77+
78+
<h5>{% trans "Deprecated Temporary <code>supportsQt6=True</code> Flag" %}</h5>
79+
<p>
80+
{% blocktrans trimmed %}
81+
During the QGIS 4 pre-release period, a temporary metadata flag called
82+
<code>supportsQt6</code> was introduced to let plugin authors signal that their plugin
83+
was compatible with Qt 6 and QGIS 4. Plugin authors were encouraged to add
84+
<code>supportsQt6=True</code> to their <code>metadata.txt</code>.
85+
{% endblocktrans %}
86+
</p>
87+
<p>
88+
{% blocktrans trimmed %}
89+
Following the changes described in
90+
<a href="https://github.com/qgis/QGIS/pull/65146" target="_blank" rel="noopener">qgis/QGIS#65146</a>
91+
and <a href="https://github.com/qgis/QGIS/pull/65168" target="_blank" rel="noopener">qgis/QGIS#65168</a>,
92+
the <code>supportsQt6</code> flag has been <strong>removed from QGIS core</strong> and is
93+
<strong>no longer recognised</strong>. Declaring <code>supportsQt6=True</code> in your metadata has
94+
no effect and plugins that relied solely on this flag to appear in the QGIS 4 plugin list have been
95+
removed from that list.
96+
{% endblocktrans %}
97+
</p>
7098

7199
<h5>{% trans "How to Update Your Plugin" %}</h5>
72100
<div class="content">
@@ -85,17 +113,31 @@ <h5>{% trans "How to Update Your Plugin" %}</h5>
85113
<strong>{% trans "Verify Qt 6 / PyQGIS 4 compatibility" %}</strong>
86114
<p>
87115
{% blocktrans trimmed %}
88-
Before bumping <code>qgisMaximumVersion</code>, make sure your plugin actually works
116+
Before bumping your plugin's compatibility to QGIS 4, make sure it actually works
89117
with QGIS 4. Key things to check:
90118
{% endblocktrans %}
91119
</p>
92120
<div class="content">
93121
<ul>
94122
<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>
123+
<li>{% trans "Replace <code>PyQt5</code> imports with <code>PyQt6</code> (or better yet, use the QGIS-provided <code>qgis.PyQt</code> compatibility shim)." %}</li>
96124
<li>{% trans "Test your plugin with a QGIS 4 nightly or release build." %}</li>
97125
</ul>
98126
</div>
127+
<p>
128+
{% blocktrans trimmed %}
129+
You can find helpful tips and helper tools on the
130+
<a href="https://github.com/qgis/QGIS/wiki/"
131+
target="_blank" rel="noopener">
132+
QGIS wiki
133+
</a>
134+
page
135+
<a href="https://github.com/qgis/QGIS/wiki/Plugin-migration-to-be-compatible-with-Qt5-and-Qt6"
136+
target="_blank" rel="noopener">
137+
Plugin migration to be compatible with Qt5 and Qt6
138+
</a>
139+
{% endblocktrans %}
140+
</p>
99141
</li>
100142
<li>
101143
<strong>{% trans "Upload a new version" %}</strong>

0 commit comments

Comments
 (0)