Unsolved What kinds of widgets can be larger than screen?
-
When I resize a QWidget to be larger than screen, it only expands to the size of screen. But other QWidget-derived widgets such as QWebEngineView, can be larger than screen size. I wonder what kinds of widgets can be larger than screen, or is there some method/function I can use to set a widget larger than screen?
-
Hi,
What OS ?
If Linux, what window manager ?Depending on the window manager, you have some helper actions that will automatically resize your window to the screen.
If you want to make it bigger:
- By mouse, drag the window to be partly outside of the screen and continue to resize it.
- By code, just set its size to what you want.
Out of curiosity, why do you want to make your window explicitly bigger than your screen ?
-
I'm on WIndows.
I can not even drag the window larger than screen. The resize() function does not work, either.
I want to take a full web page screenshot by calling the render function of the widget, and the full web page is larger than screen, so I need to resize the widget containing QWebEngineView to be larger than screen.
-
@yetanotherqtfan Maybe you could use https://doc.qt.io/qt-5/qwebenginepage.html#print instead of taking a screenshot?
-
@jsulm said in What kinds of widgets can be larger than screen?:
@yetanotherqtfan Maybe you could use https://doc.qt.io/qt-5/qwebenginepage.html#print instead of taking a screenshot?
the print function is used to print to a pdf, right? but I need to save to an image.
-
@yetanotherqtfan said in What kinds of widgets can be larger than screen?:
but I need to save to an image
Take a look at https://forum.qt.io/topic/58570/print-or-take-a-screen-of-a-qwidget-in-order-to-put-it-in-a-qtextdocument/3
You don't need a screenshot, just render your widget into a QPixmap and save it as a file. -
@jsulm said in What kinds of widgets can be larger than screen?:
@yetanotherqtfan said in What kinds of widgets can be larger than screen?:
but I need to save to an image
Take a look at https://forum.qt.io/topic/58570/print-or-take-a-screen-of-a-qwidget-in-order-to-put-it-in-a-qtextdocument/3
You don't need a screenshot, just render your widget into a QPixmap and save it as a file.I made a mistake, QWebEngineView can not be larger than screen, either. If the content of a web page is larger than the QWebEngineView widget, the QWebEngineView widget will have scroll bars. render() only saves part of the web page to image.