Home:ALL Converter>How to get the cursor position in a cell of QTableWidget

How to get the cursor position in a cell of QTableWidget

Ask Time:2020-06-07T05:28:54         Author:Quizard

Json Formatter

I have a QTableWidget and I need to know the position of the cursor in a cell.

For QLineEdit there exists a function QLineEdit::cursorPosition( ).

Is there something similar for a cell in a QTableWidget or for a QTableWidgetItem? Or any other method how I can find out the cursor position of the currentItem?

enter image description here

I hope it gets clearer with this picture. I have entered the cell item of row 27 and started to edit the cell item. The blinking cursor is between the second and the third Hallo. I want to find out at which position this blinking cursor is in the cell (same as for QLineEdit::cursorPosition)

Author:Quizard,eproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/62238239/how-to-get-the-cursor-position-in-a-cell-of-qtablewidget
yy