Results 1 to 15 of 15

Thread: std formatted string with QTextEdit

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Mar 2009
    Posts
    5
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: std formatted string with QTextEdit

    What exactly happens ? Does it help if you set a fixed-width font (such as courier new) for the QTextEdit ?

  2. #2
    Join Date
    Sep 2007
    Location
    Pune, India
    Posts
    60
    Thanks
    7
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: std formatted string with QTextEdit

    Hi,
    In my app, it is not setting the fixed width font with QTextEdit so I am not able to get the output as I could see using std::cout.
    If you tried to test above code you will see the difference between the expected output & actualt output.

  3. #3
    Join Date
    Jan 2010
    Posts
    73
    Thanks
    6
    Thanked 8 Times in 8 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: std formatted string with QTextEdit

    Quote Originally Posted by nileshsince1980 View Post
    Hi,
    In my app, it is not setting the fixed width font with QTextEdit so I am not able to get the output as I could see using std::cout.
    If you tried to test above code you will see the difference between the expected output & actualt output.
    Have you considered using tabs between columns rather than spaces? You can then use setTabStopWidth to set the tab width if it is not appropriate.

  4. #4
    Join Date
    Sep 2007
    Location
    Pune, India
    Posts
    60
    Thanks
    7
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: std formatted string with QTextEdit

    Hi Pitonyak,
    thanks for reply.
    I tried usinbg QTextStream class ..but still I am not able to see formatting as per expected for QTextEdit class.
    If you tried the output on command window using cout or qDebug and in QTextEdit you will able to see the difference.
    e.g. Using cout
    Values Keyword/Constant
    One One
    Three Three
    Four Four

    but in QTextEdit class
    Values Keyword/Constant
    One One
    Three Three
    Four Four

    The column width is not setting propertly for QTextWidth.

  5. #5
    Join Date
    Jan 2010
    Posts
    73
    Thanks
    6
    Thanked 8 Times in 8 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: std formatted string with QTextEdit

    I do not have an example handy that allows me to check a column width... I just looked where I expected to see such a thing.

Similar Threads

  1. Replies: 4
    Last Post: 21st June 2009, 18:06
  2. std:string how to change into system:string?
    By yunpeng880 in forum Qt Programming
    Replies: 1
    Last Post: 14th April 2009, 08:51
  3. Drawing Rich Formatted Text with QPainter
    By millsks in forum Qt Programming
    Replies: 1
    Last Post: 5th March 2009, 19:59
  4. Int to String - manipulating string
    By mickey in forum General Programming
    Replies: 6
    Last Post: 5th November 2007, 20:11
  5. formatted text in QTreeWidgetItem
    By swiety in forum Qt Programming
    Replies: 1
    Last Post: 30th October 2007, 16: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.