Create a QImage then pass it to the QWidget::render() method.
Create a QImage then pass it to the QWidget::render() method.
<=== The Great Pumpkin says ===>
Please use CODE tags when posting source code so it is more readable. Click "Go Advanced" and then the "#" icon to insert the tags. Paste your code between them.
Thanks for your reply, d_stranz.
So, I'm get False when I run my code. What did I miss?
Qt Code:
myWidget = getActiveWidget() # just returns the widget myWidget.render(pix) pix.save(file)To copy to clipboard, switch view to plain text mode
Thanks!
You probably need to create the QImage with the correct size and format before you can render to it.
<=== The Great Pumpkin says ===>
Please use CODE tags when posting source code so it is more readable. Click "Go Advanced" and then the "#" icon to insert the tags. Paste your code between them.
Yup! That was it. Thank you.
Qt Code:
To copy to clipboard, switch view to plain text mode
Turns out the widget was a QGLWidget.
I came across another issue that I'd hoping to get help with. I used .grabFrameBuffer() and was successful in getting the widget to save. The issue I have now is it's only saves what is visible- the items cutoff by the widget is not rendered to file.
It does show all the nodes in the little preview on the bottom right corner, even though its beyond the QGLWidget , so it does know it exists.
Is there a way to render everything that is on the widget, and not just what is visible ?
Thanks,
Nick
Bookmarks