summaryrefslogtreecommitdiffstats
path: root/kodo
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-07-31 19:49:52 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-07-31 19:49:52 +0000
commitcfc42a28c327b96c6a2afee92af3bac1a479eb8a (patch)
treee3219edf5f827eaa4db3feb509a17846a1a5a752 /kodo
parenta73fc4d7e66fe0824313aa4e9a650c4cddef6e9f (diff)
downloadtdetoys-cfc42a28c327b96c6a2afee92af3bac1a479eb8a.tar.gz
tdetoys-cfc42a28c327b96c6a2afee92af3bac1a479eb8a.zip
Trinity Qt initial conversion
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdetoys@1157650 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kodo')
-rw-r--r--kodo/kimagenumber.cpp16
-rw-r--r--kodo/kimagenumber.h12
-rw-r--r--kodo/kodometer.cpp58
-rw-r--r--kodo/kodometer.h20
4 files changed, 53 insertions, 53 deletions
diff --git a/kodo/kimagenumber.cpp b/kodo/kimagenumber.cpp
index 391fb97..b01c4b6 100644
--- a/kodo/kimagenumber.cpp
+++ b/kodo/kimagenumber.cpp
@@ -25,11 +25,11 @@
#include "kimagenumber.h"
-KImageNumber::KImageNumber(const QString& font, QWidget* parent,const char* name) :
- QFrame(parent,name),
+KImageNumber::KImageNumber(const TQString& font, TQWidget* parent,const char* name) :
+ TQFrame(parent,name),
m_value(0)
{
- fontPix = new QPixmap(font);
+ fontPix = new TQPixmap(font);
resize(sizeHint());
}
@@ -38,12 +38,12 @@ KImageNumber::~KImageNumber()
delete fontPix;
}
-void KImageNumber::paintEvent(QPaintEvent*)
+void KImageNumber::paintEvent(TQPaintEvent*)
{
int w = fontPix->width();
int each = w/11;
- QString data;
+ TQString data;
data.sprintf("%06.1f", m_value);
for(unsigned int i=0; i < data.length(); i++) {
@@ -65,15 +65,15 @@ double KImageNumber::value() const
return m_value;
}
-QSize KImageNumber::sizeHint() const
+TQSize KImageNumber::sizeHint() const
{
int w = fontPix->width();
int each = w/11;
- QString data;
+ TQString data;
data.sprintf("%06.1f", m_value);
- return QSize(data.length()*each, fontPix->height());
+ return TQSize(data.length()*each, fontPix->height());
}
#include "kimagenumber.moc"
diff --git a/kodo/kimagenumber.h b/kodo/kimagenumber.h
index 57f96e2..c3ffb8e 100644
--- a/kodo/kimagenumber.h
+++ b/kodo/kimagenumber.h
@@ -26,20 +26,20 @@
#ifndef KIMGNUM_H
#define KIMGNUM_H
-#include <qframe.h>
-#include <qpixmap.h>
+#include <tqframe.h>
+#include <tqpixmap.h>
class KImageNumber : public QFrame
{
Q_OBJECT
Q_PROPERTY( double m_value READ value WRITE setValue )
public:
- KImageNumber(const QString& font, QWidget* parent=0, const char* name=0);
+ KImageNumber(const TQString& font, TQWidget* parent=0, const char* name=0);
virtual ~KImageNumber();
- void paintEvent(QPaintEvent*);
- virtual QSize sizeHint() const;
+ void paintEvent(TQPaintEvent*);
+ virtual TQSize sizeHint() const;
double value() const;
public slots:
@@ -47,7 +47,7 @@ public slots:
protected:
double m_value;
- QPixmap* fontPix;
+ TQPixmap* fontPix;
};
#endif
diff --git a/kodo/kodometer.cpp b/kodo/kodometer.cpp
index aea6f47..e1c2f4d 100644
--- a/kodo/kodometer.cpp
+++ b/kodo/kodometer.cpp
@@ -42,8 +42,8 @@ static struct conversionEntry ConversionTable[MAX_UNIT] = {
* Note that we use installEventFilter on the two KImageNumber's
* to make clicks on them bring up the context-menu.
*/
-Kodometer::Kodometer(QWidget* parent, const char* name)
- : QFrame(parent, name),
+Kodometer::Kodometer(TQWidget* parent, const char* name)
+ : TQFrame(parent, name),
dontRefresh(false),
speed(0.0),
lastDistance(0.0),
@@ -88,18 +88,18 @@ Kodometer::Kodometer(QWidget* parent, const char* name)
menu->insertTitle(kapp->miniIcon(), KGlobal::instance()->aboutData()->programName());
- enabledID = menu->insertItem(i18n("&Enable"), this, SLOT(toggleEnabled()));
+ enabledID = menu->insertItem(i18n("&Enable"), this, TQT_SLOT(toggleEnabled()));
metricID = menu->insertItem(i18n("&Metric Display"), this,
- SLOT(toggleUnits()));
+ TQT_SLOT(toggleUnits()));
autoResetID = menu->insertItem(i18n("Auto &Reset Trip"), this,
- SLOT(toggleAutoReset()));
- menu->insertItem(i18n("Reset &Trip"), this, SLOT(resetTrip()));
- menu->insertItem(i18n("Reset &Odometer"), this, SLOT(resetTotal()));
+ TQT_SLOT(toggleAutoReset()));
+ menu->insertItem(i18n("Reset &Trip"), this, TQT_SLOT(resetTrip()));
+ menu->insertItem(i18n("Reset &Odometer"), this, TQT_SLOT(resetTotal()));
menu->insertSeparator();
menu->insertItem(SmallIconSet("help"), i18n("&Help"), helpMnu);
- menu->insertItem(SmallIconSet("exit"), i18n("&Quit"), this, SLOT(quit()));
+ menu->insertItem(SmallIconSet("exit"), i18n("&Quit"), this, TQT_SLOT(quit()));
menu->setCheckable(true);
menu->setItemChecked(enabledID, Enabled);
@@ -169,10 +169,10 @@ void Kodometer::FindAllScreens(void)
* Here's where we override events to the KImgNum's to display
* the context menu
*/
-bool Kodometer::eventFilter( QObject *, QEvent *e )
+bool Kodometer::eventFilter( TQObject *, TQEvent *e )
{
- if ( e->type() == QEvent::MouseButtonPress ) {
- mousePressEvent((QMouseEvent*)e);
+ if ( e->type() == TQEvent::MouseButtonPress ) {
+ mousePressEvent((TQMouseEvent*)e);
return true;
}
return false;
@@ -181,7 +181,7 @@ bool Kodometer::eventFilter( QObject *, QEvent *e )
/*
* Show the context menu
*/
-void Kodometer::mousePressEvent(QMouseEvent* e)
+void Kodometer::mousePressEvent(TQMouseEvent* e)
{
//FIXME fix this!
//dontRefresh = true;
@@ -193,7 +193,7 @@ void Kodometer::mousePressEvent(QMouseEvent* e)
* compare it to the last known position, and then to calculate
* the distance moved.
*/
-void Kodometer::timerEvent(QTimerEvent* e)
+void Kodometer::timerEvent(TQTimerEvent* e)
{
if (Enabled) {
if(e->timerId() == distanceID) {
@@ -237,17 +237,17 @@ void Kodometer::toggleUnits()
menu->setItemChecked(metricID, UseMetric);
- QToolTip::remove(totalLabel);
- QToolTip::remove(tripLabel);
+ TQToolTip::remove(totalLabel);
+ TQToolTip::remove(tripLabel);
if(!UseMetric) {
- QToolTip::add(totalLabel,
+ TQToolTip::add(totalLabel,
i18n(ConversionTable[distanceUnit].fromUnitTagPlural));
- QToolTip::add(tripLabel,
+ TQToolTip::add(tripLabel,
i18n(ConversionTable[tripDistanceUnit].fromUnitTagPlural));
} else {
- QToolTip::add(totalLabel,
+ TQToolTip::add(totalLabel,
i18n(ConversionTable[distanceUnit].toUnitTagPlural));
- QToolTip::add(tripLabel,
+ TQToolTip::add(tripLabel,
i18n(ConversionTable[tripDistanceUnit].toUnitTagPlural));
}
refresh();
@@ -284,29 +284,29 @@ void Kodometer::refresh(void)
{
if(distanceUnit != lastDUnit) {
lastDUnit = distanceUnit;
- QToolTip::remove(totalLabel);
+ TQToolTip::remove(totalLabel);
if(!UseMetric)
- QToolTip::add(totalLabel,
+ TQToolTip::add(totalLabel,
i18n(ConversionTable[distanceUnit].fromUnitTagPlural));
else
- QToolTip::add(totalLabel,
+ TQToolTip::add(totalLabel,
i18n(ConversionTable[distanceUnit].toUnitTagPlural));
}
if(tripDistanceUnit != lastTUnit) {
lastTUnit = tripDistanceUnit;
- QToolTip::remove(tripLabel);
+ TQToolTip::remove(tripLabel);
if(!UseMetric)
- QToolTip::add(tripLabel,
+ TQToolTip::add(tripLabel,
i18n(ConversionTable[tripDistanceUnit].fromUnitTagPlural));
else
- QToolTip::add(tripLabel,
+ TQToolTip::add(tripLabel,
i18n(ConversionTable[tripDistanceUnit].toUnitTagPlural));
}
//now draw everything
- QString distance_s;
- QString trip_s;
+ TQString distance_s;
+ TQString trip_s;
double distance_d = 0;
double trip_d = 0;
@@ -519,9 +519,9 @@ int Kodometer::CalcDistance(void)
* pretty OO world.
*/
#define THERE_IS_A_NEXT (ConversionTable[unit].maxToBeforeNext != -1.0)
-QString Kodometer::FormatDistance(double &dist, Units unit)
+TQString Kodometer::FormatDistance(double &dist, Units unit)
{
- QString string;
+ TQString string;
const char *tag;
int precision;
diff --git a/kodo/kodometer.h b/kodo/kodometer.h
index 3d5544c..b143737 100644
--- a/kodo/kodometer.h
+++ b/kodo/kodometer.h
@@ -30,10 +30,10 @@
#include <math.h>
-#include <qlabel.h>
-#include <qptrlist.h>
-#include <qkeycode.h>
-#include <qtooltip.h>
+#include <tqlabel.h>
+#include <tqptrlist.h>
+#include <tqkeycode.h>
+#include <tqtooltip.h>
#include <kaboutdata.h>
#include <kuniqueapplication.h>
@@ -94,15 +94,15 @@ class Kodometer : public QFrame
Q_OBJECT
public:
- Kodometer(QWidget* = 0, const char* = 0);
+ Kodometer(TQWidget* = 0, const char* = 0);
~Kodometer() {}
void refresh(void);
void readSettings(void);
void saveSettings(void);
- void timerEvent(QTimerEvent*);
- void mousePressEvent(QMouseEvent*);
- bool eventFilter( QObject *, QEvent *e );
+ void timerEvent(TQTimerEvent*);
+ void mousePressEvent(TQMouseEvent*);
+ bool eventFilter( TQObject *, TQEvent *e );
public slots:
void toggleEnabled();
@@ -117,7 +117,7 @@ protected:
double multiplier(Units);
int CalcDistance(void);
- QString FormatDistance(double &dist, Units);
+ TQString FormatDistance(double &dist, Units);
void FindAllScreens();
KImageNumber* tripLabel;
@@ -131,7 +131,7 @@ protected:
int enabledID;
double speed;
- QPtrList<double> speeds;
+ TQPtrList<double> speeds;
double lastDistance;
int distanceID;
int speedID;