Qt 6.11 is out! See what's new in the release
blog
Taking screenshot in qt application
-
I want to create a push button for taking a screenshot.
In QT, how can i take a screenshot in my app? -
You could take screenshot from classic C++:
https://stackoverflow.com/questions/50359643/c-screen-capture-how-to-read-the-bitmapAnd use (with HBITMAP, don't delete hBitmap Object before you use this):
QImage image = QtWin::fromHBITMAP(hBitmap).toImage(); -
You can try
QScreen::grabWindow():
https://doc.qt.io/qt-6/qscreen.html#grabWindow