Results 1 to 2 of 2

Thread: Hightlight Text inside QTableWidgetItem

  1. #1
    Join Date
    Feb 2017
    Posts
    11
    Thanks
    1
    Qt products
    Qt5
    Platforms
    Unix/X11 Windows

    Default Hightlight Text inside QTableWidgetItem

    Hi,

    I need to highlight some text inside the cell of a qtablewidget (so a QTableWidgetItem). I do not want to change the color of all the text inside the cell, just some of it. For qlabels I usually insert html tags but that does not work here.

    Does anyone have an idea how to do this?

  2. #2
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,714
    Thanks
    21
    Thanked 418 Times in 411 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: Hightlight Text inside QTableWidgetItem

    For special rendering in Model View data aware widgets you use delegates:
    http://doc.qt.io/qt-5/model-view-pro...legate-classes
    ==========================signature=============== ==================
    S.O.L.I.D principles (use them!):
    https://en.wikipedia.org/wiki/SOLID_...iented_design)

    Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.

  3. The following user says thank you to high_flyer for this useful post:

    phil333 (17th August 2017)

Similar Threads

  1. QTableWidgetItem no text
    By Aslan in forum Qt Programming
    Replies: 4
    Last Post: 15th June 2011, 04:53
  2. Replies: 1
    Last Post: 8th December 2009, 13:55
  3. Extracting text from QTableWidgetItem
    By bizmopeen in forum Newbie
    Replies: 3
    Last Post: 1st September 2009, 18:28
  4. Rich Text in QTableWidgetItem
    By joshuajcarson in forum Qt Programming
    Replies: 9
    Last Post: 2nd September 2008, 16:49
  5. QTableWidgetItem Text
    By pytro in forum Qt Programming
    Replies: 2
    Last Post: 6th August 2007, 22:44

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.