From 0a6e0958c03e41c87b15557b6f407874f20c2f8d Mon Sep 17 00:00:00 2001 From: tpearson Date: Sat, 31 Jul 2010 19:39:55 +0000 Subject: Trinity Qt initial conversion git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdeedu@1157642 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- libkdeedu/extdate/extcalendarsystem.cpp | 26 +- libkdeedu/extdate/extcalendarsystem.h | 42 +-- libkdeedu/extdate/extcalendarsystemgregorian.cpp | 24 +- libkdeedu/extdate/extcalendarsystemgregorian.h | 18 +- libkdeedu/extdate/extdatepicker.cpp | 162 ++++----- libkdeedu/extdate/extdatepicker.h | 30 +- libkdeedu/extdate/extdatetbl.cpp | 168 +++++----- libkdeedu/extdate/extdatetbl.h | 78 ++--- libkdeedu/extdate/extdatetime.cpp | 134 ++++---- libkdeedu/extdate/extdatetime.h | 70 ++-- libkdeedu/extdate/extdatetimeedit.cpp | 400 +++++++++++------------ libkdeedu/extdate/extdatetimeedit.h | 104 +++--- libkdeedu/extdate/extdatewidget.cpp | 46 +-- libkdeedu/extdate/extdatewidget.h | 6 +- libkdeedu/extdate/main.cpp | 2 +- libkdeedu/extdate/test_extdate.cc | 38 +-- libkdeedu/extdate/testwidget.cpp | 22 +- libkdeedu/extdate/testwidget.h | 6 +- 18 files changed, 688 insertions(+), 688 deletions(-) (limited to 'libkdeedu/extdate') diff --git a/libkdeedu/extdate/extcalendarsystem.cpp b/libkdeedu/extdate/extcalendarsystem.cpp index f5cd0a36..f453bb6f 100644 --- a/libkdeedu/extdate/extcalendarsystem.cpp +++ b/libkdeedu/extdate/extcalendarsystem.cpp @@ -4,7 +4,7 @@ Copyright (c) 2004 Jason Harris This class has been derived from ExtCalendarSystem; - the changesd made just replace QDate objects with ExtDate objects. + the changesd made just replace TQDate objects with ExtDate objects. These changes by Jason Harris This library is free software; you can redistribute it and/or @@ -57,9 +57,9 @@ const KLocale * ExtCalendarSystem::locale() const return KGlobal::locale(); } -QString ExtCalendarSystem::dayString(const ExtDate & pDate, bool bShort) const +TQString ExtCalendarSystem::dayString(const ExtDate & pDate, bool bShort) const { - QString sResult; + TQString sResult; sResult.setNum(day(pDate)); if (!bShort && sResult.length() == 1 ) @@ -68,9 +68,9 @@ QString ExtCalendarSystem::dayString(const ExtDate & pDate, bool bShort) const return sResult; } -QString ExtCalendarSystem::monthString(const ExtDate & pDate, bool bShort) const +TQString ExtCalendarSystem::monthString(const ExtDate & pDate, bool bShort) const { - QString sResult; + TQString sResult; sResult.setNum(month(pDate)); if (!bShort && sResult.length() == 1 ) @@ -79,9 +79,9 @@ QString ExtCalendarSystem::monthString(const ExtDate & pDate, bool bShort) const return sResult; } -QString ExtCalendarSystem::yearString(const ExtDate & pDate, bool bShort) const +TQString ExtCalendarSystem::yearString(const ExtDate & pDate, bool bShort) const { - QString sResult; + TQString sResult; sResult.setNum(year(pDate)); if (bShort && sResult.length() == 4 ) @@ -90,7 +90,7 @@ QString ExtCalendarSystem::yearString(const ExtDate & pDate, bool bShort) const return sResult; } -static int stringToInteger(const QString & sNum, int & iLength) +static int stringToInteger(const TQString & sNum, int & iLength) { unsigned int iPos = 0; @@ -106,22 +106,22 @@ static int stringToInteger(const QString & sNum, int & iLength) } -int ExtCalendarSystem::dayStringToInteger(const QString & sNum, int & iLength) const +int ExtCalendarSystem::dayStringToInteger(const TQString & sNum, int & iLength) const { return stringToInteger(sNum, iLength); } -int ExtCalendarSystem::monthStringToInteger(const QString & sNum, int & iLength) const +int ExtCalendarSystem::monthStringToInteger(const TQString & sNum, int & iLength) const { return stringToInteger(sNum, iLength); } -int ExtCalendarSystem::yearStringToInteger(const QString & sNum, int & iLength) const +int ExtCalendarSystem::yearStringToInteger(const TQString & sNum, int & iLength) const { return stringToInteger(sNum, iLength); } -QString ExtCalendarSystem::weekDayName (int weekDay, bool shortName) const +TQString ExtCalendarSystem::weekDayName (int weekDay, bool shortName) const { if ( shortName ) switch ( weekDay ) @@ -146,6 +146,6 @@ QString ExtCalendarSystem::weekDayName (int weekDay, bool shortName) const case 7: return locale()->translate("Sunday"); } - return QString::null; + return TQString::null; } diff --git a/libkdeedu/extdate/extcalendarsystem.h b/libkdeedu/extdate/extcalendarsystem.h index 5007ba90..be7ba336 100644 --- a/libkdeedu/extdate/extcalendarsystem.h +++ b/libkdeedu/extdate/extcalendarsystem.h @@ -4,7 +4,7 @@ Copyright (c) 2004 Jason Harris This class has been derived from KCalendarSystem; - the changesd made just replace QDate objects with ExtDate objects. + the changesd made just replace TQDate objects with ExtDate objects. These changes by Jason Harris This library is free software; you can redistribute it and/or @@ -73,7 +73,7 @@ public: * @param bShort If the short version of should be used * @return The year literal of the date */ - virtual QString yearString(const ExtDate & pDate, bool bShort) const; + virtual TQString yearString(const ExtDate & pDate, bool bShort) const; /** * Converts a year literal of a part of a string into a integer starting at the beginning of the string @@ -82,7 +82,7 @@ public: * @param iLength The number of QChars used, and 0 if no valid symbols was found in the string * @return An integer corresponding to the year */ - virtual int yearStringToInteger(const QString & sNum, int & iLength) const; + virtual int yearStringToInteger(const TQString & sNum, int & iLength) const; /** * Gets specific calendar type month for a given gregorian date @@ -99,7 +99,7 @@ public: * @param bShort If the short version of should be used * @return The month literal of the date */ - virtual QString monthString(const ExtDate & pDate, bool bShort) const; + virtual TQString monthString(const ExtDate & pDate, bool bShort) const; /** * Converts a month literal of a part of a string into a integer starting at the beginning of the string @@ -108,7 +108,7 @@ public: * @param iLength The number of QChars used, and 0 if no valid symbols was found in the string * @return An integer corresponding to the month */ - virtual int monthStringToInteger(const QString & sNum, int & iLength) const; + virtual int monthStringToInteger(const TQString & sNum, int & iLength) const; /** * Gets specific calendar type day number of month for a given date @@ -125,7 +125,7 @@ public: * @param bShort If the short version of should be used * @return The day literal of the date */ - virtual QString dayString(const ExtDate & pDate, bool bShort) const; + virtual TQString dayString(const ExtDate & pDate, bool bShort) const; /** * Converts a day literal of a part of a string into a integer starting at the beginning of the string @@ -134,7 +134,7 @@ public: * @param iLength The number of QChars used, and 0 if no valid symbols was found in the string * @return An integer corresponding to the day */ - virtual int dayStringToInteger(const QString & sNum, int & iLength) const; + virtual int dayStringToInteger(const TQString & sNum, int & iLength) const; /** * Gets specific calendar type number of day of week number for a given @@ -166,7 +166,7 @@ public: virtual bool setYMD(ExtDate & date, int y, int m, int d) const = 0; /** - * Returns a QDate object containing a date nyears later. + * Returns a TQDate object containing a date nyears later. * * @param date The old date * @param nyears The number of years to add @@ -175,7 +175,7 @@ public: virtual ExtDate addYears(const ExtDate & date, int nyears) const = 0; /** - * Returns a QDate object containing a date nmonths later. + * Returns a TQDate object containing a date nmonths later. * * @param date The old date * @param nmonths The number of months to add @@ -184,7 +184,7 @@ public: virtual ExtDate addMonths(const ExtDate & date, int nmonths) const = 0; /** - * Returns a QDate object containing a date ndays later. + * Returns a TQDate object containing a date ndays later. * * @param date The old date * @param ndays The number of days to add @@ -235,14 +235,14 @@ public: /** * Gets specific calendar type month name for a given month number - * If an invalid month is specified, QString::null is returned. + * If an invalid month is specified, TQString::null is returned. * * @param month The month number * @param year The year the month belongs to * @param shortName Specifies if the short month name should be used * @return The name of the month */ - virtual QString monthName (int month, int year, bool shortName = false) const = 0; + virtual TQString monthName (int month, int year, bool shortName = false) const = 0; /** * Gets specific calendar type month name for a given gregorian date @@ -251,13 +251,13 @@ public: * @param shortName Specifies if the short month name should be used * @return The name of the month */ - virtual QString monthName (const ExtDate & date, bool shortName = false ) const = 0; + virtual TQString monthName (const ExtDate & date, bool shortName = false ) const = 0; /** * Returns a string containing the possessive form of the month name. * ("of January", "of February", etc.) * It's needed in long format dates in some languages. - * If an invalid month is specified, QString::null is returned. + * If an invalid month is specified, TQString::null is returned. * * @param month The month number * @param year The year the month belongs to @@ -265,7 +265,7 @@ public: * * @return The possessive form of the name of the month */ - virtual QString monthNamePossessive(int month, int year, bool shortName = false) const = 0; + virtual TQString monthNamePossessive(int month, int year, bool shortName = false) const = 0; /** * Returns a string containing the possessive form of the month name. @@ -277,17 +277,17 @@ public: * * @return The possessive form of the name of the month */ - virtual QString monthNamePossessive(const ExtDate & date, bool shortName = false) const = 0; + virtual TQString monthNamePossessive(const ExtDate & date, bool shortName = false) const = 0; /** * Gets specific calendar type week day name - * If an invalid week day is specified, QString::null is returned. + * If an invalid week day is specified, TQString::null is returned. * * @param weekDay number of day in week (1 -> Monday) * @param shortName short or complete day name * @return day name */ - virtual QString weekDayName (int weekDay, bool shortName = false) const = 0; + virtual TQString weekDayName (int weekDay, bool shortName = false) const = 0; /** * Gets specific calendar type week day name @@ -296,7 +296,7 @@ public: * @param shortName short or complete day name * @return day name */ - virtual QString weekDayName (const ExtDate & date, bool shortName = false) const = 0; + virtual TQString weekDayName (const ExtDate & date, bool shortName = false) const = 0; /** * Gets the first year value supported by specific calendar type @@ -308,7 +308,7 @@ public: /** * Gets the maximum year value supported by specific calendar type - * algorithms (QDate, 8000) + * algorithms (TQDate, 8000) * * @return maximum year supported */ @@ -324,7 +324,7 @@ public: /** * Gets the string representing the calendar */ - virtual QString calendarName() const = 0; + virtual TQString calendarName() const = 0; /** * Gets if the calendar is lunar based diff --git a/libkdeedu/extdate/extcalendarsystemgregorian.cpp b/libkdeedu/extdate/extcalendarsystemgregorian.cpp index d358f595..47338f4b 100644 --- a/libkdeedu/extdate/extcalendarsystemgregorian.cpp +++ b/libkdeedu/extdate/extcalendarsystemgregorian.cpp @@ -4,7 +4,7 @@ Copyright (c) 2004 Jason Harris This class has been derived from KCalendarSystemGregorian; - the changesd made just replace QDate objects with ExtDate objects. + the changesd made just replace TQDate objects with ExtDate objects. These changes by Jason Harris This library is free software; you can redistribute it and/or @@ -72,18 +72,18 @@ int ExtCalendarSystemGregorian::weekNumber(const ExtDate& date, return date.weekNumber(yearNum); } -QString ExtCalendarSystemGregorian::monthName(const ExtDate& date, +TQString ExtCalendarSystemGregorian::monthName(const ExtDate& date, bool shortName) const { return monthName(month(date), year(date), shortName); } -QString ExtCalendarSystemGregorian::monthNamePossessive(const ExtDate& date, bool shortName) const +TQString ExtCalendarSystemGregorian::monthNamePossessive(const ExtDate& date, bool shortName) const { return monthNamePossessive(month(date), year(date), shortName); } -QString ExtCalendarSystemGregorian::monthName(int month, int year, bool shortName) const +TQString ExtCalendarSystemGregorian::monthName(int month, int year, bool shortName) const { Q_UNUSED(year); @@ -144,10 +144,10 @@ QString ExtCalendarSystemGregorian::monthName(int month, int year, bool shortNam return locale()->translate("December"); } - return QString::null; + return TQString::null; } -QString ExtCalendarSystemGregorian::monthNamePossessive(int month, int year, +TQString ExtCalendarSystemGregorian::monthNamePossessive(int month, int year, bool shortName) const { Q_UNUSED(year); @@ -209,7 +209,7 @@ QString ExtCalendarSystemGregorian::monthNamePossessive(int month, int year, return locale()->translate("of December"); } - return QString::null; + return TQString::null; } bool ExtCalendarSystemGregorian::setYMD(ExtDate & date, int y, int m, int d) const @@ -233,7 +233,7 @@ ExtDate ExtCalendarSystemGregorian::addDays(const ExtDate & date, int ndays) con return date.addDays(ndays); } -QString ExtCalendarSystemGregorian::weekDayName(int col, bool shortName) const +TQString ExtCalendarSystemGregorian::weekDayName(int col, bool shortName) const { // ### Should this really be different to each calendar system? Or are we // only going to support weeks with 7 days? @@ -241,7 +241,7 @@ QString ExtCalendarSystemGregorian::weekDayName(int col, bool shortName) const return ExtCalendarSystem::weekDayName(col, shortName); } -QString ExtCalendarSystemGregorian::weekDayName(const ExtDate& date, bool shortName) const +TQString ExtCalendarSystemGregorian::weekDayName(const ExtDate& date, bool shortName) const { return weekDayName(dayOfWeek(date), shortName); } @@ -292,9 +292,9 @@ int ExtCalendarSystemGregorian::weekDayOfPray() const return 7; // sunday } -QString ExtCalendarSystemGregorian::calendarName() const +TQString ExtCalendarSystemGregorian::calendarName() const { - return QString::fromLatin1("gregorian"); + return TQString::fromLatin1("gregorian"); } bool ExtCalendarSystemGregorian::isLunar() const @@ -312,7 +312,7 @@ bool ExtCalendarSystemGregorian::isSolar() const return true; } -int ExtCalendarSystemGregorian::yearStringToInteger(const QString & sNum, int & iLength) const +int ExtCalendarSystemGregorian::yearStringToInteger(const TQString & sNum, int & iLength) const { int iYear; iYear = ExtCalendarSystem::yearStringToInteger(sNum, iLength); diff --git a/libkdeedu/extdate/extcalendarsystemgregorian.h b/libkdeedu/extdate/extcalendarsystemgregorian.h index c426f997..6d1035c9 100644 --- a/libkdeedu/extdate/extcalendarsystemgregorian.h +++ b/libkdeedu/extdate/extcalendarsystemgregorian.h @@ -4,7 +4,7 @@ Copyright (c) 2004 Jason Harris This class has been derived from KCalendarSystemGregorian; - the changesd made just replace QDate objects with ExtDate objects. + the changesd made just replace TQDate objects with ExtDate objects. These changes by Jason Harris This library is free software; you can redistribute it and/or @@ -70,20 +70,20 @@ public: virtual int weeksInYear(int year) const; virtual int weekNumber(const ExtDate& date, int * yearNum = 0) const; - virtual int yearStringToInteger(const QString & sNum, int & iLength) const; + virtual int yearStringToInteger(const TQString & sNum, int & iLength) const; - virtual QString monthName (int month, int year, bool shortName = false) const; - virtual QString monthName (const ExtDate & date, bool shortName = false ) const; - virtual QString monthNamePossessive(int month, int year, bool shortName = false) const; - virtual QString monthNamePossessive(const ExtDate & date, bool shortName = false ) const; - virtual QString weekDayName (int weekDay, bool shortName = false) const; - virtual QString weekDayName (const ExtDate & date, bool shortName = false) const; + virtual TQString monthName (int month, int year, bool shortName = false) const; + virtual TQString monthName (const ExtDate & date, bool shortName = false ) const; + virtual TQString monthNamePossessive(int month, int year, bool shortName = false) const; + virtual TQString monthNamePossessive(const ExtDate & date, bool shortName = false ) const; + virtual TQString weekDayName (int weekDay, bool shortName = false) const; + virtual TQString weekDayName (const ExtDate & date, bool shortName = false) const; virtual int minValidYear () const; virtual int maxValidYear () const; virtual int weekDayOfPray () const; - virtual QString calendarName() const; + virtual TQString calendarName() const; virtual bool isLunar() const; virtual bool isLunisolar() const; diff --git a/libkdeedu/extdate/extdatepicker.cpp b/libkdeedu/extdate/extdatepicker.cpp index 22b4ba80..ad524863 100644 --- a/libkdeedu/extdate/extdatepicker.cpp +++ b/libkdeedu/extdate/extdatepicker.cpp @@ -20,11 +20,11 @@ Boston, MA 02110-1301, USA. */ -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include #include #include @@ -48,10 +48,10 @@ public: void fillWeeksCombo(const ExtDate &date); - QToolButton *closeButton; - QComboBox *selectWeek; - QToolButton *todayButton; - QBoxLayout *navigationLayout; + TQToolButton *closeButton; + TQComboBox *selectWeek; + TQToolButton *todayButton; + TQBoxLayout *navigationLayout; ExtCalendarSystem *calendar; }; @@ -77,26 +77,26 @@ void ExtDatePicker::fillWeeksCombo(const ExtDate &date) for (; day <= lastDay; day = d->calendar->addDays(day, 7 /*calendar->daysOfWeek()*/) ) { int year = 0; - QString week = i18n("Week %1").arg(d->calendar->weekNumber(day, &year)); + TQString week = i18n("Week %1").arg(d->calendar->weekNumber(day, &year)); if ( year != date.year() ) week += "*"; // show that this is a week from a different year d->selectWeek->insertItem(week); } } -ExtDatePicker::ExtDatePicker(QWidget *parent, ExtDate dt, const char *name) - : QFrame(parent,name) +ExtDatePicker::ExtDatePicker(TQWidget *parent, ExtDate dt, const char *name) + : TQFrame(parent,name) { init( dt ); } -ExtDatePicker::ExtDatePicker(QWidget *parent, ExtDate dt, const char *name, WFlags f) - : QFrame(parent,name, f) +ExtDatePicker::ExtDatePicker(TQWidget *parent, ExtDate dt, const char *name, WFlags f) + : TQFrame(parent,name, f) { init( dt ); } -ExtDatePicker::ExtDatePicker( QWidget *parent, const char *name ) - : QFrame(parent,name) +ExtDatePicker::ExtDatePicker( TQWidget *parent, const char *name ) + : TQFrame(parent,name) { init( ExtDate::currentDate() ); } @@ -107,31 +107,31 @@ void ExtDatePicker::init( const ExtDate &dt ) d->calendar = new ExtCalendarSystemGregorian(); - QBoxLayout * topLayout = new QVBoxLayout(this); + TQBoxLayout * topLayout = new TQVBoxLayout(this); - d->navigationLayout = new QHBoxLayout(topLayout); + d->navigationLayout = new TQHBoxLayout(topLayout); d->navigationLayout->addStretch(); - yearBackward = new QToolButton(this); + yearBackward = new TQToolButton(this); yearBackward->setAutoRaise(true); d->navigationLayout->addWidget(yearBackward); - monthBackward = new QToolButton(this); + monthBackward = new TQToolButton(this); monthBackward ->setAutoRaise(true); d->navigationLayout->addWidget(monthBackward); d->navigationLayout->addSpacing(KDialog::spacingHint()); - selectMonth = new QToolButton(this); + selectMonth = new TQToolButton(this); selectMonth ->setAutoRaise(true); d->navigationLayout->addWidget(selectMonth); - selectYear = new QToolButton(this); + selectYear = new TQToolButton(this); selectYear->setToggleButton(true); selectYear->setAutoRaise(true); d->navigationLayout->addWidget(selectYear); d->navigationLayout->addSpacing(KDialog::spacingHint()); - monthForward = new QToolButton(this); + monthForward = new TQToolButton(this); monthForward ->setAutoRaise(true); d->navigationLayout->addWidget(monthForward); - yearForward = new QToolButton(this); + yearForward = new TQToolButton(this); yearForward ->setAutoRaise(true); d->navigationLayout->addWidget(yearForward); d->navigationLayout->addStretch(); @@ -141,22 +141,22 @@ void ExtDatePicker::init( const ExtDate &dt ) table = new ExtDateTable(this); fontsize = KGlobalSettings::generalFont().pointSize(); if (fontsize == -1) - fontsize = QFontInfo(KGlobalSettings::generalFont()).pointSize(); + fontsize = TQFontInfo(KGlobalSettings::generalFont()).pointSize(); fontsize++; // Make a little bigger - d->selectWeek = new QComboBox(false, this); // read only week selection - d->todayButton = new QToolButton(this); + d->selectWeek = new TQComboBox(false, this); // read only week selection + d->todayButton = new TQToolButton(this); d->todayButton->setIconSet(SmallIconSet("today")); - QToolTip::add(yearForward, i18n("Next year")); - QToolTip::add(yearBackward, i18n("Previous year")); - QToolTip::add(monthForward, i18n("Next month")); - QToolTip::add(monthBackward, i18n("Previous month")); - QToolTip::add(d->selectWeek, i18n("Select a week")); - QToolTip::add(selectMonth, i18n("Select a month")); - QToolTip::add(selectYear, i18n("Select a year")); - QToolTip::add(d->todayButton, i18n("Select the current day")); + TQToolTip::add(yearForward, i18n("Next year")); + TQToolTip::add(yearBackward, i18n("Previous year")); + TQToolTip::add(monthForward, i18n("Next month")); + TQToolTip::add(monthBackward, i18n("Previous month")); + TQToolTip::add(d->selectWeek, i18n("Select a week")); + TQToolTip::add(selectMonth, i18n("Select a month")); + TQToolTip::add(selectYear, i18n("Select a year")); + TQToolTip::add(d->todayButton, i18n("Select the current day")); // ----- setFontSize(fontsize); @@ -164,37 +164,37 @@ void ExtDatePicker::init( const ExtDate &dt ) line->installEventFilter( this ); line->setReadOnly( true ); - if ( QApplication::reverseLayout() ) + if ( TQApplication::reverseLayout() ) { - yearForward->setIconSet(BarIconSet(QString::fromLatin1("2leftarrow"))); - yearBackward->setIconSet(BarIconSet(QString::fromLatin1("2rightarrow"))); - monthForward->setIconSet(BarIconSet(QString::fromLatin1("1leftarrow"))); - monthBackward->setIconSet(BarIconSet(QString::fromLatin1("1rightarrow"))); + yearForward->setIconSet(BarIconSet(TQString::fromLatin1("2leftarrow"))); + yearBackward->setIconSet(BarIconSet(TQString::fromLatin1("2rightarrow"))); + monthForward->setIconSet(BarIconSet(TQString::fromLatin1("1leftarrow"))); + monthBackward->setIconSet(BarIconSet(TQString::fromLatin1("1rightarrow"))); } else { - yearForward->setIconSet(BarIconSet(QString::fromLatin1("2rightarrow"))); - yearBackward->setIconSet(BarIconSet(QString::fromLatin1("2leftarrow"))); - monthForward->setIconSet(BarIconSet(QString::fromLatin1("1rightarrow"))); - monthBackward->setIconSet(BarIconSet(QString::fromLatin1("1leftarrow"))); + yearForward->setIconSet(BarIconSet(TQString::fromLatin1("2rightarrow"))); + yearBackward->setIconSet(BarIconSet(TQString::fromLatin1("2leftarrow"))); + monthForward->setIconSet(BarIconSet(TQString::fromLatin1("1rightarrow"))); + monthBackward->setIconSet(BarIconSet(TQString::fromLatin1("1leftarrow"))); } - connect(table, SIGNAL(dateChanged(const ExtDate&)), SLOT(dateChangedSlot(const ExtDate&))); - connect(table, SIGNAL(tableClicked()), SLOT(tableClickedSlot())); - connect(monthForward, SIGNAL(clicked()), SLOT(monthForwardClicked())); - connect(monthBackward, SIGNAL(clicked()), SLOT(monthBackwardClicked())); - connect(yearForward, SIGNAL(clicked()), SLOT(yearForwardClicked())); - connect(yearBackward, SIGNAL(clicked()), SLOT(yearBackwardClicked())); - connect(d->selectWeek, SIGNAL(activated(int)), SLOT(weekSelected(int))); - connect(d->todayButton, SIGNAL(clicked()), SLOT(todayButtonClicked())); - connect(selectMonth, SIGNAL(clicked()), SLOT(selectMonthClicked())); - connect(selectYear, SIGNAL(toggled(bool)), SLOT(selectYearClicked())); - connect(line, SIGNAL(returnPressed()), SLOT(lineEnterPressed())); + connect(table, TQT_SIGNAL(dateChanged(const ExtDate&)), TQT_SLOT(dateChangedSlot(const ExtDate&))); + connect(table, TQT_SIGNAL(tableClicked()), TQT_SLOT(tableClickedSlot())); + connect(monthForward, TQT_SIGNAL(clicked()), TQT_SLOT(monthForwardClicked())); + connect(monthBackward, TQT_SIGNAL(clicked()), TQT_SLOT(monthBackwardClicked())); + connect(yearForward, TQT_SIGNAL(clicked()), TQT_SLOT(yearForwardClicked())); + connect(yearBackward, TQT_SIGNAL(clicked()), TQT_SLOT(yearBackwardClicked())); + connect(d->selectWeek, TQT_SIGNAL(activated(int)), TQT_SLOT(weekSelected(int))); + connect(d->todayButton, TQT_SIGNAL(clicked()), TQT_SLOT(todayButtonClicked())); + connect(selectMonth, TQT_SIGNAL(clicked()), TQT_SLOT(selectMonthClicked())); + connect(selectYear, TQT_SIGNAL(toggled(bool)), TQT_SLOT(selectYearClicked())); + connect(line, TQT_SIGNAL(returnPressed()), TQT_SLOT(lineEnterPressed())); table->setFocus(); topLayout->addWidget(table); - QBoxLayout * bottomLayout = new QHBoxLayout(topLayout); + TQBoxLayout * bottomLayout = new TQHBoxLayout(topLayout); bottomLayout->addWidget(d->todayButton); bottomLayout->addWidget(line); bottomLayout->addWidget(d->selectWeek); @@ -209,28 +209,28 @@ ExtDatePicker::~ExtDatePicker() } bool -ExtDatePicker::eventFilter(QObject *o, QEvent *e ) +ExtDatePicker::eventFilter(TQObject *o, TQEvent *e ) { - if ( e->type() == QEvent::KeyPress ) { - QKeyEvent *k = (QKeyEvent *)e; + if ( e->type() == TQEvent::KeyPress ) { + TQKeyEvent *k = (TQKeyEvent *)e; if ( (k->key() == Qt::Key_Prior) || (k->key() == Qt::Key_Next) || (k->key() == Qt::Key_Up) || (k->key() == Qt::Key_Down) ) { - QApplication::sendEvent( table, e ); + TQApplication::sendEvent( table, e ); table->setFocus(); return true; // eat event } } - return QFrame::eventFilter( o, e ); + return TQFrame::eventFilter( o, e ); } void -ExtDatePicker::resizeEvent(QResizeEvent* e) +ExtDatePicker::resizeEvent(TQResizeEvent* e) { - QWidget::resizeEvent(e); + TQWidget::resizeEvent(e); } void @@ -353,14 +353,14 @@ ExtDatePicker::selectMonthClicked() ExtDate date = table->getDate(); int i, month, months = d->calendar->monthsInYear(date); - QPopupMenu popup(selectMonth); + TQPopupMenu popup(selectMonth); for (i = 1; i <= months; i++) popup.insertItem(d->calendar->monthName(i, d->calendar->year(date)), i); popup.setActiveItem(d->calendar->month(date) - 1); - if ( (month = popup.exec(selectMonth->mapToGlobal(QPoint(0, 0)), d->calendar->month(date) - 1)) == -1 ) return; // canceled + if ( (month = popup.exec(selectMonth->mapToGlobal(TQPoint(0, 0)), d->calendar->month(date) - 1)) == -1 ) return; // canceled int day = d->calendar->day(date); // ----- construct a valid date in this month: @@ -377,7 +377,7 @@ ExtDatePicker::selectYearClicked() { // const ExtCalendarSystem * calendar = KGlobal::locale()->calendar(); - if (selectYear->state() == QButton::Off) + if (selectYear->state() == TQButton::Off) { return; } @@ -388,9 +388,9 @@ ExtDatePicker::selectYearClicked() // ----- picker->resize(picker->sizeHint()); popup->setMainWidget(picker); - connect(picker, SIGNAL(closeMe(int)), popup, SLOT(close(int))); + connect(picker, TQT_SIGNAL(closeMe(int)), popup, TQT_SLOT(close(int))); picker->setFocus(); - if(popup->exec(selectYear->mapToGlobal(QPoint(0, selectMonth->height())))) + if(popup->exec(selectYear->mapToGlobal(TQPoint(0, selectMonth->height())))) { ExtDate date; int day; @@ -414,7 +414,7 @@ ExtDatePicker::selectYearClicked() void ExtDatePicker::setEnabled(bool enable) { - QWidget *widgets[]= { + TQWidget *widgets[]= { yearForward, yearBackward, monthForward, monthBackward, selectMonth, selectYear, line, table, d->selectWeek, d->todayButton }; @@ -432,7 +432,7 @@ ExtDatePicker::lineEnterPressed() { ExtDate temp; // ----- - if(val->date(line->text(), temp)==QValidator::Acceptable) + if(val->date(line->text(), temp)==TQValidator::Acceptable) { kdDebug(298) << "ExtDatePicker::lineEnterPressed: valid date entered." << endl; emit(dateEntered(temp)); @@ -452,13 +452,13 @@ ExtDatePicker::todayButtonClicked() QSize ExtDatePicker::sizeHint() const { - return QWidget::sizeHint(); + return TQWidget::sizeHint(); } void ExtDatePicker::setFontSize(int s) { - QWidget *buttons[]= { + TQWidget *buttons[]= { // yearBackward, // monthBackward, selectMonth, @@ -468,8 +468,8 @@ ExtDatePicker::setFontSize(int s) }; const int NoOfButtons=sizeof(buttons)/sizeof(buttons[0]); int count; - QFont font; - QRect r; + TQFont font; + TQRect r; // ----- fontsize=s; for(count=0; countsetFont(font); } - QFontMetrics metrics(selectMonth->fontMetrics()); + TQFontMetrics metrics(selectMonth->fontMetrics()); for (int i = 1; ; ++i) { - QString str = d->calendar->monthName(i, + TQString str = d->calendar->monthName(i, d->calendar->year(table->getDate()), false); if (str.isNull()) break; r=metrics.boundingRect(str); @@ -490,7 +490,7 @@ ExtDatePicker::setFontSize(int s) maxMonthRect.setHeight(QMAX(r.height(), maxMonthRect.height())); } - QSize metricBound = style().sizeFromContents(QStyle::CT_ToolButton, + TQSize metricBound = style().sizeFromContents(TQStyle::CT_ToolButton, selectMonth, maxMonthRect); selectMonth->setMinimumSize(metricBound); @@ -505,14 +505,14 @@ ExtDatePicker::setCloseButton( bool enable ) return; if ( enable ) { - d->closeButton = new QToolButton( this ); + d->closeButton = new TQToolButton( this ); d->closeButton->setAutoRaise(true); d->navigationLayout->addSpacing(KDialog::spacingHint()); d->navigationLayout->addWidget(d->closeButton); - QToolTip::add(d->closeButton, i18n("Close")); + TQToolTip::add(d->closeButton, i18n("Close")); d->closeButton->setPixmap( SmallIcon("remove") ); - connect( d->closeButton, SIGNAL( clicked() ), - topLevelWidget(), SLOT( close() ) ); + connect( d->closeButton, TQT_SIGNAL( clicked() ), + topLevelWidget(), TQT_SLOT( close() ) ); } else { delete d->closeButton; diff --git a/libkdeedu/extdate/extdatepicker.h b/libkdeedu/extdate/extdatepicker.h index 58fae58a..732ff7e1 100644 --- a/libkdeedu/extdate/extdatepicker.h +++ b/libkdeedu/extdate/extdatepicker.h @@ -60,7 +60,7 @@ public: /** The usual constructor. The given date will be displayed * initially. **/ - ExtDatePicker(QWidget *parent=0, + ExtDatePicker(TQWidget *parent=0, ExtDate=ExtDate::currentDate(), const char *name=0); @@ -68,7 +68,7 @@ public: * initially. * @since 3.1 **/ - ExtDatePicker(QWidget *parent, + ExtDatePicker(TQWidget *parent, ExtDate, const char *name, WFlags f); // ### KDE 4.0: Merge @@ -78,7 +78,7 @@ public: * current date. * @since 3.1 */ - ExtDatePicker( QWidget *parent, const char *name ); + ExtDatePicker( TQWidget *parent, const char *name ); /** * The destructor. @@ -91,7 +91,7 @@ public: * size hint, try adding 28 to each of the reported numbers of * pixels. **/ - QSize sizeHint() const; + TQSize sizeHint() const; /** * Sets the date. @@ -153,22 +153,22 @@ public: bool hasCloseButton() const; protected: - /// to catch move keyEvents when QLineEdit has keyFocus - virtual bool eventFilter(QObject *o, QEvent *e ); + /// to catch move keyEvents when TQLineEdit has keyFocus + virtual bool eventFilter(TQObject *o, TQEvent *e ); /// the resize event - virtual void resizeEvent(QResizeEvent*); + virtual void resizeEvent(TQResizeEvent*); /// the year forward button - QToolButton *yearForward; + TQToolButton *yearForward; /// the year backward button - QToolButton *yearBackward; + TQToolButton *yearBackward; /// the month forward button - QToolButton *monthForward; + TQToolButton *monthForward; /// the month backward button - QToolButton *monthBackward; + TQToolButton *monthBackward; /// the button for selecting the month directly - QToolButton *selectMonth; + TQToolButton *selectMonth; /// the button for selecting the year directly - QToolButton *selectYear; + TQToolButton *selectYear; /// the line edit to enter the date directly KLineEdit *line; /// the validator for the line edit: @@ -176,9 +176,9 @@ protected: /// the date table ExtDateTable *table; /// the size calculated during resize events - // QSize sizehint; + // TQSize sizehint; /// the widest month string in pixels: - QSize maxMonthRect; + TQSize maxMonthRect; protected slots: void dateChangedSlot(const ExtDate&); void tableClickedSlot(); diff --git a/libkdeedu/extdate/extdatetbl.cpp b/libkdeedu/extdate/extdatetbl.cpp index 43a33a76..ca403a68 100644 --- a/libkdeedu/extdate/extdatetbl.cpp +++ b/libkdeedu/extdate/extdatetbl.cpp @@ -5,7 +5,7 @@ (C) 2004 Jason Harris (jharris@30doradus.org) These classes has been derived from those in kdatetbl.[h|cpp]. - The only differences are adaptations to use ExtDate instead of QDate, + The only differences are adaptations to use ExtDate instead of TQDate, to allow for more remote dates. These changes by Jason Harris. This library is free software; you can redistribute it and/or @@ -47,8 +47,8 @@ #include #include #include "kpopupmenu.h" -#include -#include +#include +#include #include @@ -73,30 +73,30 @@ public: struct DatePaintingMode { - QColor fgColor; - QColor bgColor; + TQColor fgColor; + TQColor bgColor; BackgroundMode bgMode; }; - QDict customPaintingModes; + TQDict customPaintingModes; ExtCalendarSystem *calendar; }; -ExtDateValidator::ExtDateValidator(QWidget* parent, const char* name) - : QValidator(parent, name) +ExtDateValidator::ExtDateValidator(TQWidget* parent, const char* name) + : TQValidator(parent, name) { } -QValidator::State -ExtDateValidator::validate(QString& text, int&) const +TQValidator::State +ExtDateValidator::validate(TQString& text, int&) const { ExtDate temp; // ----- everything is tested in date(): return date(text, temp); } -QValidator::State -ExtDateValidator::date(const QString& text, ExtDate& ed) const +TQValidator::State +ExtDateValidator::date(const TQString& text, ExtDate& ed) const { //FIXME: Can't uncomment unless ExtDate is adopted by KDE //ExtDate tmp = KGlobal::locale()->readDate(text); @@ -111,13 +111,13 @@ ExtDateValidator::date(const QString& text, ExtDate& ed) const } void -ExtDateValidator::fixup( QString& ) const +ExtDateValidator::fixup( TQString& ) const { } -ExtDateTable::ExtDateTable(QWidget *parent, ExtDate date_, const char* name, WFlags f) - : QGridView(parent, name, f) +ExtDateTable::ExtDateTable(TQWidget *parent, ExtDate date_, const char* name, WFlags f) + : TQGridView(parent, name, f) { d = new ExtDateTablePrivate; setFontSize(10); @@ -126,7 +126,7 @@ ExtDateTable::ExtDateTable(QWidget *parent, ExtDate date_, const char* name, WFl kdDebug() << "ExtDateTable ctor: WARNING: Given date is invalid, using current date." << endl; date_=ExtDate::currentDate(); } - setFocusPolicy( QWidget::StrongFocus ); + setFocusPolicy( TQWidget::StrongFocus ); setNumRows(7); // 6 weeks max + headline setNumCols(7); // 7 days a week setHScrollBarMode(AlwaysOff); @@ -177,19 +177,19 @@ ExtDate ExtDateTable::dateFromPos( int pos ) } void -ExtDateTable::paintCell(QPainter *painter, int row, int col) +ExtDateTable::paintCell(TQPainter *painter, int row, int col) { //FIXME: Can't uncomment unless ExtDate is added to kdelibs // const ExtCalendarSystem * calendar = KGlobal::locale()->calendar(); // int firstWeekDay = KGlobal::locale()->weekStartDay(); const int firstWeekDay = 7; - QRect rect; - QString text; - QPen pen; + TQRect rect; + TQString text; + TQPen pen; int w=cellWidth(); int h=cellHeight(); - QFont font=KGlobalSettings::generalFont(); + TQFont font=KGlobalSettings::generalFont(); // ----- if(row==0) @@ -203,10 +203,10 @@ ExtDateTable::paintCell(QPainter *painter, int row, int col) ( daynum == 6 && d->calendar->calendarName() == "gregorian" ) ) normalday=false; - QBrush brushTitle(); - QBrush brushInvertTitle(colorGroup().base()); - QColor titleColor(isEnabled()?( KGlobalSettings::activeTitleColor() ):( KGlobalSettings::inactiveTitleColor() ) ); - QColor textColor(isEnabled()?( KGlobalSettings::activeTextColor() ):( KGlobalSettings::inactiveTextColor() ) ); + TQBrush brushTitle(); + TQBrush brushInvertTitle(colorGroup().base()); + TQColor titleColor(isEnabled()?( KGlobalSettings::activeTitleColor() ):( KGlobalSettings::inactiveTitleColor() ) ); + TQColor textColor(isEnabled()?( KGlobalSettings::activeTextColor() ):( KGlobalSettings::inactiveTextColor() ) ); if (!normalday) { painter->setPen(textColor); @@ -248,7 +248,7 @@ ExtDateTable::paintCell(QPainter *painter, int row, int col) { if (mode->bgMode != NoBgMode) { - QBrush oldbrush=painter->brush(); + TQBrush oldbrush=painter->brush(); painter->setBrush( mode->bgColor ); switch(mode->bgMode) { @@ -300,7 +300,7 @@ ExtDateTable::paintCell(QPainter *painter, int row, int col) } void -ExtDateTable::keyPressEvent( QKeyEvent *e ) +ExtDateTable::keyPressEvent( TQKeyEvent *e ) { //FIXME: Can't uncomment unless ExtDate is added to kdelibs // const ExtCalendarSystem * calendar = KGlobal::locale()->calendar(); @@ -361,9 +361,9 @@ ExtDateTable::keyPressEvent( QKeyEvent *e ) } void -ExtDateTable::viewportResizeEvent(QResizeEvent * e) +ExtDateTable::viewportResizeEvent(TQResizeEvent * e) { - QGridView::viewportResizeEvent(e); + TQGridView::viewportResizeEvent(e); setCellWidth(viewport()->width()/7); setCellHeight(viewport()->height()/7); @@ -376,8 +376,8 @@ ExtDateTable::setFontSize(int size) // const ExtCalendarSystem * calendar = KGlobal::locale()->calendar(); int count; - QFontMetrics metrics(fontMetrics()); - QRect rect; + TQFontMetrics metrics(fontMetrics()); + TQRect rect; // ----- store rectangles: fontsize=size; // ----- find largest day name: @@ -390,23 +390,23 @@ ExtDateTable::setFontSize(int size) maxCell.setHeight(QMAX(maxCell.height(), rect.height())); } // ----- compare with a real wide number and add some space: - rect=metrics.boundingRect(QString::fromLatin1("88")); + rect=metrics.boundingRect(TQString::fromLatin1("88")); maxCell.setWidth(QMAX(maxCell.width()+2, rect.width())); maxCell.setHeight(QMAX(maxCell.height()+4, rect.height())); } void -ExtDateTable::wheelEvent ( QWheelEvent * e ) +ExtDateTable::wheelEvent ( TQWheelEvent * e ) { setDate(date.addMonths( -(int)(e->delta()/120)) ); e->accept(); } void -ExtDateTable::contentsMousePressEvent(QMouseEvent *e) +ExtDateTable::contentsMousePressEvent(TQMouseEvent *e) { - if(e->type()!=QEvent::MouseButtonPress) + if(e->type()!=TQEvent::MouseButtonPress) { // the ExtDatePicker only reacts on mouse press events: return; } @@ -418,7 +418,7 @@ ExtDateTable::contentsMousePressEvent(QMouseEvent *e) // ----- int row, col, pos, temp; - QPoint mouseCoord; + TQPoint mouseCoord; // ----- mouseCoord = e->pos(); row=rowAt(mouseCoord.y()); @@ -506,16 +506,16 @@ ExtDateTable::getDate() const } // what are those repaintContents() good for? (pfeiffer) -void ExtDateTable::focusInEvent( QFocusEvent *e ) +void ExtDateTable::focusInEvent( TQFocusEvent *e ) { // repaintContents(false); - QGridView::focusInEvent( e ); + TQGridView::focusInEvent( e ); } -void ExtDateTable::focusOutEvent( QFocusEvent *e ) +void ExtDateTable::focusOutEvent( TQFocusEvent *e ) { // repaintContents(false); - QGridView::focusOutEvent( e ); + TQGridView::focusOutEvent( e ); } QSize @@ -523,11 +523,11 @@ ExtDateTable::sizeHint() const { if(maxCell.height()>0 && maxCell.width()>0) { - return QSize(maxCell.width()*numCols()+2*frameWidth(), + return TQSize(maxCell.width()*numCols()+2*frameWidth(), (maxCell.height()+2)*numRows()+2*frameWidth()); } else { kdDebug() << "ExtDateTable::sizeHint: obscure failure - " << endl; - return QSize(-1, -1); + return TQSize(-1, -1); } } @@ -541,7 +541,7 @@ bool ExtDateTable::popupMenuEnabled() const return d->popupMenuEnabled; } -void ExtDateTable::setCustomDatePainting(const ExtDate &date, const QColor &fgColor, BackgroundMode bgMode, const QColor &bgColor) +void ExtDateTable::setCustomDatePainting(const ExtDate &date, const TQColor &fgColor, BackgroundMode bgMode, const TQColor &bgColor) { if (!fgColor.isValid()) { @@ -565,18 +565,18 @@ void ExtDateTable::unsetCustomDatePainting( const ExtDate &date ) } ExtDateInternalWeekSelector::ExtDateInternalWeekSelector -(QWidget* parent, const char* name) +(TQWidget* parent, const char* name) : KLineEdit(parent, name), - val(new QIntValidator(this)), + val(new TQIntValidator(this)), result(0) { - QFont font; + TQFont font; // ----- font=KGlobalSettings::generalFont(); setFont(font); - setFrameStyle(QFrame::NoFrame); + setFrameStyle(TQFrame::NoFrame); setValidator(val); - connect(this, SIGNAL(returnPressed()), SLOT(weekEnteredSlot())); + connect(this, TQT_SIGNAL(returnPressed()), TQT_SLOT(weekEnteredSlot())); } void @@ -604,7 +604,7 @@ ExtDateInternalWeekSelector::getWeek() void ExtDateInternalWeekSelector::setWeek(int week) { - QString temp; + TQString temp; // ----- temp.setNum(week); setText(temp); @@ -638,15 +638,15 @@ ExtDateInternalMonthPicker::~ExtDateInternalMonthPicker() { } ExtDateInternalMonthPicker::ExtDateInternalMonthPicker -(const ExtDate & date, QWidget* parent, const char* name) - : QGridView(parent, name), +(const ExtDate & date, TQWidget* parent, const char* name) + : TQGridView(parent, name), result(0) // invalid { //FIXME: Can't uncomment the following unless ExtDate is moved to kdelibs // ExtCalendarSystem *calendar = KGlobal::locale()->calendar(); - QRect rect; - QFont font; + TQRect rect; + TQFont font; // ----- activeCol = -1; activeRow = -1; @@ -654,7 +654,7 @@ ExtDateInternalMonthPicker::ExtDateInternalMonthPicker setFont(font); setHScrollBarMode(AlwaysOff); setVScrollBarMode(AlwaysOff); - setFrameStyle(QFrame::NoFrame); + setFrameStyle(TQFrame::NoFrame); setNumCols(3); d = new ExtDateInternalMonthPrivate(date.year(), date.month(), date.day()); // For monthsInYear != 12 @@ -664,10 +664,10 @@ ExtDateInternalMonthPicker::ExtDateInternalMonthPicker viewport()->setEraseColor(KGlobalSettings::baseColor()); // for consistency with the datepicker // ----- find the preferred size // (this is slow, possibly, but unfortunately it is needed here): - QFontMetrics metrics(font); + TQFontMetrics metrics(font); for(int i = 1; ; ++i) { - QString str = d->calendar->monthName(i, + TQString str = d->calendar->monthName(i, d->calendar->year(date), false); if (str.isNull()) break; rect=metrics.boundingRect(str); @@ -679,7 +679,7 @@ ExtDateInternalMonthPicker::ExtDateInternalMonthPicker QSize ExtDateInternalMonthPicker::sizeHint() const { - return QSize((max.width()+6)*numCols()+2*frameWidth(), + return TQSize((max.width()+6)*numCols()+2*frameWidth(), (max.height()+6)*numRows()+2*frameWidth()); } @@ -690,23 +690,23 @@ ExtDateInternalMonthPicker::getResult() const } void -ExtDateInternalMonthPicker::setupPainter(QPainter *p) +ExtDateInternalMonthPicker::setupPainter(TQPainter *p) { p->setPen(KGlobalSettings::textColor()); } void -ExtDateInternalMonthPicker::viewportResizeEvent(QResizeEvent*) +ExtDateInternalMonthPicker::viewportResizeEvent(TQResizeEvent*) { setCellWidth(width() / numCols()); setCellHeight(height() / numRows()); } void -ExtDateInternalMonthPicker::paintCell(QPainter* painter, int row, int col) +ExtDateInternalMonthPicker::paintCell(TQPainter* painter, int row, int col) { int index; - QString text; + TQString text; // ----- find the number of the cell: index=3*row+col+1; text=d->calendar->monthName(index, @@ -718,7 +718,7 @@ ExtDateInternalMonthPicker::paintCell(QPainter* painter, int row, int col) } void -ExtDateInternalMonthPicker::contentsMousePressEvent(QMouseEvent *e) +ExtDateInternalMonthPicker::contentsMousePressEvent(TQMouseEvent *e) { if(!isEnabled() || e->button() != LeftButton) { @@ -727,7 +727,7 @@ ExtDateInternalMonthPicker::contentsMousePressEvent(QMouseEvent *e) } // ----- int row, col; - QPoint mouseCoord; + TQPoint mouseCoord; // ----- mouseCoord = e->pos(); row=rowAt(mouseCoord.y()); @@ -745,12 +745,12 @@ ExtDateInternalMonthPicker::contentsMousePressEvent(QMouseEvent *e) } void -ExtDateInternalMonthPicker::contentsMouseMoveEvent(QMouseEvent *e) +ExtDateInternalMonthPicker::contentsMouseMoveEvent(TQMouseEvent *e) { if (e->state() & LeftButton) { int row, col; - QPoint mouseCoord; + TQPoint mouseCoord; // ----- mouseCoord = e->pos(); row=rowAt(mouseCoord.y()); @@ -785,7 +785,7 @@ ExtDateInternalMonthPicker::contentsMouseMoveEvent(QMouseEvent *e) } void -ExtDateInternalMonthPicker::contentsMouseReleaseEvent(QMouseEvent *e) +ExtDateInternalMonthPicker::contentsMouseReleaseEvent(TQMouseEvent *e) { if(!isEnabled()) { @@ -793,7 +793,7 @@ ExtDateInternalMonthPicker::contentsMouseReleaseEvent(QMouseEvent *e) } // ----- int row, col, pos; - QPoint mouseCoord; + TQPoint mouseCoord; // ----- mouseCoord = e->pos(); row=rowAt(mouseCoord.y()); @@ -811,22 +811,22 @@ ExtDateInternalMonthPicker::contentsMouseReleaseEvent(QMouseEvent *e) ExtDateInternalYearSelector::ExtDateInternalYearSelector -(QWidget* parent, const char* name) - : QLineEdit(parent, name), - val(new QIntValidator(this)), +(TQWidget* parent, const char* name) + : TQLineEdit(parent, name), + val(new TQIntValidator(this)), result(0), d(new ExtDateInternalYearPrivate()) { - QFont font; + TQFont font; // ----- font=KGlobalSettings::generalFont(); setFont(font); - setFrameStyle(QFrame::NoFrame); + setFrameStyle(TQFrame::NoFrame); // set year limits (perhaps we should get rid of limits altogether) //there si also a year limit in ExtCalendarSystemGregorian... val->setRange(-50000, 50000); setValidator(val); - connect(this, SIGNAL(returnPressed()), SLOT(yearEnteredSlot())); + connect(this, TQT_SIGNAL(returnPressed()), TQT_SLOT(yearEnteredSlot())); } ExtDateInternalYearSelector::~ExtDateInternalYearSelector() { @@ -867,23 +867,23 @@ ExtDateInternalYearSelector::getYear() void ExtDateInternalYearSelector::setYear(int year) { - QString temp; + TQString temp; // ----- temp.setNum(year); setText(temp); } -KPopupFrame::KPopupFrame(QWidget* parent, const char* name) - : QFrame(parent, name, WType_Popup), +KPopupFrame::KPopupFrame(TQWidget* parent, const char* name) + : TQFrame(parent, name, WType_Popup), result(0), // rejected main(0) { - setFrameStyle(QFrame::Box|QFrame::Raised); + setFrameStyle(TQFrame::Box|TQFrame::Raised); setMidLineWidth(2); } void -KPopupFrame::keyPressEvent(QKeyEvent* e) +KPopupFrame::keyPressEvent(TQKeyEvent* e) { if(e->key()==Key_Escape) { @@ -900,7 +900,7 @@ KPopupFrame::close(int r) } void -KPopupFrame::setMainWidget(QWidget* m) +KPopupFrame::setMainWidget(TQWidget* m) { main=m; if(main!=0) @@ -910,7 +910,7 @@ KPopupFrame::setMainWidget(QWidget* m) } void -KPopupFrame::resizeEvent(QResizeEvent*) +KPopupFrame::resizeEvent(TQResizeEvent*) { if(main!=0) { @@ -920,10 +920,10 @@ KPopupFrame::resizeEvent(QResizeEvent*) } void -KPopupFrame::popup(const QPoint &pos) +KPopupFrame::popup(const TQPoint &pos) { // Make sure the whole popup is visible. - QRect d = KGlobalSettings::desktopGeometry(pos); + TQRect d = KGlobalSettings::desktopGeometry(pos); int x = pos.x(); int y = pos.y(); @@ -944,7 +944,7 @@ KPopupFrame::popup(const QPoint &pos) } int -KPopupFrame::exec(QPoint pos) +KPopupFrame::exec(TQPoint pos) { popup(pos); repaint(); @@ -956,7 +956,7 @@ KPopupFrame::exec(QPoint pos) int KPopupFrame::exec(int x, int y) { - return exec(QPoint(x, y)); + return exec(TQPoint(x, y)); } void KPopupFrame::virtual_hook( int, void* ) diff --git a/libkdeedu/extdate/extdatetbl.h b/libkdeedu/extdate/extdatetbl.h index ac9b7156..8aa3281a 100644 --- a/libkdeedu/extdate/extdatetbl.h +++ b/libkdeedu/extdate/extdatetbl.h @@ -5,7 +5,7 @@ (C) 2004 Jason Harris (jharris@30doradus.org) These classes has been derived from those in kdatetbl.[h|cpp]. - The only differences are adaptations to use ExtDate instead of QDate, + The only differences are adaptations to use ExtDate instead of TQDate, to allow for more remote dates. These changes by Jason Harris. This library is free software; you can redistribute it and/or @@ -26,8 +26,8 @@ #ifndef EXTDATETBL_H #define EXTDATETBL_H -#include -#include +#include +#include #include #include "extcalendarsystemgregorian.h" @@ -42,7 +42,7 @@ class ExtDateInternalWeekSelector : public KLineEdit { Q_OBJECT protected: - QIntValidator *val; + TQIntValidator *val; int result; public slots: void weekEnteredSlot(); @@ -50,7 +50,7 @@ public slots: signals: void closeMe(int); public: - ExtDateInternalWeekSelector( QWidget* parent=0, const char* name=0); + ExtDateInternalWeekSelector( TQWidget* parent=0, const char* name=0); int getWeek(); void setWeek(int week); @@ -81,7 +81,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. @@ -91,7 +91,7 @@ public: /** * The constructor. */ - ExtDateInternalMonthPicker(const ExtDate& date, QWidget* parent, const char* name=0); + ExtDateInternalMonthPicker(const ExtDate& date, TQWidget* parent, const char* name=0); /** * The destructor. */ @@ -99,7 +99,7 @@ public: /** * The size hint. */ - QSize sizeHint() const; + TQSize sizeHint() const; /** * Return the result. 0 means no selection (reject()), 1..12 are the * months. @@ -109,24 +109,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 ExtDateInternalMonthPrivate; @@ -142,14 +142,14 @@ class ExtDateInternalYearSelector : public QLineEdit { Q_OBJECT protected: - QIntValidator *val; + TQIntValidator *val; int result; public slots: void yearEnteredSlot(); signals: void closeMe(int); public: - ExtDateInternalYearSelector( QWidget* parent=0, const char* name=0); + ExtDateInternalYearSelector( TQWidget* parent=0, const char* name=0); ~ExtDateInternalYearSelector(); int getYear(); void setYear(int year); @@ -185,11 +185,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. @@ -200,7 +200,7 @@ public: /** * The contructor. Creates a dialog without buttons. */ - KPopupFrame(QWidget* parent=0, const char* name=0); + KPopupFrame(TQWidget* parent=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. @@ -208,20 +208,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. */ @@ -229,7 +229,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: @@ -243,10 +243,10 @@ private: class ExtDateValidator : public QValidator { public: - ExtDateValidator(QWidget* parent=0, const char* name=0); - virtual State validate(QString&, int&) const; - virtual void fixup ( QString & input ) const; - State date(const QString&, ExtDate&) const; + ExtDateValidator(TQWidget* parent=0, const char* name=0); + virtual State validate(TQString&, int&) const; + virtual void fixup ( TQString & input ) const; + State date(const TQString&, ExtDate&) const; }; /** @@ -272,7 +272,7 @@ public: /** * The constructor. */ - ExtDateTable(QWidget *parent=0, + ExtDateTable(TQWidget *parent=0, ExtDate date=ExtDate::currentDate(), const char* name=0, WFlags f=0); @@ -288,7 +288,7 @@ public: * to be done there anyway. The size is stored in maxCell. The * sizeHint() simply returns a multiple of maxCell. */ - virtual QSize sizeHint() const; + virtual TQSize sizeHint() const; /** * Set the font size of the date table. */ @@ -323,7 +323,7 @@ public: * * @since 3.2 */ - void setCustomDatePainting( const ExtDate &date, const QColor &fgColor, BackgroundMode bgMode=NoBgMode, const QColor &bgColor=QColor()); + void setCustomDatePainting( const ExtDate &date, const TQColor &fgColor, BackgroundMode bgMode=NoBgMode, const TQColor &bgColor=TQColor()); /** * Unsets the custom painting of a date so that the date is painted as usual. @@ -346,19 +346,19 @@ 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 ); // ### KDE 4.0 make the following private and mark as members @@ -390,7 +390,7 @@ protected: /** * Save the size of the largest used cell content. */ - QRect maxCell; + TQRect maxCell; signals: /** * The selected date changed. diff --git a/libkdeedu/extdate/extdatetime.cpp b/libkdeedu/extdate/extdatetime.cpp index 36e3860d..fe32cf91 100644 --- a/libkdeedu/extdate/extdatetime.cpp +++ b/libkdeedu/extdate/extdatetime.cpp @@ -14,7 +14,7 @@ **********************************************************************/ #include "extdatetime.h" -#include +#include #include #include @@ -45,7 +45,7 @@ static const uint MSECS_PER_MIN = 60000; uint ExtDate::m_monthLength[] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}; uint ExtDate::m_monthOrigin[] = { 0, 30, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334}; -QString ExtDate::m_shortMonthNames[12] = { +TQString ExtDate::m_shortMonthNames[12] = { i18n("Short month name", "Jan"), i18n("Short month name", "Feb"), i18n("Short month name", "Mar"), i18n("Short month name", "Apr"), i18n("Short month name", "May"), i18n("Short month name", "Jun"), @@ -53,13 +53,13 @@ QString ExtDate::m_shortMonthNames[12] = { i18n("Short month name", "Sep"), i18n("Short month name", "Oct"), i18n("Short month name", "Nov"), i18n("Short month name", "Dec") }; -QString ExtDate::m_shortDayNames[7] = { +TQString ExtDate::m_shortDayNames[7] = { i18n("Short day name", "Mon"), i18n("Short day name", "Tue"), i18n("Short day name", "Wed"), i18n("Short day name", "Thu"), i18n("Short day name", "Fri"), i18n("Short day name", "Sat"), i18n("Short day name", "Sun") }; -QString ExtDate::m_longMonthNames[12] = { +TQString ExtDate::m_longMonthNames[12] = { i18n("Long month name", "January"), i18n("Long month name", "February"), i18n("Long month name", "March"), i18n("Long month name", "April"), i18n("Long month name", "May"), i18n("Long month name", "June"), @@ -67,7 +67,7 @@ QString ExtDate::m_longMonthNames[12] = { i18n("Long month name", "September"), i18n("Long month name", "October"), i18n("Long month name", "November"), i18n("Long month name", "December") }; -QString ExtDate::m_longDayNames[7] = { +TQString ExtDate::m_longDayNames[7] = { i18n("Long day name", "Monday"), i18n("Long day name", "Tuesday"), i18n("Long day name", "Wednesday"), i18n("Long day name", "Thursday"), i18n("Long day name", "Friday"), i18n("Long day name", "Saturday"), @@ -233,19 +233,19 @@ int ExtDate::weekNumber( int *yearNum ) const } #ifndef QT_NO_TEXTDATE -QString ExtDate::shortMonthName( int month ) {return m_shortMonthNames[month-1];} -QString ExtDate::shortDayName( int weekday ) {return m_shortDayNames[weekday-1];} -QString ExtDate::longMonthName( int month ) {return m_longMonthNames[month-1];} -QString ExtDate::longDayName( int weekday ) {return m_longDayNames[weekday-1];} +TQString ExtDate::shortMonthName( int month ) {return m_shortMonthNames[month-1];} +TQString ExtDate::shortDayName( int weekday ) {return m_shortDayNames[weekday-1];} +TQString ExtDate::longMonthName( int month ) {return m_longMonthNames[month-1];} +TQString ExtDate::longDayName( int weekday ) {return m_longDayNames[weekday-1];} #endif //QT_NO_TEXTDATE #ifndef QT_NO_TEXTSTRING #if !defined(QT_NO_SPRINTF) -QString ExtDate::toString( Qt::DateFormat f) const +TQString ExtDate::toString( Qt::DateFormat f) const { QString a_format; - if ( ! isValid() ) return QString::null; + if ( ! isValid() ) return TQString::null; switch (f) { @@ -270,9 +270,9 @@ QString ExtDate::toString( Qt::DateFormat f) const } #endif -QString ExtDate::toString( const QString& format ) const +TQString ExtDate::toString( const TQString& format ) const { - if ( ! isValid() ) return QString::null; + if ( ! isValid() ) return TQString::null; //We use the KDE Date format specs. //Replace occurences of the following tokens with their @@ -291,14 +291,14 @@ QString ExtDate::toString( const QString& format ) const //All other characters are left as-is. - QString result( format ); + TQString result( format ); - result.replace( "%Y", QString().sprintf( "%d", year() ) ); - result.replace( "%y", QString().sprintf( "%02d", (year() % 100) ) ); - result.replace( "%n", QString().sprintf( "%d", month() ) ); - result.replace( "%m", QString().sprintf( "%02d", month() ) ); - result.replace( "%e", QString().sprintf( "%d", day() ) ); - result.replace( "%d", QString().sprintf( "%02d", day() ) ); + result.replace( "%Y", TQString().sprintf( "%d", year() ) ); + result.replace( "%y", TQString().sprintf( "%02d", (year() % 100) ) ); + result.replace( "%n", TQString().sprintf( "%d", month() ) ); + result.replace( "%m", TQString().sprintf( "%02d", month() ) ); + result.replace( "%e", TQString().sprintf( "%d", day() ) ); + result.replace( "%d", TQString().sprintf( "%02d", day() ) ); result.replace( "%b", shortMonthName( month() ) ); result.replace( "%B", longMonthName( month() ) ); result.replace( "%a", shortDayName( dayOfWeek() ) ); @@ -402,7 +402,7 @@ ExtDate ExtDate::currentDate(Qt::TimeSpec ts) #ifndef QT_NO_DATESTRING //Try both DateFormat values -ExtDate ExtDate::fromString( const QString& s ) +ExtDate ExtDate::fromString( const TQString& s ) { ExtDate dResult = ExtDate::fromString( s, Qt::TextDate ); if ( dResult.isValid() ) return dResult; @@ -412,13 +412,13 @@ ExtDate ExtDate::fromString( const QString& s ) else return ExtDate(); //invalid } -ExtDate ExtDate::fromString( const QString& s, Qt::DateFormat f ) +ExtDate ExtDate::fromString( const TQString& s, Qt::DateFormat f ) { ExtDate dt = ExtDate(); //initialize invalid date if ( s.isEmpty() ) { return dt; } if ( f == Qt::LocalDate ) { //can't use LocalFormat #if defined(QT_CHECK_RANGE) - qWarning( "QDate::fromString: Parameter out of range" ); + qWarning( "TQDate::fromString: Parameter out of range" ); #endif return dt; } @@ -442,7 +442,7 @@ ExtDate ExtDate::fromString( const QString& s, Qt::DateFormat f ) //Three possible date formats: //dd mth yyyy; mth dd yyyy; wkd mth dd yyyy //"mth" is the word for the month (long or short form) - QStringList ss = QStringList::split( " ", s ); + TQStringList ss = TQStringList::split( " ", s ); bool ok = false; int month = -1; uint imonth = 0; @@ -515,13 +515,13 @@ bool ExtDate::isValid( int y, int m, int d ) return true; } -QDate ExtDate::qdate() const { - QDate q( year(), month(), day() ); +TQDate ExtDate::qdate() const { + TQDate q( year(), month(), day() ); if ( q.isValid() ) return q; else - return QDate(); + return TQDate(); } bool ExtDate::leapYear( int year ) @@ -552,7 +552,7 @@ int ExtDate::dayOfYear(int y, int m, int d) \ingroup time A ExtDateTime object contains a calendar date and a clock time (a - "datetime"). It is a combination of the ExtDate and QTime classes. + "datetime"). It is a combination of the ExtDate and TQTime classes. It can read the current datetime from the system clock. It provides functions for comparing datetimes and for manipulating a datetime by adding a number of seconds, days, months or years. @@ -582,11 +582,11 @@ int ExtDate::dayOfYear(int y, int m, int d) number of seconds between two datetimes. The range of a datetime object is constrained to the ranges of the - ExtDate and QTime objects which it embodies. + ExtDate and TQTime objects which it embodies. Methods in this class are reentrant. - \sa ExtDate QTime ExtDateTimeEdit + \sa ExtDate TQTime ExtDateTimeEdit */ @@ -614,7 +614,7 @@ ExtDateTime::ExtDateTime( const ExtDate &date ) Constructs a datetime with date \a date and time \a time. */ -ExtDateTime::ExtDateTime( const ExtDate &date, const QTime &time ) +ExtDateTime::ExtDateTime( const ExtDate &date, const TQTime &time ) : d(date), t(time) { } @@ -626,7 +626,7 @@ ExtDateTime::ExtDateTime( const ExtDate &date, const QTime &time ) Returns TRUE if both the date and the time are null; otherwise returns FALSE. A null datetime is invalid. - \sa ExtDate::isNull(), QTime::isNull() + \sa ExtDate::isNull(), TQTime::isNull() */ /*! @@ -635,7 +635,7 @@ ExtDateTime::ExtDateTime( const ExtDate &date, const QTime &time ) Returns TRUE if both the date and the time are valid; otherwise returns FALSE. - \sa ExtDate::isValid(), QTime::isValid() + \sa ExtDate::isValid(), TQTime::isValid() */ /*! @@ -647,7 +647,7 @@ ExtDateTime::ExtDateTime( const ExtDate &date, const QTime &time ) */ /*! - \fn QTime ExtDateTime::time() const + \fn TQTime ExtDateTime::time() const Returns the time part of the datetime. @@ -663,7 +663,7 @@ ExtDateTime::ExtDateTime( const ExtDate &date, const QTime &time ) */ /*! - \fn void ExtDateTime::setTime( const QTime &time ) + \fn void ExtDateTime::setTime( const TQTime &time ) Sets the time part of this datetime to \a time. @@ -773,7 +773,7 @@ void ExtDateTime::setTime_t( uint secsSince1Jan1970UTC, Qt::TimeSpec ts ) If \a f is \c Qt::TextDate, the string format is "Wed May 20 03:40:13 1998" (using ExtDate::shortDayName(), ExtDate::shortMonthName(), - and QTime::toString() to generate the string, so the day and month + and TQTime::toString() to generate the string, so the day and month names will have localized names). If \a f is \c Qt::ISODate, the string format corresponds to the @@ -786,13 +786,13 @@ void ExtDateTime::setTime_t( uint secsSince1Jan1970UTC, Qt::TimeSpec ts ) If the format \a f is invalid or the datetime is invalid, toString() returns a null string. - \sa ExtDate::toString() QTime::toString() + \sa ExtDate::toString() TQTime::toString() */ -QString ExtDateTime::toString( Qt::DateFormat f ) const +TQString ExtDateTime::toString( Qt::DateFormat f ) const { if ( !isValid() ) - return QString::null; + return TQString::null; if ( f == Qt::ISODate ) { return d.toString( Qt::ISODate ) + "T" + t.toString( Qt::ISODate ); @@ -807,17 +807,17 @@ QString ExtDateTime::toString( Qt::DateFormat f ) const + " " + KGlobal::locale()->timeFormat() ); } - return QString::null; + return TQString::null; } #endif -QString ExtDateTime::toString( const QString& format ) const +TQString ExtDateTime::toString( const TQString& format ) const { if ( !isValid() ) - return QString::null; + return TQString::null; //Parse the date portion of the format string - QString result = date().toString( format ); + TQString result = date().toString( format ); //For the time format, use the following KDE format specs: //Replace occurences of the following tokens with their @@ -833,13 +833,13 @@ QString ExtDateTime::toString( const QString& format ) const int h = time().hour(); - result.replace( "%H", QString().sprintf( "%02d", h ) ); - result.replace( "%k", QString().sprintf( "%d", h ) ); - result.replace( "%I", QString().sprintf( "%02d", ( h > 12 ) ? h-12 : h ) ); - result.replace( "%l", QString().sprintf( "%d", ( h > 12 ) ? h-12 : h ) ); - result.replace( "%M", QString().sprintf( "%02d", time().minute() ) ); - result.replace( "%S", QString().sprintf( "%02d", time().second() ) ); - result.replace( "%p", QString().sprintf( "%s", ( h > 12 ) ? "pm" : "am" ) ); + result.replace( "%H", TQString().sprintf( "%02d", h ) ); + result.replace( "%k", TQString().sprintf( "%d", h ) ); + result.replace( "%I", TQString().sprintf( "%02d", ( h > 12 ) ? h-12 : h ) ); + result.replace( "%l", TQString().sprintf( "%d", ( h > 12 ) ? h-12 : h ) ); + result.replace( "%M", TQString().sprintf( "%02d", time().minute() ) ); + result.replace( "%S", TQString().sprintf( "%02d", time().second() ) ); + result.replace( "%p", TQString().sprintf( "%s", ( h > 12 ) ? "pm" : "am" ) ); return result; } @@ -909,7 +909,7 @@ ExtDateTime ExtDateTime::addSecs( int nsecs ) const } ExtDateTime ret; - ret.setTime( QTime().addMSecs( tt ) ); + ret.setTime( TQTime().addMSecs( tt ) ); ret.setDate( ExtDate( dd ) ); return ret; @@ -934,11 +934,11 @@ int ExtDateTime::daysTo( const ExtDateTime &dt ) const Example: \code ExtDateTime dt = ExtDateTime::currentDateTime(); - ExtDateTime xmas( ExtDate(dt.date().year(),12,24), QTime(17,00) ); + ExtDateTime xmas( ExtDate(dt.date().year(),12,24), TQTime(17,00) ); kdDebug( ) << "There are " << dt.secsTo(xmas) << " seconds to Christmas" << endl; \endcode - \sa addSecs(), daysTo(), QTime::secsTo() + \sa addSecs(), daysTo(), TQTime::secsTo() */ int ExtDateTime::secsTo( const ExtDateTime &dt ) const @@ -1023,7 +1023,7 @@ bool ExtDateTime::operator>=( const ExtDateTime &dt ) const Returns the current datetime, as reported by the system clock. - \sa ExtDate::currentDate(), QTime::currentTime() + \sa ExtDate::currentDate(), TQTime::currentTime() */ ExtDateTime ExtDateTime::currentDateTime() @@ -1035,14 +1035,14 @@ ExtDateTime ExtDateTime::currentDateTime() Returns the current datetime, as reported by the system clock, for the TimeSpec \a ts. The default TimeSpec is LocalTime. - \sa ExtDate::currentDate(), QTime::currentTime(), Qt::TimeSpec + \sa ExtDate::currentDate(), TQTime::currentTime(), Qt::TimeSpec */ ExtDateTime ExtDateTime::currentDateTime( Qt::TimeSpec ts ) { ExtDateTime dt; dt.setDate( ExtDate::currentDate(ts) ); - QTime t = t.currentTime(ts); + TQTime t = t.currentTime(ts); if ( t.hour()==0 && t.minute()==0 ) // midnight or right after? dt.setDate( ExtDate::currentDate(ts) ); // fetch date again dt.setTime( t ); @@ -1060,7 +1060,7 @@ ExtDateTime ExtDateTime::currentDateTime( Qt::TimeSpec ts ) \warning Note that \c Qt::LocalDate cannot be used here. */ -ExtDateTime ExtDateTime::fromString( const QString& s ) +ExtDateTime ExtDateTime::fromString( const TQString& s ) { ExtDateTime dtResult = ExtDateTime::fromString( s, Qt::TextDate ); if ( dtResult.isValid() ) return dtResult; @@ -1071,7 +1071,7 @@ ExtDateTime ExtDateTime::fromString( const QString& s ) else return ExtDateTime(); //invalid } -ExtDateTime ExtDateTime::fromString( const QString& s, Qt::DateFormat f ) +ExtDateTime ExtDateTime::fromString( const TQString& s, Qt::DateFormat f ) { ExtDateTime dt; @@ -1085,21 +1085,21 @@ ExtDateTime ExtDateTime::fromString( const QString& s, Qt::DateFormat f ) if ( f == Qt::ISODate ) { if ( s.length() <= 10 || ! s.contains( ':' ) ) { //no time specified - QTime t = QTime(0,0,0); + TQTime t = TQTime(0,0,0); return ExtDateTime( ExtDate::fromString( s.mid(0,10), Qt::ISODate ) ); } else { return ExtDateTime( ExtDate::fromString( s.mid(0,10), Qt::ISODate ), - QTime::fromString( s.mid(11), Qt::ISODate ) ); + TQTime::fromString( s.mid(11), Qt::ISODate ) ); } } #if !defined(QT_NO_REGEXP) && !defined(QT_NO_TEXTDATE) else if ( f == Qt::TextDate ) { //parse the time, if it exists. - QTime time; - QString sd = s; + TQTime time; + TQString sd = s; int hour, minute, second; - int pivot = s.find( QRegExp(QString::fromLatin1("[0-9][0-9]:[0-9][0-9]:[0-9][0-9]")) ); + int pivot = s.find( TQRegExp(TQString::fromLatin1("[0-9][0-9]:[0-9][0-9]:[0-9][0-9]")) ); if ( pivot != -1 ) { hour = s.mid( pivot, 2 ).toInt(); minute = s.mid( pivot+3, 2 ).toInt(); @@ -1121,12 +1121,12 @@ ExtDateTime ExtDateTime::fromString( const QString& s, Qt::DateFormat f ) #ifndef QT_NO_DATASTREAM -KDE_EXPORT QDataStream &operator<<( QDataStream & ostream, const ExtDate & date) +KDE_EXPORT TQDataStream &operator<<( TQDataStream & ostream, const ExtDate & date) { return ostream << (Q_UINT32)(date.jd()); } -KDE_EXPORT QDataStream &operator>>( QDataStream & ostream, ExtDate & date) +KDE_EXPORT TQDataStream &operator>>( TQDataStream & ostream, ExtDate & date) { Q_UINT32 julday; ostream >> julday; @@ -1134,12 +1134,12 @@ KDE_EXPORT QDataStream &operator>>( QDataStream & ostream, ExtDate & date) return ostream; } -KDE_EXPORT QDataStream &operator<<( QDataStream & ostream, const ExtDateTime & dt) +KDE_EXPORT TQDataStream &operator<<( TQDataStream & ostream, const ExtDateTime & dt) { return ostream << dt.d << dt.t; } -KDE_EXPORT QDataStream &operator>>( QDataStream & ostream, ExtDateTime & dt) +KDE_EXPORT TQDataStream &operator>>( TQDataStream & ostream, ExtDateTime & dt) { ostream >> dt.d >> dt.t; return ostream; diff --git a/libkdeedu/extdate/extdatetime.h b/libkdeedu/extdate/extdatetime.h index e1bc2a79..0830af83 100644 --- a/libkdeedu/extdate/extdatetime.h +++ b/libkdeedu/extdate/extdatetime.h @@ -17,9 +17,9 @@ #define EXTDATETIME_H #include -#include "qstring.h" -#include "qnamespace.h" -#include "qdatetime.h" +#include "tqstring.h" +#include "tqnamespace.h" +#include "tqdatetime.h" #include #define INVALID_DAY LONG_MIN @@ -39,13 +39,13 @@ class KDE_EXPORT ExtDate public: ExtDate() : m_jd(INVALID_DAY), m_year(0), m_month(0), m_day(0) {} ExtDate( int y, int m, int d ); - ExtDate( const QDate &q ) { ExtDate( q.year(), q.month(), q.day() ); } + ExtDate( const TQDate &q ) { ExtDate( q.year(), q.month(), q.day() ); } ExtDate( long int jd ); bool isNull() const { return m_jd == INVALID_DAY; } bool isValid() const; - QDate qdate() const; + TQDate qdate() const; int year() const { return m_year; } int month() const { return m_month; } @@ -59,19 +59,19 @@ public: #ifndef QT_NO_TEXTDATE #ifndef QT_NO_COMPAT - static QString monthName( int month ) { return shortMonthName( month ); } - static QString dayName( int weekday ) { return shortDayName( weekday ); } + static TQString monthName( int month ) { return shortMonthName( month ); } + static TQString dayName( int weekday ) { return shortDayName( weekday ); } #endif - static QString shortMonthName( int month ); - static QString shortDayName( int weekday ); - static QString longMonthName( int month ); - static QString longDayName( int weekday ); + static TQString shortMonthName( int month ); + static TQString shortDayName( int weekday ); + static TQString longMonthName( int month ); + static TQString longDayName( int weekday ); #endif //QT_NO_TEXTDATE #ifndef QT_NO_TEXTSTRING #if !defined(QT_NO_SPRINTF) - QString toString( Qt::DateFormat f = Qt::TextDate ) const; + TQString toString( Qt::DateFormat f = Qt::TextDate ) const; #endif - QString toString( const QString& format ) const; + TQString toString( const TQString& format ) const; #endif bool setYMD( int y, int m, int d ); bool setJD( long int _jd ); @@ -90,8 +90,8 @@ public: static ExtDate currentDate( Qt::TimeSpec ts = Qt::LocalTime ); #ifndef QT_NO_DATESTRING - static ExtDate fromString( const QString &s ); - static ExtDate fromString( const QString &s, Qt::DateFormat f ); + static ExtDate fromString( const TQString &s ); + static ExtDate fromString( const TQString &s, Qt::DateFormat f ); #endif static bool isValid( int y, int m, int d ); static bool leapYear( int year ); @@ -106,18 +106,18 @@ private: int m_year, m_month, m_day; static uint m_monthLength[12]; static uint m_monthOrigin[12]; - static QString m_shortMonthNames[12]; - static QString m_shortDayNames[7]; - static QString m_longMonthNames[12]; - static QString m_longDayNames[7]; + static TQString m_shortMonthNames[12]; + static TQString m_shortDayNames[7]; + static TQString m_longMonthNames[12]; + static TQString m_longDayNames[7]; friend class ExtDateTime; #ifndef QT_NO_DATASTREAM - friend Q_EXPORT QDataStream &operator<<( QDataStream &, const ExtDate & ); - friend Q_EXPORT QDataStream &operator>>( QDataStream &, ExtDate & ); - friend Q_EXPORT QDataStream &operator<<( QDataStream &, const ExtDateTime & ); - friend Q_EXPORT QDataStream &operator>>( QDataStream &, ExtDateTime & ); + friend Q_EXPORT TQDataStream &operator<<( TQDataStream &, const ExtDate & ); + friend Q_EXPORT TQDataStream &operator>>( TQDataStream &, ExtDate & ); + friend Q_EXPORT TQDataStream &operator<<( TQDataStream &, const ExtDateTime & ); + friend Q_EXPORT TQDataStream &operator>>( TQDataStream &, ExtDateTime & ); #endif }; @@ -130,23 +130,23 @@ class KDE_EXPORT ExtDateTime public: ExtDateTime() {} // set null date and null time ExtDateTime( const ExtDate & ); - ExtDateTime( const ExtDate &, const QTime & ); + ExtDateTime( const ExtDate &, const TQTime & ); bool isNull() const { return d.isNull() && t.isNull(); } bool isValid() const { return d.isValid() && t.isValid(); } ExtDate date() const { return d; } - QTime time() const { return t; } + TQTime time() const { return t; } uint toTime_t() const; void setDate( const ExtDate &date ) { d = date; } - void setTime( const QTime &time ) { t = time; } + void setTime( const TQTime &time ) { t = time; } void setTime_t( uint secsSince1Jan1970UTC ); void setTime_t( uint secsSince1Jan1970UTC, Qt::TimeSpec ); #ifndef QT_NO_DATESTRING #ifndef QT_NO_SPRINTF - QString toString( Qt::DateFormat f = Qt::TextDate ) const; + TQString toString( Qt::DateFormat f = Qt::TextDate ) const; #endif - QString toString( const QString& format ) const; + TQString toString( const TQString& format ) const; #endif ExtDateTime addDays( int days ) const; ExtDateTime addMonths( int months ) const; @@ -165,15 +165,15 @@ public: static ExtDateTime currentDateTime(); static ExtDateTime currentDateTime( Qt::TimeSpec ); #ifndef QT_NO_DATESTRING - static ExtDateTime fromString( const QString &s ); - static ExtDateTime fromString( const QString &s, Qt::DateFormat f ); + static ExtDateTime fromString( const TQString &s ); + static ExtDateTime fromString( const TQString &s, Qt::DateFormat f ); #endif private: ExtDate d; - QTime t; + TQTime t; #ifndef QT_NO_DATASTREAM - friend Q_EXPORT QDataStream &operator<<( QDataStream &, const ExtDateTime &); - friend Q_EXPORT QDataStream &operator>>( QDataStream &, ExtDateTime & ); + friend Q_EXPORT TQDataStream &operator<<( TQDataStream &, const ExtDateTime &); + friend Q_EXPORT TQDataStream &operator>>( TQDataStream &, ExtDateTime & ); #endif }; @@ -182,8 +182,8 @@ private: *****************************************************************************/ #ifndef QT_NO_DATASTREAM -Q_EXPORT QDataStream &operator<<( QDataStream &, const ExtDate & ); -Q_EXPORT QDataStream &operator>>( QDataStream &, ExtDate & ); +Q_EXPORT TQDataStream &operator<<( TQDataStream &, const ExtDate & ); +Q_EXPORT TQDataStream &operator>>( TQDataStream &, ExtDate & ); #endif // QT_NO_DATASTREAM #endif // EXTDATE_H diff --git a/libkdeedu/extdate/extdatetimeedit.cpp b/libkdeedu/extdate/extdatetimeedit.cpp index 2a9a467b..203f1dbb 100644 --- a/libkdeedu/extdate/extdatetimeedit.cpp +++ b/libkdeedu/extdate/extdatetimeedit.cpp @@ -31,14 +31,14 @@ //#include "../kernel/qrichtext_p.h" #include #include -#include -#include -#include -#include -#include -#include -#include -#include //need for QTimeEdit +#include +#include +#include +#include +#include +#include +#include +#include //need for QTimeEdit #define EXTDATETIMEEDIT_HIDDEN_CHAR '0' @@ -71,48 +71,48 @@ static void readLocaleSettings() int dpos, mpos, ypos; cleanup(); - lDateSep = new QString(); - lTimeSep = new QString(); + lDateSep = new TQString(); + lTimeSep = new TQString(); #if defined(Q_WS_WIN) QT_WA( { TCHAR data[10]; GetLocaleInfo( LOCALE_USER_DEFAULT, LOCALE_SDATE, data, 10 ); - *lDateSep = QString::fromUcs2( (ushort*)data ); + *lDateSep = TQString::fromUcs2( (ushort*)data ); GetLocaleInfo( LOCALE_USER_DEFAULT, LOCALE_STIME, data, 10 ); - *lTimeSep = QString::fromUcs2( (ushort*)data ); + *lTimeSep = TQString::fromUcs2( (ushort*)data ); GetLocaleInfo( LOCALE_USER_DEFAULT, LOCALE_ITIME, data, 10 ); - lAMPM = QString::fromUcs2( (ushort*)data ).toInt()==0; + lAMPM = TQString::fromUcs2( (ushort*)data ).toInt()==0; GetLocaleInfo( LOCALE_USER_DEFAULT, LOCALE_S1159, data, 10 ); - QString am = QString::fromUcs2( (ushort*)data ); + TQString am = TQString::fromUcs2( (ushort*)data ); if ( !am.isEmpty() ) - lAM = new QString( am ); + lAM = new TQString( am ); GetLocaleInfo( LOCALE_USER_DEFAULT, LOCALE_S2359, data, 10 ); - QString pm = QString::fromUcs2( (ushort*)data ); + TQString pm = TQString::fromUcs2( (ushort*)data ); if ( !pm.isEmpty() ) - lPM = new QString( pm ); + lPM = new TQString( pm ); } , { char data[10]; GetLocaleInfoA( LOCALE_USER_DEFAULT, LOCALE_SDATE, (char*)&data, 10 ); - *lDateSep = QString::fromLocal8Bit( data ); + *lDateSep = TQString::fromLocal8Bit( data ); GetLocaleInfoA( LOCALE_USER_DEFAULT, LOCALE_STIME, (char*)&data, 10 ); - *lTimeSep = QString::fromLocal8Bit( data ); + *lTimeSep = TQString::fromLocal8Bit( data ); GetLocaleInfoA( LOCALE_USER_DEFAULT, LOCALE_ITIME, (char*)&data, 10 ); - lAMPM = QString::fromLocal8Bit( data ).toInt()==0; + lAMPM = TQString::fromLocal8Bit( data ).toInt()==0; GetLocaleInfoA( LOCALE_USER_DEFAULT, LOCALE_S1159, (char*)&data, 10 ); - QString am = QString::fromLocal8Bit( data ); + TQString am = TQString::fromLocal8Bit( data ); if ( !am.isEmpty() ) - lAM = new QString( am ); + lAM = new TQString( am ); GetLocaleInfoA( LOCALE_USER_DEFAULT, LOCALE_S2359, (char*)&data, 10 ); - QString pm = QString::fromLocal8Bit( data ); + TQString pm = TQString::fromLocal8Bit( data ); if ( !pm.isEmpty() ) - lPM = new QString( pm ); + lPM = new TQString( pm ); } ); #else *lDateSep = "-"; *lTimeSep = ":"; #endif - QString d = ExtDate( 1999, 11, 22 ).toString( Qt::LocalDate ); + TQString d = ExtDate( 1999, 11, 22 ).toString( Qt::LocalDate ); dpos = d.find( "22" ); mpos = d.find( "11" ); ypos = d.find( "99" ); @@ -134,7 +134,7 @@ static void readLocaleSettings() // this code needs to change if new formats are added #ifndef Q_WS_WIN - QString sep = d.mid( QMIN( dpos, mpos ) + 2, QABS( dpos - mpos ) - 2 ); + TQString sep = d.mid( QMIN( dpos, mpos ) + 2, QABS( dpos - mpos ) - 2 ); if ( d.contains( sep ) == 2 ) { *lDateSep = sep; } @@ -142,13 +142,13 @@ static void readLocaleSettings() } #ifndef Q_WS_WIN - QString t = QTime( 11, 22, 33 ).toString( Qt::LocalDate ); + TQString t = TQTime( 11, 22, 33 ).toString( Qt::LocalDate ); dpos = t.find( "11" ); mpos = t.find( "22" ); ypos = t.find( "33" ); // We only allow hhmmss if ( dpos > -1 && dpos < mpos && mpos < ypos ) { - QString sep = t.mid( dpos + 2, mpos - dpos - 2 ); + TQString sep = t.mid( dpos + 2, mpos - dpos - 2 ); if ( sep == t.mid( mpos + 2, ypos - mpos - 2 ) ) { *lTimeSep = sep; } @@ -163,14 +163,14 @@ static ExtDateEdit::Order localOrder() { return lOrder; } -static QString localDateSep() { +static TQString localDateSep() { if ( !lDateSep ) { readLocaleSettings(); } return *lDateSep; } -static QString localTimeSep() { +static TQString localTimeSep() { if ( !lTimeSep ) { readLocaleSettings(); } @@ -217,16 +217,16 @@ public: sections[sec].setSelectionEnd( selend ); } uint sectionCount() const { return (uint)sections.count(); } - void setSeparator( const QString& s ) { sep = s; } - QString separator() const { return sep; } + void setSeparator( const TQString& s ) { sep = s; } + TQString separator() const { return sep; } void setFrame( bool f ) { frm = f; } bool frame() const { return frm; } int focusSection() const { return focusSec; } - int section( const QPoint& p ) + int section( const TQPoint& p ) { - cursor->place( p + QPoint( offset, 0 ), parag ); + cursor->place( p + TQPoint( offset, 0 ), parag ); int idx = cursor->index(); for ( uint i = 0; i < sections.count(); ++i ) { if ( idx >= sections[i].selectionStart() && @@ -261,12 +261,12 @@ public: return FALSE; } - void paint( const QString& txt, bool focus, QPainter& p, - const QColorGroup& cg, const QRect& rect, QStyle& style ) + void paint( const TQString& txt, bool focus, TQPainter& p, + const TQColorGroup& cg, const TQRect& rect, TQStyle& style ) { int fw = 0; if ( frm ) - fw = style.pixelMetric(QStyle::PM_DefaultFrameWidth); + fw = style.pixelMetric(TQStyle::PM_DefaultFrameWidth); parag->truncate( 0 ); parag->append( txt ); @@ -293,7 +293,7 @@ public: fb->removeRef(); nf->removeRef(); - QRect r( rect.x(), rect.y(), rect.width() - 2 * ( 2 + fw ), rect.height() ); + TQRect r( rect.x(), rect.y(), rect.width() - 2 * ( 2 + fw ), rect.height() ); parag->pseudoDocument()->docRect = r; parag->invalidate(0); parag->format(); @@ -309,7 +309,7 @@ public: p.translate( -xoff, -yoff ); } - void resize( const QSize& size ) { sz = size; } + void resize( const TQSize& size ) { sz = size; } int mapSection( int sec ) { @@ -334,24 +334,24 @@ private: bool frm; QTextParagraph *parag; QTextCursor *cursor; - QSize sz; + TQSize sz; int focusSec; - QValueList< QNumberSection > sections; - QString sep; + TQValueList< QNumberSection > sections; + TQString sep; int offset; }; class ExtDateTimeSpinWidget : public QSpinWidget { public: - ExtDateTimeSpinWidget( QWidget *parent, const char *name ) - : QSpinWidget( parent, name ) + ExtDateTimeSpinWidget( TQWidget *parent, const char *name ) + : TQSpinWidget( parent, name ) { } protected: #ifndef QT_NO_WHEELEVENT - void wheelEvent( QWheelEvent *e ) + void wheelEvent( TQWheelEvent *e ) { ExtDateTimeEditor *editor = (ExtDateTimeEditor*)editWidget()->qt_cast( "ExtDateTimeEditor" ); Q_ASSERT( editor ); @@ -363,7 +363,7 @@ protected: if ( section == -1 ) return; - QSpinWidget::wheelEvent( e ); + TQSpinWidget::wheelEvent( e ); } #endif }; @@ -374,7 +374,7 @@ protected: */ ExtDateTimeEditor::ExtDateTimeEditor( ExtDateTimeEditBase * parent, const char * name ) - : QWidget( parent, name, WNoAutoErase ) + : TQWidget( parent, name, WNoAutoErase ) { d = new ExtDateTimeEditorPrivate(); cw = parent; @@ -407,14 +407,14 @@ void ExtDateTimeEditor::init() */ -bool ExtDateTimeEditor::event( QEvent *e ) +bool ExtDateTimeEditor::event( TQEvent *e ) { - if ( e->type() == QEvent::FocusIn || e->type() == QEvent::FocusOut ) { - if ( e->type() == QEvent::FocusOut ) + if ( e->type() == TQEvent::FocusIn || e->type() == TQEvent::FocusOut ) { + if ( e->type() == TQEvent::FocusOut ) qApp->sendEvent( cw, e ); update( rect() ); - } else if ( e->type() == QEvent::AccelOverride ) { - QKeyEvent* ke = (QKeyEvent*) e; + } else if ( e->type() == TQEvent::AccelOverride ) { + TQKeyEvent* ke = (TQKeyEvent*) e; switch ( ke->key() ) { case Key_Delete: case Key_Backspace: @@ -427,17 +427,17 @@ bool ExtDateTimeEditor::event( QEvent *e ) break; } } - return QWidget::event( e ); + return TQWidget::event( e ); } /*! \reimp */ -void ExtDateTimeEditor::resizeEvent( QResizeEvent *e ) +void ExtDateTimeEditor::resizeEvent( TQResizeEvent *e ) { d->resize( e->size() ); - QWidget::resizeEvent( e ); + TQWidget::resizeEvent( e ); } @@ -445,9 +445,9 @@ void ExtDateTimeEditor::resizeEvent( QResizeEvent *e ) */ -void ExtDateTimeEditor::paintEvent( QPaintEvent * ) +void ExtDateTimeEditor::paintEvent( TQPaintEvent * ) { - QString txt; + TQString txt; for ( uint i = 0; i < d->sectionCount(); ++i ) { txt += cw->sectionFormattedText( i ); if ( i < d->sectionCount()-1 ) { @@ -459,8 +459,8 @@ void ExtDateTimeEditor::paintEvent( QPaintEvent * ) } QSharedDoubleBuffer buffer( this ); - const QBrush &bg = - colorGroup().brush( isEnabled() ? QColorGroup::Base : QColorGroup::Background ); + const TQBrush &bg = + colorGroup().brush( isEnabled() ? TQColorGroup::Base : TQColorGroup::Background ); buffer.painter()->fillRect( 0, 0, width(), height(), bg ); d->paint( txt, hasFocus(), *buffer.painter(), colorGroup(), rect(), style() ); @@ -471,7 +471,7 @@ void ExtDateTimeEditor::paintEvent( QPaintEvent * ) /*! Returns the section index at point \a p. */ -int ExtDateTimeEditor::sectionAt( const QPoint &p ) +int ExtDateTimeEditor::sectionAt( const TQPoint &p ) { return d->section( p ); } @@ -486,9 +486,9 @@ int ExtDateTimeEditor::mapSection( int sec ) */ -void ExtDateTimeEditor::mousePressEvent( QMouseEvent *e ) +void ExtDateTimeEditor::mousePressEvent( TQMouseEvent *e ) { - QPoint p( e->pos().x(), 0 ); + TQPoint p( e->pos().x(), 0 ); int sec = sectionAt( p ); if ( sec != -1 ) { cw->setFocusSection( sec ); @@ -499,11 +499,11 @@ void ExtDateTimeEditor::mousePressEvent( QMouseEvent *e ) /*! \reimp */ -bool ExtDateTimeEditor::eventFilter( QObject *o, QEvent *e ) +bool ExtDateTimeEditor::eventFilter( TQObject *o, TQEvent *e ) { if ( o == this ) { - if ( e->type() == QEvent::KeyPress ) { - QKeyEvent *ke = (QKeyEvent*)e; + if ( e->type() == TQEvent::KeyPress ) { + TQKeyEvent *ke = (TQKeyEvent*)e; switch ( ke->key() ) { case Key_Right: if ( d->focusSection() < (int)d->sectionCount()-1 ) { @@ -537,7 +537,7 @@ bool ExtDateTimeEditor::eventFilter( QObject *o, QEvent *e ) if ( ke->state() == Qt::ControlButton ) return FALSE; - QWidget *w = this; + TQWidget *w = this; bool hadDateEdit = FALSE; while ( w ) { if ( ::qt_cast(w) && qstrcmp( w->name(), "qt_spin_widget" ) != 0 || @@ -569,7 +569,7 @@ bool ExtDateTimeEditor::eventFilter( QObject *o, QEvent *e ) } } break; default: - QString txt = ke->text().lower(); + TQString txt = ke->text().lower(); if ( !txt.isEmpty() && !separator().isEmpty() && txt[0] == separator()[0] ) { // do the same thing as KEY_RIGHT when the user presses the separator key if ( d->focusSection() < 2 ) { @@ -580,7 +580,7 @@ bool ExtDateTimeEditor::eventFilter( QObject *o, QEvent *e ) } else if ( !txt.isEmpty() && ::qt_cast(cw) && focusSection() == (int) d->sectionCount()-1 ) { // the first character of the AM/PM indicator toggles if the section has focus QTimeEdit *te = (QTimeEdit*)cw; - QTime time = te->time(); + TQTime time = te->time(); if ( lAMPM && lAM && lPM && (te->display()&QTimeEdit::AMPM) ) { if ( txt[0] == (*lAM).lower()[0] && time.hour() >= 12 ) { time.setHMS( time.hour()-12, time.minute(), time.second(), time.msec() ); @@ -637,7 +637,7 @@ void ExtDateTimeEditor::setSectionSelection( int sec, int selstart, int selend ) currently, only the first character of \a s is used. */ -void ExtDateTimeEditor::setSeparator( const QString& s ) +void ExtDateTimeEditor::setSeparator( const TQString& s ) { d->setSeparator( s ); update(); @@ -648,7 +648,7 @@ void ExtDateTimeEditor::setSeparator( const QString& s ) Returns the editor's separator. */ -QString ExtDateTimeEditor::separator() const +TQString ExtDateTimeEditor::separator() const { return d->separator(); } @@ -682,7 +682,7 @@ bool ExtDateTimeEditor::setFocusSection( int sec ) ExtDateTimeEditor. */ -/*! \fn QString ExtDateTimeEditBase::sectionFormattedText( int sec ) +/*! \fn TQString ExtDateTimeEditBase::sectionFormattedText( int sec ) \internal Pure virtual function which returns the formatted text of section \a @@ -747,7 +747,7 @@ public: ExtDate max; bool changed; ExtDateTimeEditor *ed; - QSpinWidget *controls; + TQSpinWidget *controls; }; @@ -823,7 +823,7 @@ public: called name \a name. */ -ExtDateEdit::ExtDateEdit( QWidget * parent, const char * name ) +ExtDateEdit::ExtDateEdit( TQWidget * parent, const char * name ) : ExtDateTimeEditBase( parent, name ) { init(); @@ -839,7 +839,7 @@ ExtDateEdit::ExtDateEdit( QWidget * parent, const char * name ) The date editor is initialized with \a date. */ -ExtDateEdit::ExtDateEdit( const ExtDate& date, QWidget * parent, const char * name ) +ExtDateEdit::ExtDateEdit( const ExtDate& date, TQWidget * parent, const char * name ) : ExtDateTimeEditBase( parent, name ) { init(); @@ -857,10 +857,10 @@ void ExtDateEdit::init() d->ed = new ExtDateTimeEditor( this, "date editor" ); d->controls->setEditWidget( d->ed ); setFocusProxy( d->ed ); - connect( d->controls, SIGNAL( stepUpPressed() ), SLOT( stepUp() ) ); - connect( d->controls, SIGNAL( stepDownPressed() ), SLOT( stepDown() ) ); - connect( this, SIGNAL( valueChanged(const ExtDate&) ), - SLOT( updateButtons() ) ); + connect( d->controls, TQT_SIGNAL( stepUpPressed() ), TQT_SLOT( stepUp() ) ); + connect( d->controls, TQT_SIGNAL( stepDownPressed() ), TQT_SLOT( stepDown() ) ); + connect( this, TQT_SIGNAL( valueChanged(const ExtDate&) ), + TQT_SLOT( updateButtons() ) ); d->ed->appendSection( QNumberSection( 0,4 ) ); d->ed->appendSection( QNumberSection( 5,7 ) ); d->ed->appendSection( QNumberSection( 8,10 ) ); @@ -883,7 +883,7 @@ void ExtDateEdit::init() d->max = ExtDate( 50000, 12, 31 ); d->changed = FALSE; - setSizePolicy( QSizePolicy::Minimum, QSizePolicy::Fixed ); + setSizePolicy( TQSizePolicy::Minimum, TQSizePolicy::Fixed ); refcount++; } @@ -953,7 +953,7 @@ void ExtDateEdit::setRange( const ExtDate& min, const ExtDate& max ) character of \a s is used. */ -void ExtDateEdit::setSeparator( const QString& s ) +void ExtDateEdit::setSeparator( const TQString& s ) { d->ed->setSeparator( s ); } @@ -962,7 +962,7 @@ void ExtDateEdit::setSeparator( const QString& s ) Returns the editor's separator. */ -QString ExtDateEdit::separator() const +TQString ExtDateEdit::separator() const { return d->ed->separator(); } @@ -989,7 +989,7 @@ void ExtDateEdit::updateButtons() /*! \reimp */ -void ExtDateEdit::resizeEvent( QResizeEvent * ) +void ExtDateEdit::resizeEvent( TQResizeEvent * ) { d->controls->resize( width(), height() ); } @@ -997,22 +997,22 @@ void ExtDateEdit::resizeEvent( QResizeEvent * ) /*! \reimp */ -QSize ExtDateEdit::sizeHint() const +TQSize ExtDateEdit::sizeHint() const { constPolish(); - QFontMetrics fm( font() ); - int fw = style().pixelMetric( QStyle::PM_DefaultFrameWidth, this ); + TQFontMetrics fm( font() ); + int fw = style().pixelMetric( TQStyle::PM_DefaultFrameWidth, this ); int h = QMAX( fm.lineSpacing(), 14 ) + 2; int w = 2 + fm.width( '9' ) * 8 + fm.width( d->ed->separator() ) * 2 + d->controls->upRect().width() + fw * 4; - return QSize( w, QMAX(h + fw * 2,20) ).expandedTo( QApplication::globalStrut() ); + return TQSize( w, QMAX(h + fw * 2,20) ).expandedTo( TQApplication::globalStrut() ); } /*! \reimp */ -QSize ExtDateEdit::minimumSizeHint() const +TQSize ExtDateEdit::minimumSizeHint() const { return sizeHint(); } @@ -1026,9 +1026,9 @@ QSize ExtDateEdit::minimumSizeHint() const \sa setOrder() */ -QString ExtDateEdit::sectionFormattedText( int sec ) +TQString ExtDateEdit::sectionFormattedText( int sec ) { - QString txt; + TQString txt; txt = sectionText( sec ); if ( d->typing && sec == d->ed->focusSection() ) d->ed->setSectionSelection( sec, sectionOffsetEnd( sec ) - txt.length(), @@ -1071,7 +1071,7 @@ int ExtDateEdit::sectionLength( int sec ) const \sa setOrder() */ -QString ExtDateEdit::sectionText( int sec ) const +TQString ExtDateEdit::sectionText( int sec ) const { int val = 0; if ( sec == d->yearSection ) @@ -1081,7 +1081,7 @@ QString ExtDateEdit::sectionText( int sec ) const else if ( sec == d->daySection ) val = d->d; - return QString::number( val ); + return TQString::number( val ); } /*! \internal @@ -1363,25 +1363,25 @@ void ExtDateEdit::addNumber( int sec, int num ) bool overwrite = FALSE; bool accepted = FALSE; d->typing = TRUE; - QString txt; + TQString txt; if ( sec == d->yearSection ) { if ( d->overwrite ) { d->y = num; d->overwrite = FALSE; accepted = TRUE; } else { - txt = QString::number( 10*d->y + num ); + txt = TQString::number( 10*d->y + num ); if ( txt.length() > 5 ) txt = txt.mid(1); d->y = txt.toInt(); accepted = TRUE; } /* - txt = QString::number( d->y ); + txt = TQString::number( d->y ); if ( d->overwrite || txt.length() == 4 ) { accepted = TRUE; d->y = num; } else { - txt += QString::number( num ); + txt += TQString::number( num ); if ( txt.length() == 4 ) { int val = txt.toInt(); if ( val < 1792 ) @@ -1389,7 +1389,7 @@ void ExtDateEdit::addNumber( int sec, int num ) else if ( val > 8000 ) d->y = 8000; else if ( outOfRange( val, d->m, d->d ) ) - txt = QString::number( d->y ); + txt = TQString::number( d->y ); else { accepted = TRUE; d->y = val; @@ -1405,17 +1405,17 @@ void ExtDateEdit::addNumber( int sec, int num ) } */ } else if ( sec == d->monthSection ) { - txt = QString::number( d->m ); + txt = TQString::number( d->m ); if ( d->overwrite || txt.length() == 2 ) { accepted = TRUE; d->m = num; } else { - txt += QString::number( num ); + txt += TQString::number( num ); int temp = txt.toInt(); if ( temp > 12 ) temp = num; if ( outOfRange( d->y, temp, d->d ) ) - txt = QString::number( d->m ); + txt = TQString::number( d->m ); else { accepted = TRUE; d->m = temp; @@ -1426,18 +1426,18 @@ void ExtDateEdit::addNumber( int sec, int num ) } } } else if ( sec == d->daySection ) { - txt = QString::number( d->d ); + txt = TQString::number( d->d ); if ( d->overwrite || txt.length() == 2 ) { accepted = TRUE; d->d = num; d->dayCache = d->d; } else { - txt += QString::number( num ); + txt += TQString::number( num ); int temp = txt.toInt(); if ( temp > 31 ) temp = num; if ( outOfRange( d->y, d->m, temp ) ) - txt = QString::number( d->d ); + txt = TQString::number( d->d ); else { accepted = TRUE; d->d = temp; @@ -1549,9 +1549,9 @@ void ExtDateEdit::fix() */ -bool ExtDateEdit::event( QEvent *e ) +bool ExtDateEdit::event( TQEvent *e ) { - if( e->type() == QEvent::FocusOut ) { + if( e->type() == TQEvent::FocusOut ) { d->typing = FALSE; d->overwrite = TRUE; // the following can't be done in fix() because fix() called @@ -1571,7 +1571,7 @@ bool ExtDateEdit::event( QEvent *e ) emit valueChanged( date() ); d->changed = FALSE; } - } else if ( e->type() == QEvent::LocaleChange ) { + } else if ( e->type() == TQEvent::LocaleChange ) { readLocaleSettings(); d->ed->setSeparator( localDateSep() ); setOrder( localOrder() ); @@ -1593,17 +1593,17 @@ void ExtDateEdit::removeFirstNumber( int sec ) { if ( sec == -1 ) return; - QString txt; + TQString txt; if ( sec == d->yearSection ) { - txt = QString::number( d->y ); + txt = TQString::number( d->y ); txt = txt.mid( 1, txt.length() ) + "0"; d->y = txt.toInt(); } else if ( sec == d->monthSection ) { - txt = QString::number( d->m ); + txt = TQString::number( d->m ); txt = txt.mid( 1, txt.length() ) + "0"; d->m = txt.toInt(); } else if ( sec == d->daySection ) { - txt = QString::number( d->d ); + txt = TQString::number( d->d ); txt = txt.mid( 1, txt.length() ) + "0"; d->d = txt.toInt(); d->dayCache = d->d; @@ -1619,17 +1619,17 @@ void ExtDateEdit::removeLastNumber( int sec ) { if ( sec == -1 ) return; - QString txt; + TQString txt; if ( sec == d->yearSection ) { - txt = QString::number( d->y ); + txt = TQString::number( d->y ); txt = txt.mid( 0, txt.length()-1 ); d->y = txt.toInt(); } else if ( sec == d->monthSection ) { - txt = QString::number( d->m ); + txt = TQString::number( d->m ); txt = txt.mid( 0, txt.length()-1 ); d->m = txt.toInt(); } else if ( sec == d->daySection ) { - txt = QString::number( d->d ); + txt = TQString::number( d->d ); txt = txt.mid( 0, txt.length()-1 ); d->d = txt.toInt(); d->dayCache = d->d; @@ -1661,7 +1661,7 @@ bool ExtDateEdit::autoAdvance() const /*! \reimp */ -void ExtDateEdit::timerEvent( QTimerEvent * ) +void ExtDateEdit::timerEvent( TQTimerEvent * ) { d->overwrite = TRUE; } @@ -1686,11 +1686,11 @@ public: bool overwrite; int timerId; bool typing; - QTime min; - QTime max; + TQTime min; + TQTime max; bool changed; ExtDateTimeEditor *ed; - QSpinWidget *controls; + TQSpinWidget *controls; }; /*! @@ -1709,7 +1709,7 @@ public: hour, minute, second order. It is recommended that the QTimeEdit is initialised with a time, e.g. \code - QTime timeNow = QTime::currentTime(); + TQTime timeNow = TQTime::currentTime(); QTimeEdit *timeEdit = new QTimeEdit( timeNow, this ); timeEdit->setRange( timeNow, timeNow.addSecs( 60 * 60 ) ); \endcode @@ -1718,7 +1718,7 @@ public: maximum time to one hour from now. The maximum and minimum values for a time value in the time editor - default to the maximum and minimum values for a QTime. You can + default to the maximum and minimum values for a TQTime. You can change this by calling setMinValue(), setMaxValue() or setRange(). Terminology: A QTimeWidget consists of three sections, one each @@ -1728,7 +1728,7 @@ public: \img datetimewidgets.png Date Time Widgets - \sa QTime ExtDateEdit ExtDateTimeEdit + \sa TQTime ExtDateEdit ExtDateTimeEdit */ @@ -1737,7 +1737,7 @@ public: // name. // */ // -// QTimeEdit::QTimeEdit( QWidget * parent, const char * name ) +// QTimeEdit::QTimeEdit( TQWidget * parent, const char * name ) // : ExtDateTimeEditBase( parent, name ) // { // init(); @@ -1750,7 +1750,7 @@ public: // parent \a parent and called \a name. // */ // -// QTimeEdit::QTimeEdit( const QTime& time, QWidget * parent, const char * name ) +// QTimeEdit::QTimeEdit( const TQTime& time, TQWidget * parent, const char * name ) // : ExtDateTimeEditBase( parent, name ) // { // init(); @@ -1767,8 +1767,8 @@ public: // d->controls = new ExtDateTimeSpinWidget( this, qstrcmp( name(), "qt_datetime_timeedit" ) == 0 ? "qt_spin_widget" : "time edit controls" ); // d->controls->setEditWidget( d->ed ); // setFocusProxy( d->ed ); -// connect( d->controls, SIGNAL( stepUpPressed() ), SLOT( stepUp() ) ); -// connect( d->controls, SIGNAL( stepDownPressed() ), SLOT( stepDown() ) ); +// connect( d->controls, TQT_SIGNAL( stepUpPressed() ), TQT_SLOT( stepUp() ) ); +// connect( d->controls, TQT_SIGNAL( stepDownPressed() ), TQT_SLOT( stepDown() ) ); // // d->ed->appendSection( QNumberSection( 0,0, TRUE, 0 ) ); // d->ed->appendSection( QNumberSection( 0,0, TRUE, 1 ) ); @@ -1787,11 +1787,11 @@ public: // d->overwrite = TRUE; // d->timerId = 0; // d->typing = FALSE; -// d->min = QTime( 0, 0, 0 ); -// d->max = QTime( 23, 59, 59 ); +// d->min = TQTime( 0, 0, 0 ); +// d->max = TQTime( 23, 59, 59 ); // d->changed = FALSE; // -// setSizePolicy( QSizePolicy::Minimum, QSizePolicy::Fixed ); +// setSizePolicy( TQSizePolicy::Minimum, TQSizePolicy::Fixed ); // // refcount++; // } @@ -1818,7 +1818,7 @@ public: // \sa maxValue setRange() // */ // -// QTime QTimeEdit::minValue() const +// TQTime QTimeEdit::minValue() const // { // return d->min; // } @@ -1834,7 +1834,7 @@ public: // \sa minValue setRange() // */ // -// QTime QTimeEdit::maxValue() const +// TQTime QTimeEdit::maxValue() const // { // return d->max; // } @@ -1846,7 +1846,7 @@ public: // Similarly, if \a max is invalid no maximum time is set. // */ // -// void QTimeEdit::setRange( const QTime& min, const QTime& max ) +// void QTimeEdit::setRange( const TQTime& min, const TQTime& max ) // { // if ( min.isValid() ) // d->min = min; @@ -1894,7 +1894,7 @@ public: // minValue(), or is greater than maxValue(), nothing happens. // */ // -// void QTimeEdit::setTime( const QTime& time ) +// void QTimeEdit::setTime( const TQTime& time ) // { // if ( !time.isValid() ) { // d->h = 0; @@ -1912,11 +1912,11 @@ public: // d->ed->repaint( d->ed->rect(), FALSE ); // } // -// QTime QTimeEdit::time() const +// TQTime QTimeEdit::time() const // { -// if ( QTime::isValid( d->h, d->m, d->s ) ) -// return QTime( d->h, d->m, d->s ); -// return QTime(); +// if ( TQTime::isValid( d->h, d->m, d->s ) ) +// return TQTime( d->h, d->m, d->s ); +// return TQTime(); // } // // /*! @@ -1944,7 +1944,7 @@ public: // character of \a s is used. // */ // -// void QTimeEdit::setSeparator( const QString& s ) +// void QTimeEdit::setSeparator( const TQString& s ) // { // d->ed->setSeparator( s ); // } @@ -1953,14 +1953,14 @@ public: // Returns the editor's separator. // */ // -// QString QTimeEdit::separator() const +// TQString QTimeEdit::separator() const // { // return d->ed->separator(); // } // // // /*! -// \fn void QTimeEdit::valueChanged( const QTime& time ) +// \fn void QTimeEdit::valueChanged( const TQTime& time ) // // This signal is emitted whenever the editor's value changes. The \a // time parameter is the new value. @@ -1970,15 +1970,15 @@ public: // // */ // -// bool QTimeEdit::event( QEvent *e ) +// bool QTimeEdit::event( TQEvent *e ) // { -// if ( e->type() == QEvent::FocusOut ) { +// if ( e->type() == TQEvent::FocusOut ) { // d->typing = FALSE; // if ( d->changed ) { // emit valueChanged( time() ); // d->changed = FALSE; // } -// } else if ( e->type() == QEvent::LocaleChange ) { +// } else if ( e->type() == TQEvent::LocaleChange ) { // readLocaleSettings(); // d->ed->setSeparator( localTimeSep() ); // } @@ -1989,7 +1989,7 @@ public: // // */ // -// void QTimeEdit::timerEvent( QTimerEvent * ) +// void QTimeEdit::timerEvent( TQTimerEvent * ) // { // d->overwrite = TRUE; // } @@ -2098,9 +2098,9 @@ public: // on \a sec. // */ // -// QString QTimeEdit::sectionFormattedText( int sec ) +// TQString QTimeEdit::sectionFormattedText( int sec ) // { -// QString txt; +// TQString txt; // txt = sectionText( sec ); // txt = txt.rightJustify( 2, EXTDATETIMEEDIT_HIDDEN_CHAR ); // int offset = sec*2+sec*separator().length() + txt.length(); @@ -2123,7 +2123,7 @@ public: // killTimer( d->timerId ); // d->overwrite = TRUE; // d->typing = FALSE; -// QString txt = sectionText( sec ); +// TQString txt = sectionText( sec ); // txt = txt.rightJustify( 2, EXTDATETIMEEDIT_HIDDEN_CHAR ); // int offset = sec*2+sec*separator().length() + txt.length(); // d->ed->setSectionSelection( sec, offset - txt.length(), offset ); @@ -2187,39 +2187,39 @@ public: // // */ // -// QString QTimeEdit::sectionText( int sec ) +// TQString QTimeEdit::sectionText( int sec ) // { // sec = d->ed->mapSection( sec ); // -// QString txt; +// TQString txt; // switch( sec ) { // case 0: // if ( !(d->display & AMPM) || ( d->h < 13 && d->h ) ) { // I wished the day stared at 0:00 for everybody -// txt = QString::number( d->h ); +// txt = TQString::number( d->h ); // } else { // if ( d->h ) -// txt = QString::number( d->h - 12 ); +// txt = TQString::number( d->h - 12 ); // else // txt = "12"; // } // break; // case 1: -// txt = QString::number( d->m ); +// txt = TQString::number( d->m ); // break; // case 2: -// txt = QString::number( d->s ); +// txt = TQString::number( d->s ); // break; // case 3: // if ( d->h < 12 ) { // if ( lAM ) // txt = *lAM; // else -// txt = QString::fromLatin1( "AM" ); +// txt = TQString::fromLatin1( "AM" ); // } else { // if ( lPM ) // txt = *lPM; // else -// txt = QString::fromLatin1( "PM" ); +// txt = TQString::fromLatin1( "PM" ); // } // break; // default: @@ -2235,8 +2235,8 @@ public: // // bool QTimeEdit::outOfRange( int h, int m, int s ) const // { -// if ( QTime::isValid( h, m, s ) ) { -// QTime currentTime( h, m, s ); +// if ( TQTime::isValid( h, m, s ) ) { +// TQTime currentTime( h, m, s ); // if ( currentTime > maxValue() || // currentTime < minValue() ) // return TRUE; @@ -2259,12 +2259,12 @@ public: // bool overwrite = FALSE; // bool accepted = FALSE; // d->typing = TRUE; -// QString txt; +// TQString txt; // // switch( sec ) { // case 0: // txt = ( d->display & AMPM && d->h > 12 ) ? -// QString::number( d->h - 12 ) : QString::number( d->h ); +// TQString::number( d->h - 12 ) : TQString::number( d->h ); // // if ( d->overwrite || txt.length() == 2 ) { // if ( d->display & AMPM && num == 0 ) @@ -2276,7 +2276,7 @@ public: // d->h = num; // } // } else { -// txt += QString::number( num ); +// txt += TQString::number( num ); // int temp = txt.toInt(); // // if ( d->display & AMPM ) { @@ -2286,7 +2286,7 @@ public: // } // accepted = TRUE; // } else if ( outOfRange( temp + 12, d->m, d->s ) ) { -// txt = QString::number( d->h ); +// txt = TQString::number( d->h ); // } else { // if ( d->h > 11 ) { // temp += 12; @@ -2294,7 +2294,7 @@ public: // accepted = TRUE; // } // } else if ( !(d->display & AMPM) && outOfRange( temp, d->m, d->s ) ) { -// txt = QString::number( d->h ); +// txt = TQString::number( d->h ); // } else { // accepted = TRUE; // } @@ -2310,19 +2310,19 @@ public: // break; // // case 1: -// txt = QString::number( d->m ); +// txt = TQString::number( d->m ); // if ( d->overwrite || txt.length() == 2 ) { // if ( !outOfRange( d->h, num, d->s ) ) { // accepted = TRUE; // d->m = num; // } // } else { -// txt += QString::number( num ); +// txt += TQString::number( num ); // int temp = txt.toInt(); // if ( temp > 59 ) // temp = num; // if ( outOfRange( d->h, temp, d->s ) ) -// txt = QString::number( d->m ); +// txt = TQString::number( d->m ); // else { // accepted = TRUE; // d->m = temp; @@ -2335,19 +2335,19 @@ public: // break; // // case 2: -// txt = QString::number( d->s ); +// txt = TQString::number( d->s ); // if ( d->overwrite || txt.length() == 2 ) { // if ( !outOfRange( d->h, d->m, num ) ) { // accepted = TRUE; // d->s = num; // } // } else { -// txt += QString::number( num ); +// txt += TQString::number( num ); // int temp = txt.toInt(); // if ( temp > 59 ) // temp = num; // if ( outOfRange( d->h, d->m, temp ) ) -// txt = QString::number( d->s ); +// txt = TQString::number( d->s ); // else { // accepted = TRUE; // d->s = temp; @@ -2386,16 +2386,16 @@ public: // if ( sec == -1 ) // return; // sec = d->ed->mapSection( sec ); -// QString txt; +// TQString txt; // switch( sec ) { // case 0: -// txt = QString::number( d->h ); +// txt = TQString::number( d->h ); // break; // case 1: -// txt = QString::number( d->m ); +// txt = TQString::number( d->m ); // break; // case 2: -// txt = QString::number( d->s ); +// txt = TQString::number( d->s ); // break; // } // txt = txt.mid( 1, txt.length() ) + "0"; @@ -2421,16 +2421,16 @@ public: // if ( sec == -1 ) // return; // sec = d->ed->mapSection( sec ); -// QString txt; +// TQString txt; // switch( sec ) { // case 0: -// txt = QString::number( d->h ); +// txt = TQString::number( d->h ); // break; // case 1: -// txt = QString::number( d->m ); +// txt = TQString::number( d->m ); // break; // case 2: -// txt = QString::number( d->s ); +// txt = TQString::number( d->s ); // break; // } // txt = txt.mid( 0, txt.length()-1 ); @@ -2450,18 +2450,18 @@ public: // // /*! \reimp // */ -// void QTimeEdit::resizeEvent( QResizeEvent * ) +// void QTimeEdit::resizeEvent( TQResizeEvent * ) // { // d->controls->resize( width(), height() ); // } // // /*! \reimp // */ -// QSize QTimeEdit::sizeHint() const +// TQSize QTimeEdit::sizeHint() const // { // constPolish(); -// QFontMetrics fm( font() ); -// int fw = style().pixelMetric( QStyle::PM_DefaultFrameWidth, this ); +// TQFontMetrics fm( font() ); +// int fw = style().pixelMetric( TQStyle::PM_DefaultFrameWidth, this ); // int h = fm.lineSpacing() + 2; // int w = 2 + fm.width( '9' ) * 6 + fm.width( d->ed->separator() ) * 2 + // d->controls->upRect().width() + fw * 4; @@ -2469,15 +2469,15 @@ public: // if ( lAM ) // w += fm.width( *lAM ) + 4; // else -// w += fm.width( QString::fromLatin1( "AM" ) ) + 4; +// w += fm.width( TQString::fromLatin1( "AM" ) ) + 4; // } // -// return QSize( w, QMAX(h + fw * 2,20) ).expandedTo( QApplication::globalStrut() ); +// return TQSize( w, QMAX(h + fw * 2,20) ).expandedTo( TQApplication::globalStrut() ); // } // // /*! \reimp // */ -// QSize QTimeEdit::minimumSizeHint() const +// TQSize QTimeEdit::minimumSizeHint() const // { // return sizeHint(); // } @@ -2558,8 +2558,8 @@ public: Constructs an empty datetime edit with parent \a parent and called \a name. */ -ExtDateTimeEdit::ExtDateTimeEdit( QWidget * parent, const char * name ) - : QWidget( parent, name ) +ExtDateTimeEdit::ExtDateTimeEdit( TQWidget * parent, const char * name ) + : TQWidget( parent, name ) { init(); } @@ -2572,8 +2572,8 @@ ExtDateTimeEdit::ExtDateTimeEdit( QWidget * parent, const char * name ) parent \a parent and called \a name. */ ExtDateTimeEdit::ExtDateTimeEdit( const ExtDateTime& datetime, - QWidget * parent, const char * name ) - : QWidget( parent, name ) + TQWidget * parent, const char * name ) + : TQWidget( parent, name ) { init(); setDateTime( datetime ); @@ -2598,7 +2598,7 @@ ExtDateTimeEdit::~ExtDateTimeEdit() for the ExtDateTimeEdit. */ -void ExtDateTimeEdit::resizeEvent( QResizeEvent * ) +void ExtDateTimeEdit::resizeEvent( TQResizeEvent * ) { int dw = de->sizeHint().width(); int tw = te->sizeHint().width(); @@ -2620,11 +2620,11 @@ void ExtDateTimeEdit::resizeEvent( QResizeEvent * ) /*! \reimp */ -QSize ExtDateTimeEdit::minimumSizeHint() const +TQSize ExtDateTimeEdit::minimumSizeHint() const { - QSize dsh = de->minimumSizeHint(); - QSize tsh = te->minimumSizeHint(); - return QSize( dsh.width() + tsh.width(), + TQSize dsh = de->minimumSizeHint(); + TQSize tsh = te->minimumSizeHint(); + return TQSize( dsh.width() + tsh.width(), QMAX( dsh.height(), tsh.height() ) ); } @@ -2637,23 +2637,23 @@ void ExtDateTimeEdit::init() de = new ExtDateEdit( this, "qt_datetime_dateedit" ); te = new QTimeEdit( this, "qt_datetime_timeedit" ); d->adv = FALSE; - connect( de, SIGNAL( valueChanged( const ExtDate& ) ), - this, SLOT( newValue( const ExtDate& ) ) ); - connect( te, SIGNAL( valueChanged( const QTime& ) ), - this, SLOT( newValue( const QTime& ) ) ); + connect( de, TQT_SIGNAL( valueChanged( const ExtDate& ) ), + this, TQT_SLOT( newValue( const ExtDate& ) ) ); + connect( te, TQT_SIGNAL( valueChanged( const TQTime& ) ), + this, TQT_SLOT( newValue( const TQTime& ) ) ); setFocusProxy( de ); - setSizePolicy( QSizePolicy::Minimum, QSizePolicy::Fixed ); + setSizePolicy( TQSizePolicy::Minimum, TQSizePolicy::Fixed ); } /*! \reimp */ -QSize ExtDateTimeEdit::sizeHint() const +TQSize ExtDateTimeEdit::sizeHint() const { constPolish(); - QSize dsh = de->sizeHint(); - QSize tsh = te->sizeHint(); - return QSize( dsh.width() + tsh.width(), + TQSize dsh = de->sizeHint(); + TQSize tsh = te->sizeHint(); + return TQSize( dsh.width() + tsh.width(), QMAX( dsh.height(), tsh.height() ) ); } @@ -2702,7 +2702,7 @@ void ExtDateTimeEdit::newValue( const ExtDate& ) Re-emits the value \a t. */ -void ExtDateTimeEdit::newValue( const QTime& ) +void ExtDateTimeEdit::newValue( const TQTime& ) { ExtDateTime dt = dateTime(); emit valueChanged( dt ); diff --git a/libkdeedu/extdate/extdatetimeedit.h b/libkdeedu/extdate/extdatetimeedit.h index 048f7aa3..4bcf78c8 100644 --- a/libkdeedu/extdate/extdatetimeedit.h +++ b/libkdeedu/extdate/extdatetimeedit.h @@ -26,8 +26,8 @@ #define EXTDATETIMEEDIT_H #ifndef QT_H -#include -#include +#include +#include #endif // QT_H #include "extdatetime.h" @@ -40,11 +40,11 @@ class ExtDateTimeEditBase : public QWidget { Q_OBJECT public: - ExtDateTimeEditBase( QWidget* parent=0, const char* name=0 ) - : QWidget( parent, name ) {} + ExtDateTimeEditBase( TQWidget* parent=0, const char* name=0 ) + : TQWidget( parent, name ) {} virtual bool setFocusSection( int sec ) = 0; - virtual QString sectionFormattedText( int sec ) = 0; + virtual TQString sectionFormattedText( int sec ) = 0; virtual void addNumber( int sec, int num ) = 0; virtual void removeLastNumber( int sec ) = 0; @@ -72,8 +72,8 @@ class KDE_EXPORT ExtDateEdit : public ExtDateTimeEditBase // Q_PROPERTY( ExtDate minValue READ minValue WRITE setMinValue ) public: - ExtDateEdit( QWidget* parent=0, const char* name=0 ); - ExtDateEdit( const ExtDate& date, QWidget* parent=0, const char* name=0 ); + ExtDateEdit( TQWidget* parent=0, const char* name=0 ); + ExtDateEdit( const ExtDate& date, TQWidget* parent=0, const char* name=0 ); ~ExtDateEdit(); enum Order { DMY /**< Day-Month-Year */, @@ -81,8 +81,8 @@ public: YMD /**< Year-Month-Day, also the default */, YDM /**< Year-Day-Month @deprecated Included for completeness. */ }; - QSize sizeHint() const; - QSize minimumSizeHint() const; + TQSize sizeHint() const; + TQSize minimumSizeHint() const; public slots: virtual void setDate( const ExtDate& date ); @@ -99,8 +99,8 @@ public: virtual void setMaxValue( const ExtDate& d ) { setRange( minValue(), d ); } ExtDate maxValue() const; virtual void setRange( const ExtDate& min, const ExtDate& max ); - QString separator() const; - virtual void setSeparator( const QString& s ); + TQString separator() const; + virtual void setSeparator( const TQString& s ); // Make removeFirstNumber() virtual in ExtDateTimeEditBase in 4.0 void removeFirstNumber( int sec ); @@ -109,12 +109,12 @@ signals: void valueChanged( const ExtDate& date ); protected: - bool event( QEvent *e ); - void timerEvent( QTimerEvent * ); - void resizeEvent( QResizeEvent * ); + bool event( TQEvent *e ); + void timerEvent( TQTimerEvent * ); + void resizeEvent( TQResizeEvent * ); void stepUp(); void stepDown(); - QString sectionFormattedText( int sec ); + TQString sectionFormattedText( int sec ); void addNumber( int sec, int num ); void removeLastNumber( int sec ); @@ -133,7 +133,7 @@ private: void init(); int sectionOffsetEnd( int sec ) const; int sectionLength( int sec ) const; - QString sectionText( int sec ) const; + TQString sectionText( int sec ) const; ExtDateEditPrivate* d; #if defined(Q_DISABLE_COPY) @@ -148,10 +148,10 @@ private: // { // Q_OBJECT // Q_SETS( Display ) -// Q_PROPERTY( QTime time READ time WRITE setTime ) +// Q_PROPERTY( TQTime time READ time WRITE setTime ) // Q_PROPERTY( bool autoAdvance READ autoAdvance WRITE setAutoAdvance ) -// Q_PROPERTY( QTime maxValue READ maxValue WRITE setMaxValue ) -// Q_PROPERTY( QTime minValue READ minValue WRITE setMinValue ) +// Q_PROPERTY( TQTime maxValue READ maxValue WRITE setMaxValue ) +// Q_PROPERTY( TQTime minValue READ minValue WRITE setMinValue ) // Q_PROPERTY( Display display READ display WRITE setDisplay ) // // public: @@ -163,28 +163,28 @@ private: // AMPM = 0x10 // }; // -// QTimeEdit( QWidget* parent=0, const char* name=0 ); -// QTimeEdit( const QTime& time, QWidget* parent=0, const char* name=0 ); +// QTimeEdit( TQWidget* parent=0, const char* name=0 ); +// QTimeEdit( const TQTime& time, TQWidget* parent=0, const char* name=0 ); // ~QTimeEdit(); // -// QSize sizeHint() const; -// QSize minimumSizeHint() const; +// TQSize sizeHint() const; +// TQSize minimumSizeHint() const; // // public slots: -// virtual void setTime( const QTime& time ); +// virtual void setTime( const TQTime& time ); // // public: -// QTime time() const; +// TQTime time() const; // virtual void setAutoAdvance( bool advance ); // bool autoAdvance() const; // -// virtual void setMinValue( const QTime& d ) { setRange( d, maxValue() ); } -// QTime minValue() const; -// virtual void setMaxValue( const QTime& d ) { setRange( minValue(), d ); } -// QTime maxValue() const; -// virtual void setRange( const QTime& min, const QTime& max ); -// QString separator() const; -// virtual void setSeparator( const QString& s ); +// virtual void setMinValue( const TQTime& d ) { setRange( d, maxValue() ); } +// TQTime minValue() const; +// virtual void setMaxValue( const TQTime& d ) { setRange( minValue(), d ); } +// TQTime maxValue() const; +// virtual void setRange( const TQTime& min, const TQTime& max ); +// TQString separator() const; +// virtual void setSeparator( const TQString& s ); // // uint display() const; // void setDisplay( uint disp ); @@ -193,15 +193,15 @@ private: // void removeFirstNumber( int sec ); // // signals: -// void valueChanged( const QTime& time ); +// void valueChanged( const TQTime& time ); // // protected: -// bool event( QEvent *e ); -// void timerEvent( QTimerEvent *e ); -// void resizeEvent( QResizeEvent * ); +// bool event( TQEvent *e ); +// void timerEvent( TQTimerEvent *e ); +// void resizeEvent( TQResizeEvent * ); // void stepUp(); // void stepDown(); -// QString sectionFormattedText( int sec ); +// TQString sectionFormattedText( int sec ); // void addNumber( int sec, int num ); // void removeLastNumber( int sec ); // bool setFocusSection( int s ); @@ -216,7 +216,7 @@ private: // // private: // void init(); -// QString sectionText( int sec ); +// TQString sectionText( int sec ); // QTimeEditPrivate* d; // // #if defined(Q_DISABLE_COPY) @@ -234,13 +234,13 @@ class KDE_EXPORT ExtDateTimeEdit : public QWidget // Q_PROPERTY( ExtDateTime dateTime READ dateTime WRITE setDateTime ) public: - ExtDateTimeEdit( QWidget* parent=0, const char* name=0 ); - ExtDateTimeEdit( const ExtDateTime& datetime, QWidget* parent=0, + ExtDateTimeEdit( TQWidget* parent=0, const char* name=0 ); + ExtDateTimeEdit( const ExtDateTime& datetime, TQWidget* parent=0, const char* name=0 ); ~ExtDateTimeEdit(); - QSize sizeHint() const; - QSize minimumSizeHint() const; + TQSize sizeHint() const; + TQSize minimumSizeHint() const; public slots: virtual void setDateTime( const ExtDateTime & dt ); @@ -260,13 +260,13 @@ signals: protected: // ### make init() private in Qt 4.0 void init(); - void resizeEvent( QResizeEvent * ); + void resizeEvent( TQResizeEvent * ); protected slots: // ### make these two functions private in Qt 4.0, // and merge them into one with no parameter void newValue( const ExtDate& d ); - void newValue( const QTime& t ); + void newValue( const TQTime& t ); private: ExtDateEdit* de; @@ -313,24 +313,24 @@ public: // void setControlWidget( ExtDateTimeEditBase * widget ); // ExtDateTimeEditBase * controlWidget() const; - void setSeparator( const QString& s ); - QString separator() const; + void setSeparator( const TQString& s ); + TQString separator() const; int focusSection() const; bool setFocusSection( int s ); void appendSection( const QNumberSection& sec ); void clearSections(); void setSectionSelection( int sec, int selstart, int selend ); - bool eventFilter( QObject *o, QEvent *e ); - int sectionAt( const QPoint &p ); + bool eventFilter( TQObject *o, TQEvent *e ); + int sectionAt( const TQPoint &p ); int mapSection( int sec ); protected: void init(); - bool event( QEvent *e ); - void resizeEvent( QResizeEvent * ); - void paintEvent( QPaintEvent * ); - void mousePressEvent( QMouseEvent *e ); + bool event( TQEvent *e ); + void resizeEvent( TQResizeEvent * ); + void paintEvent( TQPaintEvent * ); + void mousePressEvent( TQMouseEvent *e ); private: ExtDateTimeEditBase* cw; diff --git a/libkdeedu/extdate/extdatewidget.cpp b/libkdeedu/extdate/extdatewidget.cpp index 6a3fcbf5..5f5d19d6 100644 --- a/libkdeedu/extdate/extdatewidget.cpp +++ b/libkdeedu/extdate/extdatewidget.cpp @@ -1,7 +1,7 @@ /* This file is part of the KDE libraries Copyright (C) 2001 Waldo Bastian (bastian@kde.org) - Modified to use ExtDate instead of QDate. Modifications + Modified to use ExtDate instead of TQDate. Modifications Copyright (C) 2004 Jason Harris (jharris@30doradus.org) This library is free software; you can redistribute it and/or @@ -20,9 +20,9 @@ */ -#include -#include -#include +#include +#include +#include #include #include @@ -33,8 +33,8 @@ class ExtDateWidgetSpinBox : public QSpinBox { public: - ExtDateWidgetSpinBox(int min, int max, QWidget *parent) - : QSpinBox(min, max, 1, parent) + ExtDateWidgetSpinBox(int min, int max, TQWidget *parent) + : TQSpinBox(min, max, 1, parent) { editor()->setAlignment(AlignRight); } @@ -46,23 +46,23 @@ public: ExtDateWidgetPrivate() { calendar = new ExtCalendarSystemGregorian(); } ~ExtDateWidgetPrivate() { delete calendar; } ExtDateWidgetSpinBox *m_day; - QComboBox *m_month; + TQComboBox *m_month; ExtDateWidgetSpinBox *m_year; ExtDate m_dat; ExtCalendarSystemGregorian *calendar; }; -ExtDateWidget::ExtDateWidget( QWidget *parent, const char *name ) - : QWidget( parent, name ) +ExtDateWidget::ExtDateWidget( TQWidget *parent, const char *name ) + : TQWidget( parent, name ) { init(ExtDate::currentDate()); setDate(ExtDate()); } -ExtDateWidget::ExtDateWidget( const ExtDate &date, QWidget *parent, +ExtDateWidget::ExtDateWidget( const ExtDate &date, TQWidget *parent, const char *name ) - : QWidget( parent, name ) + : TQWidget( parent, name ) { init(date); setDate(date); @@ -74,13 +74,13 @@ ExtDateWidget::ExtDateWidget( const ExtDate &date, QWidget *parent, // { // d = new ExtDateWidgetPrivate; // KLocale *locale = KGlobal::locale(); -// QHBoxLayout *layout = new QHBoxLayout(this, 0, KDialog::spacingHint()); +// TQHBoxLayout *layout = new TQHBoxLayout(this, 0, KDialog::spacingHint()); // layout->setAutoAdd(true); // d->m_day = new ExtDateWidgetSpinBox(1, 1, this); -// d->m_month = new QComboBox(false, this); +// d->m_month = new TQComboBox(false, this); // for (int i = 1; ; ++i) // { -// QString str = d->calendar->monthName(i, +// TQString str = d->calendar->monthName(i, // d->calendar->year(ExtDate())); // if (str.isNull()) break; // d->m_month->insertItem(str); @@ -89,22 +89,22 @@ ExtDateWidget::ExtDateWidget( const ExtDate &date, QWidget *parent, // d->m_year = new ExtDateWidgetSpinBox(d->calendar->minValidYear(), // d->calendar->maxValidYear(), this); // -// connect(d->m_day, SIGNAL(valueChanged(int)), this, SLOT(slotDateChanged())); -// connect(d->m_month, SIGNAL(activated(int)), this, SLOT(slotDateChanged())); -// connect(d->m_year, SIGNAL(valueChanged(int)), this, SLOT(slotDateChanged())); +// connect(d->m_day, TQT_SIGNAL(valueChanged(int)), this, TQT_SLOT(slotDateChanged())); +// connect(d->m_month, TQT_SIGNAL(activated(int)), this, TQT_SLOT(slotDateChanged())); +// connect(d->m_year, TQT_SIGNAL(valueChanged(int)), this, TQT_SLOT(slotDateChanged())); // } void ExtDateWidget::init(const ExtDate& date) { d = new ExtDateWidgetPrivate; //KLocale *locale = KGlobal::locale(); - QHBoxLayout *layout = new QHBoxLayout(this, 0, KDialog::spacingHint()); + TQHBoxLayout *layout = new TQHBoxLayout(this, 0, KDialog::spacingHint()); layout->setAutoAdd(true); d->m_day = new ExtDateWidgetSpinBox(1, 1, this); - d->m_month = new QComboBox(false, this); + d->m_month = new TQComboBox(false, this); for (int i = 1; ; ++i) { - QString str = d->calendar->monthName(i, + TQString str = d->calendar->monthName(i, d->calendar->year(date)); if (str.isNull()) break; d->m_month->insertItem(str); @@ -113,9 +113,9 @@ void ExtDateWidget::init(const ExtDate& date) d->m_year = new ExtDateWidgetSpinBox(d->calendar->minValidYear(), d->calendar->maxValidYear(), this); - connect(d->m_day, SIGNAL(valueChanged(int)), this, SLOT(slotDateChanged())); - connect(d->m_month, SIGNAL(activated(int)), this, SLOT(slotDateChanged())); - connect(d->m_year, SIGNAL(valueChanged(int)), this, SLOT(slotDateChanged())); + connect(d->m_day, TQT_SIGNAL(valueChanged(int)), this, TQT_SLOT(slotDateChanged())); + connect(d->m_month, TQT_SIGNAL(activated(int)), this, TQT_SLOT(slotDateChanged())); + connect(d->m_year, TQT_SIGNAL(valueChanged(int)), this, TQT_SLOT(slotDateChanged())); } ExtDateWidget::~ExtDateWidget() diff --git a/libkdeedu/extdate/extdatewidget.h b/libkdeedu/extdate/extdatewidget.h index 66bec871..f2fd3045 100644 --- a/libkdeedu/extdate/extdatewidget.h +++ b/libkdeedu/extdate/extdatewidget.h @@ -1,7 +1,7 @@ /* This file is part of the KDE libraries Copyright (C) 2001 Waldo Bastian (bastian@kde.org) - Modified to use ExtDate instead of QDate. Modifications + Modified to use ExtDate instead of TQDate. Modifications Copyright (C) 2004 Jason Harris (jharris@30doradus.org) This library is free software; you can redistribute it and/or @@ -41,12 +41,12 @@ public: /** * Constructs a date selection widget, initialized to the current CPU date. */ - ExtDateWidget( QWidget *parent=0, const char *name=0 ); + ExtDateWidget( TQWidget *parent=0, const char *name=0 ); /** * Constructs a date selection widget with the initial date set to @p date. */ - ExtDateWidget( const ExtDate &date, QWidget *parent=0, const char *name=0 ); + ExtDateWidget( const ExtDate &date, TQWidget *parent=0, const char *name=0 ); /** * Destructs the date selection widget. diff --git a/libkdeedu/extdate/main.cpp b/libkdeedu/extdate/main.cpp index f71a6acd..bcc68a1f 100644 --- a/libkdeedu/extdate/main.cpp +++ b/libkdeedu/extdate/main.cpp @@ -25,6 +25,6 @@ int main( int argc, char *argv[] ) KApplication a; TestWidget *t = new TestWidget(0,0); t->show(); - QObject::connect(kapp, SIGNAL(lastWindowClosed()), kapp, SLOT(quit())); + TQObject::connect(kapp, TQT_SIGNAL(lastWindowClosed()), kapp, TQT_SLOT(quit())); return a.exec(); } diff --git a/libkdeedu/extdate/test_extdate.cc b/libkdeedu/extdate/test_extdate.cc index b21e228b..d63d1558 100644 --- a/libkdeedu/extdate/test_extdate.cc +++ b/libkdeedu/extdate/test_extdate.cc @@ -5,7 +5,7 @@ void test1_unit(int a_year) { - std::cout << a_year << " (QDate|ExtDate): " << ((QDate::leapYear(a_year)) ? "yes" : "no") + std::cout << a_year << " (QDate|ExtDate): " << ((TQDate::leapYear(a_year)) ? "yes" : "no") <<"|"<< ((ExtDate::leapYear(a_year)) ? "yes" : "no") << std::endl; } @@ -117,7 +117,7 @@ void test2() {2003, 11, 2} }; uint i; - std::cout << "(y, m, d) :: QDate : Q.dayOfWeek() : Q.weekNumber() : Q.dayOfYear() :: ExtDate : E.dayOfWeek() : E.weekNumber() : E.dayOfYear()\n" << std::endl; + std::cout << "(y, m, d) :: TQDate : Q.dayOfWeek() : Q.weekNumber() : Q.dayOfYear() :: ExtDate : E.dayOfWeek() : E.weekNumber() : E.dayOfYear()\n" << std::endl; for (i = 0 ; i < sizeof(a_set_of_dates)/sizeof(a_set_of_dates[0]) ; i++) { @@ -130,11 +130,11 @@ void test3_unit(int y, int m, int d, int dm) { QDate q(y, m, d); ExtDate e(y, m, d); - QDate q2 = q.addMonths(dm); + TQDate q2 = q.addMonths(dm); ExtDate e2 = e.addMonths(dm); std::cout << e.toString("%d.%b.%Y").local8Bit() << " + " << dm << " months :: ExtDate : " << e2.toString("%d.%b.%Y").local8Bit() - << " QDate : " << q2.toString("dd.MMM.yyyy").local8Bit() << std::endl; + << " TQDate : " << q2.toString("dd.MMM.yyyy").local8Bit() << std::endl; } void test3() @@ -162,7 +162,7 @@ void test4_unit(int y, int m, int d, int dy) QDate q2 = q.addYears(dy); ExtDate e2 = e.addYears(dy); std::cout << e.toString("%d.%m.%Y").local8Bit() << " + " << dy << " years :: ExtDate : " - << e2.toString().local8Bit() << " QDate : " + << e2.toString().local8Bit() << " TQDate : " << q2.toString().local8Bit() << std::endl; } @@ -189,10 +189,10 @@ void test4() void test5_unit(int y, int m, int d, const char *qformat, const char *eformat) { - QDate q(y, m, d); + TQDate q(y, m, d); ExtDate e(y, m, d); - if ( QString(qformat) == "" ) + if ( TQString(qformat) == "" ) std::cout << eformat << " : " << e.toString().local8Bit() << " :: " << qformat << " : " << q.toString().local8Bit() << std::endl; else @@ -238,7 +238,7 @@ void test6_unit(int y, int m, int d) { std::cout << d << "/" << m << "/" << y << " :: " << ( ExtDate::isValid(y, m, d) ? "TRUE" : "FALSE" ) << " : " - << ( QDate::isValid(y, m, d) ? "TRUE" : "FALSE" ) << std::endl; + << ( TQDate::isValid(y, m, d) ? "TRUE" : "FALSE" ) << std::endl; } void test6() @@ -265,7 +265,7 @@ void test6() }; uint i; std::cout << "Date.isValid()" << std::endl; - std::cout << "d/m/y :: ExtDate.isValid() : QDate.isValid()\n" << std::endl; + std::cout << "d/m/y :: ExtDate.isValid() : TQDate.isValid()\n" << std::endl; for (i = 0 ; i < sizeof(a_set_of_dates)/sizeof(a_set_of_dates[0]) ; i++) { @@ -277,29 +277,29 @@ void test6() void test7() { std::cout << "Express the current date:\n" << std::endl; - QDate q = QDate::currentDate(Qt::LocalTime); + TQDate q = TQDate::currentDate(Qt::LocalTime); ExtDate e = ExtDate::currentDate(Qt::TimeSpec(Qt::LocalTime)); - std::cout << "Qt::LocalTime :: ExtDate : " << e.toString().local8Bit() << " QDate : " + std::cout << "Qt::LocalTime :: ExtDate : " << e.toString().local8Bit() << " TQDate : " << q.toString().local8Bit() << std::endl; - q = QDate::currentDate(Qt::UTC); + q = TQDate::currentDate(Qt::UTC); e = ExtDate::currentDate(Qt::UTC); - std::cout << "Qt::UTC :: ExtDate : " << e.toString().local8Bit() << " QDate : " + std::cout << "Qt::UTC :: ExtDate : " << e.toString().local8Bit() << " TQDate : " << q.toString().local8Bit() << std::endl; - q = QDate::currentDate(); + q = TQDate::currentDate(); e = ExtDate::currentDate(); - std::cout << " :: ExtDate : " << e.toString().local8Bit() << " QDate : " + std::cout << " :: ExtDate : " << e.toString().local8Bit() << " TQDate : " << q.toString().local8Bit() << std::endl; std::cout << "--------------------" << std::endl; } void test8() { std::cout << "Set dates using days 1-32 for Jan and Feb (some will be invalid): \n" << std::endl; - std::cout << " QDate : ExtDate" << std::endl; + std::cout << " TQDate : ExtDate" << std::endl; for ( uint m=1; m<=2; ++m ) { for ( uint d=1; d<=32; ++d ) { - QDate test1( 2004, m, d ); + TQDate test1( 2004, m, d ); ExtDate test2( 2004, m, d ); std::cout << test1.toString( "ddd dd.MMM.yy" ).local8Bit() << " : " << test2.toString( "%a %d.%b.%y" ).local8Bit() << std::endl; @@ -310,8 +310,8 @@ void test8() { } void test9() { - std::cout << "QDateTime : ExtDateTime: \n" << std::endl; - QDateTime q = QDateTime::currentDateTime(); + std::cout << "TQDateTime : ExtDateTime: \n" << std::endl; + TQDateTime q = TQDateTime::currentDateTime(); ExtDateTime e = ExtDateTime::currentDateTime(); std::cout << q.toString().local8Bit() << " : " << e.toString().local8Bit() << std::endl; diff --git a/libkdeedu/extdate/testwidget.cpp b/libkdeedu/extdate/testwidget.cpp index 4dcd91c8..0267ddeb 100644 --- a/libkdeedu/extdate/testwidget.cpp +++ b/libkdeedu/extdate/testwidget.cpp @@ -18,20 +18,20 @@ #include #include #include -#include -#include +#include +#include #include "extdatepicker.h" #include "extdatewidget.h" #include "testwidget.h" -TestWidget::TestWidget( QWidget *p=0, const char *name=0 ) : KMainWindow( p, name ) { - QWidget *w = new QWidget(this); +TestWidget::TestWidget( TQWidget *p=0, const char *name=0 ) : KMainWindow( p, name ) { + TQWidget *w = new TQWidget(this); - glay = new QGridLayout(w, 3, 2); + glay = new TQGridLayout(w, 3, 2); - QLabel *kdpLabel = new QLabel( QString("KDatePicker"), w ); - QLabel *edpLabel = new QLabel( QString("ExtDatePicker"), w ); + TQLabel *kdpLabel = new TQLabel( TQString("KDatePicker"), w ); + TQLabel *edpLabel = new TQLabel( TQString("ExtDatePicker"), w ); kdp = new KDatePicker(w); edp = new ExtDatePicker(w); kdpEdit = new KLineEdit(w); @@ -39,7 +39,7 @@ TestWidget::TestWidget( QWidget *p=0, const char *name=0 ) : KMainWindow( p, nam edpEdit = new KLineEdit(w); edpEdit->setReadOnly( TRUE ); - kdw = new KDateWidget( QDate::currentDate(), w ); + kdw = new KDateWidget( TQDate::currentDate(), w ); edw = new ExtDateWidget( ExtDate::currentDate(), w ); glay->addWidget( kdpLabel, 0, 0 ); @@ -53,11 +53,11 @@ TestWidget::TestWidget( QWidget *p=0, const char *name=0 ) : KMainWindow( p, nam setCentralWidget(w); - connect( kdp, SIGNAL( dateChanged(QDate) ), this, SLOT( slotKDateChanged(QDate) ) ); - connect( edp, SIGNAL( dateChanged(const ExtDate&) ), this, SLOT( slotExtDateChanged(const ExtDate&) ) ); + connect( kdp, TQT_SIGNAL( dateChanged(TQDate) ), this, TQT_SLOT( slotKDateChanged(TQDate) ) ); + connect( edp, TQT_SIGNAL( dateChanged(const ExtDate&) ), this, TQT_SLOT( slotExtDateChanged(const ExtDate&) ) ); } -void TestWidget::slotKDateChanged(QDate d) { +void TestWidget::slotKDateChanged(TQDate d) { kdpEdit->setText( d.toString() ); } diff --git a/libkdeedu/extdate/testwidget.h b/libkdeedu/extdate/testwidget.h index ef69f8b6..fce00a39 100644 --- a/libkdeedu/extdate/testwidget.h +++ b/libkdeedu/extdate/testwidget.h @@ -32,15 +32,15 @@ class ExtDate; class TestWidget : public KMainWindow { Q_OBJECT public: - TestWidget( QWidget *parent, const char *name ); + TestWidget( TQWidget *parent, const char *name ); ~TestWidget() {} public slots: - void slotKDateChanged(QDate); + void slotKDateChanged(TQDate); void slotExtDateChanged(const ExtDate&); private: - QGridLayout *glay; + TQGridLayout *glay; KDatePicker *kdp; ExtDatePicker *edp; ExtDateWidget *edw; -- cgit v1.2.1