Results 1 to 3 of 3

Thread: In a QTableVew, how to get text to flow into the adjacent cell?

  1. #1
    Join Date
    Jan 2011
    Posts
    7
    Qt products
    Qt4
    Platforms
    Windows

    Default In a QTableVew, how to get text to flow into the adjacent cell?

    Hi,

    In Excel, if I do this:
    * open a new, blank spreadsheet
    * write "foo" in cell B1
    * write "this is a long sentence" in cell A1
    I can see:
    * in cell A1: "this is a lo"
    * in cell B1: "foo"

    Then, if I delete the text ("foo") from cell B1, the text that was entered into A1 is now entirely visible:
    * in cell A1: "this is a lo"
    * in cell B1: "ng text"

    Now, how could one get this behaviour in a QTableView?

    I have tried severay things (such as setTextElideMode()), but in all cases the text entered in a cell that does not fit into it never shows up in the adjacent, textless cell. So, in the Excel example above, when cell B1 has no text, cell A1 would show "this is a lo", and cell B1 would show nothing.

    Is there a simple way (that I missed) to get this behaviour in a QTableView?

    I use Qt 4.6.2 on Windows.

    -- dave

  2. #2
    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: In a QTableVew, how to get text to flow into the adjacent cell?

    Is QTableView::setSpan() what you are looking for?

  3. #3
    Join Date
    Jan 2011
    Posts
    7
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: In a QTableVew, how to get text to flow into the adjacent cell?

    Yes, that's it

    Thanks!

    -- dave

Similar Threads

  1. Replies: 1
    Last Post: 29th January 2010, 11:17
  2. Long text inside a table cell
    By TheKing in forum Qwt
    Replies: 0
    Last Post: 15th December 2009, 20:35
  3. highlightation of table cell only upto the text area
    By sam_er83 in forum Qt Programming
    Replies: 0
    Last Post: 15th September 2009, 15:03
  4. Different text styles in a single cell of QTableView?
    By xfurrier in forum Qt Programming
    Replies: 2
    Last Post: 23rd August 2009, 06:49
  5. how to merge two adjacent grids of a QTableWidget into one?
    By bookmarkernj in forum Qt Programming
    Replies: 3
    Last Post: 7th July 2007, 17:20

Tags for this Thread

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.