I am using QTextEdit in my project
I want to change the Font of the text edit area when user clicks on a button. I am using QTextEdit::setCurrentFont() function for this purpose. But, in order to change the font, the user has to first select some text in the textedit area. The font of the whole textedit changes only after selecting some text and then changing the font.
Is there any way to avoid having to select the text to change font? I want the font to change even if the user has not selected any text.
I have also tried this...but, no use..
QTextCharFormat Format = cursor->charFormat()
Format.setFontWeight(QFont::Bold);
cursor->setCharFormat(Format);
Thank you..
I solved the problem..actually the problem arisen because I set the cursor to the end of the textedit
area for each key event inorder to bring up the scroll bar when the cursor goes out of visibility.. the scroll bar was not automatically appearing because Qt resizes the QTexEdit
area. Hence I had to bring up scroll bar this way..
Now, the problem is solved since I made the QTexEdit
area as fixed size.. :)