Hello,

I am using PyQwt, and I have some issues for saving charts.
Here is my code :

Qt Code:
  1. def saveChart(self):
  2. fileName = QtGui.QFileDialog.getSaveFileName(self, 'Export File Name', 'JPGgraph', 'JPG Documents (*.jpg)')
  3. if not fileName.isEmpty():
  4. if not fileName.toLower().endsWith('.jpg'):
  5. fileName += '.jpg'
  6. currentPlot = self.plots[self.graphComboBox.currentIndex()].plot
  7. filtre = QwtPlotPrintFilter()
  8. screen = QtGui.QPixmap.grabWidget(currentPlot)
  9. #screen.fill(QtCore.Qt.white)
  10. #print currentPlot.size()
  11. #print currentPlot.rect()
  12. #print currentPlot.sizeHint()
  13. #print currentPlot.minimumSizeHint()
  14. currentPlot.print_(screen, filtre)
  15. screen.save(fileName, "JPG", -1)
To copy to clipboard, switch view to plain text mode 

I have several QwtPlot in a QStackWidget, which is in a QHorizontalLayout, which is in a QWidget which is the central widget of my QMainWindow.

When I try to save on of my chart, either the width is higher than the height or the height is higher than the width.
The result is :

Or :


Someone know what I should do to solve this issue ?

Thanks in advance,

Cédric