From e86f8310a920cbf1ecfac955fbad05916e954693 Mon Sep 17 00:00:00 2001 From: tpearson Date: Thu, 30 Jun 2011 19:20:52 +0000 Subject: TQt4 port knowit This enables compilation under both Qt3 and Qt4 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/knowit@1238876 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- src/knowitedit.cpp | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) (limited to 'src/knowitedit.cpp') diff --git a/src/knowitedit.cpp b/src/knowitedit.cpp index 298d63c..7f30eb4 100644 --- a/src/knowitedit.cpp +++ b/src/knowitedit.cpp @@ -18,42 +18,42 @@ #include "knowitedit.h" #include -KnowitEdit::KnowitEdit(const QString& text, const QString& context, QWidget* parent, - const char* name) : KTextEdit(text, context, parent, name), swapEOL(true) +KnowitEdit::KnowitEdit(const TQString& text, const TQString& context, TQWidget* tqparent, + const char* name) : KTextEdit(text, context, tqparent, name), swapEOL(true) { setAcceptDrops(true); } -KnowitEdit::KnowitEdit(QWidget* parent, const char* name) : KTextEdit(parent, name), +KnowitEdit::KnowitEdit(TQWidget* tqparent, const char* name) : KTextEdit(tqparent, name), swapEOL(true) { } -void KnowitEdit::keyPressEvent(QKeyEvent* e) +void KnowitEdit::keyPressEvent(TQKeyEvent* e) { if (swapEOL && - (e->key() == Qt::Key_Enter || e->key() == Qt::Key_Return) && - (e->state() | (Qt::NoButton | Qt::ControlButton | Qt::Keypad) == - (Qt::NoButton | Qt::ControlButton | Qt::Keypad))) { - QKeyEvent* e1 = new QKeyEvent(QKeyEvent::KeyPress, e->key(), - e->ascii(), e->state() ^ Qt::ControlButton, e->text(), e->isAutoRepeat(), + (e->key() == TQt::Key_Enter || e->key() == TQt::Key_Return) && + (e->state() | (Qt::NoButton | TQt::ControlButton | TQt::Keypad) == + (Qt::NoButton | TQt::ControlButton | TQt::Keypad))) { + TQKeyEvent* e1 = new TQKeyEvent(TQKeyEvent::KeyPress, e->key(), + e->ascii(), e->state() ^ TQt::ControlButton, e->text(), e->isAutoRepeat(), e->count()); e->ignore(); - QTextEdit::keyPressEvent(e1); + TQTextEdit::keyPressEvent(e1); } - else QTextEdit::keyPressEvent(e); + else TQTextEdit::keyPressEvent(e); } -void KnowitEdit::contentsDragEnterEvent(QDragEnterEvent* event) +void KnowitEdit::contentsDragEnterEvent(TQDragEnterEvent* event) { if (KURLDrag::canDecode(event)) event->accept(true); - else QTextEdit::contentsDragEnterEvent(event); + else TQTextEdit::contentsDragEnterEvent(event); } -void KnowitEdit::contentsDropEvent(QDropEvent* event) +void KnowitEdit::contentsDropEvent(TQDropEvent* event) { if (KURLDrag::canDecode(event)) { KURL::List L; @@ -61,6 +61,6 @@ void KnowitEdit::contentsDropEvent(QDropEvent* event) for (uint i=0; i 1); } - else QTextEdit::contentsDropEvent(event); + else TQTextEdit::contentsDropEvent(event); } -- cgit v1.2.1