summaryrefslogtreecommitdiffstats
path: root/kplato/kptdurationwidget.ui.h
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-06-25 05:28:35 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-06-25 05:28:35 +0000
commitf008adb5a77e094eaf6abf3fc0f36958e66896a5 (patch)
tree8e9244c4d4957c36be81e15b566b4aa5ea26c982 /kplato/kptdurationwidget.ui.h
parent1210f27b660efb7b37ff43ec68763e85a403471f (diff)
downloadkoffice-f008adb5a77e094eaf6abf3fc0f36958e66896a5.tar.gz
koffice-f008adb5a77e094eaf6abf3fc0f36958e66896a5.zip
TQt4 port koffice
This should enable compilation under both Qt3 and Qt4; fixes for any missed components will be forthcoming git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/koffice@1238284 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kplato/kptdurationwidget.ui.h')
-rw-r--r--kplato/kptdurationwidget.ui.h94
1 files changed, 47 insertions, 47 deletions
diff --git a/kplato/kptdurationwidget.ui.h b/kplato/kptdurationwidget.ui.h
index 87b63c20..2bf5b033 100644
--- a/kplato/kptdurationwidget.ui.h
+++ b/kplato/kptdurationwidget.ui.h
@@ -2,7 +2,7 @@
// ui.h extension file, included from the uic-generated form implementation.
//
// If you wish to add, delete or rename functions or slots use
-// Qt Designer which will update this file, preserving your code. Create an
+// TQt Designer which will update this file, preserving your code. Create an
// init() function in place of a constructor, and a destroy() function in
// place of a destructor.
//
@@ -41,26 +41,26 @@ namespace KPlato
struct FieldDescriptor
{
// Which field is to my left, and what conversion factor separates us?
- QLineEdit *left;
+ TQLineEdit *left;
double leftScale;
// Which field am I, and how am I formatted?
- QLineEdit *current;
+ TQLineEdit *current;
const char *format;
// Which field is to my right, and what conversion factor separates us?
- QLineEdit *right;
+ TQLineEdit *right;
double rightScale;
// If I am hidden, who else hides with me?
- QLabel *separator;
+ TQLabel *separator;
// Used for calculating a correct duration
double fullScale;
double scale;
// Used for displaying a unit behind each field
- QLabel *unit;
+ TQLabel *unit;
};
#define setField(f, l, ls, c, fmt, r, rs, s, fs, sc, u) \
@@ -100,10 +100,10 @@ void DurationWidget::init()
// - any overflow from the integer part is carried left one field
//
// and the process repeated until the rightmost and leftmost fields are reached.
- QRegExp re(QString("\\d{1,10}|\\d{1,7}\\") + m_decimalPoint +
- QString("\\d{0,10}|\\d{0,7}\\") + m_decimalPoint +
- QString("\\d{1,3}"));
- m_validator = new QRegExpValidator(re, this);
+ TQRegExp re(TQString("\\d{1,10}|\\d{1,7}\\") + m_decimalPoint +
+ TQString("\\d{0,10}|\\d{0,7}\\") + m_decimalPoint +
+ TQString("\\d{1,3}"));
+ m_validator = new TQRegExpValidator(re, TQT_TQOBJECT(this));
m_ddd->setValidator(m_validator);
m_hh->setValidator(m_validator);
m_mm->setValidator(m_validator);
@@ -127,67 +127,67 @@ void DurationWidget::init()
void DurationWidget::destroy()
{
delete m_fields;
- //delete m_validator; //QWidget takes care of this
+ //delete m_validator; //TQWidget takes care of this
}
-Q_INT64 DurationWidget::setValueMilliseconds(Q_INT64 milliseconds)
+TQ_INT64 DurationWidget::setValueMilliseconds(TQ_INT64 milliseconds)
{
unsigned sc = (unsigned)m_fields[4].leftScale;
- Q_INT64 secs = milliseconds / sc;
- Q_INT64 ms = milliseconds % sc;
- QString tmp;
+ TQ_INT64 secs = milliseconds / sc;
+ TQ_INT64 ms = milliseconds % sc;
+ TQString tmp;
tmp.sprintf(m_fields[4].format, ms);
m_fields[4].current->setText(tmp);
return secs;
}
-Q_INT64 DurationWidget::setValueSeconds(Q_INT64 seconds)
+TQ_INT64 DurationWidget::setValueSeconds(TQ_INT64 seconds)
{
unsigned sc = (unsigned)m_fields[3].leftScale;
- Q_INT64 mins = seconds / sc;
- Q_INT64 s = seconds % sc;
- QString tmp;
+ TQ_INT64 mins = seconds / sc;
+ TQ_INT64 s = seconds % sc;
+ TQString tmp;
tmp.sprintf(m_fields[3].format, s);
m_fields[3].current->setText(tmp);
return mins;
}
-Q_INT64 DurationWidget::setValueMinutes(Q_INT64 mins)
+TQ_INT64 DurationWidget::setValueMinutes(TQ_INT64 mins)
{
unsigned sc = (unsigned)m_fields[2].leftScale;
- Q_INT64 hours = mins / sc;
- Q_INT64 m = mins % sc;
- QString tmp;
+ TQ_INT64 hours = mins / sc;
+ TQ_INT64 m = mins % sc;
+ TQString tmp;
tmp.sprintf(m_fields[2].format, m);
m_fields[2].current->setText(tmp);
return hours;
}
// NOTE: Input is minutes and also returns minutes!
-Q_INT64 DurationWidget::setValueHours(Q_INT64 mins)
+TQ_INT64 DurationWidget::setValueHours(TQ_INT64 mins)
{
if (m_fields[1].current->isHidden())
return mins;
unsigned sc = (unsigned)m_fields[1].rightScale;
- Q_INT64 hours = (Q_INT64)(mins / sc);
- Q_INT64 m = mins - (Q_INT64)(hours * sc);
+ TQ_INT64 hours = (TQ_INT64)(mins / sc);
+ TQ_INT64 m = mins - (TQ_INT64)(hours * sc);
//kdDebug()<<k_funcinfo<<"mins="<<mins<<" -> hours="<<hours<<" rem="<<m<<endl;
- QString tmp;
+ TQString tmp;
tmp.sprintf(m_fields[1].format, hours);
m_fields[1].current->setText(tmp);
return m;
}
// NOTE: Input is minutes and also returns minutes!
-Q_INT64 DurationWidget::setValueDays(Q_INT64 mins)
+TQ_INT64 DurationWidget::setValueDays(TQ_INT64 mins)
{
if (m_fields[0].current->isHidden())
return mins;
double sc = m_fields[1].rightScale * m_fields[0].rightScale;
- Q_INT64 days = (Q_INT64)(mins / sc);
- Q_INT64 m = mins - (Q_INT64)(days * sc);
+ TQ_INT64 days = (TQ_INT64)(mins / sc);
+ TQ_INT64 m = mins - (TQ_INT64)(days * sc);
//kdDebug()<<k_funcinfo<<"mins="<<mins<<" -> days="<<days<<" rem="<<m<<endl;
- QString tmp;
+ TQString tmp;
tmp.sprintf(m_fields[0].format, days);
m_fields[0].current->setText(tmp);
return m;
@@ -195,7 +195,7 @@ Q_INT64 DurationWidget::setValueDays(Q_INT64 mins)
void DurationWidget::setValue(const KPlato::Duration &newDuration)
{
- Q_INT64 value = newDuration.milliseconds();
+ TQ_INT64 value = newDuration.milliseconds();
//kdDebug()<<k_funcinfo<<f<<": value="<<value<<endl;
value = setValueMilliseconds(value); // returns seconds
value = setValueSeconds(value); // returns minutes
@@ -218,7 +218,7 @@ Duration DurationWidget::value() const
{
double v = m_fields[i].current->text().toDouble();
v = v * m_fields[i].scale / m_fields[i].fullScale;;
- d.addMilliseconds((Q_INT64)(v*(1000*60*60*24)));
+ d.addMilliseconds((TQ_INT64)(v*(1000*60*60*24)));
}
++i;
if (!m_fields[i].current->isHidden() &&
@@ -227,7 +227,7 @@ Duration DurationWidget::value() const
{
double v = m_fields[i].current->text().toDouble();
v = v * m_fields[i].scale / m_fields[i].fullScale;;
- d.addMilliseconds((Q_INT64)(v*(1000*60*60)));
+ d.addMilliseconds((TQ_INT64)(v*(1000*60*60)));
}
++i;
if (!m_fields[i].current->isHidden() &&
@@ -236,7 +236,7 @@ Duration DurationWidget::value() const
{
double v = m_fields[i].current->text().toDouble();
v = v * m_fields[i].scale / m_fields[i].fullScale;;
- d.addMilliseconds((Q_INT64)(v*(1000*60)));
+ d.addMilliseconds((TQ_INT64)(v*(1000*60)));
}
++i;
if (!m_fields[i].current->isHidden() &&
@@ -245,12 +245,12 @@ Duration DurationWidget::value() const
{
double v = m_fields[i].current->text().toDouble();
v = v * m_fields[i].scale / m_fields[i].fullScale;;
- d.addMilliseconds((Q_INT64)(v*(1000)));
+ d.addMilliseconds((TQ_INT64)(v*(1000)));
}
++i;
if (!m_fields[i].current->isHidden())
{
- Q_INT64 v = m_fields[i].current->text().toUInt();
+ TQ_INT64 v = m_fields[i].current->text().toUInt();
d.addMilliseconds(v);
}
return d;
@@ -290,12 +290,12 @@ void DurationWidget::handleLostFocus(
int field)
{
// Get our own info, and that of our left and right neighbours.
- QLineEdit *left = m_fields[field].left;
+ TQLineEdit *left = m_fields[field].left;
double leftScale = m_fields[field].leftScale;
const char *leftFormat = left ? m_fields[field - 1].format : NULL;
- QLineEdit *current = m_fields[field].current;
+ TQLineEdit *current = m_fields[field].current;
const char *currentFormat = m_fields[field].format;
- QLineEdit *right = m_fields[field].right;
+ TQLineEdit *right = m_fields[field].right;
double rightScale = m_fields[field].rightScale;
const char *rightFormat = right ? m_fields[field + 1].format : NULL;
@@ -304,10 +304,10 @@ void DurationWidget::handleLostFocus(
leftScale = 1;
// Get the text and start processing...
- QString newValue(current->text());
+ TQString newValue(current->text());
double v = KGlobal::locale()->readNumber(newValue);
unsigned currentValue = 0;
- QString tmp;
+ TQString tmp;
//kdDebug()<<k_funcinfo<<field<<": value="<<v<<" v="<<v<<endl;
if (left && v >= leftScale)
{
@@ -321,7 +321,7 @@ void DurationWidget::handleLostFocus(
v = v - (tmp.toUInt() * leftScale);
newValue = KGlobal::locale()->formatNumber(v);
}
- int point = newValue.find(m_decimalPoint);
+ int point = newValue.tqfind(m_decimalPoint);
if (point != -1)
{
//HACK doubles may be rounded(at fractions > 6 digits on my system)
@@ -419,7 +419,7 @@ void DurationWidget::setFieldScale(int f, double scale)
m_fields[f].scale = scale;
}
-void DurationWidget::setFieldUnit(int f, QString unit)
+void DurationWidget::setFieldUnit(int f, TQString unit)
{
if (m_fields[f].unit)
{
@@ -436,12 +436,12 @@ double DurationWidget::power(double m, int e) {
return value;
}
-double DurationWidget::fraction(QString number, int *exp) {
- int point = number.find(m_decimalPoint);
+double DurationWidget::fraction(TQString number, int *exp) {
+ int point = number.tqfind(m_decimalPoint);
if (point == -1) {
return 0.0;
}
- QString v;
+ TQString v;
if (exp) {
v = number.mid(point+m_decimalPoint.length());
*exp = v.length();