\section{KDate\-Table Class Reference}
\label{classKDateTable}\index{KDateTable@{KDateTable}}
Date selection table.  


{\tt \#include $<$kdatetbl.h$>$}

Inheritance diagram for KDate\-Table:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=53pt]{classKDateTable__inherit__graph}
\end{center}
\end{figure}
Collaboration diagram for KDate\-Table:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=130pt]{classKDateTable__coll__graph}
\end{center}
\end{figure}
\subsection*{Signals}
\begin{CompactItemize}
\item 
void {\bf date\-Changed} ({\bf QDate})
\begin{CompactList}\small\item\em The selected date changed. \item\end{CompactList}\item 
void {\bf table\-Clicked} ()
\begin{CompactList}\small\item\em A date has been selected by clicking on the table. \item\end{CompactList}\end{CompactItemize}
\subsection*{Public Member Functions}
\begin{CompactItemize}
\item 
{\bf KDate\-Table} ({\bf QWidget} $\ast$parent=0, {\bf QDate} {\bf date}={\bf QDate::current\-Date}(), const  char $\ast$name=0, WFlags f=0)
\begin{CompactList}\small\item\em The constructor. \item\end{CompactList}\item 
virtual {\bf QSize} {\bf size\-Hint} () const 
\begin{CompactList}\small\item\em Returns a recommended size for the widget. \item\end{CompactList}\item 
void {\bf set\-Font\-Size} (int size)
\begin{CompactList}\small\item\em Set the font size of the date table. \item\end{CompactList}\item 
bool {\bf set\-Date} (const  {\bf QDate} \&)
\begin{CompactList}\small\item\em Select and display this date. \item\end{CompactList}\item 
const  {\bf QDate} \& {\bf get\-Date} () const \label{classKDateTable_a4}

\end{CompactItemize}
\subsection*{Protected Member Functions}
\begin{CompactItemize}
\item 
virtual void {\bf paint\-Cell} ({\bf QPainter} $\ast$, int, int)
\begin{CompactList}\small\item\em Paint a cell. \item\end{CompactList}\item 
virtual void {\bf viewport\-Resize\-Event} ({\bf QResize\-Event} $\ast$)
\begin{CompactList}\small\item\em Handle the resize events. \item\end{CompactList}\item 
virtual void {\bf contents\-Mouse\-Press\-Event} ({\bf QMouse\-Event} $\ast$)
\begin{CompactList}\small\item\em React on mouse clicks that select a date. \item\end{CompactList}\item 
virtual void {\bf wheel\-Event} ({\bf QWheel\-Event} $\ast$e)\label{classKDateTable_b3}

\item 
virtual void {\bf key\-Press\-Event} ({\bf QKey\-Event} $\ast$e)\label{classKDateTable_b4}

\item 
virtual void {\bf focus\-In\-Event} ({\bf QFocus\-Event} $\ast$e)\label{classKDateTable_b5}

\item 
virtual void {\bf focus\-Out\-Event} ({\bf QFocus\-Event} $\ast$e)\label{classKDateTable_b6}

\item 
virtual void {\bf virtual\_\-hook} (int id, void $\ast$data)\label{classKDateTable_b7}

\end{CompactItemize}
\subsection*{Protected Attributes}
\begin{CompactItemize}
\item 
int {\bf fontsize}
\begin{CompactList}\small\item\em The font size of the displayed text. \item\end{CompactList}\item 
{\bf QDate} {\bf date}
\begin{CompactList}\small\item\em The currently selected date. \item\end{CompactList}\item 
int {\bf firstday}
\begin{CompactList}\small\item\em The day of the first day in the month [1..7]. \item\end{CompactList}\item 
int {\bf numdays}
\begin{CompactList}\small\item\em The number of days in the current month. \item\end{CompactList}\item 
int {\bf num\-Days\-Prev\-Month}
\begin{CompactList}\small\item\em The number of days in the previous month. \item\end{CompactList}\item 
bool {\bf unused\_\-has\-Selection}
\begin{CompactList}\small\item\em unused \#\#\# remove in {\bf KDE} 4.0 \item\end{CompactList}\item 
{\bf QRect} {\bf max\-Cell}
\begin{CompactList}\small\item\em Save the size of the largest used cell content. \item\end{CompactList}\end{CompactItemize}


\subsection{Detailed Description}
Date selection table. 

This is a support class for the {\bf KDate\-Picker}{\rm (p.\,\pageref{classKDatePicker})} class. It just draws the calender table without titles, but could theoretically be used as a standalone.

When a date is selected by the user, it emits a signal: date\-Selected(QDate) 



Definition at line 245 of file kdatetbl.h.

\subsection{Constructor \& Destructor Documentation}
\index{KDateTable@{KDate\-Table}!KDateTable@{KDateTable}}
\index{KDateTable@{KDateTable}!KDateTable@{KDate\-Table}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}KDate\-Table::KDate\-Table ({\bf QWidget} $\ast$ {\em parent} = 0, {\bf QDate} {\em date} = {\bf QDate::current\-Date}(), const char $\ast$ {\em name} = 0, WFlags {\em f} = 0)}\label{classKDateTable_a0}


