summaryrefslogtreecommitdiffstats
path: root/libkdeedu/extdate
diff options
context:
space:
mode:
Diffstat (limited to 'libkdeedu/extdate')
-rw-r--r--libkdeedu/extdate/extcalendarsystem.cpp2
-rw-r--r--libkdeedu/extdate/extcalendarsystem.h12
-rw-r--r--libkdeedu/extdate/extcalendarsystemgregorian.cpp8
-rw-r--r--libkdeedu/extdate/extdatepicker.cpp66
-rw-r--r--libkdeedu/extdate/extdatepicker.h21
-rw-r--r--libkdeedu/extdate/extdatetbl.cpp108
-rw-r--r--libkdeedu/extdate/extdatetbl.h39
-rw-r--r--libkdeedu/extdate/extdatetime.cpp136
-rw-r--r--libkdeedu/extdate/extdatetime.h48
-rw-r--r--libkdeedu/extdate/extdatetimeedit.cpp447
-rw-r--r--libkdeedu/extdate/extdatetimeedit.h140
-rw-r--r--libkdeedu/extdate/extdatewidget.cpp32
-rw-r--r--libkdeedu/extdate/extdatewidget.h9
-rw-r--r--libkdeedu/extdate/test_extdate.cc32
-rw-r--r--libkdeedu/extdate/testwidget.cpp4
-rw-r--r--libkdeedu/extdate/testwidget.h3
16 files changed, 562 insertions, 545 deletions
diff --git a/libkdeedu/extdate/extcalendarsystem.cpp b/libkdeedu/extdate/extcalendarsystem.cpp
index f453bb6f..58960986 100644
--- a/libkdeedu/extdate/extcalendarsystem.cpp
+++ b/libkdeedu/extdate/extcalendarsystem.cpp
@@ -146,6 +146,6 @@ TQString ExtCalendarSystem::weekDayName (int weekDay, bool shortName) const
case 7: return locale()->translate("Sunday");
}
- return TQString::null;
+ return TQString();
}
diff --git a/libkdeedu/extdate/extcalendarsystem.h b/libkdeedu/extdate/extcalendarsystem.h
index be7ba336..4607fc1d 100644
--- a/libkdeedu/extdate/extcalendarsystem.h
+++ b/libkdeedu/extdate/extcalendarsystem.h
@@ -79,7 +79,7 @@ public:
* Converts a year literal of a part of a string into a integer starting at the beginning of the string
*
* @param sNum The string to parse
- * @param iLength The number of QChars used, and 0 if no valid symbols was found in the string
+ * @param iLength The number of TQChars used, and 0 if no valid symbols was found in the string
* @return An integer corresponding to the year
*/
virtual int yearStringToInteger(const TQString & sNum, int & iLength) const;
@@ -105,7 +105,7 @@ public:
* Converts a month literal of a part of a string into a integer starting at the beginning of the string
*
* @param sNum The string to parse
- * @param iLength The number of QChars used, and 0 if no valid symbols was found in the string
+ * @param iLength The number of TQChars used, and 0 if no valid symbols was found in the string
* @return An integer corresponding to the month
*/
virtual int monthStringToInteger(const TQString & sNum, int & iLength) const;
@@ -131,7 +131,7 @@ public:
* Converts a day literal of a part of a string into a integer starting at the beginning of the string
*
* @param sNum The string to parse
- * @param iLength The number of QChars used, and 0 if no valid symbols was found in the string
+ * @param iLength The number of TQChars used, and 0 if no valid symbols was found in the string
* @return An integer corresponding to the day
*/
virtual int dayStringToInteger(const TQString & sNum, int & iLength) const;
@@ -235,7 +235,7 @@ public:
/**
* Gets specific calendar type month name for a given month number
- * If an invalid month is specified, TQString::null is returned.
+ * If an invalid month is specified, TQString() is returned.
*
* @param month The month number
* @param year The year the month belongs to
@@ -257,7 +257,7 @@ public:
* 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, TQString::null is returned.
+ * If an invalid month is specified, TQString() is returned.
*
* @param month The month number
* @param year The year the month belongs to
@@ -281,7 +281,7 @@ public:
/**
* Gets specific calendar type week day name
- * If an invalid week day is specified, TQString::null is returned.
+ * If an invalid week day is specified, TQString() is returned.
*
* @param weekDay number of day in week (1 -> Monday)
* @param shortName short or complete day name
diff --git a/libkdeedu/extdate/extcalendarsystemgregorian.cpp b/libkdeedu/extdate/extcalendarsystemgregorian.cpp
index 47338f4b..0b167ce9 100644
--- a/libkdeedu/extdate/extcalendarsystemgregorian.cpp
+++ b/libkdeedu/extdate/extcalendarsystemgregorian.cpp
@@ -144,7 +144,7 @@ TQString ExtCalendarSystemGregorian::monthName(int month, int year, bool shortNa
return locale()->translate("December");
}
- return TQString::null;
+ return TQString();
}
TQString ExtCalendarSystemGregorian::monthNamePossessive(int month, int year,
@@ -209,7 +209,7 @@ TQString ExtCalendarSystemGregorian::monthNamePossessive(int month, int year,
return locale()->translate("of December");
}
- return TQString::null;
+ return TQString();
}
bool ExtCalendarSystemGregorian::setYMD(ExtDate & date, int y, int m, int d) const
@@ -294,7 +294,7 @@ int ExtCalendarSystemGregorian::weekDayOfPray() const
TQString ExtCalendarSystemGregorian::calendarName() const
{
- return TQString::fromLatin1("gregorian");
+ return TQString::tqfromLatin1("gregorian");
}
bool ExtCalendarSystemGregorian::isLunar() const
@@ -317,7 +317,7 @@ int ExtCalendarSystemGregorian::yearStringToInteger(const TQString & sNum, int &
int iYear;
iYear = ExtCalendarSystem::yearStringToInteger(sNum, iLength);
- // Qt treats a year in the range 0-100 as 1900-1999.
+ // TQt treats a year in the range 0-100 as 1900-1999.
// It is nicer for the user if we treat 0-68 as 2000-2068
if (iYear < 69)
iYear += 2000;
diff --git a/libkdeedu/extdate/extdatepicker.cpp b/libkdeedu/extdate/extdatepicker.cpp
index ad524863..5a5864d2 100644
--- a/libkdeedu/extdate/extdatepicker.cpp
+++ b/libkdeedu/extdate/extdatepicker.cpp
@@ -77,28 +77,28 @@ void ExtDatePicker::fillWeeksCombo(const ExtDate &date)
for (; day <= lastDay; day = d->calendar->addDays(day, 7 /*calendar->daysOfWeek()*/) )
{
int year = 0;
- TQString week = i18n("Week %1").arg(d->calendar->weekNumber(day, &year));
+ TQString week = i18n("Week %1").tqarg(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(TQWidget *parent, ExtDate dt, const char *name)
- : TQFrame(parent,name)
+ExtDatePicker::ExtDatePicker(TQWidget *tqparent, ExtDate dt, const char *name)
+ : TQFrame(tqparent,name)
{
init( dt );
}
-ExtDatePicker::ExtDatePicker(TQWidget *parent, ExtDate dt, const char *name, WFlags f)
- : TQFrame(parent,name, f)
+ExtDatePicker::ExtDatePicker(TQWidget *tqparent, ExtDate dt, const char *name, WFlags f)
+ : TQFrame(tqparent,name, f)
{
init( dt );
}
-ExtDatePicker::ExtDatePicker( TQWidget *parent, const char *name )
- : TQFrame(parent,name)
+ExtDatePicker::ExtDatePicker( TQWidget *tqparent, const char *name )
+ : TQFrame(tqparent,name)
{
- init( ExtDate::currentDate() );
+ init( ExtDate::tqcurrentDate() );
}
void ExtDatePicker::init( const ExtDate &dt )
@@ -166,17 +166,17 @@ void ExtDatePicker::init( const ExtDate &dt )
if ( TQApplication::reverseLayout() )
{
- yearForward->setIconSet(BarIconSet(TQString::fromLatin1("2leftarrow")));
- yearBackward->setIconSet(BarIconSet(TQString::fromLatin1("2rightarrow")));
- monthForward->setIconSet(BarIconSet(TQString::fromLatin1("1leftarrow")));
- monthBackward->setIconSet(BarIconSet(TQString::fromLatin1("1rightarrow")));
+ yearForward->setIconSet(BarIconSet(TQString::tqfromLatin1("2leftarrow")));
+ yearBackward->setIconSet(BarIconSet(TQString::tqfromLatin1("2rightarrow")));
+ monthForward->setIconSet(BarIconSet(TQString::tqfromLatin1("1leftarrow")));
+ monthBackward->setIconSet(BarIconSet(TQString::tqfromLatin1("1rightarrow")));
}
else
{
- yearForward->setIconSet(BarIconSet(TQString::fromLatin1("2rightarrow")));
- yearBackward->setIconSet(BarIconSet(TQString::fromLatin1("2leftarrow")));
- monthForward->setIconSet(BarIconSet(TQString::fromLatin1("1rightarrow")));
- monthBackward->setIconSet(BarIconSet(TQString::fromLatin1("1leftarrow")));
+ yearForward->setIconSet(BarIconSet(TQString::tqfromLatin1("2rightarrow")));
+ yearBackward->setIconSet(BarIconSet(TQString::tqfromLatin1("2leftarrow")));
+ monthForward->setIconSet(BarIconSet(TQString::tqfromLatin1("1rightarrow")));
+ monthBackward->setIconSet(BarIconSet(TQString::tqfromLatin1("1leftarrow")));
}
connect(table, TQT_SIGNAL(dateChanged(const ExtDate&)), TQT_SLOT(dateChangedSlot(const ExtDate&)));
connect(table, TQT_SIGNAL(tableClicked()), TQT_SLOT(tableClickedSlot()));
@@ -214,10 +214,10 @@ ExtDatePicker::eventFilter(TQObject *o, TQEvent *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) )
+ if ( (k->key() == TQt::Key_Prior) ||
+ (k->key() == TQt::Key_Next) ||
+ (k->key() == TQt::Key_Up) ||
+ (k->key() == TQt::Key_Down) )
{
TQApplication::sendEvent( table, e );
table->setFocus();
@@ -365,9 +365,9 @@ ExtDatePicker::selectMonthClicked()
int day = d->calendar->day(date);
// ----- construct a valid date in this month:
//date.setYMD(date.year(), month, 1);
- //date.setYMD(date.year(), month, QMIN(day, date.daysInMonth()));
+ //date.setYMD(date.year(), month, TQMIN(day, date.daysInMonth()));
d->calendar->setYMD(date, d->calendar->year(date), month,
- QMIN(day, d->calendar->daysInMonth(date)));
+ TQMIN(day, d->calendar->daysInMonth(date)));
// ----- set this month
setDate(date);
}
@@ -386,7 +386,7 @@ ExtDatePicker::selectYearClicked()
KPopupFrame* popup = new KPopupFrame(this);
ExtDateInternalYearSelector* picker = new ExtDateInternalYearSelector(popup);
// -----
- picker->resize(picker->sizeHint());
+ picker->resize(picker->tqsizeHint());
popup->setMainWidget(picker);
connect(picker, TQT_SIGNAL(closeMe(int)), popup, TQT_SLOT(close(int)));
picker->setFocus();
@@ -400,9 +400,9 @@ ExtDatePicker::selectYearClicked()
day=d->calendar->day(date);
// ----- construct a valid date in this month:
//date.setYMD(year, date.month(), 1);
- //date.setYMD(year, date.month(), QMIN(day, date.daysInMonth()));
+ //date.setYMD(year, date.month(), TQMIN(day, date.daysInMonth()));
d->calendar->setYMD(date, year, d->calendar->month(date),
- QMIN(day, d->calendar->daysInMonth(date)));
+ TQMIN(day, d->calendar->daysInMonth(date)));
// ----- set this month
setDate(date);
} else {
@@ -446,13 +446,13 @@ ExtDatePicker::lineEnterPressed()
void
ExtDatePicker::todayButtonClicked()
{
- setDate(ExtDate::currentDate());
+ setDate(ExtDate::tqcurrentDate());
}
-QSize
-ExtDatePicker::sizeHint() const
+TQSize
+ExtDatePicker::tqsizeHint() const
{
- return TQWidget::sizeHint();
+ return TQWidget::tqsizeHint();
}
void
@@ -486,11 +486,11 @@ ExtDatePicker::setFontSize(int s)
d->calendar->year(table->getDate()), false);
if (str.isNull()) break;
r=metrics.boundingRect(str);
- maxMonthRect.setWidth(QMAX(r.width(), maxMonthRect.width()));
- maxMonthRect.setHeight(QMAX(r.height(), maxMonthRect.height()));
+ maxMonthRect.setWidth(TQMAX(r.width(), maxMonthRect.width()));
+ maxMonthRect.setHeight(TQMAX(r.height(), maxMonthRect.height()));
}
- TQSize metricBound = style().sizeFromContents(TQStyle::CT_ToolButton,
+ TQSize metricBound = tqstyle().tqsizeFromContents(TQStyle::CT_ToolButton,
selectMonth,
maxMonthRect);
selectMonth->setMinimumSize(metricBound);
@@ -512,7 +512,7 @@ ExtDatePicker::setCloseButton( bool enable )
TQToolTip::add(d->closeButton, i18n("Close"));
d->closeButton->setPixmap( SmallIcon("remove") );
connect( d->closeButton, TQT_SIGNAL( clicked() ),
- topLevelWidget(), TQT_SLOT( close() ) );
+ tqtopLevelWidget(), TQT_SLOT( close() ) );
}
else {
delete d->closeButton;
diff --git a/libkdeedu/extdate/extdatepicker.h b/libkdeedu/extdate/extdatepicker.h
index 8c745b52..fa4a1fef 100644
--- a/libkdeedu/extdate/extdatepicker.h
+++ b/libkdeedu/extdate/extdatepicker.h
@@ -49,26 +49,27 @@ class ExtDateTable;
*
* @short A date selection widget.
**/
-class KDE_EXPORT ExtDatePicker: public QFrame
+class KDE_EXPORT ExtDatePicker: public TQFrame
{
Q_OBJECT
-// Q_PROPERTY( ExtDate date READ date WRITE setDate)
- Q_PROPERTY( bool closeButton READ hasCloseButton WRITE setCloseButton )
- Q_PROPERTY( int fontSize READ fontSize WRITE setFontSize )
+ TQ_OBJECT
+// TQ_PROPERTY( ExtDate date READ date WRITE setDate)
+ TQ_PROPERTY( bool closeButton READ hasCloseButton WRITE setCloseButton )
+ TQ_PROPERTY( int fontSize READ fontSize WRITE setFontSize )
public:
/** The usual constructor. The given date will be displayed
* initially.
**/
- ExtDatePicker(TQWidget *parent=0,
- ExtDate=ExtDate::currentDate(),
+ ExtDatePicker(TQWidget *tqparent=0,
+ ExtDate=ExtDate::tqcurrentDate(),
const char *name=0);
/** The usual constructor. The given date will be displayed
* initially.
* @since 3.1
**/
- ExtDatePicker(TQWidget *parent,
+ ExtDatePicker(TQWidget *tqparent,
ExtDate,
const char *name,
WFlags f); // ### KDE 4.0: Merge
@@ -78,7 +79,7 @@ public:
* current date.
* @since 3.1
*/
- ExtDatePicker( TQWidget *parent, const char *name );
+ ExtDatePicker( TQWidget *tqparent, const char *name );
/**
* The destructor.
@@ -91,7 +92,7 @@ public:
* size hint, try adding 28 to each of the reported numbers of
* pixels.
**/
- TQSize sizeHint() const;
+ TQSize tqsizeHint() const;
/**
* Sets the date.
@@ -137,7 +138,7 @@ public:
/**
* By calling this method with @p enable = true, ExtDatePicker will show
* a little close-button in the upper button-row. Clicking the
- * close-button will cause the ExtDatePicker's topLevelWidget()'s close()
+ * close-button will cause the ExtDatePicker's tqtopLevelWidget()'s close()
* method being called. This is mostly useful for toplevel datepickers
* without a window manager decoration.
* @see hasCloseButton
diff --git a/libkdeedu/extdate/extdatetbl.cpp b/libkdeedu/extdate/extdatetbl.cpp
index ca403a68..91f14395 100644
--- a/libkdeedu/extdate/extdatetbl.cpp
+++ b/libkdeedu/extdate/extdatetbl.cpp
@@ -28,7 +28,7 @@
//
// Copyright (C) 1997 Tim D. Gilman
// (C) 1998-2001 Mirko Boehm
-// Written using Qt (http://www.troll.no) for the
+// Written using TQt (http://www.troll.no) for the
// KDE project (http://www.kde.org)
//
// Modified to use ExtDate by Jason Harris, 2004
@@ -82,8 +82,8 @@ public:
};
-ExtDateValidator::ExtDateValidator(TQWidget* parent, const char* name)
- : TQValidator(parent, name)
+ExtDateValidator::ExtDateValidator(TQWidget* tqparent, const char* name)
+ : TQValidator(TQT_TQOBJECT(tqparent), name)
{
}
@@ -116,17 +116,17 @@ ExtDateValidator::fixup( TQString& ) const
}
-ExtDateTable::ExtDateTable(TQWidget *parent, ExtDate date_, const char* name, WFlags f)
- : TQGridView(parent, name, f)
+ExtDateTable::ExtDateTable(TQWidget *tqparent, ExtDate date_, const char* name, WFlags f)
+ : TQGridView(tqparent, name, f)
{
d = new ExtDateTablePrivate;
setFontSize(10);
if(!date_.isValid())
{
kdDebug() << "ExtDateTable ctor: WARNING: Given date is invalid, using current date." << endl;
- date_=ExtDate::currentDate();
+ date_=ExtDate::tqcurrentDate();
}
- setFocusPolicy( TQWidget::StrongFocus );
+ setFocusPolicy( TQ_StrongFocus );
setNumRows(7); // 6 weeks max + headline
setNumCols(7); // 7 days a week
setHScrollBarMode(AlwaysOff);
@@ -204,7 +204,7 @@ ExtDateTable::paintCell(TQPainter *painter, int row, int col)
normalday=false;
TQBrush brushTitle();
- TQBrush brushInvertTitle(colorGroup().base());
+ TQBrush brushInvertTitle(tqcolorGroup().base());
TQColor titleColor(isEnabled()?( KGlobalSettings::activeTitleColor() ):( KGlobalSettings::inactiveTitleColor() ) );
TQColor textColor(isEnabled()?( KGlobalSettings::activeTextColor() ):( KGlobalSettings::inactiveTextColor() ) );
if (!normalday)
@@ -221,7 +221,7 @@ ExtDateTable::paintCell(TQPainter *painter, int row, int col)
}
painter->drawText(0, 0, w, h-1, AlignCenter,
d->calendar->weekDayName(daynum, true), -1, &rect);
- painter->setPen(colorGroup().text());
+ painter->setPen(tqcolorGroup().text());
painter->moveTo(0, h-1);
painter->lineTo(w-1, h-1);
// ----- draw the weekday:
@@ -235,10 +235,10 @@ ExtDateTable::paintCell(TQPainter *painter, int row, int col)
text = d->calendar->dayString(pCellDate, true);
if( d->calendar->month(pCellDate) != d->calendar->month(date) )
{ // we are either
- // ° painting a day of the previous month or
- // ° painting a day of the following month
+ // � painting a day of the previous month or
+ // � painting a day of the following month
// TODO: don't hardcode gray here! Use a color with less contrast to the background than normal text.
- painter->setPen( colorGroup().mid() );
+ painter->setPen( tqcolorGroup().mid() );
// painter->setPen(gray);
} else { // paint a day of the current month
if ( d->useCustomColors )
@@ -263,9 +263,9 @@ ExtDateTable::paintCell(TQPainter *painter, int row, int col)
}
painter->setPen( mode->fgColor );
} else
- painter->setPen(colorGroup().text());
+ painter->setPen(tqcolorGroup().text());
} else //if ( firstWeekDay < 4 ) // <- this doesn' make sense at all!
- painter->setPen(colorGroup().text());
+ painter->setPen(tqcolorGroup().text());
}
pen=painter->pen();
@@ -276,19 +276,19 @@ ExtDateTable::paintCell(TQPainter *painter, int row, int col)
if( ((offset+dy) == (pos+1)) && hasFocus())
{
// draw the currently selected date
- painter->setPen(colorGroup().highlight());
- painter->setBrush(colorGroup().highlight());
- pen=colorGroup().highlightedText();
+ painter->setPen(tqcolorGroup().highlight());
+ painter->setBrush(tqcolorGroup().highlight());
+ pen=TQPen(tqcolorGroup().highlightedText());
} else {
painter->setBrush(paletteBackgroundColor());
painter->setPen(paletteBackgroundColor());
-// painter->setBrush(colorGroup().base());
-// painter->setPen(colorGroup().base());
+// painter->setBrush(tqcolorGroup().base());
+// painter->setPen(tqcolorGroup().base());
}
- if ( pCellDate == ExtDate::currentDate() )
+ if ( pCellDate == ExtDate::tqcurrentDate() )
{
- painter->setPen(colorGroup().text());
+ painter->setPen(tqcolorGroup().text());
}
if ( paintRect ) painter->drawRect(0, 0, w, h);
@@ -347,7 +347,7 @@ ExtDateTable::keyPressEvent( TQKeyEvent *e )
setDate(date.addDays(1));
return;
case Key_N:
- setDate(ExtDate::currentDate());
+ setDate(ExtDate::tqcurrentDate());
return;
case Key_Return:
case Key_Enter:
@@ -386,13 +386,13 @@ ExtDateTable::setFontSize(int size)
for(count=0; count<7; ++count)
{
rect=metrics.boundingRect(d->calendar->weekDayName(count+1, true));
- maxCell.setWidth(QMAX(maxCell.width(), rect.width()));
- maxCell.setHeight(QMAX(maxCell.height(), rect.height()));
+ maxCell.setWidth(TQMAX(maxCell.width(), rect.width()));
+ maxCell.setHeight(TQMAX(maxCell.height(), rect.height()));
}
// ----- compare with a real wide number and add some space:
- rect=metrics.boundingRect(TQString::fromLatin1("88"));
- maxCell.setWidth(QMAX(maxCell.width()+2, rect.width()));
- maxCell.setHeight(QMAX(maxCell.height()+4, rect.height()));
+ rect=metrics.boundingRect(TQString::tqfromLatin1("88"));
+ maxCell.setWidth(TQMAX(maxCell.width()+2, rect.width()));
+ maxCell.setHeight(TQMAX(maxCell.height()+4, rect.height()));
}
void
@@ -494,7 +494,7 @@ ExtDateTable::setDate(const ExtDate& date_)
numDaysPrevMonth=d->calendar->daysInMonth(temp);
if(changed)
{
- repaintContents(false);
+ tqrepaintContents(false);
}
return true;
}
@@ -505,28 +505,28 @@ ExtDateTable::getDate() const
return date;
}
-// what are those repaintContents() good for? (pfeiffer)
+// what are those tqrepaintContents() good for? (pfeiffer)
void ExtDateTable::focusInEvent( TQFocusEvent *e )
{
-// repaintContents(false);
+// tqrepaintContents(false);
TQGridView::focusInEvent( e );
}
void ExtDateTable::focusOutEvent( TQFocusEvent *e )
{
-// repaintContents(false);
+// tqrepaintContents(false);
TQGridView::focusOutEvent( e );
}
-QSize
-ExtDateTable::sizeHint() const
+TQSize
+ExtDateTable::tqsizeHint() const
{
if(maxCell.height()>0 && maxCell.width()>0)
{
return TQSize(maxCell.width()*numCols()+2*frameWidth(),
(maxCell.height()+2)*numRows()+2*frameWidth());
} else {
- kdDebug() << "ExtDateTable::sizeHint: obscure failure - " << endl;
+ kdDebug() << "ExtDateTable::tqsizeHint: obscure failure - " << endl;
return TQSize(-1, -1);
}
}
@@ -554,7 +554,7 @@ void ExtDateTable::setCustomDatePainting(const ExtDate &date, const TQColor &fgC
mode->fgColor=fgColor;
mode->bgColor=bgColor;
- d->customPaintingModes.replace( date.toString(), mode );
+ d->customPaintingModes.tqreplace( date.toString(), mode );
d->useCustomColors=true;
update();
}
@@ -565,9 +565,9 @@ void ExtDateTable::unsetCustomDatePainting( const ExtDate &date )
}
ExtDateInternalWeekSelector::ExtDateInternalWeekSelector
-(TQWidget* parent, const char* name)
- : KLineEdit(parent, name),
- val(new TQIntValidator(this)),
+(TQWidget* tqparent, const char* name)
+ : KLineEdit(tqparent, name),
+ val(new TQIntValidator(TQT_TQOBJECT(this))),
result(0)
{
TQFont font;
@@ -638,8 +638,8 @@ ExtDateInternalMonthPicker::~ExtDateInternalMonthPicker() {
}
ExtDateInternalMonthPicker::ExtDateInternalMonthPicker
-(const ExtDate & date, TQWidget* parent, const char* name)
- : TQGridView(parent, name),
+(const ExtDate & date, TQWidget* tqparent, const char* name)
+ : TQGridView(tqparent, name),
result(0) // invalid
{
//FIXME: Can't uncomment the following unless ExtDate is moved to kdelibs
@@ -676,8 +676,8 @@ ExtDateInternalMonthPicker::ExtDateInternalMonthPicker
}
}
-QSize
-ExtDateInternalMonthPicker::sizeHint() const
+TQSize
+ExtDateInternalMonthPicker::tqsizeHint() const
{
return TQSize((max.width()+6)*numCols()+2*frameWidth(),
(max.height()+6)*numRows()+2*frameWidth());
@@ -720,7 +720,7 @@ ExtDateInternalMonthPicker::paintCell(TQPainter* painter, int row, int col)
void
ExtDateInternalMonthPicker::contentsMousePressEvent(TQMouseEvent *e)
{
- if(!isEnabled() || e->button() != LeftButton)
+ if(!isEnabled() || e->button() != Qt::LeftButton)
{
KNotifyClient::beep();
return;
@@ -747,7 +747,7 @@ ExtDateInternalMonthPicker::contentsMousePressEvent(TQMouseEvent *e)
void
ExtDateInternalMonthPicker::contentsMouseMoveEvent(TQMouseEvent *e)
{
- if (e->state() & LeftButton)
+ if (e->state() & Qt::LeftButton)
{
int row, col;
TQPoint mouseCoord;
@@ -779,7 +779,7 @@ ExtDateInternalMonthPicker::contentsMouseMoveEvent(TQMouseEvent *e)
updateCell( row, col /*, false */ ); // mark the new active cell
}
}
- if ( tmpRow > -1 ) // repaint the former active cell
+ if ( tmpRow > -1 ) // tqrepaint the former active cell
updateCell( tmpRow, tmpCol /*, true */ );
}
}
@@ -811,9 +811,9 @@ ExtDateInternalMonthPicker::contentsMouseReleaseEvent(TQMouseEvent *e)
ExtDateInternalYearSelector::ExtDateInternalYearSelector
-(TQWidget* parent, const char* name)
- : TQLineEdit(parent, name),
- val(new TQIntValidator(this)),
+(TQWidget* tqparent, const char* name)
+ : TQLineEdit(tqparent, name),
+ val(new TQIntValidator(TQT_TQOBJECT(this))),
result(0),
d(new ExtDateInternalYearPrivate())
{
@@ -873,8 +873,8 @@ ExtDateInternalYearSelector::setYear(int year)
setText(temp);
}
-KPopupFrame::KPopupFrame(TQWidget* parent, const char* name)
- : TQFrame(parent, name, WType_Popup),
+KPopupFrame::KPopupFrame(TQWidget* tqparent, const char* name)
+ : TQFrame(tqparent, name, WType_Popup),
result(0), // rejected
main(0)
{
@@ -888,7 +888,7 @@ KPopupFrame::keyPressEvent(TQKeyEvent* e)
if(e->key()==Key_Escape)
{
result=0; // rejected
- qApp->exit_loop();
+ tqApp->exit_loop();
}
}
@@ -896,7 +896,7 @@ void
KPopupFrame::close(int r)
{
result=r;
- qApp->exit_loop();
+ tqApp->exit_loop();
}
void
@@ -947,8 +947,8 @@ int
KPopupFrame::exec(TQPoint pos)
{
popup(pos);
- repaint();
- qApp->enter_loop();
+ tqrepaint();
+ tqApp->enter_loop();
hide();
return result;
}
diff --git a/libkdeedu/extdate/extdatetbl.h b/libkdeedu/extdate/extdatetbl.h
index 8aa3281a..ef3bd9d8 100644
--- a/libkdeedu/extdate/extdatetbl.h
+++ b/libkdeedu/extdate/extdatetbl.h
@@ -41,6 +41,7 @@ class KPopupMenu;
class ExtDateInternalWeekSelector : public KLineEdit
{
Q_OBJECT
+ TQ_OBJECT
protected:
TQIntValidator *val;
int result;
@@ -50,7 +51,7 @@ public slots:
signals:
void closeMe(int);
public:
- ExtDateInternalWeekSelector( TQWidget* parent=0, const char* name=0);
+ ExtDateInternalWeekSelector( TQWidget* tqparent=0, const char* name=0);
int getWeek();
void setWeek(int week);
@@ -65,9 +66,10 @@ private:
* @version $Id$
* @author Tim Gilman, Mirko Boehm
*/
-class ExtDateInternalMonthPicker : public QGridView
+class ExtDateInternalMonthPicker : public TQGridView
{
Q_OBJECT
+ TQ_OBJECT
protected:
/**
* Store the month that has been clicked [1..12].
@@ -91,7 +93,7 @@ public:
/**
* The constructor.
*/
- ExtDateInternalMonthPicker(const ExtDate& date, TQWidget* parent, const char* name=0);
+ ExtDateInternalMonthPicker(const ExtDate& date, TQWidget* tqparent, const char* name=0);
/**
* The destructor.
*/
@@ -99,7 +101,7 @@ public:
/**
* The size hint.
*/
- TQSize sizeHint() const;
+ TQSize tqsizeHint() const;
/**
* Return the result. 0 means no selection (reject()), 1..12 are the
* months.
@@ -138,9 +140,10 @@ private:
* @version $Id$
* @author Tim Gilman, Mirko Boehm
*/
-class ExtDateInternalYearSelector : public QLineEdit
+class ExtDateInternalYearSelector : public TQLineEdit
{
Q_OBJECT
+ TQ_OBJECT
protected:
TQIntValidator *val;
int result;
@@ -149,7 +152,7 @@ public slots:
signals:
void closeMe(int);
public:
- ExtDateInternalYearSelector( TQWidget* parent=0, const char* name=0);
+ ExtDateInternalYearSelector( TQWidget* tqparent=0, const char* name=0);
~ExtDateInternalYearSelector();
int getYear();
void setYear(int year);
@@ -174,9 +177,10 @@ private:
* @author Tim Gilman, Mirko Boehm
* @version $Id$
*/
-class KPopupFrame : public QFrame
+class KPopupFrame : public TQFrame
{
Q_OBJECT
+ TQ_OBJECT
protected:
/**
* The result. It is returned from exec() when the popup window closes.
@@ -200,7 +204,7 @@ public:
/**
* The contructor. Creates a dialog without buttons.
*/
- KPopupFrame(TQWidget* parent=0, const char* name=0);
+ KPopupFrame(TQWidget* tqparent=0, const char* name=0);
/**
* Set the main widget. You cannot set the main widget from the constructor,
* since it must be a child of the frame itselfes.
@@ -240,10 +244,10 @@ private:
/**
* Validates user-entered dates.
*/
-class ExtDateValidator : public QValidator
+class ExtDateValidator : public TQValidator
{
public:
- ExtDateValidator(TQWidget* parent=0, const char* name=0);
+ ExtDateValidator(TQWidget* tqparent=0, const char* name=0);
virtual State validate(TQString&, int&) const;
virtual void fixup ( TQString & input ) const;
State date(const TQString&, ExtDate&) const;
@@ -262,18 +266,19 @@ public:
* @version $Id$
* @author Tim Gilman, Mirko Boehm
*/
-class ExtDateTable : public QGridView
+class ExtDateTable : public TQGridView
{
Q_OBJECT
- //Q_PROPERTY( ExtDate date READ getDate WRITE setDate )
- Q_PROPERTY( bool popupMenu READ popupMenuEnabled WRITE setPopupMenuEnabled )
+ TQ_OBJECT
+ //TQ_PROPERTY( ExtDate date READ getDate WRITE setDate )
+ TQ_PROPERTY( bool popupMenu READ popupMenuEnabled WRITE setPopupMenuEnabled )
public:
/**
* The constructor.
*/
- ExtDateTable(TQWidget *parent=0,
- ExtDate date=ExtDate::currentDate(),
+ ExtDateTable(TQWidget *tqparent=0,
+ ExtDate date=ExtDate::tqcurrentDate(),
const char* name=0, WFlags f=0);
/**
@@ -286,9 +291,9 @@ public:
* To save some time, the size of the largest used cell content is
* calculated in each paintCell() call, since all calculations have
* to be done there anyway. The size is stored in maxCell. The
- * sizeHint() simply returns a multiple of maxCell.
+ * tqsizeHint() simply returns a multiple of maxCell.
*/
- virtual TQSize sizeHint() const;
+ virtual TQSize tqsizeHint() const;
/**
* Set the font size of the date table.
*/
diff --git a/libkdeedu/extdate/extdatetime.cpp b/libkdeedu/extdate/extdatetime.cpp
index fe32cf91..2af13595 100644
--- a/libkdeedu/extdate/extdatetime.cpp
+++ b/libkdeedu/extdate/extdatetime.cpp
@@ -77,7 +77,7 @@ TQString ExtDate::m_longDayNames[7] = {
ExtDate::ExtDate( int y, int m, int d)
{
if ( !isValid(y,m,d) ) {
-#if defined(QT_CHECK_RANGE)
+#if defined(TQT_CHECK_RANGE)
qWarning( "ExtDate: Invalid date %04d-%02d-%02d", y, m, d );
#endif
m_year = 0;
@@ -232,20 +232,20 @@ int ExtDate::weekNumber( int *yearNum ) const
return week;
}
-#ifndef QT_NO_TEXTDATE
+#ifndef TQT_NO_TEXTDATE
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
+#endif //TQT_NO_TEXTDATE
-#ifndef QT_NO_TEXTSTRING
-#if !defined(QT_NO_SPRINTF)
+#ifndef TQT_NO_TEXTSTRING
+#if !defined(TQT_NO_SPRINTF)
TQString ExtDate::toString( Qt::DateFormat f) const
{
- QString a_format;
+ TQString a_format;
- if ( ! isValid() ) return TQString::null;
+ if ( ! isValid() ) return TQString();
switch (f)
{
@@ -272,7 +272,7 @@ TQString ExtDate::toString( Qt::DateFormat f) const
TQString ExtDate::toString( const TQString& format ) const
{
- if ( ! isValid() ) return TQString::null;
+ if ( ! isValid() ) return TQString();
//We use the KDE Date format specs.
//Replace occurences of the following tokens with their
@@ -293,16 +293,16 @@ TQString ExtDate::toString( const TQString& format ) const
TQString result( format );
- 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() ) );
- result.replace( "%A", longDayName( dayOfWeek() ) );
+ result.tqreplace( "%Y", TQString().sprintf( "%d", year() ) );
+ result.tqreplace( "%y", TQString().sprintf( "%02d", (year() % 100) ) );
+ result.tqreplace( "%n", TQString().sprintf( "%d", month() ) );
+ result.tqreplace( "%m", TQString().sprintf( "%02d", month() ) );
+ result.tqreplace( "%e", TQString().sprintf( "%d", day() ) );
+ result.tqreplace( "%d", TQString().sprintf( "%02d", day() ) );
+ result.tqreplace( "%b", shortMonthName( month() ) );
+ result.tqreplace( "%B", longMonthName( month() ) );
+ result.tqreplace( "%a", shortDayName( dayOfWeek() ) );
+ result.tqreplace( "%A", longDayName( dayOfWeek() ) );
return result;
}
@@ -311,7 +311,7 @@ TQString ExtDate::toString( const TQString& format ) const
bool ExtDate::setYMD( int y, int m, int d )
{
if ( ! isValid(y,m,d) ) {
-#if defined(QT_CHECK_RANGE)
+#if defined(TQT_CHECK_RANGE)
qWarning( "ExtDate: Invalid date %04d-%02d-%02d", y, m, d );
#endif
m_year = 0;
@@ -377,7 +377,7 @@ int ExtDate::daysTo( const ExtDate & a_date) const
return a_date.jd() - jd();
}
-ExtDate ExtDate::currentDate(Qt::TimeSpec ts)
+ExtDate ExtDate::tqcurrentDate(Qt::TimeSpec ts)
{
time_t a_current_time;
struct tm a_current_time_tm;
@@ -385,11 +385,11 @@ ExtDate ExtDate::currentDate(Qt::TimeSpec ts)
time(&a_current_time);
switch (ts)
{
- case Qt::LocalTime :
+ case TQt::LocalTime :
localtime_r(&a_current_time, &a_current_time_tm);
break;
- case Qt::UTC :
+ case TQt::UTC :
gmtime_r(&a_current_time, &a_current_time_tm);
break;
@@ -400,7 +400,7 @@ ExtDate ExtDate::currentDate(Qt::TimeSpec ts)
return ExtDate(a_current_time_tm.tm_year + 1900, a_current_time_tm.tm_mon + 1, a_current_time_tm.tm_mday);
}
-#ifndef QT_NO_DATESTRING
+#ifndef TQT_NO_DATESTRING
//Try both DateFormat values
ExtDate ExtDate::fromString( const TQString& s )
{
@@ -417,7 +417,7 @@ 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)
+#if defined(TQT_CHECK_RANGE)
qWarning( "TQDate::fromString: Parameter out of range" );
#endif
return dt;
@@ -436,7 +436,7 @@ ExtDate ExtDate::fromString( const TQString& s, Qt::DateFormat f )
break;
default :
-#ifndef QT_NO_TEXTDATE
+#ifndef TQT_NO_TEXTDATE
case Qt::TextDate :
{
//Three possible date formats:
@@ -499,12 +499,12 @@ ExtDate ExtDate::fromString( const TQString& s, Qt::DateFormat f )
}
#else
break;
-#endif //ifndef QT_NO_TEXTDATE
+#endif //ifndef TQT_NO_TEXTDATE
}
return dt;
}
-#endif //ifndef QT_NO_DATESTRING
+#endif //ifndef TQT_NO_DATESTRING
bool ExtDate::isValid( int y, int m, int d )
{
@@ -559,7 +559,7 @@ int ExtDate::dayOfYear(int y, int m, int d)
A ExtDateTime object is typically created either by giving a date
and time explicitly in the constructor, or by using the static
- function currentDateTime(), which returns a ExtDateTime object set
+ function tqcurrentDateTime(), which returns a ExtDateTime object set
to the system clock's time. The date and time can be changed with
setDate() and setTime(). A datetime can also be set using the
setTime_t() function, which takes a POSIX-standard "number of
@@ -710,8 +710,8 @@ void ExtDateTime::setTime_t( uint secsSince1Jan1970UTC )
}
/*!
- Sets the date and time to \a ts time (\c Qt::LocalTime or \c
- Qt::UTC) given the number of seconds that have passed since
+ Sets the date and time to \a ts time (\c TQt::LocalTime or \c
+ TQt::UTC) given the number of seconds that have passed since
1970-01-01T00:00:00, Coordinated Universal Time (UTC). On systems
that do not support timezones this function will behave as if
local time were UTC.
@@ -726,11 +726,11 @@ void ExtDateTime::setTime_t( uint secsSince1Jan1970UTC, Qt::TimeSpec ts )
time_t tmp = (time_t) secsSince1Jan1970UTC;
tm *brokenDown = 0;
-#if defined(Q_OS_UNIX) && defined(QT_THREAD_SUPPORT) && defined(_POSIX_THREAD_SAFE_FUNCTIONS)
+#if defined(Q_OS_UNIX) && defined(TQT_THREAD_SUPPORT) && defined(_POSIX_THREAD_SAFE_FUNCTIONS)
// posix compliant system
// use the reentrant versions of localtime() and gmtime() where available
tm res;
- if ( ts == Qt::LocalTime )
+ if ( ts == TQt::LocalTime )
brokenDown = localtime_r( &tmp, &res );
if ( !brokenDown ) {
brokenDown = gmtime_r( &tmp, &res );
@@ -742,7 +742,7 @@ void ExtDateTime::setTime_t( uint secsSince1Jan1970UTC, Qt::TimeSpec ts )
}
}
#else
- if ( ts == Qt::LocalTime )
+ if ( ts == TQt::LocalTime )
brokenDown = localtime( &tmp );
if ( !brokenDown ) {
brokenDown = gmtime( &tmp );
@@ -763,8 +763,8 @@ void ExtDateTime::setTime_t( uint secsSince1Jan1970UTC, Qt::TimeSpec ts )
// MSECS_PER_MIN * brokenDown->tm_min +
// 1000 * brokenDown->tm_sec;
}
-#ifndef QT_NO_DATESTRING
-#ifndef QT_NO_SPRINTF
+#ifndef TQT_NO_DATESTRING
+#ifndef TQT_NO_SPRINTF
/*!
\overload
@@ -792,12 +792,12 @@ void ExtDateTime::setTime_t( uint secsSince1Jan1970UTC, Qt::TimeSpec ts )
TQString ExtDateTime::toString( Qt::DateFormat f ) const
{
if ( !isValid() )
- return TQString::null;
+ return TQString();
if ( f == Qt::ISODate ) {
return d.toString( Qt::ISODate ) + "T" + t.toString( Qt::ISODate );
}
-#ifndef QT_NO_TEXTDATE
+#ifndef TQT_NO_TEXTDATE
else if ( f == Qt::TextDate ) {
return toString( "%a %b %e %Y %H:%M:%S" );
}
@@ -807,14 +807,14 @@ TQString ExtDateTime::toString( Qt::DateFormat f ) const
+ " " + KGlobal::locale()->timeFormat() );
}
- return TQString::null;
+ return TQString();
}
#endif
TQString ExtDateTime::toString( const TQString& format ) const
{
if ( !isValid() )
- return TQString::null;
+ return TQString();
//Parse the date portion of the format string
TQString result = date().toString( format );
@@ -833,17 +833,17 @@ TQString ExtDateTime::toString( const TQString& format ) const
int h = time().hour();
- 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" ) );
+ result.tqreplace( "%H", TQString().sprintf( "%02d", h ) );
+ result.tqreplace( "%k", TQString().sprintf( "%d", h ) );
+ result.tqreplace( "%I", TQString().sprintf( "%02d", ( h > 12 ) ? h-12 : h ) );
+ result.tqreplace( "%l", TQString().sprintf( "%d", ( h > 12 ) ? h-12 : h ) );
+ result.tqreplace( "%M", TQString().sprintf( "%02d", time().minute() ) );
+ result.tqreplace( "%S", TQString().sprintf( "%02d", time().second() ) );
+ result.tqreplace( "%p", TQString().sprintf( "%s", ( h > 12 ) ? "pm" : "am" ) );
return result;
}
-#endif //QT_NO_DATESTRING
+#endif //TQT_NO_DATESTRING
/*!
Returns a ExtDateTime object containing a datetime \a ndays days
@@ -933,7 +933,7 @@ int ExtDateTime::daysTo( const ExtDateTime &dt ) const
Example:
\code
- ExtDateTime dt = ExtDateTime::currentDateTime();
+ ExtDateTime dt = ExtDateTime::tqcurrentDateTime();
ExtDateTime xmas( ExtDate(dt.date().year(),12,24), TQTime(17,00) );
kdDebug( ) << "There are " << dt.secsTo(xmas) << " seconds to Christmas" << endl;
\endcode
@@ -1023,33 +1023,33 @@ bool ExtDateTime::operator>=( const ExtDateTime &dt ) const
Returns the current datetime, as reported by the system clock.
- \sa ExtDate::currentDate(), TQTime::currentTime()
+ \sa ExtDate::tqcurrentDate(), TQTime::currentTime()
*/
-ExtDateTime ExtDateTime::currentDateTime()
+ExtDateTime ExtDateTime::tqcurrentDateTime()
{
- return currentDateTime( Qt::LocalTime );
+ return tqcurrentDateTime( Qt::LocalTime );
}
/*!
Returns the current datetime, as reported by the system clock, for the
TimeSpec \a ts. The default TimeSpec is LocalTime.
- \sa ExtDate::currentDate(), TQTime::currentTime(), Qt::TimeSpec
+ \sa ExtDate::tqcurrentDate(), TQTime::currentTime(), Qt::TimeSpec
*/
-ExtDateTime ExtDateTime::currentDateTime( Qt::TimeSpec ts )
+ExtDateTime ExtDateTime::tqcurrentDateTime( Qt::TimeSpec ts )
{
ExtDateTime dt;
- dt.setDate( ExtDate::currentDate(ts) );
+ dt.setDate( ExtDate::tqcurrentDate(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.setDate( ExtDate::tqcurrentDate(ts) ); // fetch date again
dt.setTime( t );
return dt;
}
-#ifndef QT_NO_DATESTRING
+#ifndef TQT_NO_DATESTRING
/*!
Returns the ExtDateTime represented by the string \a s, using the
format \a f, or an invalid datetime if this is not possible.
@@ -1076,7 +1076,7 @@ ExtDateTime ExtDateTime::fromString( const TQString& s, Qt::DateFormat f )
ExtDateTime dt;
if ( ( s.isEmpty() ) || ( f == Qt::LocalDate ) ) {
-#if defined(QT_CHECK_RANGE)
+#if defined(TQT_CHECK_RANGE)
qWarning( "ExtDateTime::fromString: Parameter out of range" );
#endif
dt.d.setJD( INVALID_DAY );
@@ -1084,7 +1084,7 @@ ExtDateTime ExtDateTime::fromString( const TQString& s, Qt::DateFormat f )
}
if ( f == Qt::ISODate ) {
- if ( s.length() <= 10 || ! s.contains( ':' ) ) { //no time specified
+ if ( s.length() <= 10 || ! s.tqcontains( ':' ) ) { //no time specified
TQTime t = TQTime(0,0,0);
return ExtDateTime( ExtDate::fromString( s.mid(0,10), Qt::ISODate ) );
} else {
@@ -1092,14 +1092,14 @@ ExtDateTime ExtDateTime::fromString( const TQString& s, Qt::DateFormat f )
TQTime::fromString( s.mid(11), Qt::ISODate ) );
}
}
-#if !defined(QT_NO_REGEXP) && !defined(QT_NO_TEXTDATE)
+#if !defined(TQT_NO_REGEXP) && !defined(TQT_NO_TEXTDATE)
else if ( f == Qt::TextDate ) {
//parse the time, if it exists.
TQTime time;
TQString sd = s;
int hour, minute, second;
- int pivot = s.find( TQRegExp(TQString::fromLatin1("[0-9][0-9]:[0-9][0-9]:[0-9][0-9]")) );
+ int pivot = s.tqfind( TQRegExp(TQString::tqfromLatin1("[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();
@@ -1114,21 +1114,21 @@ ExtDateTime ExtDateTime::fromString( const TQString& s, Qt::DateFormat f )
return ExtDateTime( date, time );
}
-#endif //QT_NO_REGEXP
+#endif //TQT_NO_REGEXP
return ExtDateTime();
}
-#endif //QT_NO_DATESTRING
+#endif //TQT_NO_DATESTRING
-#ifndef QT_NO_DATASTREAM
+#ifndef TQT_NO_DATASTREAM
KDE_EXPORT TQDataStream &operator<<( TQDataStream & ostream, const ExtDate & date)
{
- return ostream << (Q_UINT32)(date.jd());
+ return ostream << (TQ_UINT32)(date.jd());
}
KDE_EXPORT TQDataStream &operator>>( TQDataStream & ostream, ExtDate & date)
{
- Q_UINT32 julday;
+ TQ_UINT32 julday;
ostream >> julday;
date.setJD( julday );
return ostream;
@@ -1136,7 +1136,9 @@ KDE_EXPORT TQDataStream &operator>>( TQDataStream & ostream, ExtDate & date)
KDE_EXPORT TQDataStream &operator<<( TQDataStream & ostream, const ExtDateTime & dt)
{
- return ostream << dt.d << dt.t;
+ ostream << dt.d;
+ ostream << dt.t;
+ return ostream;
}
KDE_EXPORT TQDataStream &operator>>( TQDataStream & ostream, ExtDateTime & dt)
@@ -1145,4 +1147,4 @@ KDE_EXPORT TQDataStream &operator>>( TQDataStream & ostream, ExtDateTime & dt)
return ostream;
}
-#endif // QT_NO_DATASTREAM
+#endif // TQT_NO_DATASTREAM
diff --git a/libkdeedu/extdate/extdatetime.h b/libkdeedu/extdate/extdatetime.h
index 0830af83..0ebe324f 100644
--- a/libkdeedu/extdate/extdatetime.h
+++ b/libkdeedu/extdate/extdatetime.h
@@ -57,8 +57,8 @@ public:
int weekNumber( int *yearNum = 0 ) const;
long int jd() const { return m_jd; }
-#ifndef QT_NO_TEXTDATE
-#ifndef QT_NO_COMPAT
+#ifndef TQT_NO_TEXTDATE
+#ifndef TQT_NO_COMPAT
static TQString monthName( int month ) { return shortMonthName( month ); }
static TQString dayName( int weekday ) { return shortDayName( weekday ); }
#endif
@@ -66,9 +66,9 @@ public:
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)
+#endif //TQT_NO_TEXTDATE
+#ifndef TQT_NO_TEXTSTRING
+#if !defined(TQT_NO_SPRINTF)
TQString toString( Qt::DateFormat f = Qt::TextDate ) const;
#endif
TQString toString( const TQString& format ) const;
@@ -88,8 +88,8 @@ public:
bool operator>( const ExtDate &d ) const { return m_jd > d.jd(); }
bool operator>=( const ExtDate &d ) const { return m_jd >= d.jd(); }
- static ExtDate currentDate( Qt::TimeSpec ts = Qt::LocalTime );
-#ifndef QT_NO_DATESTRING
+ static ExtDate tqcurrentDate( Qt::TimeSpec ts = Qt::LocalTime );
+#ifndef TQT_NO_DATESTRING
static ExtDate fromString( const TQString &s );
static ExtDate fromString( const TQString &s, Qt::DateFormat f );
#endif
@@ -113,11 +113,11 @@ private:
friend class ExtDateTime;
-#ifndef QT_NO_DATASTREAM
- 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 & );
+#ifndef TQT_NO_DATASTREAM
+ friend TQ_EXPORT TQDataStream &operator<<( TQDataStream &, const ExtDate & );
+ friend TQ_EXPORT TQDataStream &operator>>( TQDataStream &, ExtDate & );
+ friend TQ_EXPORT TQDataStream &operator<<( TQDataStream &, const ExtDateTime & );
+ friend TQ_EXPORT TQDataStream &operator>>( TQDataStream &, ExtDateTime & );
#endif
};
@@ -142,8 +142,8 @@ public:
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
+#ifndef TQT_NO_DATESTRING
+#ifndef TQT_NO_SPRINTF
TQString toString( Qt::DateFormat f = Qt::TextDate ) const;
#endif
TQString toString( const TQString& format ) const;
@@ -162,18 +162,18 @@ public:
bool operator>( const ExtDateTime &dt ) const;
bool operator>=( const ExtDateTime &dt ) const;
- static ExtDateTime currentDateTime();
- static ExtDateTime currentDateTime( Qt::TimeSpec );
-#ifndef QT_NO_DATESTRING
+ static ExtDateTime tqcurrentDateTime();
+ static ExtDateTime tqcurrentDateTime( Qt::TimeSpec );
+#ifndef TQT_NO_DATESTRING
static ExtDateTime fromString( const TQString &s );
static ExtDateTime fromString( const TQString &s, Qt::DateFormat f );
#endif
private:
ExtDate d;
TQTime t;
-#ifndef QT_NO_DATASTREAM
- friend Q_EXPORT TQDataStream &operator<<( TQDataStream &, const ExtDateTime &);
- friend Q_EXPORT TQDataStream &operator>>( TQDataStream &, ExtDateTime & );
+#ifndef TQT_NO_DATASTREAM
+ friend TQ_EXPORT TQDataStream &operator<<( TQDataStream &, const ExtDateTime &);
+ friend TQ_EXPORT TQDataStream &operator>>( TQDataStream &, ExtDateTime & );
#endif
};
@@ -181,10 +181,10 @@ private:
Date and time stream functions
*****************************************************************************/
-#ifndef QT_NO_DATASTREAM
-Q_EXPORT TQDataStream &operator<<( TQDataStream &, const ExtDate & );
-Q_EXPORT TQDataStream &operator>>( TQDataStream &, ExtDate & );
-#endif // QT_NO_DATASTREAM
+#ifndef TQT_NO_DATASTREAM
+TQ_EXPORT TQDataStream &operator<<( TQDataStream &, const ExtDate & );
+TQ_EXPORT TQDataStream &operator>>( TQDataStream &, ExtDate & );
+#endif // TQT_NO_DATASTREAM
#endif // EXTDATE_H
diff --git a/libkdeedu/extdate/extdatetimeedit.cpp b/libkdeedu/extdate/extdatetimeedit.cpp
index 203f1dbb..e5ff6087 100644
--- a/libkdeedu/extdate/extdatetimeedit.cpp
+++ b/libkdeedu/extdate/extdatetimeedit.cpp
@@ -25,12 +25,12 @@
#include "extdatetimeedit.h"
-#ifndef QT_NO_DATETIMEEDIT
+#ifndef TQT_NO_DATETIMEEDIT
-//#include "../kernel/qinternal_p.h"
-//#include "../kernel/qrichtext_p.h"
-#include <private/qinternal_p.h>
-#include <private/qrichtext_p.h>
+//#include "../kernel/tqinternal_p.h"
+//#include "../kernel/tqrichtext_p.h"
+#include <private/tqinternal_p.h>
+#include <private/tqrichtext_p.h>
#include <tqrangecontrol.h>
#include <tqapplication.h>
#include <tqpixmap.h>
@@ -38,15 +38,15 @@
#include <tqvaluelist.h>
#include <tqstring.h>
#include <tqstyle.h>
-#include <tqdatetimeedit.h> //need for QTimeEdit
+#include <tqdatetimeedit.h> //need for TQTimeEdit
#define EXTDATETIMEEDIT_HIDDEN_CHAR '0'
-static QString *lDateSep = 0;
-static QString *lTimeSep = 0;
+static TQString *lDateSep = 0;
+static TQString *lTimeSep = 0;
static bool lAMPM = FALSE;
-static QString *lAM = 0;
-static QString *lPM = 0;
+static TQString *lAM = 0;
+static TQString *lPM = 0;
static ExtDateEdit::Order lOrder = ExtDateEdit::YMD;
static int refcount = 0;
@@ -74,8 +74,8 @@ static void readLocaleSettings()
lDateSep = new TQString();
lTimeSep = new TQString();
-#if defined(Q_WS_WIN)
- QT_WA( {
+#if defined(TQ_WS_WIN)
+ TQT_WA( {
TCHAR data[10];
GetLocaleInfo( LOCALE_USER_DEFAULT, LOCALE_SDATE, data, 10 );
*lDateSep = TQString::fromUcs2( (ushort*)data );
@@ -113,9 +113,9 @@ static void readLocaleSettings()
*lTimeSep = ":";
#endif
TQString d = ExtDate( 1999, 11, 22 ).toString( Qt::LocalDate );
- dpos = d.find( "22" );
- mpos = d.find( "11" );
- ypos = d.find( "99" );
+ dpos = d.tqfind( "22" );
+ mpos = d.tqfind( "11" );
+ ypos = d.tqfind( "99" );
if ( dpos > -1 && mpos > -1 && ypos > -1 ) {
// test for DMY, MDY, YMD, YDM
if ( dpos < mpos && mpos < ypos ) {
@@ -133,19 +133,19 @@ static void readLocaleSettings()
// this code needs to change if new formats are added
-#ifndef Q_WS_WIN
- TQString sep = d.mid( QMIN( dpos, mpos ) + 2, QABS( dpos - mpos ) - 2 );
- if ( d.contains( sep ) == 2 ) {
+#ifndef TQ_WS_WIN
+ TQString sep = d.mid( TQMIN( dpos, mpos ) + 2, TQABS( dpos - mpos ) - 2 );
+ if ( d.tqcontains( sep ) == 2 ) {
*lDateSep = sep;
}
#endif
}
-#ifndef Q_WS_WIN
+#ifndef TQ_WS_WIN
TQString t = TQTime( 11, 22, 33 ).toString( Qt::LocalDate );
- dpos = t.find( "11" );
- mpos = t.find( "22" );
- ypos = t.find( "33" );
+ dpos = t.tqfind( "11" );
+ mpos = t.tqfind( "22" );
+ ypos = t.tqfind( "33" );
// We only allow hhmmss
if ( dpos > -1 && dpos < mpos && mpos < ypos ) {
TQString sep = t.mid( dpos + 2, mpos - dpos - 2 );
@@ -182,11 +182,11 @@ class ExtDateTimeEditorPrivate
public:
ExtDateTimeEditorPrivate()
: frm( TRUE ),
- parag( new QTextParagraph( 0, 0, 0, FALSE ) ),
+ parag( new TQTextParagraph( 0, 0, 0, FALSE ) ),
focusSec(0)
{
parag->formatter()->setWrapEnabled( FALSE );
- cursor = new QTextCursor( 0 );
+ cursor = new TQTextCursor( 0 );
cursor->setParagraph( parag );
offset = 0;
sep = localDateSep();
@@ -200,7 +200,7 @@ public:
cleanup();
}
- void appendSection( const QNumberSection& sec )
+ void appendSection( const TQNumberSection& sec )
{
sections.append( sec );
@@ -235,7 +235,7 @@ public:
}
return -1;
}
- QNumberSection section( int idx ) const
+ TQNumberSection section( int idx ) const
{
return sections[idx];
}
@@ -266,20 +266,20 @@ public:
{
int fw = 0;
if ( frm )
- fw = style.pixelMetric(TQStyle::PM_DefaultFrameWidth);
+ fw = style.tqpixelMetric(TQStyle::PM_DefaultFrameWidth);
parag->truncate( 0 );
parag->append( txt );
if ( !focus )
- parag->removeSelection( QTextDocument::Standard );
+ parag->removeSelection( TQTextDocument::Standard );
else {
applyFocusSelection();
}
/* color all EXTDATETIMEEDIT_HIDDEN_CHAR chars to background color */
- QTextFormat *fb = parag->formatCollection()->format( p.font(),
+ TQTextFormat *fb = parag->formatCollection()->format( p.font(),
cg.base() );
- QTextFormat *nf = parag->formatCollection()->format( p.font(),
+ TQTextFormat *nf = parag->formatCollection()->format( p.font(),
cg.text() );
for ( uint i = 0; i < txt.length(); ++i ) {
parag->setFormat( i, 1, nf );
@@ -295,7 +295,7 @@ public:
TQRect r( rect.x(), rect.y(), rect.width() - 2 * ( 2 + fw ), rect.height() );
parag->pseudoDocument()->docRect = r;
- parag->invalidate(0);
+ parag->tqinvalidate(0);
parag->format();
int xoff = 2 + fw - offset;
@@ -322,7 +322,7 @@ protected:
if ( focusSec > -1 ) {
int selstart = sections[ focusSec ].selectionStart();
int selend = sections[ focusSec ].selectionEnd();
- parag->setSelection( QTextDocument::Standard, selstart, selend );
+ parag->setSelection( TQTextDocument::Standard, selstart, selend );
parag->format();
if ( parag->at( selstart )->x < offset ||
parag->at( selend )->x + parag->string()->width( selend ) > offset + sz.width() ) {
@@ -332,52 +332,25 @@ protected:
}
private:
bool frm;
- QTextParagraph *parag;
- QTextCursor *cursor;
+ TQTextParagraph *parag;
+ TQTextCursor *cursor;
TQSize sz;
int focusSec;
- TQValueList< QNumberSection > sections;
+ TQValueList< TQNumberSection > sections;
TQString sep;
int offset;
};
-class ExtDateTimeSpinWidget : public QSpinWidget
-{
-public:
- ExtDateTimeSpinWidget( TQWidget *parent, const char *name )
- : TQSpinWidget( parent, name )
- {
- }
-
-protected:
-#ifndef QT_NO_WHEELEVENT
- void wheelEvent( TQWheelEvent *e )
- {
- ExtDateTimeEditor *editor = (ExtDateTimeEditor*)editWidget()->qt_cast( "ExtDateTimeEditor" );
- Q_ASSERT( editor );
- if ( !editor )
- return;
-
- int section = editor->sectionAt( e->pos() );
- editor->setFocusSection( section );
-
- if ( section == -1 )
- return;
- TQSpinWidget::wheelEvent( e );
- }
-#endif
-};
-
/*!
- Constructs an empty datetime editor with parent \a parent and
+ Constructs an empty datetime editor with tqparent \a tqparent and
called \a name.
*/
-ExtDateTimeEditor::ExtDateTimeEditor( ExtDateTimeEditBase * parent,
+ExtDateTimeEditor::ExtDateTimeEditor( ExtDateTimeEditBase * tqparent,
const char * name )
- : TQWidget( parent, name, WNoAutoErase )
+ : TQWidget( tqparent, name, WNoAutoErase )
{
d = new ExtDateTimeEditorPrivate();
- cw = parent;
+ cw = tqparent;
init();
}
@@ -399,7 +372,7 @@ void ExtDateTimeEditor::init()
setBackgroundMode( PaletteBase );
setFocusSection( -1 );
installEventFilter( this );
- setFocusPolicy( WheelFocus );
+ setFocusPolicy( TQ_WheelFocus );
}
@@ -411,7 +384,7 @@ bool ExtDateTimeEditor::event( TQEvent *e )
{
if ( e->type() == TQEvent::FocusIn || e->type() == TQEvent::FocusOut ) {
if ( e->type() == TQEvent::FocusOut )
- qApp->sendEvent( cw, e );
+ tqApp->sendEvent( cw, e );
update( rect() );
} else if ( e->type() == TQEvent::AccelOverride ) {
TQKeyEvent* ke = (TQKeyEvent*) e;
@@ -458,12 +431,12 @@ void ExtDateTimeEditor::paintEvent( TQPaintEvent * )
}
}
- QSharedDoubleBuffer buffer( this );
+ TQSharedDoubleBuffer buffer( this );
const TQBrush &bg =
- colorGroup().brush( isEnabled() ? TQColorGroup::Base : TQColorGroup::Background );
+ tqcolorGroup().brush( isEnabled() ? TQColorGroup::Base : TQColorGroup::Background );
buffer.painter()->fillRect( 0, 0, width(), height(), bg );
- d->paint( txt, hasFocus(), *buffer.painter(), colorGroup(), rect(),
- style() );
+ d->paint( txt, hasFocus(), *buffer.painter(), tqcolorGroup(), rect(),
+ tqstyle() );
buffer.end();
}
@@ -492,7 +465,7 @@ void ExtDateTimeEditor::mousePressEvent( TQMouseEvent *e )
int sec = sectionAt( p );
if ( sec != -1 ) {
cw->setFocusSection( sec );
- repaint( rect(), FALSE );
+ tqrepaint( rect(), FALSE );
}
}
@@ -501,20 +474,20 @@ void ExtDateTimeEditor::mousePressEvent( TQMouseEvent *e )
*/
bool ExtDateTimeEditor::eventFilter( TQObject *o, TQEvent *e )
{
- if ( o == this ) {
+ if ( TQT_BASE_OBJECT(o) == TQT_BASE_OBJECT(this) ) {
if ( e->type() == TQEvent::KeyPress ) {
TQKeyEvent *ke = (TQKeyEvent*)e;
switch ( ke->key() ) {
case Key_Right:
if ( d->focusSection() < (int)d->sectionCount()-1 ) {
if ( cw->setFocusSection( focusSection()+1 ) )
- repaint( rect(), FALSE );
+ tqrepaint( rect(), FALSE );
}
return TRUE;
case Key_Left:
if ( d->focusSection() > 0 ) {
if ( cw->setFocusSection( focusSection()-1 ) )
- repaint( rect(), FALSE );
+ tqrepaint( rect(), FALSE );
}
return TRUE;
case Key_Up:
@@ -524,32 +497,32 @@ bool ExtDateTimeEditor::eventFilter( TQObject *o, TQEvent *e )
cw->stepDown();
return TRUE;
case Key_Backspace:
- if ( ::qt_cast<ExtDateEdit*>(cw) )
+ if ( ::tqqt_cast<ExtDateEdit*>(cw) )
((ExtDateEdit*)cw)->removeFirstNumber( d->focusSection() );
- else if ( ::qt_cast<QTimeEdit*>(cw) )
- ((QTimeEdit*)cw)->removeFirstNumber( d->focusSection() );
+ else if ( ::tqqt_cast<TQTimeEdit*>(cw) )
+ ((TQTimeEdit*)cw)->removeFirstNumber( d->focusSection() );
return TRUE;
case Key_Delete:
cw->removeLastNumber( d->focusSection() );
return TRUE;
case Key_Tab:
case Key_BackTab: {
- if ( ke->state() == Qt::ControlButton )
+ if ( ke->state() == TQt::ControlButton )
return FALSE;
TQWidget *w = this;
bool hadDateEdit = FALSE;
while ( w ) {
- if ( ::qt_cast<ExtDateTimeSpinWidget*>(w) && qstrcmp( w->name(), "qt_spin_widget" ) != 0 ||
- ::qt_cast<ExtDateTimeEdit*>(w) )
+ if ( ::tqqt_cast<ExtDateTimeSpinWidget*>(w) && qstrcmp( w->name(), "qt_spin_widget" ) != 0 ||
+ ::tqqt_cast<ExtDateTimeEdit*>(w) )
break;
- hadDateEdit = hadDateEdit || ::qt_cast<ExtDateEdit*>(w);
- w = w->parentWidget();
+ hadDateEdit = hadDateEdit || ::tqqt_cast<ExtDateEdit*>(w);
+ w = w->tqparentWidget();
}
if ( w ) {
- if ( !::qt_cast<ExtDateTimeEdit*>(w) ) {
- w = w->parentWidget();
+ if ( !::tqqt_cast<ExtDateTimeEdit*>(w) ) {
+ w = w->tqparentWidget();
} else {
ExtDateTimeEdit *ed = (ExtDateTimeEdit*)w;
if ( hadDateEdit && ke->key() == Key_Tab ) {
@@ -559,29 +532,29 @@ bool ExtDateTimeEditor::eventFilter( TQObject *o, TQEvent *e )
ed->dateEdit()->setFocus();
return TRUE;
} else {
- while ( w && !::qt_cast<ExtDateTimeEdit*>(w) )
- w = w->parentWidget();
+ while ( w && !::tqqt_cast<ExtDateTimeEdit*>(w) )
+ w = w->tqparentWidget();
}
}
- qApp->sendEvent( w, e );
+ tqApp->sendEvent( w, e );
return TRUE;
}
} break;
default:
- TQString txt = ke->text().lower();
+ TQString txt = TQString(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 ) {
if ( cw->setFocusSection( focusSection()+1 ) )
- repaint( rect(), FALSE );
+ tqrepaint( rect(), FALSE );
}
return TRUE;
- } else if ( !txt.isEmpty() && ::qt_cast<QTimeEdit*>(cw) && focusSection() == (int) d->sectionCount()-1 ) {
+ } else if ( !txt.isEmpty() && ::tqqt_cast<TQTimeEdit*>(cw) && focusSection() == (int) d->sectionCount()-1 ) {
// the first character of the AM/PM indicator toggles if the section has focus
- QTimeEdit *te = (QTimeEdit*)cw;
+ TQTimeEdit *te = (TQTimeEdit*)cw;
TQTime time = te->time();
- if ( lAMPM && lAM && lPM && (te->display()&QTimeEdit::AMPM) ) {
+ if ( lAMPM && lAM && lPM && (te->display()&TQTimeEdit::AMPM) ) {
if ( txt[0] == (*lAM).lower()[0] && time.hour() >= 12 ) {
time.setHMS( time.hour()-12, time.minute(), time.second(), time.msec() );
te->setTime( time );
@@ -608,7 +581,7 @@ bool ExtDateTimeEditor::eventFilter( TQObject *o, TQEvent *e )
Appends the number section \a sec to the editor.
*/
-void ExtDateTimeEditor::appendSection( const QNumberSection& sec )
+void ExtDateTimeEditor::appendSection( const TQNumberSection& sec )
{
d->appendSection( sec );
}
@@ -678,7 +651,7 @@ bool ExtDateTimeEditor::setFocusSection( int sec )
\internal
Small abstract class that provides some functions that are common
- for both ExtDateEdit and QTimeEdit. Its used internally by
+ for both ExtDateEdit and TQTimeEdit. Its used internally by
ExtDateTimeEditor.
*/
@@ -767,9 +740,9 @@ public:
with a date, e.g.
\code
- ExtDateEdit *dateEdit = new ExtDateEdit( ExtDate::currentDate(), this );
- dateEdit->setRange( ExtDate::currentDate().addDays( -365 ),
- ExtDate::currentDate().addDays( 365 ) );
+ ExtDateEdit *dateEdit = new ExtDateEdit( ExtDate::tqcurrentDate(), this );
+ dateEdit->setRange( ExtDate::tqcurrentDate().addDays( -365 ),
+ ExtDate::tqcurrentDate().addDays( 365 ) );
dateEdit->setOrder( ExtDateEdit::MDY );
dateEdit->setAutoAdvance( TRUE );
\endcode
@@ -793,7 +766,7 @@ public:
\image html datetimewidgets.png "Date Time Widgets"
- \sa ExtDate QTimeEdit ExtDateTimeEdit
+ \sa ExtDate TQTimeEdit ExtDateTimeEdit
*/
/*!
@@ -806,7 +779,7 @@ public:
/*!
- \enum QTimeEdit::Display
+ \enum TQTimeEdit::Display
This enum defines the sections that comprise a time
@@ -819,12 +792,12 @@ public:
*/
/*!
- Constructs an empty date editor which is a child of \a parent and
+ Constructs an empty date editor which is a child of \a tqparent and
called name \a name.
*/
-ExtDateEdit::ExtDateEdit( TQWidget * parent, const char * name )
- : ExtDateTimeEditBase( parent, name )
+ExtDateEdit::ExtDateEdit( TQWidget * tqparent, const char * name )
+ : ExtDateTimeEditBase( tqparent, name )
{
init();
updateButtons();
@@ -833,14 +806,14 @@ ExtDateEdit::ExtDateEdit( TQWidget * parent, const char * name )
/*!
\overload
- Constructs a date editor with the initial value \a date, parent \a
- parent and called \a name.
+ Constructs a date editor with the initial value \a date, tqparent \a
+ tqparent and called \a name.
The date editor is initialized with \a date.
*/
-ExtDateEdit::ExtDateEdit( const ExtDate& date, TQWidget * parent, const char * name )
- : ExtDateTimeEditBase( parent, name )
+ExtDateEdit::ExtDateEdit( const ExtDate& date, TQWidget * tqparent, const char * name )
+ : ExtDateTimeEditBase( tqparent, name )
{
init();
setDate( date );
@@ -861,9 +834,9 @@ void ExtDateEdit::init()
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 ) );
+ d->ed->appendSection( TQNumberSection( 0,4 ) );
+ d->ed->appendSection( TQNumberSection( 5,7 ) );
+ d->ed->appendSection( TQNumberSection( 8,10 ) );
d->yearSection = -1;
d->monthSection = -1;
@@ -883,7 +856,7 @@ void ExtDateEdit::init()
d->max = ExtDate( 50000, 12, 31 );
d->changed = FALSE;
- setSizePolicy( TQSizePolicy::Minimum, TQSizePolicy::Fixed );
+ tqsetSizePolicy( TQSizePolicy::Minimum, TQSizePolicy::Fixed );
refcount++;
}
@@ -997,24 +970,24 @@ void ExtDateEdit::resizeEvent( TQResizeEvent * )
/*! \reimp
*/
-TQSize ExtDateEdit::sizeHint() const
+TQSize ExtDateEdit::tqsizeHint() const
{
constPolish();
TQFontMetrics fm( font() );
- int fw = style().pixelMetric( TQStyle::PM_DefaultFrameWidth, this );
- int h = QMAX( fm.lineSpacing(), 14 ) + 2;
+ int fw = tqstyle().tqpixelMetric( TQStyle::PM_DefaultFrameWidth, this );
+ int h = TQMAX( fm.lineSpacing(), 14 ) + 2;
int w = 2 + fm.width( '9' ) * 8 + fm.width( d->ed->separator() ) * 2
+ d->controls->upRect().width() + fw * 4;
- return TQSize( w, QMAX(h + fw * 2,20) ).expandedTo( TQApplication::globalStrut() );
+ return TQSize( w, TQMAX(h + fw * 2,20) ).expandedTo( TQApplication::globalStrut() );
}
/*! \reimp
*/
-TQSize ExtDateEdit::minimumSizeHint() const
+TQSize ExtDateEdit::tqminimumSizeHint() const
{
- return sizeHint();
+ return tqsizeHint();
}
@@ -1160,7 +1133,7 @@ void ExtDateEdit::setOrder( ExtDateEdit::Order order )
}
if ( isVisible() )
- d->ed->repaint( d->ed->rect(), FALSE );
+ d->ed->tqrepaint( d->ed->rect(), FALSE );
}
@@ -1198,7 +1171,7 @@ void ExtDateEdit::stepUp()
emit valueChanged( date() );
}
- d->ed->repaint( d->ed->rect(), FALSE );
+ d->ed->tqrepaint( d->ed->rect(), FALSE );
}
@@ -1232,7 +1205,7 @@ void ExtDateEdit::stepDown()
emit valueChanged( date() );
}
- d->ed->repaint( d->ed->rect(), FALSE );
+ d->ed->tqrepaint( d->ed->rect(), FALSE );
}
/*!
@@ -1295,7 +1268,7 @@ void ExtDateEdit::setDay( int day )
If the date property is not valid, the editor displays all zeroes
and ExtDateEdit::date() will return an invalid date. It is strongly
recommended that the editor is given a default date value (e.g.
- currentDate()). That way, attempts to set the date property to an
+ tqcurrentDate()). That way, attempts to set the date property to an
invalid date will fail.
When changing the date property, if the date is less than
@@ -1319,7 +1292,7 @@ void ExtDateEdit::setDate( const ExtDate& date )
emit valueChanged( date );
}
d->changed = FALSE;
- d->ed->repaint( d->ed->rect(), FALSE );
+ d->ed->tqrepaint( d->ed->rect(), FALSE );
}
ExtDate ExtDateEdit::date() const
@@ -1341,8 +1314,8 @@ ExtDate ExtDateEdit::date() const
bool ExtDateEdit::outOfRange( int y, int m, int d ) const
{
if ( ExtDate::isValid( y, m, d ) ) {
- ExtDate currentDate( y, m, d );
- if ( currentDate > maxValue() || currentDate < minValue() ) {
+ ExtDate tqcurrentDate( y, m, d );
+ if ( tqcurrentDate > maxValue() || tqcurrentDate < minValue() ) {
//## outOfRange should set overwrite?
return TRUE;
}
@@ -1454,8 +1427,8 @@ void ExtDateEdit::addNumber( int sec, int num )
emit valueChanged( date() );
}
d->overwrite = overwrite;
- d->timerId = startTimer( qApp->doubleClickInterval()*4 );
- d->ed->repaint( d->ed->rect(), FALSE );
+ d->timerId = startTimer( tqApp->doubleClickInterval()*4 );
+ d->ed->tqrepaint( d->ed->rect(), FALSE );
}
@@ -1502,7 +1475,7 @@ void ExtDateEdit::fix()
changed = TRUE;
}
- int currentYear = ExtDate::currentDate().year();
+ int currentYear = ExtDate::tqcurrentDate().year();
int year = d->y;
/* No longer valid for extended dates
if ( year < 100 ) {
@@ -1608,7 +1581,7 @@ void ExtDateEdit::removeFirstNumber( int sec )
d->d = txt.toInt();
d->dayCache = d->d;
}
- d->ed->repaint( d->ed->rect(), FALSE );
+ d->ed->tqrepaint( d->ed->rect(), FALSE );
}
/*! \reimp
@@ -1634,7 +1607,7 @@ void ExtDateEdit::removeLastNumber( int sec )
d->d = txt.toInt();
d->dayCache = d->d;
}
- d->ed->repaint( d->ed->rect(), FALSE );
+ d->ed->tqrepaint( d->ed->rect(), FALSE );
}
/*!
@@ -1675,7 +1648,7 @@ void ExtDateEdit::timerEvent( TQTimerEvent * )
///////////
-class QTimeEditPrivate
+class TQTimeEditPrivate
{
public:
int h;
@@ -1694,26 +1667,26 @@ public:
};
/*!
- \class QTimeEdit ExtDatetimeedit.h
- \brief The QTimeEdit class provides a time editor.
+ \class TQTimeEdit ExtDatetimeedit.h
+ \brief The TQTimeEdit class provides a time editor.
\ingroup advanced
\ingroup time
\mainclass
- QTimeEdit allows the user to edit times by using the keyboard or
+ TQTimeEdit allows the user to edit times by using the keyboard or
the arrow keys to increase/decrease time values. The arrow keys
- can be used to move from section to section within the QTimeEdit
+ can be used to move from section to section within the TQTimeEdit
box. The user can automatically be moved to the next section once
they complete a section using setAutoAdvance(). Times appear in
- hour, minute, second order. It is recommended that the QTimeEdit
+ hour, minute, second order. It is recommended that the TQTimeEdit
is initialised with a time, e.g.
\code
TQTime timeNow = TQTime::currentTime();
- QTimeEdit *timeEdit = new QTimeEdit( timeNow, this );
+ TQTimeEdit *timeEdit = new TQTimeEdit( timeNow, this );
timeEdit->setRange( timeNow, timeNow.addSecs( 60 * 60 ) );
\endcode
- Here we've created a QTimeEdit widget set to the current time.
+ Here we've created a TQTimeEdit widget set to the current time.
We've also set the minimum value to the current time and the
maximum time to one hour from now.
@@ -1721,7 +1694,7 @@ public:
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
+ Terminology: A TQTimeWidget consists of three sections, one each
for the hour, minute and second. You can change the separator
character using setSeparator(), by default the separator is read
from the system's settings.
@@ -1733,12 +1706,12 @@ public:
// /*!
-// Constructs an empty time edit with parent \a parent and called \a
+// Constructs an empty time edit with tqparent \a tqparent and called \a
// name.
// */
//
-// QTimeEdit::QTimeEdit( TQWidget * parent, const char * name )
-// : ExtDateTimeEditBase( parent, name )
+// TQTimeEdit::TQTimeEdit( TQWidget * tqparent, const char * name )
+// : ExtDateTimeEditBase( tqparent, name )
// {
// init();
// }
@@ -1747,11 +1720,11 @@ public:
// \overload
//
// Constructs a time edit with the initial time value, \a time,
-// parent \a parent and called \a name.
+// tqparent \a tqparent and called \a name.
// */
//
-// QTimeEdit::QTimeEdit( const TQTime& time, TQWidget * parent, const char * name )
-// : ExtDateTimeEditBase( parent, name )
+// TQTimeEdit::TQTimeEdit( const TQTime& time, TQWidget * tqparent, const char * name )
+// : ExtDateTimeEditBase( tqparent, name )
// {
// init();
// setTime( time );
@@ -1760,9 +1733,9 @@ public:
// /*! \internal
// */
//
-// void QTimeEdit::init()
+// void TQTimeEdit::init()
// {
-// d = new QTimeEditPrivate();
+// d = new TQTimeEditPrivate();
// d->ed = new ExtDateTimeEditor( this, "time edit base" );
// d->controls = new ExtDateTimeSpinWidget( this, qstrcmp( name(), "qt_datetime_timeedit" ) == 0 ? "qt_spin_widget" : "time edit controls" );
// d->controls->setEditWidget( d->ed );
@@ -1770,9 +1743,9 @@ public:
// 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 ) );
-// d->ed->appendSection( QNumberSection( 0,0, TRUE, 2 ) );
+// d->ed->appendSection( TQNumberSection( 0,0, TRUE, 0 ) );
+// d->ed->appendSection( TQNumberSection( 0,0, TRUE, 1 ) );
+// d->ed->appendSection( TQNumberSection( 0,0, TRUE, 2 ) );
// d->ed->setSeparator( localTimeSep() );
//
// d->h = 0;
@@ -1781,7 +1754,7 @@ public:
// d->display = Hours | Minutes | Seconds;
// if ( lAMPM ) {
// d->display |= AMPM;
-// d->ed->appendSection( QNumberSection( 0,0, FALSE, 3 ) );
+// d->ed->appendSection( TQNumberSection( 0,0, FALSE, 3 ) );
// }
// d->adv = FALSE;
// d->overwrite = TRUE;
@@ -1791,7 +1764,7 @@ public:
// d->max = TQTime( 23, 59, 59 );
// d->changed = FALSE;
//
-// setSizePolicy( TQSizePolicy::Minimum, TQSizePolicy::Fixed );
+// tqsetSizePolicy( TQSizePolicy::Minimum, TQSizePolicy::Fixed );
//
// refcount++;
// }
@@ -1800,7 +1773,7 @@ public:
// Destroys the object and frees any allocated resources.
// */
//
-// QTimeEdit::~QTimeEdit()
+// TQTimeEdit::~TQTimeEdit()
// {
// delete d;
// if ( !--refcount )
@@ -1808,33 +1781,33 @@ public:
// }
//
// /*!
-// \property QTimeEdit::minValue
+// \property TQTimeEdit::minValue
// \brief the minimum time value
//
// Setting the minimum time value is equivalent to calling
-// QTimeEdit::setRange( \e t, maxValue() ), where \e t is the minimum
+// TQTimeEdit::setRange( \e t, maxValue() ), where \e t is the minimum
// time. The default minimum time is 00:00:00.
//
// \sa maxValue setRange()
// */
//
-// TQTime QTimeEdit::minValue() const
+// TQTime TQTimeEdit::minValue() const
// {
// return d->min;
// }
//
// /*!
-// \property QTimeEdit::maxValue
+// \property TQTimeEdit::maxValue
// \brief the maximum time value
//
// Setting the maximum time value is equivalent to calling
-// QTimeEdit::setRange( minValue(), \e t ), where \e t is the maximum
+// TQTimeEdit::setRange( minValue(), \e t ), where \e t is the maximum
// time. The default maximum time is 23:59:59.
//
// \sa minValue setRange()
// */
//
-// TQTime QTimeEdit::maxValue() const
+// TQTime TQTimeEdit::maxValue() const
// {
// return d->max;
// }
@@ -1846,7 +1819,7 @@ public:
// Similarly, if \a max is invalid no maximum time is set.
// */
//
-// void QTimeEdit::setRange( const TQTime& min, const TQTime& max )
+// void TQTimeEdit::setRange( const TQTime& min, const TQTime& max )
// {
// if ( min.isValid() )
// d->min = min;
@@ -1855,13 +1828,13 @@ public:
// }
//
// /*!
-// \property QTimeEdit::display
+// \property TQTimeEdit::display
// \brief the sections that are displayed in the time edit
//
// The value can be any combination of the values in the Display enum.
// By default, the widget displays hours, minutes and seconds.
// */
-// void QTimeEdit::setDisplay( uint display )
+// void TQTimeEdit::setDisplay( uint display )
// {
// if ( d->display == display )
// return;
@@ -1869,32 +1842,32 @@ public:
// d->ed->clearSections();
// d->display = display;
// if ( d->display & Hours )
-// d->ed->appendSection( QNumberSection( 0,0, TRUE, 0 ) );
+// d->ed->appendSection( TQNumberSection( 0,0, TRUE, 0 ) );
// if ( d->display & Minutes )
-// d->ed->appendSection( QNumberSection( 0,0, TRUE, 1 ) );
+// d->ed->appendSection( TQNumberSection( 0,0, TRUE, 1 ) );
// if ( d->display & Seconds )
-// d->ed->appendSection( QNumberSection( 0,0, TRUE, 2 ) );
+// d->ed->appendSection( TQNumberSection( 0,0, TRUE, 2 ) );
// if ( d->display & AMPM )
-// d->ed->appendSection( QNumberSection( 0,0, FALSE, 3 ) );
+// d->ed->appendSection( TQNumberSection( 0,0, FALSE, 3 ) );
//
// d->ed->setFocusSection( 0 );
// d->ed->update();
// }
//
-// uint QTimeEdit::display() const
+// uint TQTimeEdit::display() const
// {
// return d->display;
// }
//
// /*!
-// \property QTimeEdit::time
+// \property TQTimeEdit::time
// \brief the editor's time value.
//
// When changing the time property, if the time is less than
// minValue(), or is greater than maxValue(), nothing happens.
// */
//
-// void QTimeEdit::setTime( const TQTime& time )
+// void TQTimeEdit::setTime( const TQTime& time )
// {
// if ( !time.isValid() ) {
// d->h = 0;
@@ -1909,10 +1882,10 @@ public:
// emit valueChanged( time );
// }
// d->changed = FALSE;
-// d->ed->repaint( d->ed->rect(), FALSE );
+// d->ed->tqrepaint( d->ed->rect(), FALSE );
// }
//
-// TQTime QTimeEdit::time() const
+// TQTime TQTimeEdit::time() const
// {
// if ( TQTime::isValid( d->h, d->m, d->s ) )
// return TQTime( d->h, d->m, d->s );
@@ -1920,7 +1893,7 @@ public:
// }
//
// /*!
-// \property QTimeEdit::autoAdvance
+// \property TQTimeEdit::autoAdvance
// \brief whether the editor automatically advances to the next
// section
//
@@ -1929,12 +1902,12 @@ public:
// The default is FALSE.
// */
//
-// void QTimeEdit::setAutoAdvance( bool advance )
+// void TQTimeEdit::setAutoAdvance( bool advance )
// {
// d->adv = advance;
// }
//
-// bool QTimeEdit::autoAdvance() const
+// bool TQTimeEdit::autoAdvance() const
// {
// return d->adv;
// }
@@ -1944,7 +1917,7 @@ public:
// character of \a s is used.
// */
//
-// void QTimeEdit::setSeparator( const TQString& s )
+// void TQTimeEdit::setSeparator( const TQString& s )
// {
// d->ed->setSeparator( s );
// }
@@ -1953,14 +1926,14 @@ public:
// Returns the editor's separator.
// */
//
-// TQString QTimeEdit::separator() const
+// TQString TQTimeEdit::separator() const
// {
// return d->ed->separator();
// }
//
//
// /*!
-// \fn void QTimeEdit::valueChanged( const TQTime& time )
+// \fn void TQTimeEdit::valueChanged( const TQTime& time )
//
// This signal is emitted whenever the editor's value changes. The \a
// time parameter is the new value.
@@ -1970,7 +1943,7 @@ public:
//
// */
//
-// bool QTimeEdit::event( TQEvent *e )
+// bool TQTimeEdit::event( TQEvent *e )
// {
// if ( e->type() == TQEvent::FocusOut ) {
// d->typing = FALSE;
@@ -1989,7 +1962,7 @@ public:
//
// */
//
-// void QTimeEdit::timerEvent( TQTimerEvent * )
+// void TQTimeEdit::timerEvent( TQTimerEvent * )
// {
// d->overwrite = TRUE;
// }
@@ -1999,7 +1972,7 @@ public:
//
// */
//
-// void QTimeEdit::stepUp()
+// void TQTimeEdit::stepUp()
// {
// int sec = d->ed->mapSection( d->ed->focusSection() );
// bool accepted = TRUE;
@@ -2030,8 +2003,8 @@ public:
// break;
// default:
// accepted = FALSE;
-// #ifdef QT_CHECK_RANGE
-// qWarning( "QTimeEdit::stepUp: Focus section out of range!" );
+// #ifdef TQT_CHECK_RANGE
+// qWarning( "TQTimeEdit::stepUp: Focus section out of range!" );
// #endif
// break;
// }
@@ -2039,7 +2012,7 @@ public:
// d->changed = TRUE;
// emit valueChanged( time() );
// }
-// d->ed->repaint( d->ed->rect(), FALSE );
+// d->ed->tqrepaint( d->ed->rect(), FALSE );
// }
//
//
@@ -2047,7 +2020,7 @@ public:
//
// */
//
-// void QTimeEdit::stepDown()
+// void TQTimeEdit::stepDown()
// {
// int sec = d->ed->mapSection( d->ed->focusSection() );
//
@@ -2079,8 +2052,8 @@ public:
// break;
// default:
// accepted = FALSE;
-// #ifdef QT_CHECK_RANGE
-// qWarning( "QTimeEdit::stepDown: Focus section out of range!" );
+// #ifdef TQT_CHECK_RANGE
+// qWarning( "TQTimeEdit::stepDown: Focus section out of range!" );
// #endif
// break;
// }
@@ -2088,7 +2061,7 @@ public:
// d->changed = TRUE;
// emit valueChanged( time() );
// }
-// d->ed->repaint( d->ed->rect(), FALSE );
+// d->ed->tqrepaint( d->ed->rect(), FALSE );
// }
//
//
@@ -2098,7 +2071,7 @@ public:
// on \a sec.
// */
//
-// TQString QTimeEdit::sectionFormattedText( int sec )
+// TQString TQTimeEdit::sectionFormattedText( int sec )
// {
// TQString txt;
// txt = sectionText( sec );
@@ -2117,7 +2090,7 @@ public:
//
// */
//
-// bool QTimeEdit::setFocusSection( int sec )
+// bool TQTimeEdit::setFocusSection( int sec )
// {
// if ( sec != d->ed->focusSection() ) {
// killTimer( d->timerId );
@@ -2141,7 +2114,7 @@ public:
// range 0..24.
// */
//
-// void QTimeEdit::setHour( int h )
+// void TQTimeEdit::setHour( int h )
// {
// if ( h < 0 )
// h = 0;
@@ -2156,7 +2129,7 @@ public:
// range 0..59.
// */
//
-// void QTimeEdit::setMinute( int m )
+// void TQTimeEdit::setMinute( int m )
// {
// if ( m < 0 )
// m = 0;
@@ -2171,7 +2144,7 @@ public:
// range 0..59.
// */
//
-// void QTimeEdit::setSecond( int s )
+// void TQTimeEdit::setSecond( int s )
// {
// if ( s < 0 )
// s = 0;
@@ -2187,7 +2160,7 @@ public:
//
// */
//
-// TQString QTimeEdit::sectionText( int sec )
+// TQString TQTimeEdit::sectionText( int sec )
// {
// sec = d->ed->mapSection( sec );
//
@@ -2214,12 +2187,12 @@ public:
// if ( lAM )
// txt = *lAM;
// else
-// txt = TQString::fromLatin1( "AM" );
+// txt = TQString::tqfromLatin1( "AM" );
// } else {
// if ( lPM )
// txt = *lPM;
// else
-// txt = TQString::fromLatin1( "PM" );
+// txt = TQString::tqfromLatin1( "PM" );
// }
// break;
// default:
@@ -2233,7 +2206,7 @@ public:
// Returns TRUE if \a h, \a m, and \a s are out of range.
// */
//
-// bool QTimeEdit::outOfRange( int h, int m, int s ) const
+// bool TQTimeEdit::outOfRange( int h, int m, int s ) const
// {
// if ( TQTime::isValid( h, m, s ) ) {
// TQTime currentTime( h, m, s );
@@ -2250,7 +2223,7 @@ public:
//
// */
//
-// void QTimeEdit::addNumber( int sec, int num )
+// void TQTimeEdit::addNumber( int sec, int num )
// {
// if ( sec == -1 )
// return;
@@ -2369,8 +2342,8 @@ public:
// if ( accepted )
// emit valueChanged( time() );
// d->overwrite = overwrite;
-// d->timerId = startTimer( qApp->doubleClickInterval()*4 );
-// d->ed->repaint( d->ed->rect(), FALSE );
+// d->timerId = startTimer( tqApp->doubleClickInterval()*4 );
+// d->ed->tqrepaint( d->ed->rect(), FALSE );
// }
//
//
@@ -2381,7 +2354,7 @@ public:
// remove the first number from \a sec by pressing the backspace key.
// */
//
-// void QTimeEdit::removeFirstNumber( int sec )
+// void TQTimeEdit::removeFirstNumber( int sec )
// {
// if ( sec == -1 )
// return;
@@ -2410,13 +2383,13 @@ public:
// d->s = txt.toInt();
// break;
// }
-// d->ed->repaint( d->ed->rect(), FALSE );
+// d->ed->tqrepaint( d->ed->rect(), FALSE );
// }
//
// /*! \reimp
//
// */
-// void QTimeEdit::removeLastNumber( int sec )
+// void TQTimeEdit::removeLastNumber( int sec )
// {
// if ( sec == -1 )
// return;
@@ -2445,23 +2418,23 @@ public:
// d->s = txt.toInt();
// break;
// }
-// d->ed->repaint( d->ed->rect(), FALSE );
+// d->ed->tqrepaint( d->ed->rect(), FALSE );
// }
//
// /*! \reimp
// */
-// void QTimeEdit::resizeEvent( TQResizeEvent * )
+// void TQTimeEdit::resizeEvent( TQResizeEvent * )
// {
// d->controls->resize( width(), height() );
// }
//
// /*! \reimp
// */
-// TQSize QTimeEdit::sizeHint() const
+// TQSize TQTimeEdit::tqsizeHint() const
// {
// constPolish();
// TQFontMetrics fm( font() );
-// int fw = style().pixelMetric( TQStyle::PM_DefaultFrameWidth, this );
+// int fw = tqstyle().tqpixelMetric( 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,17 +2442,17 @@ public:
// if ( lAM )
// w += fm.width( *lAM ) + 4;
// else
-// w += fm.width( TQString::fromLatin1( "AM" ) ) + 4;
+// w += fm.width( TQString::tqfromLatin1( "AM" ) ) + 4;
// }
//
-// return TQSize( w, QMAX(h + fw * 2,20) ).expandedTo( TQApplication::globalStrut() );
+// return TQSize( w, TQMAX(h + fw * 2,20) ).expandedTo( TQApplication::globalStrut() );
// }
//
// /*! \reimp
// */
-// TQSize QTimeEdit::minimumSizeHint() const
+// TQSize TQTimeEdit::tqminimumSizeHint() const
// {
-// return sizeHint();
+// return tqsizeHint();
// }
//
// /*!
@@ -2490,7 +2463,7 @@ public:
//
// // ### Remove in 4.0?
//
-// void QTimeEdit::updateButtons()
+// void TQTimeEdit::updateButtons()
// {
// if ( !isEnabled() )
// return;
@@ -2511,13 +2484,13 @@ public:
/*!
\class ExtDateTimeEdit ExtDatetimeedit.h
- \brief The ExtDateTimeEdit class combines a ExtDateEdit and QTimeEdit
+ \brief The ExtDateTimeEdit class combines a ExtDateEdit and TQTimeEdit
widget into a single widget for editing datetimes.
\ingroup advanced
\ingroup time
- ExtDateTimeEdit consists of a ExtDateEdit and QTimeEdit widget placed
+ ExtDateTimeEdit consists of a ExtDateEdit and TQTimeEdit widget placed
side by side and offers the functionality of both. The user can
edit the date and time by using the keyboard or the arrow keys to
increase/decrease date or time values. The Tab key can be used to
@@ -2534,16 +2507,16 @@ public:
It is recommended that the ExtDateTimeEdit is initialised with a
datetime, e.g.
\code
- ExtDateTimeEdit *dateTimeEdit = new ExtDateTimeEdit( ExtDateTime::currentDateTime(), this );
- dateTimeEdit->dateEdit()->setRange( ExtDateTime::currentDate(),
- ExtDateTime::currentDate().addDays( 7 ) );
+ ExtDateTimeEdit *dateTimeEdit = new ExtDateTimeEdit( ExtDateTime::tqcurrentDateTime(), this );
+ dateTimeEdit->dateEdit()->setRange( ExtDateTime::tqcurrentDate(),
+ ExtDateTime::tqcurrentDate().addDays( 7 ) );
\endcode
Here we've created a new ExtDateTimeEdit set to the current date and
time, and set the date to have a minimum date of now and a maximum
date of a week from now.
Terminology: A ExtDateEdit widget consists of three 'sections', one
- each for the year, month and day. Similarly a QTimeEdit consists
+ each for the year, month and day. Similarly a TQTimeEdit consists
of three sections, one each for the hour, minute and second. The
character that separates each date section is specified with
setDateSeparator(); similarly setTimeSeparator() is used for the
@@ -2551,15 +2524,15 @@ public:
\image html datetimewidgets.png "Date Time Widgets"
- \sa ExtDateEdit QTimeEdit
+ \sa ExtDateEdit TQTimeEdit
*/
/*!
- Constructs an empty datetime edit with parent \a parent and called
+ Constructs an empty datetime edit with tqparent \a tqparent and called
\a name.
*/
-ExtDateTimeEdit::ExtDateTimeEdit( TQWidget * parent, const char * name )
- : TQWidget( parent, name )
+ExtDateTimeEdit::ExtDateTimeEdit( TQWidget * tqparent, const char * name )
+ : TQWidget( tqparent, name )
{
init();
}
@@ -2569,11 +2542,11 @@ ExtDateTimeEdit::ExtDateTimeEdit( TQWidget * parent, const char * name )
\overload
Constructs a datetime edit with the initial value \a datetime,
- parent \a parent and called \a name.
+ tqparent \a tqparent and called \a name.
*/
ExtDateTimeEdit::ExtDateTimeEdit( const ExtDateTime& datetime,
- TQWidget * parent, const char * name )
- : TQWidget( parent, name )
+ TQWidget * tqparent, const char * name )
+ : TQWidget( tqparent, name )
{
init();
setDateTime( datetime );
@@ -2600,8 +2573,8 @@ ExtDateTimeEdit::~ExtDateTimeEdit()
void ExtDateTimeEdit::resizeEvent( TQResizeEvent * )
{
- int dw = de->sizeHint().width();
- int tw = te->sizeHint().width();
+ int dw = de->tqsizeHint().width();
+ int tw = te->tqsizeHint().width();
int w = width();
int h = height();
int extra = w - ( dw + tw );
@@ -2620,12 +2593,12 @@ void ExtDateTimeEdit::resizeEvent( TQResizeEvent * )
/*! \reimp
*/
-TQSize ExtDateTimeEdit::minimumSizeHint() const
+TQSize ExtDateTimeEdit::tqminimumSizeHint() const
{
- TQSize dsh = de->minimumSizeHint();
- TQSize tsh = te->minimumSizeHint();
+ TQSize dsh = de->tqminimumSizeHint();
+ TQSize tsh = te->tqminimumSizeHint();
return TQSize( dsh.width() + tsh.width(),
- QMAX( dsh.height(), tsh.height() ) );
+ TQMAX( dsh.height(), tsh.height() ) );
}
/*! \internal
@@ -2635,26 +2608,26 @@ void ExtDateTimeEdit::init()
{
d = new ExtDateTimeEditPrivate();
de = new ExtDateEdit( this, "qt_datetime_dateedit" );
- te = new QTimeEdit( this, "qt_datetime_timeedit" );
+ te = new TQTimeEdit( this, "qt_datetime_timeedit" );
d->adv = FALSE;
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( TQSizePolicy::Minimum, TQSizePolicy::Fixed );
+ tqsetSizePolicy( TQSizePolicy::Minimum, TQSizePolicy::Fixed );
}
/*! \reimp
*/
-TQSize ExtDateTimeEdit::sizeHint() const
+TQSize ExtDateTimeEdit::tqsizeHint() const
{
constPolish();
- TQSize dsh = de->sizeHint();
- TQSize tsh = te->sizeHint();
+ TQSize dsh = de->tqsizeHint();
+ TQSize tsh = te->tqsizeHint();
return TQSize( dsh.width() + tsh.width(),
- QMAX( dsh.height(), tsh.height() ) );
+ TQMAX( dsh.height(), tsh.height() ) );
}
/*!
@@ -2740,7 +2713,7 @@ bool ExtDateTimeEdit::autoAdvance() const
*/
/*!
- \fn QTimeEdit* ExtDateTimeEdit::timeEdit()
+ \fn TQTimeEdit* ExtDateTimeEdit::timeEdit()
Returns the internal widget used for editing the time part of the
datetime.
diff --git a/libkdeedu/extdate/extdatetimeedit.h b/libkdeedu/extdate/extdatetimeedit.h
index 4bcf78c8..3aad17d9 100644
--- a/libkdeedu/extdate/extdatetimeedit.h
+++ b/libkdeedu/extdate/extdatetimeedit.h
@@ -5,7 +5,7 @@
**
** Created : 001103
**
-** Original QDateTimeEdit Copyright (C) 2000 Trolltech AS. All rights reserved.
+** Original TQDateTimeEdit Copyright (C) 2000 Trolltech AS. All rights reserved.
**
** >> modifications to introduce ExtDate (C) 2004 Jason Harris <jharris@30doradus.org>
** >> ExtDate modifications are licensed under the GPL: http://www.gnu.org/licenses/gpl.html
@@ -25,23 +25,24 @@
#ifndef EXTDATETIMEEDIT_H
#define EXTDATETIMEEDIT_H
-#ifndef QT_H
+#ifndef TQT_H
#include <tqwidget.h>
#include <tqstring.h>
-#endif // QT_H
+#endif // TQT_H
#include "extdatetime.h"
-#ifndef QT_NO_DATETIMEEDIT
+#ifndef TQT_NO_DATETIMEEDIT
-class QTimeEdit;
+class TQTimeEdit;
-class ExtDateTimeEditBase : public QWidget
+class ExtDateTimeEditBase : public TQWidget
{
Q_OBJECT
+ TQ_OBJECT
public:
- ExtDateTimeEditBase( TQWidget* parent=0, const char* name=0 )
- : TQWidget( parent, name ) {}
+ ExtDateTimeEditBase( TQWidget* tqparent=0, const char* name=0 )
+ : TQWidget( tqparent, name ) {}
virtual bool setFocusSection( int sec ) = 0;
virtual TQString sectionFormattedText( int sec ) = 0;
@@ -53,7 +54,7 @@ public slots:
virtual void stepDown() = 0;
private:
-#if defined(Q_DISABLE_COPY) // Disabled copy constructor and operator=
+#if defined(TQ_DISABLE_COPY) // Disabled copy constructor and operator=
ExtDateTimeEditBase( const ExtDateTimeEditBase & );
ExtDateTimeEditBase &operator=( const ExtDateTimeEditBase & );
#endif
@@ -64,16 +65,17 @@ class ExtDateEditPrivate;
class KDE_EXPORT ExtDateEdit : public ExtDateTimeEditBase
{
Q_OBJECT
+ TQ_OBJECT
Q_ENUMS( Order )
- Q_PROPERTY( Order order READ order WRITE setOrder )
-// Q_PROPERTY( ExtDate date READ date WRITE setDate )
- Q_PROPERTY( bool autoAdvance READ autoAdvance WRITE setAutoAdvance )
-// Q_PROPERTY( ExtDate maxValue READ maxValue WRITE setMaxValue )
-// Q_PROPERTY( ExtDate minValue READ minValue WRITE setMinValue )
+ TQ_PROPERTY( Order order READ order WRITE setOrder )
+// TQ_PROPERTY( ExtDate date READ date WRITE setDate )
+ TQ_PROPERTY( bool autoAdvance READ autoAdvance WRITE setAutoAdvance )
+// TQ_PROPERTY( ExtDate maxValue READ maxValue WRITE setMaxValue )
+// TQ_PROPERTY( ExtDate minValue READ minValue WRITE setMinValue )
public:
- ExtDateEdit( TQWidget* parent=0, const char* name=0 );
- ExtDateEdit( const ExtDate& date, TQWidget* parent=0, const char* name=0 );
+ ExtDateEdit( TQWidget* tqparent=0, const char* name=0 );
+ ExtDateEdit( const ExtDate& date, TQWidget* tqparent=0, const char* name=0 );
~ExtDateEdit();
enum Order { DMY /**< Day-Month-Year */,
@@ -81,8 +83,8 @@ public:
YMD /**< Year-Month-Day, also the default */,
YDM /**< Year-Day-Month @deprecated Included for completeness. */ };
- TQSize sizeHint() const;
- TQSize minimumSizeHint() const;
+ TQSize tqsizeHint() const;
+ TQSize tqminimumSizeHint() const;
public slots:
virtual void setDate( const ExtDate& date );
@@ -136,23 +138,24 @@ private:
TQString sectionText( int sec ) const;
ExtDateEditPrivate* d;
-#if defined(Q_DISABLE_COPY)
+#if defined(TQ_DISABLE_COPY)
ExtDateEdit( const ExtDateEdit & );
ExtDateEdit &operator=( const ExtDateEdit & );
#endif
};
-// class QTimeEditPrivate;
+// class TQTimeEditPrivate;
//
-// class Q_EXPORT QTimeEdit : public ExtDateTimeEditBase
+// class TQ_EXPORT TQTimeEdit : public ExtDateTimeEditBase
// {
// Q_OBJECT
-// Q_SETS( Display )
-// Q_PROPERTY( TQTime time READ time WRITE setTime )
-// Q_PROPERTY( bool autoAdvance READ autoAdvance WRITE setAutoAdvance )
-// Q_PROPERTY( TQTime maxValue READ maxValue WRITE setMaxValue )
-// Q_PROPERTY( TQTime minValue READ minValue WRITE setMinValue )
-// Q_PROPERTY( Display display READ display WRITE setDisplay )
+// TQ_OBJECT
+// TQ_SETS( Display )
+// TQ_PROPERTY( TQTime time READ time WRITE setTime )
+// TQ_PROPERTY( bool autoAdvance READ autoAdvance WRITE setAutoAdvance )
+// TQ_PROPERTY( TQTime maxValue READ maxValue WRITE setMaxValue )
+// TQ_PROPERTY( TQTime minValue READ minValue WRITE setMinValue )
+// TQ_PROPERTY( Display display READ display WRITE setDisplay )
//
// public:
// enum Display {
@@ -163,12 +166,12 @@ private:
// AMPM = 0x10
// };
//
-// QTimeEdit( TQWidget* parent=0, const char* name=0 );
-// QTimeEdit( const TQTime& time, TQWidget* parent=0, const char* name=0 );
-// ~QTimeEdit();
+// TQTimeEdit( TQWidget* tqparent=0, const char* name=0 );
+// TQTimeEdit( const TQTime& time, TQWidget* tqparent=0, const char* name=0 );
+// ~TQTimeEdit();
//
-// TQSize sizeHint() const;
-// TQSize minimumSizeHint() const;
+// TQSize tqsizeHint() const;
+// TQSize tqminimumSizeHint() const;
//
// public slots:
// virtual void setTime( const TQTime& time );
@@ -217,30 +220,31 @@ private:
// private:
// void init();
// TQString sectionText( int sec );
-// QTimeEditPrivate* d;
+// TQTimeEditPrivate* d;
//
-// #if defined(Q_DISABLE_COPY)
-// QTimeEdit( const QTimeEdit & );
-// QTimeEdit &operator=( const QTimeEdit & );
+// #if defined(TQ_DISABLE_COPY)
+// TQTimeEdit( const TQTimeEdit & );
+// TQTimeEdit &operator=( const TQTimeEdit & );
// #endif
// };
//
class ExtDateTimeEditPrivate;
-class KDE_EXPORT ExtDateTimeEdit : public QWidget
+class KDE_EXPORT ExtDateTimeEdit : public TQWidget
{
Q_OBJECT
-// Q_PROPERTY( ExtDateTime dateTime READ dateTime WRITE setDateTime )
+ TQ_OBJECT
+// TQ_PROPERTY( ExtDateTime dateTime READ dateTime WRITE setDateTime )
public:
- ExtDateTimeEdit( TQWidget* parent=0, const char* name=0 );
- ExtDateTimeEdit( const ExtDateTime& datetime, TQWidget* parent=0,
+ ExtDateTimeEdit( TQWidget* tqparent=0, const char* name=0 );
+ ExtDateTimeEdit( const ExtDateTime& datetime, TQWidget* tqparent=0,
const char* name=0 );
~ExtDateTimeEdit();
- TQSize sizeHint() const;
- TQSize minimumSizeHint() const;
+ TQSize tqsizeHint() const;
+ TQSize tqminimumSizeHint() const;
public slots:
virtual void setDateTime( const ExtDateTime & dt );
@@ -249,7 +253,7 @@ public:
ExtDateTime dateTime() const;
ExtDateEdit* dateEdit() { return de; }
- QTimeEdit* timeEdit() { return te; }
+ TQTimeEdit* timeEdit() { return te; }
virtual void setAutoAdvance( bool advance );
bool autoAdvance() const;
@@ -258,31 +262,31 @@ signals:
void valueChanged( const ExtDateTime& datetime );
protected:
- // ### make init() private in Qt 4.0
+ // ### make init() private in TQt 4.0
void init();
void resizeEvent( TQResizeEvent * );
protected slots:
- // ### make these two functions private in Qt 4.0,
+ // ### make these two functions private in TQt 4.0,
// and merge them into one with no parameter
void newValue( const ExtDate& d );
void newValue( const TQTime& t );
private:
ExtDateEdit* de;
- QTimeEdit* te;
+ TQTimeEdit* te;
ExtDateTimeEditPrivate* d;
-#if defined(Q_DISABLE_COPY)
+#if defined(TQ_DISABLE_COPY)
ExtDateTimeEdit( const ExtDateTimeEdit & );
ExtDateTimeEdit &operator=( const ExtDateTimeEdit & );
#endif
};
-class QNumberSection
+class TQNumberSection
{
public:
- QNumberSection( int selStart = 0, int selEnd = 0, bool separat = TRUE, int actual = -1 )
+ TQNumberSection( int selStart = 0, int selEnd = 0, bool separat = TRUE, int actual = -1 )
: selstart( selStart ), selend( selEnd ), act( actual ), sep( separat )
{}
int selectionStart() const { return selstart; }
@@ -292,7 +296,7 @@ public:
int width() const { return selend - selstart; }
int index() const { return act; }
bool separator() const { return sep; }
- Q_DUMMY_COMPARISON_OPERATOR( QNumberSection )
+ TQ_DUMMY_COMPARISON_OPERATOR( TQNumberSection )
private:
int selstart :12;
int selend :12;
@@ -302,11 +306,12 @@ private:
class ExtDateTimeEditorPrivate;
-class ExtDateTimeEditor : public QWidget
+class ExtDateTimeEditor : public TQWidget
{
Q_OBJECT
+ TQ_OBJECT
public:
- ExtDateTimeEditor( ExtDateTimeEditBase * parent=0,
+ ExtDateTimeEditor( ExtDateTimeEditBase * tqparent=0,
const char * name=0 );
~ExtDateTimeEditor();
@@ -318,7 +323,7 @@ public:
int focusSection() const;
bool setFocusSection( int s );
- void appendSection( const QNumberSection& sec );
+ void appendSection( const TQNumberSection& sec );
void clearSections();
void setSectionSelection( int sec, int selstart, int selend );
bool eventFilter( TQObject *o, TQEvent *e );
@@ -337,5 +342,34 @@ private:
ExtDateTimeEditorPrivate* d;
};
+class ExtDateTimeSpinWidget : public TQSpinWidget
+{
+ Q_OBJECT
+ TQ_OBJECT
+public:
+ ExtDateTimeSpinWidget( TQWidget *tqparent, const char *name )
+ : TQSpinWidget( tqparent, name )
+ {
+ }
+
+protected:
+#ifndef TQT_NO_WHEELEVENT
+ void wheelEvent( TQWheelEvent *e )
+ {
+ ExtDateTimeEditor *editor = (ExtDateTimeEditor*)editWidget()->qt_cast( "ExtDateTimeEditor" );
+ Q_ASSERT( editor );
+ if ( !editor )
+ return;
+
+ int section = editor->sectionAt( e->pos() );
+ editor->setFocusSection( section );
+
+ if ( section == -1 )
+ return;
+ TQSpinWidget::wheelEvent( e );
+ }
+#endif
+};
+
#endif
#endif
diff --git a/libkdeedu/extdate/extdatewidget.cpp b/libkdeedu/extdate/extdatewidget.cpp
index 5f5d19d6..f787293f 100644
--- a/libkdeedu/extdate/extdatewidget.cpp
+++ b/libkdeedu/extdate/extdatewidget.cpp
@@ -30,13 +30,13 @@
#include "extdatewidget.h"
#include "extcalendarsystemgregorian.h"
-class ExtDateWidgetSpinBox : public QSpinBox
+class ExtDateWidgetSpinBox : public TQSpinBox
{
public:
- ExtDateWidgetSpinBox(int min, int max, TQWidget *parent)
- : TQSpinBox(min, max, 1, parent)
+ ExtDateWidgetSpinBox(int min, int max, TQWidget *tqparent)
+ : TQSpinBox(min, max, 1, tqparent)
{
- editor()->setAlignment(AlignRight);
+ editor()->tqsetAlignment(AlignRight);
}
};
@@ -53,16 +53,16 @@ public:
};
-ExtDateWidget::ExtDateWidget( TQWidget *parent, const char *name )
- : TQWidget( parent, name )
+ExtDateWidget::ExtDateWidget( TQWidget *tqparent, const char *name )
+ : TQWidget( tqparent, name )
{
- init(ExtDate::currentDate());
+ init(ExtDate::tqcurrentDate());
setDate(ExtDate());
}
-ExtDateWidget::ExtDateWidget( const ExtDate &date, TQWidget *parent,
+ExtDateWidget::ExtDateWidget( const ExtDate &date, TQWidget *tqparent,
const char *name )
- : TQWidget( parent, name )
+ : TQWidget( tqparent, name )
{
init(date);
setDate(date);
@@ -74,8 +74,8 @@ ExtDateWidget::ExtDateWidget( const ExtDate &date, TQWidget *parent,
// {
// d = new ExtDateWidgetPrivate;
// KLocale *locale = KGlobal::locale();
-// TQHBoxLayout *layout = new TQHBoxLayout(this, 0, KDialog::spacingHint());
-// layout->setAutoAdd(true);
+// TQHBoxLayout *tqlayout = new TQHBoxLayout(this, 0, KDialog::spacingHint());
+// tqlayout->setAutoAdd(true);
// d->m_day = new ExtDateWidgetSpinBox(1, 1, this);
// d->m_month = new TQComboBox(false, this);
// for (int i = 1; ; ++i)
@@ -98,8 +98,8 @@ void ExtDateWidget::init(const ExtDate& date)
{
d = new ExtDateWidgetPrivate;
//KLocale *locale = KGlobal::locale();
- TQHBoxLayout *layout = new TQHBoxLayout(this, 0, KDialog::spacingHint());
- layout->setAutoAdd(true);
+ TQHBoxLayout *tqlayout = new TQHBoxLayout(this, 0, KDialog::spacingHint());
+ tqlayout->setAutoAdd(true);
d->m_day = new ExtDateWidgetSpinBox(1, 1, this);
d->m_month = new TQComboBox(false, this);
for (int i = 1; ; ++i)
@@ -157,15 +157,15 @@ void ExtDateWidget::slotDateChanged( )
int y,m,day;
y = d->m_year->value();
- y = QMIN(QMAX(y, d->calendar->minValidYear()), d->calendar->maxValidYear());
+ y = TQMIN(TQMAX(y, d->calendar->minValidYear()), d->calendar->maxValidYear());
d->calendar->setYMD(date, y, 1, 1);
m = d->m_month->currentItem()+1;
- m = QMIN(QMAX(m,1), d->calendar->monthsInYear(date));
+ m = TQMIN(TQMAX(m,1), d->calendar->monthsInYear(date));
d->calendar->setYMD(date, y, m, 1);
day = d->m_day->value();
- day = QMIN(QMAX(day,1), d->calendar->daysInMonth(date));
+ day = TQMIN(TQMAX(day,1), d->calendar->daysInMonth(date));
d->calendar->setYMD(date, y, m, day);
setDate(date);
diff --git a/libkdeedu/extdate/extdatewidget.h b/libkdeedu/extdate/extdatewidget.h
index f2fd3045..2aa2ee0d 100644
--- a/libkdeedu/extdate/extdatewidget.h
+++ b/libkdeedu/extdate/extdatewidget.h
@@ -32,21 +32,22 @@
* @short A pushbutton to display or allow user selection of a date.
* @version $Id$
*/
-class KDE_EXPORT ExtDateWidget : public QWidget
+class KDE_EXPORT ExtDateWidget : public TQWidget
{
Q_OBJECT
-// Q_PROPERTY( ExtDate date READ date WRITE setDate )
+ TQ_OBJECT
+// TQ_PROPERTY( ExtDate date READ date WRITE setDate )
public:
/**
* Constructs a date selection widget, initialized to the current CPU date.
*/
- ExtDateWidget( TQWidget *parent=0, const char *name=0 );
+ ExtDateWidget( TQWidget *tqparent=0, const char *name=0 );
/**
* Constructs a date selection widget with the initial date set to @p date.
*/
- ExtDateWidget( const ExtDate &date, TQWidget *parent=0, const char *name=0 );
+ ExtDateWidget( const ExtDate &date, TQWidget *tqparent=0, const char *name=0 );
/**
* Destructs the date selection widget.
diff --git a/libkdeedu/extdate/test_extdate.cc b/libkdeedu/extdate/test_extdate.cc
index d63d1558..63b2120b 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): " << ((TQDate::leapYear(a_year)) ? "yes" : "no")
+ std::cout << a_year << " (TQDate|ExtDate): " << ((TQDate::leapYear(a_year)) ? "yes" : "no")
<<"|"<< ((ExtDate::leapYear(a_year)) ? "yes" : "no") << std::endl;
}
@@ -46,7 +46,7 @@ void test1()
void test2_unit(int y, int m, int d)
{
- QDate q(y, m, d);
+ TQDate q(y, m, d);
ExtDate e(y, m, d);
int q_week_number = q.dayOfWeek();
int e_week_number = e.dayOfWeek();
@@ -128,7 +128,7 @@ void test2()
void test3_unit(int y, int m, int d, int dm)
{
- QDate q(y, m, d);
+ TQDate q(y, m, d);
ExtDate e(y, m, d);
TQDate q2 = q.addMonths(dm);
ExtDate e2 = e.addMonths(dm);
@@ -157,9 +157,9 @@ void test3()
}
void test4_unit(int y, int m, int d, int dy)
{
- QDate q(y, m, d);
+ TQDate q(y, m, d);
ExtDate e(y, m, d);
- QDate q2 = q.addYears(dy);
+ TQDate q2 = q.addYears(dy);
ExtDate e2 = e.addYears(dy);
std::cout << e.toString("%d.%m.%Y").local8Bit() << " + " << dy << " years :: ExtDate : "
<< e2.toString().local8Bit() << " TQDate : "
@@ -225,7 +225,7 @@ void test5()
uint i;
std::cout << "Date.toString(\"...\")" << std::endl;
- std::cout << "Ext Format : ExtDate :: Q Format : QDate\n" << std::endl;
+ std::cout << "Ext Format : ExtDate :: Q Format : TQDate\n" << std::endl;
for (i = 0 ; i < sizeof(q_set_of_formats)/sizeof(q_set_of_formats[0]) ; i++)
{
@@ -277,16 +277,16 @@ void test6()
void test7()
{
std::cout << "Express the current date:\n" << std::endl;
- TQDate q = TQDate::currentDate(Qt::LocalTime);
- ExtDate e = ExtDate::currentDate(Qt::TimeSpec(Qt::LocalTime));
- std::cout << "Qt::LocalTime :: ExtDate : " << e.toString().local8Bit() << " TQDate : "
+ TQDate q = TQDate::tqcurrentDate(TQt::LocalTime);
+ ExtDate e = ExtDate::tqcurrentDate(TQt::TimeSpec(TQt::LocalTime));
+ std::cout << "TQt::LocalTime :: ExtDate : " << e.toString().local8Bit() << " TQDate : "
<< q.toString().local8Bit() << std::endl;
- q = TQDate::currentDate(Qt::UTC);
- e = ExtDate::currentDate(Qt::UTC);
- std::cout << "Qt::UTC :: ExtDate : " << e.toString().local8Bit() << " TQDate : "
+ q = TQDate::tqcurrentDate(TQt::UTC);
+ e = ExtDate::tqcurrentDate(TQt::UTC);
+ std::cout << "TQt::UTC :: ExtDate : " << e.toString().local8Bit() << " TQDate : "
<< q.toString().local8Bit() << std::endl;
- q = TQDate::currentDate();
- e = ExtDate::currentDate();
+ q = TQDate::tqcurrentDate();
+ e = ExtDate::tqcurrentDate();
std::cout << "<default> :: ExtDate : " << e.toString().local8Bit() << " TQDate : "
<< q.toString().local8Bit() << std::endl;
std::cout << "--------------------" << std::endl;
@@ -311,8 +311,8 @@ void test8() {
void test9() {
std::cout << "TQDateTime : ExtDateTime: \n" << std::endl;
- TQDateTime q = TQDateTime::currentDateTime();
- ExtDateTime e = ExtDateTime::currentDateTime();
+ TQDateTime q = TQDateTime::tqcurrentDateTime();
+ ExtDateTime e = ExtDateTime::tqcurrentDateTime();
std::cout << q.toString().local8Bit() << " : " << e.toString().local8Bit() << std::endl;
std::cout << "--------------------" << std::endl;
diff --git a/libkdeedu/extdate/testwidget.cpp b/libkdeedu/extdate/testwidget.cpp
index 0267ddeb..a6489cce 100644
--- a/libkdeedu/extdate/testwidget.cpp
+++ b/libkdeedu/extdate/testwidget.cpp
@@ -39,8 +39,8 @@ TestWidget::TestWidget( TQWidget *p=0, const char *name=0 ) : KMainWindow( p, na
edpEdit = new KLineEdit(w);
edpEdit->setReadOnly( TRUE );
- kdw = new KDateWidget( TQDate::currentDate(), w );
- edw = new ExtDateWidget( ExtDate::currentDate(), w );
+ kdw = new KDateWidget( TQDate::tqcurrentDate(), w );
+ edw = new ExtDateWidget( ExtDate::tqcurrentDate(), w );
glay->addWidget( kdpLabel, 0, 0 );
glay->addWidget( edpLabel, 0, 1 );
diff --git a/libkdeedu/extdate/testwidget.h b/libkdeedu/extdate/testwidget.h
index ed6fb70b..283cb3d4 100644
--- a/libkdeedu/extdate/testwidget.h
+++ b/libkdeedu/extdate/testwidget.h
@@ -31,8 +31,9 @@ class ExtDate;
class TestWidget : public KMainWindow {
Q_OBJECT
+ TQ_OBJECT
public:
- TestWidget( TQWidget *parent, const char *name );
+ TestWidget( TQWidget *tqparent, const char *name );
~TestWidget() {}
public slots: