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:
QPalette palette
= ui
->input
->palette
();
palette.
setColor(QPalette::Text, Qt
::red);
ui->input->setPalette(palette);
ui->input->repaint();
QPalette palette = ui->input->palette();
palette.setColor(QPalette::Text, Qt::red);
ui->input->setPalette(palette);
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.
Bookmarks