I've changed the background color of QTextEdit throught setStyleSheet().
tempEdit.setStyleSheet( "background-color:black;" );
QTextEdit tempEdit;
tempEdit.setStyleSheet( "background-color:black;" );
To copy to clipboard, switch view to plain text mode
and render()
tempEdit.render(&resultPixmap);
QPixmap resultPixmap( QSize(640, 480) );
tempEdit.render(&resultPixmap);
To copy to clipboard, switch view to plain text mode
or grab()
tempEdit.grab().save("temp.png");
tempEdit.grab().save("temp.png");
To copy to clipboard, switch view to plain text mode
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
Bookmarks