Quantcast
Channel: Installation and Deployment
Viewing all articles
Browse latest Browse all 22112

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 22112

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>