How to find global position of text cursor?
问题 I would like to execute a QMenu object at the position of text cursor in a QPlainTextEdit. My problem is that QTextCursor is only define by its position in the Text (index of the character). How can I find global position of the QTextCursor ? Should I use an other object than QTextCursor in order to find the position of the text cursor where I want to open my QMenu ? Thank you by advance. 回答1: I've never tried myself, but doesn't QPlainTextEdit::cursorRect() work? It should give you position