thank you for your reply, wysota. yes that works!!
here is my code for anyone who had a similar problem.

Qt Code:
  1. class TextView(QtGui.QTextEdit):
  2. def __init__(self,Ui_MainWindow, parent=None):
  3. QtGui.QTextEdit.__init__(self, parent)
  4. self.setReadOnly(True)
  5. self.setAcceptRichText(True)
  6. def insert(self, string,emoticonList):
  7. cursor = self.textCursor()
  8. if not emoticonList:
  9. cursor.insertText(string)
  10. else:
  11. ls = shlex.split(str(string))
  12. for word in ls:
  13. for emoticon in emoticonList[:]:
  14. if word == emoticon:
  15. path = "image/emoticons/" + word
  16. icon = QtGui.QPixmap(path)
  17. image = icon.toImage()
  18. cursor.insertImage(image)
  19. else:
  20. cursor.insertText(word + " ")
  21. self.setTextCursor(cursor)
  22. end = "<br>"
  23. fragment = QtGui.QTextDocumentFragment.fromHtml(end)
  24. self.textCursor().insertFragment(fragment)
  25. def insertReceiveMessage(self, msg):
  26. cursor = self.textCursor()
  27. cursor.insertText(msg)
  28. self.setTextCursor(cursor)
  29. end = "<br>"
  30. fragment = QtGui.QTextDocumentFragment.fromHtml(end)
  31. self.textCursor().insertFragment(fragment)
To copy to clipboard, switch view to plain text mode 

thank you so much, wysota!