Version 2024.1 of Dragonfly introduces a new version of Qt (and PyQt): 6.4. This means that PyQt code of user written plugins and additions must be migrated to this version of Qt, from Qt5 to Qt6.

Qt have their own migration instructions:, they should be read and understood before tackling the Dragonfly changes.

Here are the broad lines of what needs to be done, in the Dragonfly context.


All import statements must be changed, from PyQt5 to PyQt6, for example:

from PyQt5.QtCore import QObject


from PyQt6.QtCore import QObject

These changes are easily handled with a single search and replace command.


PyQt made a significant change in their enum/constant handling.

Code like this:

if self.ui.checkShowScalebar.checkState() == Qt.Checked:

needs to be changed so:

if self.ui.checkShowScalebar.checkState() == Qt.CheckState.Checked:

Most of the Enums can be found here: Unfortunately, it's impossible to handle these changes with a single search and replace command.

Other changes

All other changes are already outlined in the Qt documentation, but normally the above covers most situations. 

This exercise is usually very empirical: you run the code, and inspect the console/logs looking for errors.