Results 1 to 2 of 2

Thread: Q3ListView highlight part of a column

  1. #1
    Join Date
    Feb 2006
    Posts
    60
    Thanks
    21
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Q3ListView highlight part of a column

    hi,
    I am using Qt4.1.2. I am using Q3ListView, and i want to highlight a part of the text in an item.

    It's the same as find does in QTextEdit (highlight the text that is found).
    I want to implement find in Q3ListView, such that it highlights the text in a column i.e highlilght the text written in find dialog.

    please post the code if its available.
    Thanks in advance,

    regards,
    sree

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Q3ListView highlight part of a column

    Could you give more details? Why are you using Q3ListView instead of QTreeWidget? Anyway, you should subclass the item class and provide ways to mark, which part of the item is "highlighted" and then in the painting routine do the highlighting either by rendering rich text or simply by dividing the routine into three parts -- render text before highlight, change colour and render the highlighted part, change colour and render the rest.

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.