PDA

View Full Version : How to get CharFormat from each char



Pablik
16th July 2012, 20:58
hi, i need get CharFormat () from each char in QTextEdit, but i dont know how.

If i will know method who selectChar(int Char), then will by lock some like that:


for(int i=0; i<ui->TextEdit->toPlaintext.lenght(); i++)
{
selectChar(i);
currentCharFormat ()// and here return charFormat()
}

wysota
16th July 2012, 21:51
QTextCursor::setPosition(), QTextCursor::charFormat()

amleto
16th July 2012, 22:07
quite how you couldnt manage to figure that out from this (http://www.qtforum.org/article/38233/qplainttextedit-and-setfont-to-selected-char.html?b916b7b2) I dont know