From 0a6e0958c03e41c87b15557b6f407874f20c2f8d Mon Sep 17 00:00:00 2001 From: tpearson Date: Sat, 31 Jul 2010 19:39:55 +0000 Subject: Trinity Qt initial conversion git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdeedu@1157642 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- kstars/kstars/timebox.cpp | 44 ++++++++++++++++++++++---------------------- 1 file changed, 22 insertions(+), 22 deletions(-) (limited to 'kstars/kstars/timebox.cpp') diff --git a/kstars/kstars/timebox.cpp b/kstars/kstars/timebox.cpp index 9aa513a3..5040cf1f 100644 --- a/kstars/kstars/timebox.cpp +++ b/kstars/kstars/timebox.cpp @@ -17,14 +17,14 @@ #include "timebox.h" #include "libkdeedu/extdate/extdatetime.h" -#include //needed for QTime -#include +#include //needed for QTime +#include #include #include #include #include -timeBox::timeBox(QWidget *parent, const char *name, bool tt) : QLineEdit(parent,name) +timeBox::timeBox(TQWidget *parent, const char *name, bool tt) : TQLineEdit(parent,name) { if (tt) { @@ -39,7 +39,7 @@ timeBox::timeBox(QWidget *parent, const char *name, bool tt) : QLineEdit(parent, timet = tt; } -void timeBox::showTime (QTime t) +void timeBox::showTime (TQTime t) { setEntry( t.toString("hh:mm:ss") ); } @@ -50,26 +50,26 @@ void timeBox::showDate (ExtDate t) } -QTime timeBox::createTime ( bool *ok ) +TQTime timeBox::createTime ( bool *ok ) { -// QString entry; +// TQString entry; int h = 0, m = 0, is = 0; double s = 0.0; - QTime qt; + TQTime qt; bool valueFound = false, badEntry = false , checkValue = false; //Initialize bool for result if ( ok != NULL ) *ok = false; -// QString errMsg = i18n( "Unable to parse %1 entry. Specify a %1 value as a simple integer, a floating-point number, or a triplet of values using colons or spaces as separators." ); +// TQString errMsg = i18n( "Unable to parse %1 entry. Specify a %1 value as a simple integer, a floating-point number, or a triplet of values using colons or spaces as separators." ); - QString entry = text().stripWhiteSpace(); + TQString entry = text().stripWhiteSpace(); //Try simplest cases: integer or double representation h = entry.toInt( &checkValue ); if ( checkValue ) { - qt = QTime( h, 0, 0 ); + qt = TQTime( h, 0, 0 ); valueFound = true; if ( ok != NULL ) *ok = true; return qt; @@ -77,7 +77,7 @@ QTime timeBox::createTime ( bool *ok ) double x = entry.toDouble( &checkValue ); if ( checkValue ) { int seconds = int(x * 3600); - QTime qt(0,0,0); + TQTime qt(0,0,0); qt.addSecs(seconds); valueFound = true; if ( ok != NULL ) *ok = true; @@ -88,12 +88,12 @@ QTime timeBox::createTime ( bool *ok ) //no success yet...try assuming multiple fields if ( !valueFound ) { - QStringList fields; + TQStringList fields; //check for colon-delimiters or space-delimiters if ( entry.contains(':') ) - fields = QStringList::split( ':', entry ); - else fields = QStringList::split( " ", entry ); + fields = TQStringList::split( ':', entry ); + else fields = TQStringList::split( " ", entry ); // If two fields we will add a third one, and then parse with // the 3-field code block. If field[1] is a double, convert @@ -102,10 +102,10 @@ QTime timeBox::createTime ( bool *ok ) if ( fields.count() == 2 ) { double mx = fields[1].toDouble( &checkValue ); if ( checkValue ) { - fields[1] = QString("%1").arg( int(mx) ); - fields.append( QString("%1").arg( int( 60.0*(mx - int(mx)) ) ) ); + fields[1] = TQString("%1").arg( int(mx) ); + fields.append( TQString("%1").arg( int( 60.0*(mx - int(mx)) ) ) ); } else { - fields.append( QString( "0" ) ); + fields.append( TQString( "0" ) ); } } @@ -113,9 +113,9 @@ QTime timeBox::createTime ( bool *ok ) // ignore all after 3rd field if ( fields.count() >= 3 ) { - fields[0].replace( QRegExp("h"), "" ); - fields[1].replace( QRegExp("m"), "" ); - fields[2].replace( QRegExp("s"), "" ); + fields[0].replace( TQRegExp("h"), "" ); + fields[1].replace( TQRegExp("m"), "" ); + fields[2].replace( TQRegExp("s"), "" ); } //See if first two fields parse as integers. // @@ -132,7 +132,7 @@ QTime timeBox::createTime ( bool *ok ) if ( ok != NULL ) *ok = true; - QTime qt(h,m,is); + TQTime qt(h,m,is); return qt; } else { @@ -151,7 +151,7 @@ QTime timeBox::createTime ( bool *ok ) ExtDate timeBox::createDate (bool */*ok*/) { - QString entry = text().stripWhiteSpace(); + TQString entry = text().stripWhiteSpace(); // if entry is an empty string or invalid date use current date -- cgit v1.2.3