PDA

View Full Version : QTextEdit setCurrentFont() for entire document



sunil.thaha
8th August 2006, 15:11
Hi,

I need to set a font for the entire document in QTextEdit.

Presently this is what i do

1 store current selection
2. select all
3. setCurrentFont( QFont( fontName ) );
4. restore selection

is there a better method. i.e with out selectAll()

FYI: I am using PlainText Mode

jpn
8th August 2006, 15:25
Change it the same way you do for any widget, QWidget::setFont() (http://doc.trolltech.com/3.3/qwidget.html#setFont).

sunil.thaha
9th August 2006, 06:21
Change it the same way you do for any widget, QWidget::setFont() (http://doc.trolltech.com/3.3/qwidget.html#setFont).


It's Obselete
I am using 3.3.4 and the doc says that

sunil.thaha
9th August 2006, 07:53
Very sorry,

I did not read the doc correctly. :-(

I found the font function obselete and found another funtion currentFont()
thought that setFont is also obselete