After customizing the legend, the exported png/pdf/svg is incorrect #59456
Labels
Bug
Either a bug report, or a bug fix. Let's hope for the latter!
Print Layouts
Related to QGIS Print Layouts, Atlas or Reporting frameworks
PyQGIS
Related to the PyQGIS API
What is the bug or the crash?
I used
QgsPointClusterRenderer
and embedded aQgsRuleBasedRenderer
to modify the point layer. But when outputting the layout, it put the text and the set offset and other styles into the legend.qgis version: 3.40.0-Bratislava
OS version Windows 11 Version 2009
Qt version: 5.15.13
Python version: 3.12.7
So, I wrote a custom legend method to filter out the redundant FontMarker from the custom symbol of the legend element.
Finally, I opened the generated qgz file with qgis, and it looked correct, there is no problem if you export through the qgis layout interface. But, in the pyqgis the only problem is that when exporting png/pdf/svg, it still carries the FontMarker that has not been filtered out.
export code:
this is export png:
Steps to reproduce the issue
pyqgis
Versions
qgis version: 3.40.0-Bratislava
OS version Windows 11 Version 2009
Qt version: 5.15.13
Python version: 3.12.7
Supported QGIS version
New profile
Additional context
No response
The text was updated successfully, but these errors were encountered: