Hello!

when entering in a qlineedit I wish to set the cursor on the position where the click was done...

here is my code:

Qt Code:
  1. QPoint myPosition = this->mapFromGlobal(mouseClickPosition);
  2. int txtCursorToSet = cursorPositionAt(myPosition );
  3. setCursorPosition(txtCursorToSet);
To copy to clipboard, switch view to plain text mode 

This work only when the alignment() is Qt::AlignLeft... What should I do to get the same result with Qt::AlignHCenter and Qt::AlignRight?