I want get text color from plain text. i can get fontWeight and other format with charFormat() but when i debug foreground color, it's set to no color!!?
Please Help Me ....
sample code:
QTextCursor c = textCursor();
QTextCharFormat result = c.charFormat();
if (result.fontWeight() == QFont::Bold)
qDebug() << "bold text"; //worked
else if (result.fontWeight() == QFont::Normal)
qDebug() << "normal text"; //worked
if (result.foreground().color() == Qt::green)
qDebug() << "green"; //not worked !!
else if (result.foreground().color() == Qt::blue)
qDebug() << "blue"; //not worked !!
else
qDebug() << "no color !!";
TNX