Skip to content

Commit

Permalink
Merge pull request #11 from opengisch/hasChecked
Browse files Browse the repository at this point in the history
Enable MapThemes group checking with QGIS 3.30
  • Loading branch information
signedav authored Dec 15, 2022
2 parents ce5b014 + 684c1ca commit bb3d7e0
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions toppingmaker/projecttopping.py
Original file line number Diff line number Diff line change
Expand Up @@ -401,13 +401,13 @@ def make_items(
maptheme_item[expanded_groupnode] = {}
maptheme_item[expanded_groupnode]["group"] = True
maptheme_item[expanded_groupnode]["expanded"] = True
# setHasCheckedStateInfo(True) is not available in the API, what makes it impossible to control the checked state of a group
# see https://github.com/SebastienPeillet/QGIS/commit/736e46daa640b8a9c66107b4f05319d6d2534ac5#discussion_r1037225879
for checked_groupnode in maptheme_record.checkedGroupNodes():
if checked_groupnode not in maptheme_item:
maptheme_item[checked_groupnode] = {}
maptheme_item[checked_groupnode]["group"] = True
maptheme_item[checked_groupnode]["checked"] = True
if Qgis.QGIS_VERSION_INT >= 33000:
if maptheme_record.hasCheckedStateInfo():
for checked_groupnode in maptheme_record.checkedGroupNodes():
if checked_groupnode not in maptheme_item:
maptheme_item[checked_groupnode] = {}
maptheme_item[checked_groupnode]["group"] = True
maptheme_item[checked_groupnode]["checked"] = True

self[name] = maptheme_item

Expand Down

0 comments on commit bb3d7e0

Please sign in to comment.