grab() QTextEdit is different between linux and windows
I've changed the background color of QTextEdit throught setStyleSheet().
Code:
tempEdit.setStyleSheet( "background-color:black;" );
and render()
Code:
tempEdit.render(&resultPixmap);
or grab()
Code:
tempEdit.grab().save("temp.png");
It worked perfectly at Ubuntu 18. (temp.png was saved just the way it looked)
But background color was NOT changed at windows 10. It keeps white background. never changed.
setPalette() is not what I want. I want change the currently looking style of QTextEdit.
Can I get an advice?
---
QT version is 5.12.0
Re: grab() QTextEdit is different between linux and windows
Resolved myself.
At ubuntu it's ok to to with before.
Code:
tempEdit.grab().save("temp.png");
But at windows grab should be done from viewport
Code:
tempEdit.viewport()->grab().save("temp.png");