Page 2 of 2 FirstFirst 12
Results 21 to 25 of 25

Thread: Customize QListWidgetItem, how to?

  1. #21
    Join Date
    Sep 2009
    Location
    Warsaw/Poland
    Posts
    56
    Thanks
    8
    Thanked 4 Times in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Customize QListWidgetItem, how to?

    can anybody add example how to insert image into ListDelegate.cpp ?

  2. #22
    Join Date
    Dec 2010
    Posts
    1
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Customize QListWidgetItem, how to?

    Can u send this sorce code for me.

  3. #23
    Join Date
    Jul 2011
    Posts
    1
    Thanks
    1
    Qt products
    Qt3 Qt4
    Platforms
    Windows

    Default Re: Customize QListWidgetItem, how to?

    thank you very much, very useful thread...

  4. #24
    Join Date
    Dec 2016
    Posts
    2
    Qt products
    Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Customize QListWidgetItem, how to?

    Excellent solution.
    My only problem is when I have variable text length for each Description, I cannot set dynamic sizeHint, particularly the height will be different for each item Description. Please help.

    QSize ListDelegate::sizeHint ( const QStyleOptionViewItem & option, const QModelIndex & index ) const
    {
    QSize(200, 60); // very dumb value ***************=> How to make this vary with each ITEM?
    }

  5. #25
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Customize QListWidgetItem, how to?

    You get the index to the cell's data.

    Cheers,
    _

Similar Threads

  1. Customize QFileDialog
    By Swankee in forum Newbie
    Replies: 10
    Last Post: 25th November 2009, 21:21
  2. How to customize the icon?
    By snowdream in forum Qt Programming
    Replies: 2
    Last Post: 12th November 2009, 07:59
  3. How customize my .exe with a icon.
    By jiveaxe in forum Qt Programming
    Replies: 2
    Last Post: 30th December 2007, 19:30
  4. how can i customize a QMainWindow
    By wygggyxtf in forum Qt Programming
    Replies: 15
    Last Post: 23rd June 2007, 07:18
  5. How could i customize my QtTabWidget?
    By Rodrigo in forum Qt Programming
    Replies: 3
    Last Post: 29th May 2007, 15:30

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.