Results 1 to 4 of 4

Thread: Change the colour of a QT TextEdit row

  1. #1
    Join Date
    Oct 2010
    Posts
    54
    Thanks
    8
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Windows

    Question Change the colour of a QT TextEdit row

    Hi all i wish to change the colour of a particular row within a text edit.

    In each row there is a field which is marked either as completed (Yes) or not completed (No). If the record is marked as not complete I wish for the row to be colour red. If the row is marked as complete I want the row to coloured green.

    Thanks for your time and trouble, btw I have no idea where to start.

    Thanks

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

    Default Re: Change the colour of a QT TextEdit row

    Have a look at QSyntaxHighlighter.
    ==========================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. #3
    Join Date
    Oct 2010
    Posts
    54
    Thanks
    8
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Windows

    Question Re: Change the colour of a QT TextEdit row

    Could you perhaps give me an example of how to do this. Thanks

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

    Default Re: Change the colour of a QT TextEdit row

    How is my example better then the ones in the link I gave you?
    ==========================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.

Similar Threads

  1. change the text colour in Menubar
    By chinmayapadhi in forum Qt Programming
    Replies: 1
    Last Post: 16th August 2010, 01:31
  2. Change QTableView border colour under special cicrumstances
    By stefanadelbert in forum Qt Programming
    Replies: 0
    Last Post: 12th April 2010, 06:52
  3. How to change Label text colour in Qt designer
    By sudhansu in forum Qt Programming
    Replies: 2
    Last Post: 6th January 2010, 12:31
  4. How to change Text colour in EditText?
    By phillip_Qt in forum Qt Programming
    Replies: 6
    Last Post: 6th March 2008, 08:48
  5. Change colour of QString
    By Morea in forum Newbie
    Replies: 9
    Last Post: 10th February 2006, 22:31

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.