Resolved myself.
At ubuntu it's ok to to with before.
Qt Code:
  1. tempEdit.grab().save("temp.png");
To copy to clipboard, switch view to plain text mode 
But at windows grab should be done from viewport
Qt Code:
  1. tempEdit.viewport()->grab().save("temp.png");
To copy to clipboard, switch view to plain text mode