Clarify validity of image returned from QPlatformBackingStore::toImage()

The backingstore may reconfigure the internal data, so clients should
not assume that the image is valid beyond any new operations on the
backingstore.

Pick-to: 6.2
Change-Id: I137ad4f2adb45ec8bb78a989fbb5bac1e72965ce
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
bb10
Tor Arne Vestbø 2021-11-17 13:37:08 +01:00
parent 71f75bf6c5
commit 3cc1a32f97
1 changed files with 5 additions and 0 deletions

View File

@ -217,12 +217,17 @@ void QPlatformBackingStore::composeAndFlush(QWindow *window, const QRegion &regi
If QPlatformIntegration::RasterGLSurface is supported, either this function or
toTexture() must be implemented.
The returned image is only valid until the next operation (resize, paint, scroll,
or flush) on the backingstore. The caller must not store the return value between
calls, but instead call this function before each use, or make an explicit copy.
\sa toTexture()
*/
QImage QPlatformBackingStore::toImage() const
{
return QImage();
}
#ifndef QT_NO_OPENGL
/*!
May be reimplemented in subclasses to return the content of the