7#include "genericcalendarwidget.h"
9#include <KNotification>
10#include <KCalendarSystem>
15 :
QWidget(parent), m_DateTable(datetable)
19 m_DateTable.setParent(DateTableFrame);
23 previousYear->setAutoRaise(
true);
24 nextYear->setAutoRaise(
true);
25 previousMonth->setAutoRaise(
true);
26 nextMonth->setAutoRaise(
true);
44 connect(nextMonth, SIGNAL(clicked()), SLOT(nextMonthClicked()));
45 connect(previousMonth, SIGNAL(clicked()), SLOT(previousMonthClicked()));
46 connect(nextYear, SIGNAL(clicked()), SLOT(nextYearClicked()));
47 connect(previousYear, SIGNAL(clicked()), SLOT(previousYearClicked()));
48 connect(selectMonth, SIGNAL(activated(
int)), SLOT(monthChanged(
int)));
49 connect(selectYear, SIGNAL(valueChanged(
int)), SLOT(yearChanged(
int)));
51 m_DateTable.setCalendar();
57 selectMonth->setCurrentIndex(
date().month() - 1);
58 selectYear->setValue(
date().year());
66 return m_DateTable.date();
69const KCalendarSystem *GenericCalendarWidget::calendar()
const
71 return m_DateTable.calendar();
74void GenericCalendarWidget::populateMonthNames()
78 for (
int m = 1; m <= calendar()->monthsInYear(
date()); m++)
80 selectMonth->addItem(calendar()->monthName(m, calendar()->year(
date())));
84void GenericCalendarWidget::dateChangedSlot(
const QDate &date_)
91 selectMonth->setCurrentIndex(
date().month() - 1);
92 selectYear->setValue(
date().year());
96 qDebug() <<
"Date = " << m_Date;
101void GenericCalendarWidget::nextMonthClicked()
107 m_DateTable.setFocus();
110void GenericCalendarWidget::previousMonthClicked()
112 qDebug() <<
"Previous month clicked!";
117 m_DateTable.setFocus();
120void GenericCalendarWidget::nextYearClicked()
126 m_DateTable.setFocus();
129void GenericCalendarWidget::previousYearClicked()
135 m_DateTable.setFocus();
138void GenericCalendarWidget::yearChanged(
int year)
144 m_DateTable.setFocus();
147void GenericCalendarWidget::monthChanged(
int month)
149 qDebug() <<
"Month = " << month;
154 m_DateTable.setFocus();
176 return m_DateTable.setDate(date_);
static void beep(const QString &reason=QString())
QIcon fromTheme(const QString &name)
QMetaObject::Connection connect(const QObject *sender, PointerToMemberFunction signal, Functor functor)
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 4 2024 16:38:44 by
doxygen 1.12.0 written
by
Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.