Results 1 to 2 of 2

Thread: QDateEdit Color dates in red color

  1. #1
    Join Date
    Jan 2011
    Posts
    23
    Qt products
    Platforms
    Windows

    Question QDateEdit Color dates in red color

    Hi Guys,

    i am using QDateEdit whose setCalenderPopup property is set to TRUE. Now i want to set some of dates in that calender to RED color.

    For QCalenderWidget i am using setDateTextFormat to set red color for the dates but can someone plz help me in doing same thing for QDateEdit..

    i tried
    Qt Code:
    1. dob_date = QtGui.QDateEdit()
    2. self.dob_date.setCalenderPopup(True)
    3. dob_cal = self.dob_date.calenderWidget()
    4. self.dob_cal.setDateTextFormat(date,Format)
    To copy to clipboard, switch view to plain text mode 

    but its not working out...

    Thanx in advance
    ad3d
    Last edited by high_flyer; 23rd August 2011 at 11:34. Reason: code tags

  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: QDateEdit Color dates in red color

    you can always fall back to setForegroundRole().
    Try it.
    ==========================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. Replies: 1
    Last Post: 9th May 2011, 15:19
  2. Set tab color with system color
    By Suppaman in forum Qt Programming
    Replies: 1
    Last Post: 3rd December 2010, 13:37
  3. Replies: 3
    Last Post: 22nd January 2010, 16:46
  4. Display Label Color by selecting Color Picker
    By sosanjay in forum Qt Programming
    Replies: 1
    Last Post: 25th September 2009, 06:11
  5. how to change backgroup color, button color and shape?
    By lzha022 in forum Qt Programming
    Replies: 10
    Last Post: 16th June 2008, 22:25

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.