Results 1 to 2 of 2

Thread: How to show multiple multi-line HTML texts in a QListWidget

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

    Default How to show multiple multi-line HTML texts in a QListWidget

    I have a plan to show multiple multi-line HTML texts in a QListWidget with each multi-line HTML text in each row item.

    1) With Item delegate my problem is on sizeHint - can it change as per each item text size? Can each item contain HTML multiline-text? Please help with code.
    QSize ListDelegate::sizeHint ( const QStyleOptionViewItem & option, const QModelIndex & index ) const
    {
    return QSize(fixed as per item width, to vary as per multi-line text length which is aligned-justified);
    }
    2) Another heavy by simple solution is with QLabel as an WidgetItem for the QListWidget, but as soon I set HTML text in QLabel the item becomes unclickable.

    Please help with some code.

  2. #2
    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: How to show multiple multi-line HTML texts in a QListWidget

    Have you tried the suggestion you've got in the other thread were you posted the same question?

    Cheers,
    _

Similar Threads

  1. How to combine multiple .html files together into one .html
    By stella1016 in forum Qt Programming
    Replies: 3
    Last Post: 12th October 2011, 07:34
  2. Multi line display
    By Percy in forum Qt Programming
    Replies: 1
    Last Post: 30th April 2010, 19:57
  3. Multi-line elided text?
    By WinchellChung in forum Newbie
    Replies: 1
    Last Post: 6th February 2008, 17:37
  4. QListWidget multi selection
    By user in forum Qt Programming
    Replies: 1
    Last Post: 6th February 2008, 08:36
  5. Multi-line messages in QTableView
    By Conel in forum Qt Programming
    Replies: 6
    Last Post: 13th April 2006, 14:49

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.