PDA

View Full Version : QPlainTextEdit char format?



jajdoo
26th July 2010, 11:53
im trying to check if a certain character is in a specific color (i used a highlighter to color them according to some rules)

i tried all sorts of routes but i always get no color..

for instance:
( i = block index, j=character index)


...
blockText = document()->findBlockByNumber(i).text();
for( int j=0; j<blockText.size(); j++)
{
QTextCursor c = textCursor();
c.setPosition(document()->findBlockByNumber(i).position()+j);
QColor q = c.charFormat().foreground().color();
....


why?