Results 1 to 3 of 3

Thread: Python QTextEdit and character size

  1. #1
    Join Date
    May 2018
    Posts
    6

    Default Python QTextEdit and character size

    Hello everybody,

    I am doing a small software with PyQt.
    In this software I use a QtextEdit to summarize some of my data.
    Data are organized in lines and colums but not in a table, just as a text.
    For example, like this

    Data_1 Data_2 ...
    AAA BBBB ...
    CCC DDDD ...

    The thing is that, in the QTextEdit, characters do not seem to have the same length.
    Because of this, my data are totally unorganized and it is impossible to see the columns.
    Do you know if there is a way to avoid this?

    Thank you very much for your help.
    FroZ

  2. #2
    Join Date
    Jul 2008
    Location
    Germany
    Posts
    503
    Thanks
    11
    Thanked 76 Times in 74 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Python QTextEdit and character size

    Hi, I think a monospaced font should help.
    Another option would be to really use a QTableWidget, and split the data into rows and colums. This would also allow some more features like sorting the columns.

    Ginsengelf

  3. #3
    Join Date
    May 2018
    Posts
    6

    Default Re: Python QTextEdit and character size

    Ok, I did not know there was fonts with same character size and other with different character size.
    Thank you, it worked by using courier font.

Similar Threads

  1. tab character in QTextEdit
    By johnmauer in forum Qt Programming
    Replies: 0
    Last Post: 1st November 2010, 17:17
  2. QTextEdit: prevent the insertion of some character.
    By bred in forum Qt Programming
    Replies: 3
    Last Post: 18th October 2010, 16:13
  3. QTextEdit End-of-Line character
    By smhall316 in forum Newbie
    Replies: 1
    Last Post: 29th September 2010, 19:28
  4. How to get current character from QTextEdit
    By iamjayanth in forum Qt Programming
    Replies: 2
    Last Post: 6th April 2009, 09:05
  5. QTextEdit and Form Feed character
    By gvlaovic in forum Qt Programming
    Replies: 1
    Last Post: 15th September 2007, 13:37

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.