Quantcast
Channel: Jobs
Viewing all articles
Browse latest Browse all 18427

How to check if the selected word is bold or not

$
0
0
Hello, basicaly i want to check if the selected word in textEdit is bold already or not, if it’s bold, then to check the bold button, if not, don’t do anything. this is the code, what’s wrong? QTextCursor tc = ui->textEdit->textCursor();     tc.select(QTextCursor::WordUnderCursor);     if(tc.charFormat().fontWeight() == QFont::Bold) {         ui->actionBold->setChecked(true);     }

Viewing all articles
Browse latest Browse all 18427

Trending Articles