Results 1 to 3 of 3

Thread: Correct spacing of a text in QT Creator using QTextEdit

  1. #1
    Join Date
    Jan 2017
    Posts
    1
    Qt products
    Qt5
    Platforms
    Unix/X11

    Default Correct spacing of a text in QT Creator using QTextEdit

    I am trying to allign some text and show it via QTextEdit but I'm not sure how to do it properly .
    I realized that the space in QT creator doesnt take as much as a normal character and I guess there's where I have problems because I can space it well in c/c++ using this:

    Qt Code:
    1. snprintf(BufInterm1,100,"%-25s",BufferPPart); - %-25s
    To copy to clipboard, switch view to plain text mode 

    However, when I send it to QT, it's not displayed proper. Any idea how I can space it well ?

    This is how I'm showing it:

    Qt Code:
    1. ui->MersulText->setText(MersSosiri);
    To copy to clipboard, switch view to plain text mode 

    I've tried different fonts but none work unfortunately

    LAST EDIT: Fixed it, it can be closed
    Last edited by gimv30; 23rd January 2017 at 14:31.

  2. #2
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,714
    Thanks
    21
    Thanked 418 Times in 411 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: Correct spacing of a text in QT Creator using QTextEdit

    LAST EDIT: Fixed it, it can be closed
    It would be nice if you could share your solution so others who may search for this problem as well might benefit from your solutions as well.
    ==========================signature=============== ==================
    S.O.L.I.D principles (use them!):
    https://en.wikipedia.org/wiki/SOLID_...iented_design)

    Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.

  3. #3
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: Correct spacing of a text in QT Creator using QTextEdit

    Likely just set a monospace font on the text edit (e.g. Courier or Liberation Sans Mono) after trying proportional fonts (most of them)

Similar Threads

  1. spacing between icon and text
    By mrchumley in forum Newbie
    Replies: 2
    Last Post: 21st May 2012, 11:19
  2. How can we set line spacing in Qtextedit control?
    By pratik041 in forum Qt Programming
    Replies: 0
    Last Post: 24th January 2012, 04:41
  3. How to Make Qt Creator use the correct GDB on OSX
    By mark100net in forum Qt Tools
    Replies: 0
    Last Post: 4th December 2011, 08:21
  4. Line spacing in QTextEdit/QTextBrowser
    By Valheru in forum Qt Programming
    Replies: 5
    Last Post: 10th November 2010, 13:47
  5. Replies: 12
    Last Post: 30th May 2009, 14:29

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.