Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-2795

Wrong cursor position when editing Arabic text and inserting numerical characters (TSW: HHES-7ZLE4Y)

XMLWordPrintable

    • e084fbbe18d771702312d7db65030aaaf18b596b

      When a text field contains Arabic text and one inserts numerical characters at the end of the text, the cursor position after typing the first numerical character is wrong, on subsequent numerical character input the cursor position is correct.

      Run the following example. It will open a QTextEdit and a QLineEdit. Add a digit to each of them to see two different behaviors.

      #include <QtGui>
      
      int main(int argc, char **argv)
      {
          QApplication app(argc, argv);
      
          QLineEdit lineEdit;
          lineEdit.setText(QString::fromUtf8("الجزيرة نت"));
          lineEdit.setLayoutDirection(Qt::RightToLeft);
          lineEdit.show();
      
          QTextEdit textEdit;
          textEdit.setPlainText(lineEdit.text());
          textEdit.setLayoutDirection(Qt::RightToLeft);
          textEdit.show();
      
          return app.exec();
      }
      

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            jiang Jiang Jiang
            admin Administrator
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes