Skip to content

Commit

Permalink
QRIS plugin fails to load for older versions of QGiS #522
Browse files Browse the repository at this point in the history
  • Loading branch information
KellyMWhitehead committed Oct 25, 2024
1 parent 50c48f9 commit f5e9ae2
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/view/frm_dockwidget.py
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,12 @@ def __init__(self, iface, parent=None):
self.qrave = None

ltv: QgsLayerTreeView = iface.layerTreeView()
ltv.contextMenuAboutToShow.connect(self.add_context_batch_edit_attributes)
# workaround for QGIS < 3.32
if hasattr(ltv, 'contextMenuAboutToShow'):
ltv.contextMenuAboutToShow.connect(self.add_context_batch_edit_attributes)
else:
version = Qgis.QGIS_VERSION
QgsMessageLog().logMessage(f'The Batch QGiS Attribute Editor Tool has been disabled because QGIS version {version} does not support the contextMenuAboutToShow method. Upgrade to QGIS Version 3.32 or greater to enable this tool.', 'QRiS', level=Qgis.Warning)

def build_tree_view(self, project_file, new_item=None):
"""
Expand Down

0 comments on commit f5e9ae2

Please sign in to comment.