qcalendarwidget.sip 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  1. // qcalendarwidget.sip generated by MetaSIP
  2. //
  3. // This file is part of the QtWidgets Python extension module.
  4. //
  5. // Copyright (c) 2026 Riverbank Computing Limited <info@riverbankcomputing.com>
  6. //
  7. // This file is part of PyQt6.
  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. class QCalendarWidget : public QWidget
  22. {
  23. %TypeHeaderCode
  24. #include <qcalendarwidget.h>
  25. %End
  26. public:
  27. enum HorizontalHeaderFormat
  28. {
  29. NoHorizontalHeader,
  30. SingleLetterDayNames,
  31. ShortDayNames,
  32. LongDayNames,
  33. };
  34. enum VerticalHeaderFormat
  35. {
  36. NoVerticalHeader,
  37. ISOWeekNumbers,
  38. };
  39. enum SelectionMode
  40. {
  41. NoSelection,
  42. SingleSelection,
  43. };
  44. explicit QCalendarWidget(QWidget *parent /TransferThis/ = 0);
  45. virtual ~QCalendarWidget();
  46. virtual QSize sizeHint() const;
  47. virtual QSize minimumSizeHint() const;
  48. QDate selectedDate() const;
  49. int yearShown() const;
  50. int monthShown() const;
  51. QDate minimumDate() const;
  52. void setMinimumDate(QDate date);
  53. QDate maximumDate() const;
  54. void setMaximumDate(QDate date);
  55. Qt::DayOfWeek firstDayOfWeek() const;
  56. void setFirstDayOfWeek(Qt::DayOfWeek dayOfWeek);
  57. bool isGridVisible() const;
  58. void setGridVisible(bool show);
  59. QCalendarWidget::SelectionMode selectionMode() const;
  60. void setSelectionMode(QCalendarWidget::SelectionMode mode);
  61. QCalendarWidget::HorizontalHeaderFormat horizontalHeaderFormat() const;
  62. void setHorizontalHeaderFormat(QCalendarWidget::HorizontalHeaderFormat format);
  63. QCalendarWidget::VerticalHeaderFormat verticalHeaderFormat() const;
  64. void setVerticalHeaderFormat(QCalendarWidget::VerticalHeaderFormat format);
  65. QTextCharFormat headerTextFormat() const;
  66. void setHeaderTextFormat(const QTextCharFormat &format);
  67. QTextCharFormat weekdayTextFormat(Qt::DayOfWeek dayOfWeek) const;
  68. void setWeekdayTextFormat(Qt::DayOfWeek dayOfWeek, const QTextCharFormat &format);
  69. QMap<QDate, QTextCharFormat> dateTextFormat() const;
  70. QTextCharFormat dateTextFormat(QDate date) const;
  71. void setDateTextFormat(QDate date, const QTextCharFormat &format);
  72. protected:
  73. void updateCell(QDate date);
  74. void updateCells();
  75. virtual bool event(QEvent *event);
  76. virtual bool eventFilter(QObject *watched, QEvent *event);
  77. virtual void mousePressEvent(QMouseEvent *event);
  78. virtual void resizeEvent(QResizeEvent *event);
  79. virtual void keyPressEvent(QKeyEvent *event);
  80. virtual void paintCell(QPainter *painter, const QRect &rect, QDate date) const;
  81. public slots:
  82. void setCurrentPage(int year, int month);
  83. void setDateRange(QDate min, QDate max);
  84. void setSelectedDate(QDate date);
  85. void showNextMonth();
  86. void showNextYear();
  87. void showPreviousMonth();
  88. void showPreviousYear();
  89. void showSelectedDate();
  90. void showToday();
  91. signals:
  92. void activated(QDate date);
  93. void clicked(QDate date);
  94. void currentPageChanged(int year, int month);
  95. void selectionChanged();
  96. public:
  97. bool isNavigationBarVisible() const;
  98. bool isDateEditEnabled() const;
  99. void setDateEditEnabled(bool enable);
  100. int dateEditAcceptDelay() const;
  101. void setDateEditAcceptDelay(int delay);
  102. public slots:
  103. void setNavigationBarVisible(bool visible);
  104. public:
  105. QCalendar calendar() const;
  106. void setCalendar(QCalendar calendar);
  107. %If (Qt_6_6_0 -)
  108. void clearMinimumDate();
  109. %End
  110. %If (Qt_6_6_0 -)
  111. void clearMaximumDate();
  112. %End
  113. };