Results 1 to 3 of 3

Thread: Spaces in QTextEdit

  1. #1
    Join Date
    Nov 2007
    Posts
    16
    Thanks
    1
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Spaces in QTextEdit

    Hello,

    I'm trying to get a thin space that is the same (relative) width in a variety of different fonts so that when I format and markup a document (using spaces and thin spaces) and then change the font, the formatting isn't all messed up. Ideally, I would like a space that is always 1/4 of the width of a normal space in every font, but unicode doesn't seem to support such a space. Thin space, et. al. in unicode all have drastically different widths depending on the fonts used. Is there any way in a QTextEdit to insert a space of a specified number of pixels? Any other ideas? Thanks.

  2. #2
    Join Date
    Jan 2006
    Location
    Alingsås, Sweden
    Posts
    437
    Thanks
    3
    Thanked 39 Times in 39 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Spaces in QTextEdit

    Your issue sounds very specialized - perhaps you need to write your own rendering widget.

    For the text edit, try adding a white image between each word and specify a width. You can add images using pseudo-html.

  3. #3
    Join Date
    May 2009
    Posts
    62
    Thanks
    2
    Thanked 16 Times in 15 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Spaces in QTextEdit

    Unicode supports spaces with different widths. Another question is if the font of QTextEdit will handle them correctly.

Similar Threads

  1. QTextEdit Performance handling large paragraphs
    By netuno in forum Qt Programming
    Replies: 14
    Last Post: 1st September 2010, 22:58
  2. Drawing on QTextEdit
    By jgrauman in forum Qt Programming
    Replies: 3
    Last Post: 7th February 2009, 09:40
  3. QTextEdit slow to insert text
    By thomaspu in forum Qt Programming
    Replies: 4
    Last Post: 10th January 2008, 12:05
  4. Spaces between lines in QTextEdit
    By troorl_ua in forum Qt Programming
    Replies: 1
    Last Post: 3rd July 2007, 00:06
  5. 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.