Results 1 to 2 of 2

Thread: Determining QTextBlock font

  1. #1
    Join Date
    Jul 2010
    Location
    United States
    Posts
    13
    Thanks
    4
    Qt products
    Platforms
    Unix/X11 Windows

    Default Determining QTextBlock font

    I have a qtextblock with multiple different fonts inside of it, I would like to go through each character in the block and determine its font name, size, bold, etc. I have tried using qtextblock's charFormat().font() but it returns one general font despite having different fonts inside the block.

    Is what I am trying to do even possible?

    Thanks,
    Scott

  2. #2
    Join Date
    Jan 2006
    Location
    Germany
    Posts
    4,380
    Thanks
    19
    Thanked 1,005 Times in 913 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows Symbian S60
    Wiki edits
    5

    Default Re: Determining QTextBlock font

    You have to iterate over the QTextFragment's inside your block. The fragments contains the specific font informations.

Similar Threads

  1. Replies: 2
    Last Post: 13th March 2010, 21:42
  2. QTextBlock::setVisible()
    By jgrauman in forum Qt Programming
    Replies: 3
    Last Post: 11th December 2009, 01:06
  3. Accessing the current QTextBlock in QSyntaxHighlighter
    By lorebett in forum Qt Programming
    Replies: 16
    Last Post: 11th December 2008, 21:45
  4. QTextEdit and QTextBlock
    By Garfeild in forum Qt Programming
    Replies: 10
    Last Post: 26th April 2008, 10:32
  5. Parse QTextBlock from QTextDocument problem
    By patrik08 in forum Qt Programming
    Replies: 0
    Last Post: 5th April 2008, 08:26

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
  •  
Qt is a trademark of The Qt Company.