diff options
Diffstat (limited to 'kplato/kptdatetable.h')
-rw-r--r-- | kplato/kptdatetable.h | 151 |
1 files changed, 78 insertions, 73 deletions
diff --git a/kplato/kptdatetable.h b/kplato/kptdatetable.h index 40576e8c..65e0d05f 100644 --- a/kplato/kptdatetable.h +++ b/kplato/kptdatetable.h @@ -27,14 +27,14 @@ #include <kglobal.h> #include <klocale.h> -#include <qgridview.h> -#include <qmemarray.h> -#include <qdict.h> -#include <qpair.h> +#include <tqgridview.h> +#include <tqmemarray.h> +#include <tqdict.h> +#include <tqpair.h> -#include <qvalidator.h> -#include <qlineedit.h> -#include <qdatetime.h> +#include <tqvalidator.h> +#include <tqlineedit.h> +#include <tqdatetime.h> namespace KPlato { @@ -44,11 +44,12 @@ namespace KPlato * @version $Id: kptdatetable.h 576264 2006-08-23 16:28:46Z danders $ * @author Stephan Binner */ -class DateInternalWeekSelector : public QLineEdit +class DateInternalWeekSelector : public TQLineEdit { Q_OBJECT + TQ_OBJECT protected: - QIntValidator *val; + TQIntValidator *val; int result; public slots: void weekEnteredSlot(); @@ -56,7 +57,7 @@ signals: void closeMe(int); public: DateInternalWeekSelector(int fontsize, - QWidget* parent=0, + TQWidget* tqparent=0, const char* name=0); int getWeek() const; void setWeek(int week); @@ -72,9 +73,10 @@ private: * @version $Id: kptdatetable.h 576264 2006-08-23 16:28:46Z danders $ * @author Tim Gilman, Mirko Boehm */ -class DateInternalMonthPicker : public QGridView +class DateInternalMonthPicker : public TQGridView { Q_OBJECT + TQ_OBJECT protected: /** * Store the month that has been clicked [1..12]. @@ -88,7 +90,7 @@ protected: /** * Contains the largest rectangle needed by the month names. */ - QRect max; + TQRect max; signals: /** * This is send from the mouse click event handler. @@ -98,15 +100,15 @@ public: /** * The constructor. */ - DateInternalMonthPicker(int fontsize, QWidget* parent, const char* name=0); + DateInternalMonthPicker(int fontsize, TQWidget* tqparent, const char* name=0); /** * The size hint. */ - QSize sizeHint() const; + TQSize tqsizeHint() const; /** * The minimum size hint. */ - QSize minimumSizeHint() const { return sizeHint(); } + TQSize tqminimumSizeHint() const { return tqsizeHint(); } /** * Return the result. 0 means no selection (reject()), 1..12 are the * months. @@ -116,24 +118,24 @@ protected: /** * Set up the painter. */ - void setupPainter(QPainter *p); + void setupPainter(TQPainter *p); /** * The resize event. */ - virtual void viewportResizeEvent(QResizeEvent*); + virtual void viewportResizeEvent(TQResizeEvent*); /** * Paint a cell. This simply draws the month names in it. */ - virtual void paintCell(QPainter* painter, int row, int col); + virtual void paintCell(TQPainter* painter, int row, int col); /** * Catch mouse click and move events to paint a rectangle around the item. */ - virtual void contentsMousePressEvent(QMouseEvent *e); - virtual void contentsMouseMoveEvent(QMouseEvent *e); + virtual void contentsMousePressEvent(TQMouseEvent *e); + virtual void contentsMouseMoveEvent(TQMouseEvent *e); /** * Emit monthSelected(int) when a cell has been released. */ - virtual void contentsMouseReleaseEvent(QMouseEvent *e); + virtual void contentsMouseReleaseEvent(TQMouseEvent *e); private: class DateInternalMonthPrivate; @@ -145,11 +147,12 @@ private: * @version $Id: kptdatetable.h 576264 2006-08-23 16:28:46Z danders $ * @author Tim Gilman, Mirko Boehm */ -class DateInternalYearSelector : public QLineEdit +class DateInternalYearSelector : public TQLineEdit { Q_OBJECT + TQ_OBJECT protected: - QIntValidator *val; + TQIntValidator *val; int result; public slots: void yearEnteredSlot(); @@ -157,7 +160,7 @@ signals: void closeMe(int); public: DateInternalYearSelector(int fontsize, - QWidget* parent=0, + TQWidget* tqparent=0, const char* name=0); int getYear() const; void setYear(int year); @@ -172,9 +175,10 @@ private: * @author Tim Gilman, Mirko Boehm * @version $Id: kptdatetable.h 576264 2006-08-23 16:28:46Z danders $ */ -class PopupFrame : public QFrame +class PopupFrame : public TQFrame { Q_OBJECT + TQ_OBJECT protected: /** * The result. It is returned from exec() when the popup window closes. @@ -183,11 +187,11 @@ protected: /** * Catch key press events. */ - virtual void keyPressEvent(QKeyEvent* e); + virtual void keyPressEvent(TQKeyEvent* e); /** * The only subwidget that uses the whole dialog window. */ - QWidget *main; + TQWidget *main; public slots: /** * Close the popup window. This is called from the main widget, usually. @@ -198,7 +202,7 @@ public: /** * The contructor. Creates a dialog without buttons. */ - PopupFrame(QWidget* parent=0, const char* name=0); + PopupFrame(TQWidget* tqparent=0, const char* name=0); /** * Set the main widget. You cannot set the main widget from the constructor, * since it must be a child of the frame itselfes. @@ -206,20 +210,20 @@ public: * set the main widgets correct size before setting it as the main * widget. */ - void setMainWidget(QWidget* m); + void setMainWidget(TQWidget* m); /** * The resize event. Simply resizes the main widget to the whole * widgets client size. */ - virtual void resizeEvent(QResizeEvent*); + virtual void resizeEvent(TQResizeEvent*); /** * Open the popup window at position pos. */ - void popup(const QPoint &pos); + void popup(const TQPoint &pos); /** * Execute the popup window. */ - int exec(QPoint p); + int exec(TQPoint p); /** * Dito. */ @@ -227,7 +231,7 @@ public: private: - virtual bool close(bool alsoDelete) { return QFrame::close(alsoDelete); } + virtual bool close(bool alsoDelete) { return TQFrame::close(alsoDelete); } protected: virtual void virtual_hook( int id, void* data ); private: @@ -238,24 +242,25 @@ private: /** * Validates user-entered dates. */ -class DateValidator : public QValidator +class DateValidator : public TQValidator { public: - DateValidator(QWidget* parent=0, const char* name=0); - virtual State validate(QString&, int&) const; - virtual void fixup ( QString & input ) const; - State date(const QString&, QDate&) const; + DateValidator(TQWidget* tqparent=0, const char* name=0); + virtual State validate(TQString&, int&) const; + virtual void fixup ( TQString & input ) const; + State date(const TQString&, TQDate&) const; }; -class DateTable : public QGridView +class DateTable : public TQGridView { Q_OBJECT + TQ_OBJECT public: /** * The constructor. */ - DateTable(QWidget *parent=0, QDate date=QDate::currentDate(), + DateTable(TQWidget *tqparent=0, TQDate date=TQDate::tqcurrentDate(), const char* name="DateTable", WFlags f=0); /** @@ -263,9 +268,9 @@ public: * To save some time, the size of the largest used cell content is * calculated in each paintCell() call, since all calculations have * to be done there anyway. The size is stored in maxCell. The - * sizeHint() simply returns a multiple of maxCell. + * tqsizeHint() simply returns a multiple of maxCell. */ - virtual QSize sizeHint() const; + virtual TQSize tqsizeHint() const; /** * Set the font size of the date table. */ @@ -273,12 +278,12 @@ public: /** * Select and display this date. */ - bool setDate(const QDate&, bool repaint=true); - const QDate& getDate() const; - bool selectDate(const QDate& date_); + bool setDate(const TQDate&, bool tqrepaint=true); + const TQDate& getDate() const; + bool selectDate(const TQDate& date_); - void addMarkedDate(QDate date, int state) { m_markedDates.insert(date, state); } - bool dateMarked(QDate date); + void addMarkedDate(TQDate date, int state) { m_markedDates.insert(date, state); } + bool dateMarked(TQDate date); void addMarkedWeekday(int day, int state); void setMarkedWeekday(int day, int state) { m_markedWeekdays.insert(day, state); } @@ -303,36 +308,36 @@ protected: /** * Paint a cell. */ - virtual void paintCell(QPainter*, int, int); + virtual void paintCell(TQPainter*, int, int); /** * Handle the resize events. */ - virtual void viewportResizeEvent(QResizeEvent *); + virtual void viewportResizeEvent(TQResizeEvent *); /** * React on mouse clicks that select a date. */ - virtual void contentsMousePressEvent(QMouseEvent *); - virtual void wheelEvent( QWheelEvent * e ); - virtual void keyPressEvent( QKeyEvent *e ); - virtual void focusInEvent( QFocusEvent *e ); - virtual void focusOutEvent( QFocusEvent *e ); + virtual void contentsMousePressEvent(TQMouseEvent *); + virtual void wheelEvent( TQWheelEvent * e ); + virtual void keyPressEvent( TQKeyEvent *e ); + virtual void focusInEvent( TQFocusEvent *e ); + virtual void focusOutEvent( TQFocusEvent *e ); - bool contentsMousePressEvent_internal(QMouseEvent *); + bool contentsMousePressEvent_internal(TQMouseEvent *); - int weekOfYear(QDate date) const; - void setWeekNumbers(QDate); + int weekOfYear(TQDate date) const; + void setWeekNumbers(TQDate); bool weekSelected(int row); bool weekSelected(); bool weekdaySelected(); bool isWeekdaySelected(int day); - bool dateSelected(QDate date); + bool dateSelected(TQDate date); bool dateSelected(); void updateSelectedCells(); void updateMarkedCells(); void updateCells(); - QDate getDate(int pos) const; + TQDate getDate(int pos) const; /** * pos can be 1..42 @@ -343,9 +348,9 @@ protected: int weekday(int col) const; int column(int weekday) const; - void paintWeekday(QPainter *painter, int col); - void paintWeekNumber(QPainter *painter, int row); - void paintDay(QPainter *painter, int row, int col); + void paintWeekday(TQPainter *painter, int col); + void paintWeekNumber(TQPainter *painter, int row); + void paintDay(TQPainter *painter, int row, int col); /** * The font size of the displayed text. @@ -354,7 +359,7 @@ protected: /** * The currently selected date. */ - QDate date; + TQDate date; /** * The day of the first day in the month [1..7]. */ @@ -370,13 +375,13 @@ protected: /** * Save the size of the largest used cell content. */ - QRect maxCell; + TQRect maxCell; signals: /** * The selected date changed. */ - void dateChanged(QDate); + void dateChanged(TQDate); /** * A date has been selected by clicking on the table. */ @@ -391,7 +396,7 @@ signals: private: - QMemArray< QPair<int, int> > m_weeks; + TQMemArray< TQPair<int, int> > m_weeks; int m_currentRow; // row of selected date @@ -407,13 +412,13 @@ private: int m_dateStartCol; bool m_enabled; - QColor colorBackgroundHoliday; - QColor colorBackgroundWorkday; - QColor colorTextHoliday; - QColor colorTextWorkday; - QColor colorLine; - QColor backgroundSelectColor; - QColor penSelectColor; + TQColor colorBackgroundHoliday; + TQColor colorBackgroundWorkday; + TQColor colorTextHoliday; + TQColor colorTextWorkday; + TQColor colorLine; + TQColor backgroundSelectColor; + TQColor penSelectColor; protected: virtual void virtual_hook( int id, void* data ); |