Qt framebuffer plugin: Do not use deprecated QPixmap::grabWindow(), use QScreen::grabWindow() instead
Review Request #129722 - Created Dec. 29, 2016 and submitted
Qt framebuffer plugin: Do not use deprecated QPixmap::grabWindow(), use QScreen::grabWindow() instead.
Fixes this warning displayed in terminal:
"this function is deprecated, use QScreen::grabWindow() instead. Defaulting to primary screen."
Compiles, installs, works as before, but without deprecation warning.
If we assume that QGuiAppliaction::primaryScreen() can return null (and it can only be so if Qt does not know about any screens at all, if there are no monitors connected to a PC, I guess?), then we cannot take any screenshots at all and also we have to protect several class member variables from null pointer access. Also we can store pointer to primary screen in classs member variable to avoid unnecessary function call QGuiApplication::primaryScreen() in function QtFrameBuffer::updateFrameBuffer() at each iteration.
Revision 2 (+18 -5)