Important: Please read the Qt Code of Conduct -

Get what is pressed inside QTextEdit

  • I am trying to get what has been pressed inside a QTextEdit. More specifically I am trying to get if the user pressed on one of the edges of a cell of a table inside the QTextEdit. I can do this on the web using simple JS but since QTextEdit cannot use JS I am forced to use other methods. I cannot find anything on the internet about resizing a table inside QTextEdit using your cursor.

    I am thinking that I have to map out where the cursor pressed and then count the height of the characters and the height of the cells on that Y-axis and then see if the cursor is in an interval of a cell wall and then take the width of all characters as well as the padding and margin into account to see if the cursor is in the X-axis interval of a cell wall? Anybody got another idea since this will take hours, possibly days, to code and is quite ugly. If it is possible.