'PYQT Taking a screenshot of a hidden QWidget

I have a QTabWidget with different tabs. I want to take a screenshot of a hidden tab.

I found out how to create a screenshot of the tab if it's selected now. The problem is that I want to be able to do that even if another tab was selected.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source