The constructor. 



Definition at line 81 of file kdatetbl.cpp.

References KGlobal\-Settings::base\-Color(), QDate::current\-Date(), QDate::is\-Valid(), KStd\-Accel::name(), set\-Date(), set\-Font\-Size(), QGrid\-View::set\-Num\-Cols(), and QGrid\-View::set\-Num\-Rows().

\subsection{Member Function Documentation}
\index{KDateTable@{KDate\-Table}!sizeHint@{sizeHint}}
\index{sizeHint@{sizeHint}!KDateTable@{KDate\-Table}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf QSize} KDate\-Table::size\-Hint () const\hspace{0.3cm}{\tt  [virtual]}}\label{classKDateTable_a1}


Returns a recommended size for the widget. 

To save some time, the size of the largest used cell content is calculated in each {\bf paint\-Cell()}{\rm (p.\,\pageref{classKDateTable_b0})} call, since all calculations have to be done there anyway. The size is stored in max\-Cell. The {\bf size\-Hint()}{\rm (p.\,\pageref{classKDateTable_a1})} simply returns a multiple of max\-Cell. 

Definition at line 408 of file kdatetbl.cpp.

References QRect::height(), max\-Cell, QGrid\-View::num\-Cols(), QGrid\-View::num\-Rows(), and QRect::width().

Referenced by KDate\-Picker::size\-Hint().\index{KDateTable@{KDate\-Table}!setFontSize@{setFontSize}}
\index{setFontSize@{setFontSize}!KDateTable@{KDate\-Table}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KDate\-Table::set\-Font\-Size (int {\em size})}\label{classKDateTable_a2}


Set the font size of the date table. 



Definition at line 265 of file kdatetbl.cpp.

References QFont\-Metrics::bounding\-Rect(), fontsize, QString::from\-Latin1(), QRect::height(), KGlobal::locale(), max\-Cell, QRect::set\-Height(), QRect::set\-Width(), and QRect::width().

Referenced by KDate\-Table(), and KDate\-Picker::set\-Font\-Size().\index{KDateTable@{KDate\-Table}!setDate@{setDate}}
\index{setDate@{setDate}!KDateTable@{KDate\-Table}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}bool KDate\-Table::set\-Date (const {\bf QDate} \&)}\label{classKDateTable_a3}


Select and display this date. 



Definition at line 354 of file kdatetbl.cpp.

References date, date\-Changed(), QDate::day\-Of\-Week(), QDate::days\-In\-Month(), firstday, QDate::is\-Valid(), QDate::month(), numdays, num\-Days\-Prev\-Month, QDate::set\-YMD(), and QDate::year().

Referenced by contents\-Mouse\-Press\-Event(), KDate\-Table(), and KDate\-Picker::set\-Date().\index{KDateTable@{KDate\-Table}!paintCell@{paintCell}}
\index{paintCell@{paintCell}!KDateTable@{KDate\-Table}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KDate\-Table::paint\-Cell ({\bf QPainter} $\ast$, int, int)\hspace{0.3cm}{\tt  [protected, virtual]}}\label{classKDateTable_b0}


Paint a cell. 



Reimplemented from {\bf QGrid\-View}.

Definition at line 100 of file kdatetbl.cpp.

References KGlobal\-Settings::active\-Text\-Color(), KGlobal\-Settings::active\-Title\-Color(), KGlobal\-Settings::base\-Color(), KGlobal\-Settings::calculate\-Alternate\-Background\-Color(), QGrid\-View::cell\-Height(), QGrid\-View::cell\-Width(), QDate::current\-Date(), date, QDate::day(), QPainter::draw\-Rect(), QPainter::draw\-Text(), firstday, fontsize, KGlobal\-Settings::general\-Font(), QRect::height(), KGlobal\-Settings::highlight\-Color(), KGlobal::locale(), max\-Cell, QDate::month(), numdays, num\-Days\-Prev\-Month, QPainter::pen(), QFont::set\-Bold(), QPainter::set\-Brush(), QPainter::set\-Font(), QRect::set\-Height(), QString::set\-Num(), QPainter::set\-Pen(), QFont::set\-Point\-Size(), QRect::set\-Width(), KGlobal\-Settings::text\-Color(), KLocale::week\-Day\-Name(), KLocale::week\-Start\-Day(), QRect::width(), and QDate::year().\index{KDateTable@{KDate\-Table}!viewportResizeEvent@{viewportResizeEvent}}
\index{viewportResizeEvent@{viewportResizeEvent}!KDateTable@{KDate\-Table}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KDate\-Table::viewport\-Resize\-Event ({\bf QResize\-Event} $\ast$)\hspace{0.3cm}{\tt  [protected, virtual]}}\label{classKDateTable_b1}


Handle the resize events. 



Definition at line 256 of file kdatetbl.cpp.

