Change page setup in composer window using the QGIS API

المشرف العام

Administrator
طاقم الإدارة
Is it possible to use the QGIS API to change the orientation within page setup in the composer window.

We have a plugin that builds a map template based on user defined options. When they choose to print portrait maps page setup defaults to landscape.

I have trying adding this snippet of code to the plugin but that does not seem to do anything - perhaps it just changes the orientation of the map item?

# Set orientation resText = self.ui.orientationComboBox.currentText() if resText.startswith('Portrait'): orient = 0 else: #Landscape orient = 1 composerView.composition().PaperOrientation(orient)​

أكثر...
 
أعلى