summaryrefslogtreecommitdiffstats
path: root/kicker-applets/math
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-06-18 17:00:31 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-06-18 17:00:31 +0000
commit395a904bff7b4d6ead445c342f7ac0c5fbf29121 (patch)
tree9829cadb79d2cc7c29a940627fadb28b11e54150 /kicker-applets/math
parent399f47c376fdf4d19192732a701ea9578d11619d (diff)
downloadtdeaddons-395a904bff7b4d6ead445c342f7ac0c5fbf29121.tar.gz
tdeaddons-395a904bff7b4d6ead445c342f7ac0c5fbf29121.zip
TQt4 port kdeaddons
This enables compilation under both Qt3 and Qt4 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdeaddons@1237404 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kicker-applets/math')
-rw-r--r--kicker-applets/math/mathapplet.cpp24
-rw-r--r--kicker-applets/math/mathapplet.h3
-rw-r--r--kicker-applets/math/parser.cpp26
-rw-r--r--kicker-applets/math/parser.h4
4 files changed, 29 insertions, 28 deletions
diff --git a/kicker-applets/math/mathapplet.cpp b/kicker-applets/math/mathapplet.cpp
index 9d7ca38..8274bb6 100644
--- a/kicker-applets/math/mathapplet.cpp
+++ b/kicker-applets/math/mathapplet.cpp
@@ -49,16 +49,16 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
extern "C"
{
- KDE_EXPORT KPanelApplet* init(TQWidget *parent, const TQString& configFile)
+ KDE_EXPORT KPanelApplet* init(TQWidget *tqparent, const TQString& configFile)
{
KGlobal::locale()->insertCatalogue("kmathapplet");
- return new MathApplet(configFile, KPanelApplet::Stretch, 0, parent, "kmathapplet");
+ return new MathApplet(configFile, KPanelApplet::Stretch, 0, tqparent, "kmathapplet");
}
}
MathApplet::MathApplet(const TQString& configFile, Type type, int actions,
- TQWidget *parent, const char *name)
- : KPanelApplet(configFile, type, actions, parent, name),
+ TQWidget *tqparent, const char *name)
+ : KPanelApplet(configFile, type, actions, tqparent, name),
m_hasFocus(false)
{
// setBackgroundMode(X11ParentRelative);
@@ -151,20 +151,20 @@ void MathApplet::useRadians() {
void MathApplet::resizeEvent(TQResizeEvent*)
{
- if(orientation() == Horizontal)
+ if(orientation() ==Qt::Horizontal)
{
_btn->hide();
_input->reparent(this, TQPoint(0,0), true);
_label->setGeometry(0,0, width(), _label->height());
- if(height() >= _input->sizeHint().height() + _label->height())
+ if(height() >= _input->tqsizeHint().height() + _label->height())
{
- int inputVOffset = height() - _input->sizeHint().height() - 2;
- int labelHeight = _label->sizeHint().height();
+ int inputVOffset = height() - _input->tqsizeHint().height() - 2;
+ int labelHeight = _label->tqsizeHint().height();
_label->setGeometry(0, inputVOffset - labelHeight,
width(), labelHeight);
_input->setGeometry(0, inputVOffset,
- width(), _input->sizeHint().height());
+ width(), _input->tqsizeHint().height());
_label->show();
}
else
@@ -174,7 +174,7 @@ void MathApplet::resizeEvent(TQResizeEvent*)
// make it as high as the combobox naturally wants to be
// but no taller than the panel is!
// don't forget to center it vertically either.
- int newHeight = _input->sizeHint().height();
+ int newHeight = _input->tqsizeHint().height();
if (newHeight > height())
newHeight = height();
_input->setGeometry(0, (height() - newHeight) / 2,
@@ -269,13 +269,13 @@ void MathApplet::evaluate(const TQString& command)
}
}
- if (orientation() == Vertical)
+ if (orientation() ==Qt::Vertical)
_hbox->hide();
}
void MathApplet::mousePressEvent(TQMouseEvent *e)
{
- if ( e->button() != RightButton )
+ if ( e->button() != Qt::RightButton )
{
KPanelApplet::mousePressEvent( e );
return;
diff --git a/kicker-applets/math/mathapplet.h b/kicker-applets/math/mathapplet.h
index f8c91a0..97e4270 100644
--- a/kicker-applets/math/mathapplet.h
+++ b/kicker-applets/math/mathapplet.h
@@ -38,10 +38,11 @@ class KPopupMenu;
class MathApplet : public KPanelApplet
{
Q_OBJECT
+ TQ_OBJECT
public:
MathApplet(const TQString& configFile, Type t = Stretch, int actions = 0,
- TQWidget *parent = 0, const char *name = 0);
+ TQWidget *tqparent = 0, const char *name = 0);
virtual ~MathApplet();
int widthForHeight(int height) const;
diff --git a/kicker-applets/math/parser.cpp b/kicker-applets/math/parser.cpp
index 8a58064..c49cbab 100644
--- a/kicker-applets/math/parser.cpp
+++ b/kicker-applets/math/parser.cpp
@@ -243,9 +243,9 @@ int Parser::addfkt(TQString str)
err=0;
errpos=1;
str.remove(" " );
- const int p1=str.find('(');
- int p2=str.find(',');
- const int p3=str.find(")=");
+ const int p1=str.tqfind('(');
+ int p2=str.tqfind(',');
+ const int p3=str.tqfind(")=");
//insert '*' when it is needed
for(int i=p1+3; i < (int) str.length();i++)
@@ -656,41 +656,41 @@ int Parser::getfix(TQString name)
int Parser::errmsg()
{ switch(err)
{ case 1: KMessageBox::error(0, i18n("Parser error at position %1:\n"
- "Syntax error").arg(TQString::number(errpos)), i18n("Math Expression Evaluator"));
+ "Syntax error").tqarg(TQString::number(errpos)), i18n("Math Expression Evaluator"));
break;
case 2: KMessageBox::error(0, i18n("Parser error at position %1:\n"
- "Missing parenthesis").arg(TQString::number(errpos)), i18n("Math Expression Evaluator"));
+ "Missing tqparenthesis").tqarg(TQString::number(errpos)), i18n("Math Expression Evaluator"));
break;
case 3: KMessageBox::error(0, i18n("Parser error at position %1:\n"
- "Function name unknown").arg(TQString::number(errpos)), i18n("Math Expression Evaluator"));
+ "Function name unknown").tqarg(TQString::number(errpos)), i18n("Math Expression Evaluator"));
break;
case 4: KMessageBox::error(0, i18n("Parser error at position %1:\n"
- "Void function variable").arg(TQString::number(errpos)), i18n("Math Expression Evaluator"));
+ "Void function variable").tqarg(TQString::number(errpos)), i18n("Math Expression Evaluator"));
break;
case 5: KMessageBox::error(0, i18n("Parser error at position %1:\n"
- "Too many functions").arg(TQString::number(errpos)), i18n("Math Expression Evaluator"));
+ "Too many functions").tqarg(TQString::number(errpos)), i18n("Math Expression Evaluator"));
break;
case 6: KMessageBox::error(0, i18n("Parser error at position %1:\n"
- "Token-memory overflow").arg(TQString::number(errpos)), i18n("Math Expression Evaluator"));
+ "Token-memory overflow").tqarg(TQString::number(errpos)), i18n("Math Expression Evaluator"));
break;
case 7: KMessageBox::error(0, i18n("Parser error at position %1:\n"
- "Stack overflow").arg(TQString::number(errpos)), i18n("Math Expression Evaluator"));
+ "Stack overflow").tqarg(TQString::number(errpos)), i18n("Math Expression Evaluator"));
break;
case 8: KMessageBox::error(0, i18n("Parser error at position %1:\n"
- "Name of function not free").arg(TQString::number(errpos)), i18n("Math Expression Evaluator"));
+ "Name of function not free").tqarg(TQString::number(errpos)), i18n("Math Expression Evaluator"));
break;
case 9: KMessageBox::error(0, i18n("Parser error at position %1:\n"
- "recursive function not allowed").arg(TQString::number(errpos)), i18n("Math Expression Evaluator"));
+ "recursive function not allowed").tqarg(TQString::number(errpos)), i18n("Math Expression Evaluator"));
break;
- case 10: KMessageBox::error(0, i18n("Could not find a defined constant at position %1" ).arg(TQString::number(errpos)),
+ case 10: KMessageBox::error(0, i18n("Could not find a defined constant at position %1" ).tqarg(TQString::number(errpos)),
i18n("Math Expression Evaluator"));
break;
case 11: KMessageBox::error(0, i18n("Empty function"), i18n("Math Expression Evaluator"));
diff --git a/kicker-applets/math/parser.h b/kicker-applets/math/parser.h
index 4ee0e7d..319c470 100644
--- a/kicker-applets/math/parser.h
+++ b/kicker-applets/math/parser.h
@@ -29,7 +29,7 @@
/** @file parser.h
* \brief Contains the parser core class Parser. */
-// Qt includes
+// TQt includes
#include <tqstring.h>
#include <tqvaluevector.h>
@@ -187,7 +187,7 @@ public:
unsigned char *mem; ///< Pointer to the allocated memory for the tokens.
unsigned char *mptr; ///< Pointer to the token.
- QString fname; ///< Name of the function.
+ TQString fname; ///< Name of the function.
TQString fvar; ///< Dummy variable.
TQString fpar; ///< Parameter.
TQString fstr; ///< Function expression.