References QGrid\-View::set\-Cell\-Height(), and QGrid\-View::set\-Cell\-Width().\index{KDateTable@{KDate\-Table}!contentsMousePressEvent@{contentsMousePressEvent}}
\index{contentsMousePressEvent@{contentsMousePressEvent}!KDateTable@{KDate\-Table}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KDate\-Table::contents\-Mouse\-Press\-Event ({\bf QMouse\-Event} $\ast$)\hspace{0.3cm}{\tt  [protected, virtual]}}\label{classKDateTable_b2}


React on mouse clicks that select a date. 



Definition at line 295 of file kdatetbl.cpp.

References QDate::add\-Days(), KNotify\-Client::beep(), QGrid\-View::column\-At(), date, QDate::day(), firstday, KGlobal::locale(), QDate::month(), numdays, QMouse\-Event::pos(), QGrid\-View::row\-At(), set\-Date(), table\-Clicked(), QGrid\-View::update\-Cell(), KLocale::week\-Start\-Day(), QPoint::x(), QPoint::y(), and QDate::year().\index{KDateTable@{KDate\-Table}!dateChanged@{dateChanged}}
\index{dateChanged@{dateChanged}!KDateTable@{KDate\-Table}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KDate\-Table::date\-Changed ({\bf QDate})\hspace{0.3cm}{\tt  [signal]}}\label{classKDateTable_l0}


The selected date changed. 



Referenced by set\-Date().\index{KDateTable@{KDate\-Table}!tableClicked@{tableClicked}}
\index{tableClicked@{tableClicked}!KDateTable@{KDate\-Table}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KDate\-Table::table\-Clicked ()\hspace{0.3cm}{\tt  [signal]}}\label{classKDateTable_l1}


A date has been selected by clicking on the table. 



Referenced by contents\-Mouse\-Press\-Event().

\subsection{Member Data Documentation}
\index{KDateTable@{KDate\-Table}!fontsize@{fontsize}}
\index{fontsize@{fontsize}!KDateTable@{KDate\-Table}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int {\bf KDate\-Table::fontsize}\hspace{0.3cm}{\tt  [protected]}}\label{classKDateTable_p0}


The font size of the displayed text. 



Definition at line 294 of file kdatetbl.h.

Referenced by paint\-Cell(), and set\-Font\-Size().\index{KDateTable@{KDate\-Table}!date@{date}}
\index{date@{date}!KDateTable@{KDate\-Table}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf QDate} {\bf KDate\-Table::date}\hspace{0.3cm}{\tt  [protected]}}\label{classKDateTable_p1}


The currently selected date. 



Definition at line 298 of file kdatetbl.h.

Referenced by contents\-Mouse\-Press\-Event(), paint\-Cell(), and set\-Date().\index{KDateTable@{KDate\-Table}!firstday@{firstday}}
\index{firstday@{firstday}!KDateTable@{KDate\-Table}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int {\bf KDate\-Table::firstday}\hspace{0.3cm}{\tt  [protected]}}\label{classKDateTable_p2}


The day of the first day in the month [1..7]. 



Definition at line 302 of file kdatetbl.h.

Referenced by contents\-Mouse\-Press\-Event(), paint\-Cell(), and set\-Date().\index{KDateTable@{KDate\-Table}!numdays@{numdays}}
\index{numdays@{numdays}!KDateTable@{KDate\-Table}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int {\bf KDate\-Table::numdays}\hspace{0.3cm}{\tt  [protected]}}\label{classKDateTable_p3}


The number of days in the current month. 



Definition at line 306 of file kdatetbl.h.

Referenced by contents\-Mouse\-Press\-Event(), paint\-Cell(), and set\-Date().\index{KDateTable@{KDate\-Table}!numDaysPrevMonth@{numDaysPrevMonth}}
\index{numDaysPrevMonth@{numDaysPrevMonth}!KDateTable@{KDate\-Table}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int {\bf KDate\-Table::num\-Days\-Prev\-Month}\hspace{0.3cm}{\tt  [protected]}}\label{classKDateTable_p4}


The number of days in the previous month. 



Definition at line 310 of file kdatetbl.h.

Referenced by paint\-Cell(), and set\-Date().\index{KDateTable@{KDate\-Table}!unused_hasSelection@{unused\_\-hasSelection}}
\index{unused_hasSelection@{unused\_\-hasSelection}!KDateTable@{KDate\-Table}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}bool {\bf KDate\-Table::unused\_\-has\-Selection}\hspace{0.3cm}{\tt  [protected]}}\label{classKDateTable_p5}


unused \#\#\# remove in {\bf KDE} 4.0 



Definition at line 315 of file kdatetbl.h.\index{KDateTable@{KDate\-Table}!maxCell@{maxCell}}
\index{maxCell@{maxCell}!KDateTable@{KDate\-Table}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf QRect} {\bf KDate\-Table::max\-Cell}\hspace{0.3cm}{\tt  [protected]}}\label{classKDateTable_p6}


Save the size of the largest used cell content. 



Definition at line 319 of file kdatetbl.h.

Referenced by paint\-Cell(), set\-Font\-Size(), and size\-Hint().

The documentation for this class was generated from the following files:\begin{CompactItemize}
\item 
kdatetbl.h\item 
kdatetbl.cpp\end{CompactItemize}
