Hi,
I was wondering is it possible to change the colour of a single QChar in a QLineEdit. I'm writing a simple programme to visualise some basic cipher algorithms and during the simulation I would like it to highlight the QChar (that's part of a QString in the QLineEdit) that's currently being ciphered. Unfortunately all I was able to do is to highlight the whole text in QLineEdit with something like this:

Qt Code:
  1. QPalette palette = ui->input->palette();
  2. palette.setColor(QPalette::Text, Qt::red);
  3. ui->input->setPalette(palette);
  4. ui->input->repaint();
To copy to clipboard, switch view to plain text mode 

Where ui is my main window and input is of course the QLineEdit.

Thanks in advance for your help.