Results 1 to 2 of 2

Thread: Highlighting individual words of a sentence

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Apr 2010
    Posts
    1
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Highlighting individual words of a sentence

    I am trying to highlight individual words of a sentence as my program goes through a list of strings. I am not sure if I would use QPalette or QSyntaxHighlight. Can someone tell me the difference? I think I would use the QPalette, but I'm not sure how to incorporate this example: const QBrush & QPalette::highlightedText () const

    Thanks!

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

    Default Re: Highlighting individual words of a sentence

    QPalette is not a method for using colours, it is a method of defining colours. In this case highlightedText() says what colour the highlighted text will be but it doesn't define what text gets highlighted.

Similar Threads

  1. How to display individual character of a string?
    By cooper in forum Qt Programming
    Replies: 2
    Last Post: 15th July 2009, 05:19
  2. Adding 3 words to Button with specified length betwwen words
    By chikkireddi in forum Qt Programming
    Replies: 1
    Last Post: 26th October 2007, 11:08
  3. Replies: 5
    Last Post: 16th March 2007, 08:18
  4. dealing individual objects
    By kingslee in forum General Programming
    Replies: 9
    Last Post: 15th November 2006, 01:28
  5. how to color certain words in a textedit
    By chandrabose.s in forum Newbie
    Replies: 12
    Last Post: 15th March 2006, 09:24

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
  •  
Qt is a trademark of The Qt Company.