summaryrefslogtreecommitdiffstats
path: root/kplato/kptduration.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/kptduration.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/kptduration.h')
-rw-r--r--kplato/kptduration.h42
1 files changed, 21 insertions, 21 deletions
diff --git a/kplato/kptduration.h b/kplato/kptduration.h
index 116d0660..6305528d 100644
--- a/kplato/kptduration.h
+++ b/kplato/kptduration.h
@@ -21,8 +21,8 @@
#ifndef KPTDURATION_H
#define KPTDURATION_H
-#include <qglobal.h>
-#include <qstring.h>
+#include <tqglobal.h>
+#include <tqstring.h>
namespace KPlato
{
@@ -44,54 +44,54 @@ class Duration {
Duration();
Duration(const Duration &d);
Duration(unsigned d, unsigned h, unsigned m, unsigned s=0, unsigned ms=0);
- Duration(Q_INT64 seconds);
+ Duration(TQ_INT64 seconds);
~Duration();
/**
* Adds @param delta to *this. If @param delta > *this, *this is set to zeroDuration.
*/
- void addMilliseconds(Q_INT64 delta) { add(delta); }
+ void addMilliseconds(TQ_INT64 delta) { add(delta); }
/**
* Adds @param delta to *this. If @param delta > *this, *this is set to zeroDuration.
*/
- void addSeconds(Q_INT64 delta) { addMilliseconds(delta * 1000); }
+ void addSeconds(TQ_INT64 delta) { addMilliseconds(delta * 1000); }
/**
* Adds @param delta to *this. If @param delta > *this, *this is set to zeroDuration.
*/
- void addMinutes(Q_INT64 delta) { addSeconds(delta * 60); }
+ void addMinutes(TQ_INT64 delta) { addSeconds(delta * 60); }
/**
* Adds @param delta to *this. If @param delta > *this, *this is set to zeroDuration.
*/
- void addHours(Q_INT64 delta) { addMinutes(delta * 60); }
+ void addHours(TQ_INT64 delta) { addMinutes(delta * 60); }
/**
* Adds @param delta to *this. If @param delta > *this, *this is set to zeroDuration.
*/
- void addDays(Q_INT64 delta) { addHours(delta * 24); }
+ void addDays(TQ_INT64 delta) { addHours(delta * 24); }
//FIXME: overflow problem
- Q_INT64 milliseconds() const { return m_ms; }
- Q_INT64 seconds() const { return m_ms / 1000; }
- Q_INT64 minutes() const { return seconds() / 60; }
+ TQ_INT64 milliseconds() const { return m_ms; }
+ TQ_INT64 seconds() const { return m_ms / 1000; }
+ TQ_INT64 minutes() const { return seconds() / 60; }
unsigned hours() const { return minutes() / 60; }
unsigned days() const { return hours() / 24; }
void get(unsigned *days, unsigned *hours, unsigned *minutes, unsigned *seconds=0, unsigned *milliseconds=0) const;
bool operator==( const Duration &d ) const { return m_ms == d.m_ms; }
- bool operator==( Q_INT64 d ) const { return m_ms == d; }
+ bool operator==( TQ_INT64 d ) const { return m_ms == d; }
bool operator!=( const Duration &d ) const { return m_ms != d.m_ms; }
- bool operator!=( Q_INT64 d ) const { return m_ms != d; }
+ bool operator!=( TQ_INT64 d ) const { return m_ms != d; }
bool operator<( const Duration &d ) const { return m_ms < d.m_ms; }
- bool operator<( Q_INT64 d ) const { return m_ms < d; }
+ bool operator<( TQ_INT64 d ) const { return m_ms < d; }
bool operator<=( const Duration &d ) const { return m_ms <= d.m_ms; }
- bool operator<=( Q_INT64 d ) const { return m_ms <= d; }
+ bool operator<=( TQ_INT64 d ) const { return m_ms <= d; }
bool operator>( const Duration &d ) const { return m_ms > d.m_ms; }
- bool operator>( Q_INT64 d ) const { return m_ms > d; }
+ bool operator>( TQ_INT64 d ) const { return m_ms > d; }
bool operator>=( const Duration &d ) const { return m_ms >= d.m_ms; }
- bool operator>=( Q_INT64 d ) const { return m_ms >= d; }
+ bool operator>=( TQ_INT64 d ) const { return m_ms >= d; }
Duration &operator=(const Duration &d ) { m_ms = d.m_ms; return *this;}
Duration operator*(int unit) const;
Duration operator*(const double value) const;
@@ -106,8 +106,8 @@ class Duration {
{Duration dur(*this); dur.subtract(d); return dur; }
Duration &operator-=(const Duration &d) {subtract(d); return *this; }
- QString toString(Format format = Format_DayTime) const;
- static Duration fromString(const QString &s, Format format = Format_DayTime, bool *ok=0);
+ TQString toString(Format format = Format_DayTime) const;
+ static Duration fromString(const TQString &s, Format format = Format_DayTime, bool *ok=0);
//NOTE: These must match fieldnumbers in duration widget!
enum Unit { Unit_d, Unit_h, Unit_m, Unit_s, Unit_ms };
@@ -130,9 +130,9 @@ class Duration {
* Duration in milliseconds. Signed to allow for simple calculations which
* might go negative for intermediate results.
*/
- Q_INT64 m_ms;
+ TQ_INT64 m_ms;
- void add(Q_INT64 delta);
+ void add(TQ_INT64 delta);
void add(const Duration &delta);
/**