Bug report #20401

QgsLayoutItemLegend::adjustBoxSize does not work for legend created from pyqgis

Added by Peter Petrik over 5 years ago.

Category:Map Composer/Printing
Affected QGIS version:3.4.0 Regression?:No
Operating System: Easy fix?:No
Pull Request or Patch supplied:No Resolution:
Crashes QGIS or corrupts data:No Copied to github as #:28221


When QgsLayoutItemLegend is created directly from plugin, adjustBoxSize does not work. So when positioning the item, the size is always 0 and if can fall of the visible screen.

Maybe worth to add dpi parameter to adjustBoxSize and do not force to call paint() manually?

Possible workaround here:

Also available in: Atom PDF