I'm going to write a script in python 3 that will build some graph/diagram/chart in a window (or scroll area) (previously created in Qt Designer 5 and converted into *.py). Probably the graph will be bigger than screen size (like 2k x 3k pixels). How can I save a snapshot picture of that graph?
For example.
- User loads data and changes some settings.
- Python builds graph.
- User clicks "save snapshot".
- Python saves graphsnapshot.png.
- End.
UP1. Forgot to add. Graph is a code-generated combination of progressbars, labels, horizontal and vertical lines etc.
UP2. Proposed solution is for PyQt4. But I use PyQt5, where commands grabWidget and grabWindow are obsolete and aren't recommended to use.
Obsolete Members for QPixmap. The following members of class QPixmap are obsolete. They are provided to keep old source code working. We strongly advise against using them in new code.