summaryrefslogtreecommitdiffstats
path: root/kmymoney2/widgets/kmymoneylineedit.cpp
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-07-05 06:00:29 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-07-05 06:00:29 +0000
commitfecb0e67b23e8b83ba7fc881bb57bc48c0852d62 (patch)
tree6b8614802f0d01b353bc9ba78aff2090846c198e /kmymoney2/widgets/kmymoneylineedit.cpp
parentdadc34655c3ab961b0b0b94a10eaaba710f0b5e8 (diff)
downloadkmymoney-fecb0e67b23e8b83ba7fc881bb57bc48c0852d62.tar.gz
kmymoney-fecb0e67b23e8b83ba7fc881bb57bc48c0852d62.zip
TQt4 port kmymoney
This enables compilation under both Qt3 and Qt4 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/kmymoney@1239855 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kmymoney2/widgets/kmymoneylineedit.cpp')
-rw-r--r--kmymoney2/widgets/kmymoneylineedit.cpp58
1 files changed, 29 insertions, 29 deletions
diff --git a/kmymoney2/widgets/kmymoneylineedit.cpp b/kmymoney2/widgets/kmymoneylineedit.cpp
index 18e2e31..2250c30 100644
--- a/kmymoney2/widgets/kmymoneylineedit.cpp
+++ b/kmymoney2/widgets/kmymoneylineedit.cpp
@@ -20,9 +20,9 @@
// ----------------------------------------------------------------------------
// QT Includes
-#include <qrect.h>
-#include <qpainter.h>
-#include <qpalette.h>
+#include <tqrect.h>
+#include <tqpainter.h>
+#include <tqpalette.h>
// ----------------------------------------------------------------------------
// KDE Includes
@@ -35,11 +35,11 @@
#include "kmymoneylineedit.h"
-kMyMoneyLineEdit::kMyMoneyLineEdit(QWidget *w, const char* name, bool forceMonetaryDecimalSymbol, int alignment) :
+kMyMoneyLineEdit::kMyMoneyLineEdit(TQWidget *w, const char* name, bool forceMonetaryDecimalSymbol, int tqalignment) :
KLineEdit(w, name),
m_forceMonetaryDecimalSymbol(forceMonetaryDecimalSymbol)
{
- setAlignment(alignment);
+ tqsetAlignment(tqalignment);
}
kMyMoneyLineEdit::~kMyMoneyLineEdit()
@@ -51,13 +51,13 @@ void kMyMoneyLineEdit::resetText(void)
setText(m_text);
}
-void kMyMoneyLineEdit::loadText(const QString& text)
+void kMyMoneyLineEdit::loadText(const TQString& text)
{
m_text = text;
setText(text);
}
-void kMyMoneyLineEdit::focusOutEvent(QFocusEvent *ev)
+void kMyMoneyLineEdit::focusOutEvent(TQFocusEvent *ev)
{
// if the current text is not in the list of
// possible completions, we have a new payee
@@ -69,24 +69,24 @@ void kMyMoneyLineEdit::focusOutEvent(QFocusEvent *ev)
// force update of hint
if(text().isEmpty())
- repaint();
+ tqrepaint();
}
-void kMyMoneyLineEdit::keyReleaseEvent(QKeyEvent* k)
+void kMyMoneyLineEdit::keyReleaseEvent(TQKeyEvent* k)
{
if(m_forceMonetaryDecimalSymbol) {
- if(k->state() & Qt::Keypad) {
- if(k->key() == Qt::Key_Comma
- || k->key() == Qt::Key_Period) {
+ if(k->state() & TQt::Keypad) {
+ if(k->key() == TQt::Key_Comma
+ || k->key() == TQt::Key_Period) {
if(KGlobal::locale()->monetaryDecimalSymbol() == ",") {
- QKeyEvent newk(k->type(), Qt::Key_Comma, ',', k->state(), ",", k->isAutoRepeat(), k->count());
+ TQKeyEvent newk(k->type(), TQt::Key_Comma, ',', k->state(), ",", k->isAutoRepeat(), k->count());
KLineEdit::keyReleaseEvent(&newk);
k->ignore();
return;
}
if(KGlobal::locale()->monetaryDecimalSymbol() == ".") {
- QKeyEvent newk(k->type(), Qt::Key_Comma, ',', k->state(), ".", k->isAutoRepeat(), k->count());
+ TQKeyEvent newk(k->type(), TQt::Key_Comma, ',', k->state(), ".", k->isAutoRepeat(), k->count());
KLineEdit::keyReleaseEvent(&newk);
k->ignore();
return;
@@ -97,21 +97,21 @@ void kMyMoneyLineEdit::keyReleaseEvent(QKeyEvent* k)
KLineEdit::keyReleaseEvent(k);
}
-void kMyMoneyLineEdit::keyPressEvent(QKeyEvent* k)
+void kMyMoneyLineEdit::keyPressEvent(TQKeyEvent* k)
{
if(m_forceMonetaryDecimalSymbol) {
- if(k->state() & Qt::Keypad) {
- if(k->key() == Qt::Key_Comma
- || k->key() == Qt::Key_Period) {
+ if(k->state() & TQt::Keypad) {
+ if(k->key() == TQt::Key_Comma
+ || k->key() == TQt::Key_Period) {
if(KGlobal::locale()->monetaryDecimalSymbol() == ",") {
- QKeyEvent newk(k->type(), Qt::Key_Comma, ',', k->state(), ",", k->isAutoRepeat(), k->count());
+ TQKeyEvent newk(k->type(), TQt::Key_Comma, ',', k->state(), ",", k->isAutoRepeat(), k->count());
KLineEdit::keyPressEvent(&newk);
k->ignore();
return;
}
if(KGlobal::locale()->monetaryDecimalSymbol() == ".") {
- QKeyEvent newk(k->type(), Qt::Key_Period, '.', k->state(), ".", k->isAutoRepeat(), k->count());
+ TQKeyEvent newk(k->type(), TQt::Key_Period, '.', k->state(), ".", k->isAutoRepeat(), k->count());
KLineEdit::keyPressEvent(&newk);
k->ignore();
return;
@@ -122,26 +122,26 @@ void kMyMoneyLineEdit::keyPressEvent(QKeyEvent* k)
KLineEdit::keyPressEvent(k);
}
-void kMyMoneyLineEdit::drawContents( QPainter *p)
+void kMyMoneyLineEdit::drawContents( TQPainter *p)
{
KLineEdit::drawContents(p);
if(text().isEmpty() && !m_hint.isEmpty() && !hasFocus()) {
const int innerMargin = 1;
- // the following 5 lines are taken from QLineEdit::drawContents()
- QRect cr = contentsRect();
- QFontMetrics fm = fontMetrics();
- QRect lineRect( cr.x() + innerMargin, cr.y() + (cr.height() - fm.height() + 1) / 2,
+ // the following 5 lines are taken from TQLineEdit::drawContents()
+ TQRect cr = contentsRect();
+ TQFontMetrics fm = fontMetrics();
+ TQRect lineRect( cr.x() + innerMargin, cr.y() + (cr.height() - fm.height() + 1) / 2,
cr.width() - 2*innerMargin, fm.height() );
- QPoint topLeft = lineRect.topLeft() - QPoint(0, -fm.ascent());
+ TQPoint topLeft = lineRect.topLeft() - TQPoint(0, -fm.ascent());
p->save();
- QFont f = p->font();
+ TQFont f = p->font();
f.setItalic(true);
- f.setWeight(QFont::Light);
+ f.setWeight(TQFont::Light);
p->setFont(f);
- p->setPen(palette().disabled().text());
+ p->setPen(tqpalette().disabled().text());
p->drawText(topLeft, m_hint);