Results 1 to 5 of 5

Thread: NOT to wrap the text

  1. #1
    Join Date
    Dec 2023
    Posts
    2
    Qt products
    Platforms
    Unix/X11

    Default NOT to wrap the text

    Hi,
    When I create QTextTable and fill it with data, text with spaces is sometimes wrapped into lines - even when there is still horizontal room to contain all cells in row without word-wrapping. How to persuade the widget (maybe QTextCursor or another class?) NOT to wrap the text?
    Or maybe it's possible to replace spaces in text to a kind of non-breaking spaces, which will be understood by widget/cursor ?
    Any solution is needed.
    regards

  2. #2
    Join Date
    Dec 2023
    Posts
    2
    Qt products
    Platforms
    Unix/X11

    Default Re: NOT to wrap the text

    Any idea?

  3. #3
    Join Date
    Jul 2008
    Location
    Germany
    Posts
    517
    Thanks
    12
    Thanked 77 Times in 75 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: NOT to wrap the text


  4. #4
    Join Date
    Nov 2024
    Posts
    1
    Platforms
    Windows

    Default Re: NOT to wrap the text

    One thing you can try is setting the QTextTableFormat to prevent wrapping or use QTextCharFormat for individual cells. Not sure about replacing spaces with non-breaking ones, but might help if you play with setWordWrap() and table settings.
    Last edited by d_stranz; 21st November 2024 at 18:48. Reason: removed URL
    ~Collins~

  5. #5
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    5,304
    Thanks
    313
    Thanked 870 Times in 857 Posts
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: NOT to wrap the text

    @CCollins: no spamming in your signature or anywhere else.
    <=== The Great Pumpkin says ===>
    Please use CODE tags when posting source code so it is more readable. Click "Go Advanced" and then the "#" icon to insert the tags. Paste your code between them.

Similar Threads

  1. How to wrap the text in QPainter
    By duck88 in forum Qt Programming
    Replies: 4
    Last Post: 29th July 2014, 15:25
  2. How to Wrap the text in QTableView
    By mythili in forum Qt Programming
    Replies: 10
    Last Post: 8th May 2013, 14:15
  3. Replies: 2
    Last Post: 9th April 2013, 07:26
  4. text indent with wrap
    By linuxsong in forum Qt Quick
    Replies: 1
    Last Post: 26th July 2011, 15:14
  5. Wrap Text in PUSHBUTTON
    By BalaQT in forum Qt Programming
    Replies: 2
    Last Post: 16th September 2009, 14:54

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.