Skip to content

Commit

Permalink
Go back to the old FeatureFormSuppress to support older QGIS (#1115)
Browse files Browse the repository at this point in the history
Fixes #1090
LTS is 3.28, the new enum is only from QGIS 3.32.
  • Loading branch information
visr authored Feb 12, 2024
1 parent a39cc24 commit 11a9719
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions ribasim_qgis/widgets/ribasim_widget.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@

from PyQt5.QtWidgets import QTabWidget, QVBoxLayout, QWidget
from qgis.core import (
Qgis,
QgsAbstractVectorLayerLabeling,
QgsCoordinateReferenceSystem,
QgsEditFormConfig,
QgsFeatureRenderer,
QgsLayerTreeGroup,
QgsMapLayer,
Expand Down Expand Up @@ -172,10 +172,11 @@ def add_layer(
assert maplayer is not None
if suppress is not None:
config = maplayer.editFormConfig()
# From QGIS 3.32 on we can use https://github.com/Deltares/Ribasim/commit/8a22fc0630f343069fd3c285ae46e9fde0c71a32
config.setSuppress(
Qgis.AttributeFormSuppression.On
QgsEditFormConfig.FeatureFormSuppress.SuppressOn # type: ignore
if suppress
else Qgis.AttributeFormSuppression.Default
else QgsEditFormConfig.FeatureFormSuppress.SuppressDefault # type: ignore
)
maplayer.setEditFormConfig(config)
if renderer is not None:
Expand Down

0 comments on commit 11a9719

Please sign in to comment.