summaryrefslogtreecommitdiffstats
path: root/kodo
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-06-22 21:31:21 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-06-22 21:31:21 +0000
commita1bd60b34891ccc77056c190d7871bc4b14fe654 (patch)
tree713f2f72c8f08a18df12f5bbeef7f9b61b19d4f1 /kodo
parent8d92c3c2a4131996726cc7b625d3cd3caec296de (diff)
downloadtdetoys-a1bd60b34891ccc77056c190d7871bc4b14fe654.tar.gz
tdetoys-a1bd60b34891ccc77056c190d7871bc4b14fe654.zip
TQt4 port kdetoys
This enables compilation under both Qt3 and Qt4 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdetoys@1238103 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kodo')
-rw-r--r--kodo/kimagenumber.cpp12
-rw-r--r--kodo/kimagenumber.h9
-rw-r--r--kodo/kodometer.cpp14
-rw-r--r--kodo/kodometer.h3
4 files changed, 20 insertions, 18 deletions
diff --git a/kodo/kimagenumber.cpp b/kodo/kimagenumber.cpp
index b01c4b6..1b6d9be 100644
--- a/kodo/kimagenumber.cpp
+++ b/kodo/kimagenumber.cpp
@@ -25,12 +25,12 @@
#include "kimagenumber.h"
-KImageNumber::KImageNumber(const TQString& font, TQWidget* parent,const char* name) :
- TQFrame(parent,name),
+KImageNumber::KImageNumber(const TQString& font, TQWidget* tqparent,const char* name) :
+ TQFrame(tqparent,name),
m_value(0)
{
fontPix = new TQPixmap(font);
- resize(sizeHint());
+ resize(tqsizeHint());
}
KImageNumber::~KImageNumber()
@@ -47,7 +47,7 @@ void KImageNumber::paintEvent(TQPaintEvent*)
data.sprintf("%06.1f", m_value);
for(unsigned int i=0; i < data.length(); i++) {
- int wl = data.at(i).latin1() - '0';
+ int wl = data.tqat(i).latin1() - '0';
if(data.at(i) == '.')
wl = 10;
bitBlt(this, i*each, 0, fontPix, wl*each, 0, each, fontPix->height());
@@ -57,7 +57,7 @@ void KImageNumber::paintEvent(TQPaintEvent*)
void KImageNumber::setValue(double v)
{
m_value = v;
- repaint(false);
+ tqrepaint(false);
}
double KImageNumber::value() const
@@ -65,7 +65,7 @@ double KImageNumber::value() const
return m_value;
}
-TQSize KImageNumber::sizeHint() const
+TQSize KImageNumber::tqsizeHint() const
{
int w = fontPix->width();
int each = w/11;
diff --git a/kodo/kimagenumber.h b/kodo/kimagenumber.h
index c3ffb8e..9f8a9b9 100644
--- a/kodo/kimagenumber.h
+++ b/kodo/kimagenumber.h
@@ -29,17 +29,18 @@
#include <tqframe.h>
#include <tqpixmap.h>
-class KImageNumber : public QFrame
+class KImageNumber : public TQFrame
{
Q_OBJECT
- Q_PROPERTY( double m_value READ value WRITE setValue )
+ TQ_OBJECT
+ TQ_PROPERTY( double m_value READ value WRITE setValue )
public:
- KImageNumber(const TQString& font, TQWidget* parent=0, const char* name=0);
+ KImageNumber(const TQString& font, TQWidget* tqparent=0, const char* name=0);
virtual ~KImageNumber();
void paintEvent(TQPaintEvent*);
- virtual TQSize sizeHint() const;
+ virtual TQSize tqsizeHint() const;
double value() const;
public slots:
diff --git a/kodo/kodometer.cpp b/kodo/kodometer.cpp
index e1c2f4d..22a946d 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(TQWidget* parent, const char* name)
- : TQFrame(parent, name),
+Kodometer::Kodometer(TQWidget* tqparent, const char* name)
+ : TQFrame(tqparent, name),
dontRefresh(false),
speed(0.0),
lastDistance(0.0),
@@ -121,7 +121,7 @@ Kodometer::Kodometer(TQWidget* parent, const char* name)
}
/*
- * Now I'm not really sure what this does. I assume its here to find
+ * Now I'm not really sure what this does. I assume its here to tqfind
* all the displays on your system, and measure them. During the mouse
* tracking phase, we use the information stored here to determine how
* far the mouse moved on a given screen.
@@ -156,9 +156,9 @@ void Kodometer::FindAllScreens(void)
vPixelsPerMM = (double)Dh / (double)DhMM;
hPixelsPerMM = (double)Dw / (double)DwMM;
screenInfo[i].PixelsPerMM = (vPixelsPerMM + hPixelsPerMM) / 2.0;
-// kdDebug() << " Vertical pixels/mm are " << vPixelsPerMM <<
+// kdDebug() << " Qt::Vertical pixels/mm are " << vPixelsPerMM <<
// "mm" << endl;
-// kdDebug() << " Horizontal pixels/mm are " << hPixelsPerMM <<
+// kdDebug() << " Qt::Horizontal pixels/mm are " << hPixelsPerMM <<
// "mm" << endl;
// kdDebug() << " Average pixels/mm are " <<
// screenInfo[i].PixelsPerMM << "mm" << endl;
@@ -389,12 +389,12 @@ int Kodometer::CalcDistance(void)
case K_Left:
case K_Top:
finalScreen = 0;
- j = QMAX(pointerScreen,lastPointerScreen) - 1;
+ j = TQMAX(pointerScreen,lastPointerScreen) - 1;
increment = -1;
break;
case K_Right:
case K_Bottom:
- finalScreen = QMAX(pointerScreen,lastPointerScreen) - 1;
+ finalScreen = TQMAX(pointerScreen,lastPointerScreen) - 1;
j = 0;
increment = 1;
break;
diff --git a/kodo/kodometer.h b/kodo/kodometer.h
index b143737..501555d 100644
--- a/kodo/kodometer.h
+++ b/kodo/kodometer.h
@@ -89,9 +89,10 @@ typedef struct conversionEntry {
int printPrecision;
} conversionEntry;
-class Kodometer : public QFrame
+class Kodometer : public TQFrame
{
Q_OBJECT
+ TQ_OBJECT
public:
Kodometer(TQWidget* = 0, const char* = 0);