Results 1 to 3 of 3

Thread: How to exploit all the space on QTableWidget cells

  1. #1
    Join Date
    May 2013
    Posts
    2
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Windows

    Default How to exploit all the space on QTableWidget cells

    When we put some text on QTableWidget cells some blank pixels are put by QT at left and right of it

    In fact, when the user resizes the QTableWidget column it happens that (I describe what happens when the text is horizontally centered):

    1) if the text is a single character, it is moved while a few blank pixels are retined at its left an right. Eventually, the one-character text disappears beyond the cell's border (even though the space available would still be sufficient for displaying it)
    2) it the text is two or more characters, if it cannot be entirely displayed (along with a few blank pixels) it is first displayed as ellypsis "...", then disappears.

    I want to exploit all the space available on my cells: therefore I want to reduce (or even set to zero) the number of blank pixels at left and right side of my text, and forbid the substitution of text with ellypsis.

    Does anyone know how to do this?

    Thanks a lot.

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: How to exploit all the space on QTableWidget cells

    Implement a custom delegate.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  3. #3
    Join Date
    May 2013
    Posts
    2
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Windows

    Default Re: How to exploit all the space on QTableWidget cells

    It looks like a bit difficult for my current skills. I will study documentation on delegates and try.
    Thanks, anyway.

Similar Threads

  1. QTableWidget exclusive cells
    By bwnicewo in forum Qt Programming
    Replies: 1
    Last Post: 30th May 2012, 00:25
  2. [How to ?] Writing QTableWidget cells.
    By Rewo in forum Newbie
    Replies: 6
    Last Post: 4th April 2010, 11:00
  3. read QTableWidget cells
    By navid in forum Newbie
    Replies: 8
    Last Post: 4th April 2010, 10:40
  4. Merging cells in QTableWidget
    By lyucs in forum Newbie
    Replies: 1
    Last Post: 22nd January 2010, 19:15
  5. Focus of cells in a QTableWidget
    By SailinShoes in forum Qt Programming
    Replies: 4
    Last Post: 9th June 2008, 08:19

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.