Results 1 to 2 of 2

Thread: How to set Style sheet for QCalendarWidget?

  1. #1
    Join Date
    Oct 2008
    Location
    Beijing China
    Posts
    77
    Thanks
    21
    Thanked 3 Times in 3 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Question How to set Style sheet for QCalendarWidget?

    Hi, all,
    I have to customize the calendar's appearance via style sheet but no clue is given in the document. I know the qcalendarwidget includes a QCalendarView, a QCalendarModel and a QCalendarDelegate, while QAbstractItemView : : item {} does not work, as the QCalendarDelegate is subclass of QItemDelegate, other than QStyledItemDelegate.

    Even I give up the style sheet, the calendar's QTextCharFormat cannot meet the requirements. QTextCharFormat could change the date's foreground color, background color and brush, but a solid rounded border is also needed! I don't know how to change it unless re-implement the QCalendarWidget : : paintCells(....).

    Any Suggestion will be appreciated. Thanks in advance.

  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: How to set Style sheet for QCalendarWidget?

    Reimplement QCalendarWidget::paintCell() and do what you want there.

Similar Threads

  1. QMenu style sheet: works in dev env, breaks in release
    By JimDaniel in forum Qt Programming
    Replies: 1
    Last Post: 6th October 2008, 19:18
  2. style sheet issue.
    By kaushal_gaurav in forum Qt Programming
    Replies: 2
    Last Post: 7th August 2008, 07:18
  3. Style Sheet on QWizard
    By desch in forum Qt Programming
    Replies: 2
    Last Post: 6th December 2007, 17:12
  4. QToolButton and Style sheet
    By desch in forum Qt Programming
    Replies: 8
    Last Post: 1st December 2007, 08:38
  5. Qt 4.3 Style sheet, new features
    By Angelo Moriconi in forum Qt Programming
    Replies: 2
    Last Post: 12th June 2007, 15:22

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.