Results 1 to 4 of 4

Thread: QTextEdit setCurrentFont() for entire document

  1. #1
    Join Date
    Jan 2006
    Location
    Kerala
    Posts
    371
    Thanks
    76
    Thanked 37 Times in 32 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default QTextEdit setCurrentFont() for entire document

    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
    We can't solve problems by using the same kind of thinking we used when we created them

  2. #2
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: QTextEdit setCurrentFont() for entire document

    Change it the same way you do for any widget, QWidget::setFont().
    J-P Nurmi

  3. #3
    Join Date
    Jan 2006
    Location
    Kerala
    Posts
    371
    Thanks
    76
    Thanked 37 Times in 32 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QTextEdit setCurrentFont() for entire document

    Quote Originally Posted by jpn
    Change it the same way you do for any widget, QWidget::setFont().

    It's Obselete
    I am using 3.3.4 and the doc says that
    We can't solve problems by using the same kind of thinking we used when we created them

  4. #4
    Join Date
    Jan 2006
    Location
    Kerala
    Posts
    371
    Thanks
    76
    Thanked 37 Times in 32 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QTextEdit setCurrentFont() for entire document

    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
    We can't solve problems by using the same kind of thinking we used when we created them

Similar Threads

  1. QTextEdit API questions (plain text)
    By Gaspar in forum Qt Programming
    Replies: 4
    Last Post: 16th May 2006, 06:03

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.