Results 1 to 7 of 7

Thread: QListView Text Elide Like QListWidget

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jun 2009
    Posts
    5
    Thanks
    1
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: QListView Text Elide Like QListWidget

    Yeah It does the trick in an even sexier way ! Dunno why I didn't thought putting a gridSize bigger than my icons width Thanks again !

  2. #2
    Join Date
    Oct 2006
    Location
    New Delhi, India
    Posts
    2,467
    Thanks
    8
    Thanked 334 Times in 317 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QListView Text Elide Like QListWidget

    for i in range( self._model.rowCount() ) :
    iblSetStandardItemItem = self._model.item( i )
    iblSetStandardItemItem.setSizeHint( QSize( value, value + 16 ) )
    From above it seems you are using your own model..
    Instead of iterating over all items and setting their size hint, you can return the size hint from model::data function too.

Similar Threads

  1. add custom widget items to QListView or QListWidget
    By yazwas in forum Qt Programming
    Replies: 2
    Last Post: 16th September 2010, 22:36
  2. QListWidget or QListView with QLabel(s)
    By lukass in forum Newbie
    Replies: 6
    Last Post: 11th August 2008, 09:48
  3. Replies: 6
    Last Post: 1st July 2008, 20:34
  4. QListWidget::currentRowChanged() for QListView
    By Lykurg in forum Qt Programming
    Replies: 1
    Last Post: 13th March 2007, 15:27
  5. QListWidget / QListView Bug ?
    By guilugi in forum Qt Programming
    Replies: 5
    Last Post: 16th November 2006, 11:33

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
  •  
Qt is a trademark of The Qt Company.