1// qcalendarwidget.sip generated by MetaSIP 2// 3// This file is part of the QtWidgets Python extension module. 4// 5// Copyright (c) 2021 Riverbank Computing Limited <info@riverbankcomputing.com> 6// 7// This file is part of PyQt5. 8// 9// This file may be used under the terms of the GNU General Public License 10// version 3.0 as published by the Free Software Foundation and appearing in 11// the file LICENSE included in the packaging of this file. Please review the 12// following information to ensure the GNU General Public License version 3.0 13// requirements will be met: http://www.gnu.org/copyleft/gpl.html. 14// 15// If you do not wish to use this file under the terms of the GPL version 3.0 16// then you may purchase a commercial license. For more information contact 17// info@riverbankcomputing.com. 18// 19// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE 20// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. 21 22 23class QCalendarWidget : QWidget 24{ 25%TypeHeaderCode 26#include <qcalendarwidget.h> 27%End 28 29public: 30 enum HorizontalHeaderFormat 31 { 32 NoHorizontalHeader, 33 SingleLetterDayNames, 34 ShortDayNames, 35 LongDayNames, 36 }; 37 38 enum VerticalHeaderFormat 39 { 40 NoVerticalHeader, 41 ISOWeekNumbers, 42 }; 43 44 enum SelectionMode 45 { 46 NoSelection, 47 SingleSelection, 48 }; 49 50 explicit QCalendarWidget(QWidget *parent /TransferThis/ = 0); 51 virtual ~QCalendarWidget(); 52 virtual QSize sizeHint() const; 53 virtual QSize minimumSizeHint() const; 54 QDate selectedDate() const; 55 int yearShown() const; 56 int monthShown() const; 57 QDate minimumDate() const; 58 void setMinimumDate(const QDate &date); 59 QDate maximumDate() const; 60 void setMaximumDate(const QDate &date); 61 Qt::DayOfWeek firstDayOfWeek() const; 62 void setFirstDayOfWeek(Qt::DayOfWeek dayOfWeek); 63 bool isGridVisible() const; 64 void setGridVisible(bool show); 65 QCalendarWidget::SelectionMode selectionMode() const; 66 void setSelectionMode(QCalendarWidget::SelectionMode mode); 67 QCalendarWidget::HorizontalHeaderFormat horizontalHeaderFormat() const; 68 void setHorizontalHeaderFormat(QCalendarWidget::HorizontalHeaderFormat format); 69 QCalendarWidget::VerticalHeaderFormat verticalHeaderFormat() const; 70 void setVerticalHeaderFormat(QCalendarWidget::VerticalHeaderFormat format); 71 QTextCharFormat headerTextFormat() const; 72 void setHeaderTextFormat(const QTextCharFormat &format); 73 QTextCharFormat weekdayTextFormat(Qt::DayOfWeek dayOfWeek) const; 74 void setWeekdayTextFormat(Qt::DayOfWeek dayOfWeek, const QTextCharFormat &format); 75 QMap<QDate, QTextCharFormat> dateTextFormat() const; 76 QTextCharFormat dateTextFormat(const QDate &date) const; 77 void setDateTextFormat(const QDate &date, const QTextCharFormat &color); 78 79protected: 80 void updateCell(const QDate &date); 81 void updateCells(); 82 virtual bool event(QEvent *event); 83 virtual bool eventFilter(QObject *watched, QEvent *event); 84 virtual void mousePressEvent(QMouseEvent *event); 85 virtual void resizeEvent(QResizeEvent *event); 86 virtual void keyPressEvent(QKeyEvent *event); 87 virtual void paintCell(QPainter *painter, const QRect &rect, const QDate &date) const; 88 89public slots: 90 void setCurrentPage(int year, int month); 91 void setDateRange(const QDate &min, const QDate &max); 92 void setSelectedDate(const QDate &date); 93 void showNextMonth(); 94 void showNextYear(); 95 void showPreviousMonth(); 96 void showPreviousYear(); 97 void showSelectedDate(); 98 void showToday(); 99 100signals: 101 void activated(const QDate &date); 102 void clicked(const QDate &date); 103 void currentPageChanged(int year, int month); 104 void selectionChanged(); 105 106public: 107 bool isNavigationBarVisible() const; 108 bool isDateEditEnabled() const; 109 void setDateEditEnabled(bool enable); 110 int dateEditAcceptDelay() const; 111 void setDateEditAcceptDelay(int delay); 112 113public slots: 114 void setNavigationBarVisible(bool visible); 115 116public: 117%If (Qt_5_14_0 -) 118 QCalendar calendar() const; 119%End 120%If (Qt_5_14_0 -) 121 void setCalendar(QCalendar calendar); 122%End 123}; 124