diff options
Diffstat (limited to 'src/focusedwidgets.cpp')
-rw-r--r-- | src/focusedwidgets.cpp | 96 |
1 files changed, 48 insertions, 48 deletions
diff --git a/src/focusedwidgets.cpp b/src/focusedwidgets.cpp index 05c8b84..429d260 100644 --- a/src/focusedwidgets.cpp +++ b/src/focusedwidgets.cpp @@ -18,7 +18,7 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ -#include <qpopupmenu.h> +#include <tqpopupmenu.h> #include <klocale.h> #include <iostream> @@ -31,15 +31,15 @@ #ifdef KeyPress #undef KeyPress #endif -#include <qevent.h> +#include <tqevent.h> /** class FocusedTextEdit */ -FocusedTextEdit::FocusedTextEdit(bool disableUpdatesOnKeyPress, QWidget *parent, const char *name) - : KTextEdit(parent, name), +FocusedTextEdit::FocusedTextEdit(bool disableUpdatesOnKeyPress, TQWidget *tqparent, const char *name) + : KTextEdit(tqparent, name), m_disableUpdatesOnKeyPress(disableUpdatesOnKeyPress) { - setWFlags(Qt::WNoAutoErase); // Does not work, we still need the disableUpdatesOnKeyPress hack! + setWFlags(TQt::WNoAutoErase); // Does not work, we still need the disableUpdatesOnKeyPress hack! } FocusedTextEdit::~FocusedTextEdit() @@ -56,8 +56,8 @@ FocusedTextEdit::~FocusedTextEdit() */ void FocusedTextEdit::paste() { - adaptClipboardText(QClipboard::Selection); - adaptClipboardText(QClipboard::Clipboard); + adaptClipboardText(TQClipboard::Selection); + adaptClipboardText(TQClipboard::Clipboard); // If we paste a application/x-qrichtext content starting with a "-" or a "*", // then auto-bulletting will crash. @@ -67,14 +67,14 @@ void FocusedTextEdit::paste() // uint oldAutoFormating = autoFormatting(); // setAutoFormatting(AutoNone); - QClipboard *clipboard = QApplication::clipboard(); + TQClipboard *clipboard = TQApplication::tqclipboard(); int paragraph; int index; getCursorPosition(¶graph, &index); bool preventAutoBullet = (index == 0) && - (clipboard->data(QClipboard::Selection)->provides("application/x-qrichtext") || - clipboard->data(QClipboard::Clipboard)->provides("application/x-qrichtext") ); + (clipboard->data(TQClipboard::Selection)->provides("application/x-qrichtext") || + clipboard->data(TQClipboard::Clipboard)->provides("application/x-qrichtext") ); if (preventAutoBullet) insert(" "); @@ -105,49 +105,49 @@ void FocusedTextEdit::paste() * specified 'mode' -, replaces all '\n' within that text and writes * it back to the clipboard. */ -void FocusedTextEdit::adaptClipboardText(QClipboard::Mode mode) +void FocusedTextEdit::adaptClipboardText(TQClipboard::Mode mode) { - QClipboard *clipboard = QApplication::clipboard(); + TQClipboard *clipboard = TQApplication::tqclipboard(); if (!clipboard) return; - if ( (textFormat() == Qt::RichText) && (!clipboard->data(mode)->provides("application/x-qrichtext")) ) { - QString text = clipboard->text(mode); + if ( (textFormat() == TQt::RichText) && (!clipboard->data(mode)->provides("application/x-qrichtext")) ) { + TQString text = clipboard->text(mode); if (text) { - text = text.replace("\n", QChar(0x2028)); + text = text.tqreplace("\n", TQChar(0x2028)); clipboard->setText(text, mode); } } } -QTextCursor* FocusedTextEdit::textCursor() const +TQTextCursor* FocusedTextEdit::textCursor() const { return KTextEdit::textCursor(); } -void FocusedTextEdit::keyPressEvent(QKeyEvent *event) +void FocusedTextEdit::keyPressEvent(TQKeyEvent *event) { - if (event->key() == Qt::Key_Escape) { + if (event->key() == TQt::Key_Escape) { emit escapePressed(); return; // In RichTextFormat mode, [Return] create a new paragraphe. // To keep consistency with TextFormat mode (new line on [Return]), // we redirect [Return] to simulate [Ctrl+Return] (create a new line in both modes). // Create new paragraphes still possible in RichTextFormat mode with [Shift+Enter]. - } else if (event->key() == Qt::Key_Return && event->state() == 0) - event = new QKeyEvent(QEvent::KeyPress, event->key(), event->ascii(), Qt::ControlButton, + } else if (event->key() == TQt::Key_Return && event->state() == 0) + event = new TQKeyEvent(TQEvent::KeyPress, event->key(), event->ascii(), TQt::ControlButton, event->text(), event->isAutoRepeat(), event->count() ); - else if (event->key() == Qt::Key_Return && event->state() & Qt::ControlButton) - event = new QKeyEvent(QEvent::KeyPress, event->key(), event->ascii(), Qt::ShiftButton, + else if (event->key() == TQt::Key_Return && event->state() & TQt::ControlButton) + event = new TQKeyEvent(TQEvent::KeyPress, event->key(), event->ascii(), TQt::ShiftButton, event->text(), event->isAutoRepeat(), event->count() ); if (m_disableUpdatesOnKeyPress) setUpdatesEnabled(false); KTextEdit::keyPressEvent(event); // Workarround (for ensuring the cursor to be visible): signal not emited when pressing those keys: - if (event->key() == Qt::Key_Home || event->key() == Qt::Key_End || event->key() == Qt::Key_PageUp || event->key() == Qt::Key_PageDown) { + if (event->key() == TQt::Key_Home || event->key() == TQt::Key_End || event->key() == TQt::Key_PageUp || event->key() == TQt::Key_PageDown) { int para; int index; getCursorPosition(¶, &index); @@ -163,7 +163,7 @@ void FocusedTextEdit::keyPressEvent(QKeyEvent *event) } } -void FocusedTextEdit::wheelEvent(QWheelEvent *event) +void FocusedTextEdit::wheelEvent(TQWheelEvent *event) { if (event->delta() > 0 && contentsY() > 0) { KTextEdit::wheelEvent(event); @@ -175,15 +175,15 @@ void FocusedTextEdit::wheelEvent(QWheelEvent *event) Global::bnpView->currentBasket()->wheelEvent(event); } -void FocusedTextEdit::enterEvent(QEvent *event) +void FocusedTextEdit::enterEvent(TQEvent *event) { emit mouseEntered(); KTextEdit::enterEvent(event); } -QPopupMenu* FocusedTextEdit::createPopupMenu(const QPoint &pos) +TQPopupMenu* FocusedTextEdit::createPopupMenu(const TQPoint &pos) { - QPopupMenu *menu = KTextEdit::createPopupMenu(pos); + TQPopupMenu *menu = KTextEdit::createPopupMenu(pos); int index = 0; int id = 0; @@ -192,7 +192,7 @@ QPopupMenu* FocusedTextEdit::createPopupMenu(const QPoint &pos) if (id == -1) break; // Disable Spell Check for rich text editors, because it doesn't work anyway: - if (textFormat() == Qt::RichText && (menu->text(id) == i18n("Auto Spell Check") || menu->text(id) == i18n("Check Spelling..."))) + if (textFormat() == TQt::RichText && (menu->text(id) == i18n("Auto Spell Check") || menu->text(id) == i18n("Check Spelling..."))) menu->setItemEnabled(id, false); // Always enable tabulations!: if (menu->text(id) == i18n("Allow Tabulations")) @@ -206,8 +206,8 @@ QPopupMenu* FocusedTextEdit::createPopupMenu(const QPoint &pos) /** class FocusedColorCombo: */ -FocusedColorCombo::FocusedColorCombo(QWidget *parent, const char *name) - : KColorCombo(parent, name) +FocusedColorCombo::FocusedColorCombo(TQWidget *tqparent, const char *name) + : KColorCombo(tqparent, name) { } @@ -215,11 +215,11 @@ FocusedColorCombo::~FocusedColorCombo() { } -void FocusedColorCombo::keyPressEvent(QKeyEvent *event) +void FocusedColorCombo::keyPressEvent(TQKeyEvent *event) { - if (event->key() == Qt::Key_Escape) + if (event->key() == TQt::Key_Escape) emit escapePressed(); - else if (event->key() == Qt::Key_Return) + else if (event->key() == TQt::Key_Return) emit returnPressed2(); else KColorCombo::keyPressEvent(event); @@ -227,8 +227,8 @@ void FocusedColorCombo::keyPressEvent(QKeyEvent *event) /** class FocusedFontCombo: */ -FocusedFontCombo::FocusedFontCombo(QWidget *parent, const char *name) - : KFontCombo(parent, name) +FocusedFontCombo::FocusedFontCombo(TQWidget *tqparent, const char *name) + : KFontCombo(tqparent, name) { } @@ -236,11 +236,11 @@ FocusedFontCombo::~FocusedFontCombo() { } -void FocusedFontCombo::keyPressEvent(QKeyEvent *event) +void FocusedFontCombo::keyPressEvent(TQKeyEvent *event) { - if (event->key() == Qt::Key_Escape) + if (event->key() == TQt::Key_Escape) emit escapePressed(); - else if (event->key() == Qt::Key_Return) + else if (event->key() == TQt::Key_Return) emit returnPressed2(); else KFontCombo::keyPressEvent(event); @@ -248,8 +248,8 @@ void FocusedFontCombo::keyPressEvent(QKeyEvent *event) /** class FocusedComboBox: */ -FocusedComboBox::FocusedComboBox(QWidget *parent, const char *name) - : KComboBox(parent, name) +FocusedComboBox::FocusedComboBox(TQWidget *tqparent, const char *name) + : KComboBox(tqparent, name) { } @@ -257,11 +257,11 @@ FocusedComboBox::~FocusedComboBox() { } -void FocusedComboBox::keyPressEvent(QKeyEvent *event) +void FocusedComboBox::keyPressEvent(TQKeyEvent *event) { - if (event->key() == Qt::Key_Escape) + if (event->key() == TQt::Key_Escape) emit escapePressed(); - else if (event->key() == Qt::Key_Return) + else if (event->key() == TQt::Key_Return) emit returnPressed2(); else KComboBox::keyPressEvent(event); @@ -269,8 +269,8 @@ void FocusedComboBox::keyPressEvent(QKeyEvent *event) /** class FocusedLineEdit: */ -FocusedLineEdit::FocusedLineEdit(QWidget *parent, const char *name) - : KLineEdit(parent, name) +FocusedLineEdit::FocusedLineEdit(TQWidget *tqparent, const char *name) + : KLineEdit(tqparent, name) { } @@ -278,15 +278,15 @@ FocusedLineEdit::~FocusedLineEdit() { } -void FocusedLineEdit::keyPressEvent(QKeyEvent *event) +void FocusedLineEdit::keyPressEvent(TQKeyEvent *event) { - if (event->key() == Qt::Key_Escape) + if (event->key() == TQt::Key_Escape) emit escapePressed(); else KLineEdit::keyPressEvent(event); } -void FocusedLineEdit::enterEvent(QEvent *event) +void FocusedLineEdit::enterEvent(TQEvent *event) { emit mouseEntered(); KLineEdit::enterEvent(event); |