summaryrefslogtreecommitdiffstats
path: root/libkdepim/ktimeedit.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'libkdepim/ktimeedit.cpp')
-rw-r--r--libkdepim/ktimeedit.cpp84
1 files changed, 42 insertions, 42 deletions
diff --git a/libkdepim/ktimeedit.cpp b/libkdepim/ktimeedit.cpp
index e9758110b..15d318418 100644
--- a/libkdepim/ktimeedit.cpp
+++ b/libkdepim/ktimeedit.cpp
@@ -24,10 +24,10 @@
without including the source code for Qt in the source distribution.
*/
-#include <qkeycode.h>
-#include <qcombobox.h>
-#include <qdatetime.h>
-#include <qlineedit.h>
+#include <tqkeycode.h>
+#include <tqcombobox.h>
+#include <tqdatetime.h>
+#include <tqlineedit.h>
#include <kmessagebox.h>
#include <kglobal.h>
@@ -35,7 +35,7 @@
#include <klocale.h>
#include "ktimeedit.h"
-#include <qvalidator.h>
+#include <tqvalidator.h>
#include "ktimeedit.moc"
// Validator for a time value with only hours and minutes (no seconds)
@@ -43,9 +43,9 @@
class KOTimeValidator : public QValidator
{
public:
- KOTimeValidator(QWidget* parent, const char* name=0) : QValidator(parent, name) {}
+ KOTimeValidator(TQWidget* parent, const char* name=0) : TQValidator(parent, name) {}
- virtual State validate(QString& str, int& /*cursorPos*/) const
+ virtual State validate(TQString& str, int& /*cursorPos*/) const
{
int length = str.length();
// empty string is intermediate so one can clear the edit line and start from scratch
@@ -53,7 +53,7 @@ public:
return Intermediate;
bool ok = false;
- /*QTime time =*/ KGlobal::locale()->readTime(str, KLocale::WithoutSeconds, &ok);
+ /*TQTime time =*/ KGlobal::locale()->readTime(str, KLocale::WithoutSeconds, &ok);
if ( ok )
return Acceptable;
// kdDebug(5300)<<"Time "<<str<<" not directly acceptable, trying military format "<<endl;
@@ -69,19 +69,19 @@ public:
// readTime doesn't help knowing when the string is "Intermediate".
// HACK. Not fully locale aware etc. (esp. the separator is '.' in sv_SE...)
- QChar sep = ':';
+ TQChar sep = ':';
// I want to allow "HH:", ":MM" and ":" to make editing easier
if ( str[0] == sep )
{
if ( length == 1 ) // just ":"
return Intermediate;
- QString minutes = str.mid(1);
+ TQString minutes = str.mid(1);
int m = minutes.toInt(&ok);
if ( ok && m >= 0 && m < 60 )
return Intermediate;
} else if ( str[str.length()-1] == sep )
{
- QString hours = str.left(length-1);
+ TQString hours = str.left(length-1);
int h = hours.toInt(&ok);
if ( ok && h >= 0 && h < 24 )
return Intermediate;
@@ -89,14 +89,14 @@ public:
// return Invalid;
return Intermediate;
}
- virtual void fixup ( QString & input ) const {
+ virtual void fixup ( TQString & input ) const {
bool ok = false;
KGlobal::locale()->readTime( input, KLocale::WithoutSeconds, &ok );
if ( !ok ) {
// Also try to accept times in "military format", i.e. no delimiter, like 1200
int tm = input.toInt( &ok );
if ( ( 0 <= tm ) && ( tm < 2400 ) && ( tm%100 < 60 ) && ok ) {
- input = KGlobal::locale()->formatTime( QTime( tm / 100, tm % 100, 0 ) );
+ input = KGlobal::locale()->formatTime( TQTime( tm / 100, tm % 100, 0 ) );
}
}
}
@@ -104,9 +104,9 @@ public:
// KTimeWidget/QTimeEdit provide nicer editing, but don't provide a combobox.
// Difficult to get all in one...
-// But Qt-3.2 will offer QLineEdit::setMask, so a "99:99" mask would help.
-KTimeEdit::KTimeEdit( QWidget *parent, QTime qt, const char *name )
- : QComboBox( true, parent, name )
+// But Qt-3.2 will offer TQLineEdit::setMask, so a "99:99" mask would help.
+KTimeEdit::KTimeEdit( TQWidget *parent, TQTime qt, const char *name )
+ : TQComboBox( true, parent, name )
{
setInsertionPolicy( NoInsertion );
setValidator( new KOTimeValidator( this ) );
@@ -117,20 +117,20 @@ KTimeEdit::KTimeEdit( QWidget *parent, QTime qt, const char *name )
// insertItem( mNoTimeString );
// Fill combo box with selection of times in localized format.
- QTime timeEntry(0,0,0);
+ TQTime timeEntry(0,0,0);
do {
insertItem(KGlobal::locale()->formatTime(timeEntry));
timeEntry = timeEntry.addSecs(60*15);
} while (!timeEntry.isNull());
// Add end of day.
- insertItem( KGlobal::locale()->formatTime( QTime( 23, 59, 59 ) ) );
+ insertItem( KGlobal::locale()->formatTime( TQTime( 23, 59, 59 ) ) );
updateText();
- setFocusPolicy(QWidget::StrongFocus);
+ setFocusPolicy(TQWidget::StrongFocus);
- connect(this, SIGNAL(activated(int)), this, SLOT(active(int)));
- connect(this, SIGNAL(highlighted(int)), this, SLOT(hilit(int)));
- connect(this, SIGNAL(textChanged(const QString&)),this,SLOT(changedText()));
+ connect(this, TQT_SIGNAL(activated(int)), this, TQT_SLOT(active(int)));
+ connect(this, TQT_SIGNAL(highlighted(int)), this, TQT_SLOT(hilit(int)));
+ connect(this, TQT_SIGNAL(textChanged(const TQString&)),this,TQT_SLOT(changedText()));
}
KTimeEdit::~KTimeEdit()
@@ -146,12 +146,12 @@ bool KTimeEdit::hasTime() const
return true; // always
}
-QTime KTimeEdit::getTime() const
+TQTime KTimeEdit::getTime() const
{
//kdDebug(5300) << "KTimeEdit::getTime(), currentText() = " << currentText() << endl;
// TODO use KLocale::WithoutSeconds in HEAD
bool ok = false;
- QTime time = KGlobal::locale()->readTime( currentText(), KLocale::WithoutSeconds, &ok );
+ TQTime time = KGlobal::locale()->readTime( currentText(), KLocale::WithoutSeconds, &ok );
if ( !ok ) {
// Also try to accept times in "military format", i.e. no delimiter, like 1200
int tm = currentText().toInt( &ok );
@@ -165,16 +165,16 @@ QTime KTimeEdit::getTime() const
return time;
}
-QSizePolicy KTimeEdit::sizePolicy() const
+TQSizePolicy KTimeEdit::sizePolicy() const
{
// Set size policy to Fixed, because edit cannot contain more text than the
// string representing the time. It doesn't make sense to provide more space.
- QSizePolicy sizePolicy(QSizePolicy::Fixed,QSizePolicy::Fixed);
+ TQSizePolicy sizePolicy(TQSizePolicy::Fixed,TQSizePolicy::Fixed);
return sizePolicy;
}
-void KTimeEdit::setTime(QTime newTime)
+void KTimeEdit::setTime(TQTime newTime)
{
if ( mTime != newTime )
{
@@ -189,9 +189,9 @@ void KTimeEdit::active(int i)
{
// The last entry, 23:59, is a special case
if( i == count() - 1 )
- mTime = QTime( 23, 59, 0 );
+ mTime = TQTime( 23, 59, 0 );
else
- mTime = QTime(0,0,0).addSecs(i*15*60);
+ mTime = TQTime(0,0,0).addSecs(i*15*60);
emit timeChanged(mTime);
}
@@ -200,7 +200,7 @@ void KTimeEdit::hilit(int )
// we don't currently need to do anything here.
}
-void KTimeEdit::addTime(QTime qt)
+void KTimeEdit::addTime(TQTime qt)
{
// Calculate the new time.
mTime = qt.addSecs(mTime.minute()*60+mTime.hour()*3600);
@@ -208,12 +208,12 @@ void KTimeEdit::addTime(QTime qt)
emit timeChanged(mTime);
}
-void KTimeEdit::subTime(QTime qt)
+void KTimeEdit::subTime(TQTime qt)
{
int h, m;
// Note that we cannot use the same method for determining the new
- // time as we did in addTime, because QTime does not handle adding
+ // time as we did in addTime, because TQTime does not handle adding
// negative seconds well at all.
h = mTime.hour()-qt.hour();
m = mTime.minute()-qt.minute();
@@ -233,23 +233,23 @@ void KTimeEdit::subTime(QTime qt)
emit timeChanged(mTime);
}
-void KTimeEdit::keyPressEvent(QKeyEvent *qke)
+void KTimeEdit::keyPressEvent(TQKeyEvent *qke)
{
switch(qke->key()) {
case Key_Down:
- addTime(QTime(0,1,0));
+ addTime(TQTime(0,1,0));
break;
case Key_Up:
- subTime(QTime(0,1,0));
+ subTime(TQTime(0,1,0));
break;
case Key_Prior:
- subTime(QTime(1,0,0));
+ subTime(TQTime(1,0,0));
break;
case Key_Next:
- addTime(QTime(1,0,0));
+ addTime(TQTime(1,0,0));
break;
default:
- QComboBox::keyPressEvent(qke);
+ TQComboBox::keyPressEvent(qke);
break;
} // switch
}
@@ -257,9 +257,9 @@ void KTimeEdit::keyPressEvent(QKeyEvent *qke)
void KTimeEdit::updateText()
{
// kdDebug(5300) << "KTimeEdit::updateText() " << endl;
- QString s = KGlobal::locale()->formatTime(mTime);
+ TQString s = KGlobal::locale()->formatTime(mTime);
// Set the text but without emitting signals, nor losing the cursor position
- QLineEdit *line = lineEdit();
+ TQLineEdit *line = lineEdit();
line->blockSignals(true);
int pos = line->cursorPosition();
@@ -277,8 +277,8 @@ void KTimeEdit::updateText()
bool KTimeEdit::inputIsValid() const
{
int cursorPos = lineEdit()->cursorPosition();
- QString str = currentText();
- return validator()->validate( str, cursorPos ) == QValidator::Acceptable;
+ TQString str = currentText();
+ return validator()->validate( str, cursorPos ) == TQValidator::Acceptable;
}
void KTimeEdit::changedText()