Results 1 to 3 of 3

Thread: How do you set a part of the text in bold in a QListWidgetItem ?

  1. #1
    Join Date
    Feb 2010
    Posts
    61
    Thanks
    18
    Qt products
    Qt4
    Platforms
    MacOS X

    Default How do you set a part of the text in bold in a QListWidgetItem ?

    Hi,

    I would like some specific parts of my QListWidgetItems to be in bold.

    Could anyone provide me with a simple example ?

  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: How do you set a part of the text in bold in a QListWidgetItem ?

    You will need to use delegates and draw the text yourself.
    See QItemDelegate::drawDisplay
    Also you can use QSyntaxHighlighter to draw colored text for specific parts.

  3. #3
    Join Date
    Feb 2010
    Posts
    61
    Thanks
    18
    Qt products
    Qt4
    Platforms
    MacOS X

    Default Re: How do you set a part of the text in bold in a QListWidgetItem ?

    OK but how do I link the delegate with the highlighter ?

Similar Threads

  1. QTextEdit. To make selected text as Bold.
    By KIBSOFT in forum Qt Programming
    Replies: 5
    Last Post: 14th December 2016, 10:47
  2. QStandardItem : subpart of the text as bold
    By titoo in forum Qt Programming
    Replies: 5
    Last Post: 1st November 2012, 09:34
  3. Rich Text Inside QListWidgetItem?
    By Jick in forum Newbie
    Replies: 1
    Last Post: 17th February 2010, 01:30
  4. set Bold to MessageBox particular Text
    By BalaQT in forum Qt Programming
    Replies: 2
    Last Post: 5th November 2009, 11:53
  5. QListWidgetItem Text Rect
    By js67257 in forum Qt Programming
    Replies: 2
    Last Post: 22nd August 2006, 12:02

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.