diff options
Diffstat (limited to 'kvoctrain/kvoctrain/kvoctraintable.cpp')
-rw-r--r-- | kvoctrain/kvoctrain/kvoctraintable.cpp | 122 |
1 files changed, 61 insertions, 61 deletions
diff --git a/kvoctrain/kvoctrain/kvoctraintable.cpp b/kvoctrain/kvoctrain/kvoctraintable.cpp index 98e64c13..7dc54b45 100644 --- a/kvoctrain/kvoctrain/kvoctraintable.cpp +++ b/kvoctrain/kvoctrain/kvoctraintable.cpp @@ -23,8 +23,8 @@ * * ***************************************************************************/ -#include <qpainter.h> -#include <qstyle.h> +#include <tqpainter.h> +#include <tqstyle.h> #include <kapplication.h> #include <kdebug.h> @@ -39,8 +39,8 @@ #include "kv_resource.h" #include "prefs.h" -KVocTrainTable::KVocTrainTable(kvoctrainDoc *doc, const LangSet *ls, QWidget *parent, const char *name) - : QTable(parent, name), langs(ls) +KVocTrainTable::KVocTrainTable(kvoctrainDoc *doc, const LangSet *ls, TQWidget *parent, const char *name) + : TQTable(parent, name), langs(ls) { m_doc = doc; defaultItem = 0; @@ -57,17 +57,17 @@ KVocTrainTable::KVocTrainTable(kvoctrainDoc *doc, const LangSet *ls, QWidget *pa triggerSect = -1; - m_pixInQuery = QPixmap(KGlobal::iconLoader()->loadIcon("ok", KIcon::Small)); - m_pixInactive = QPixmap(KGlobal::iconLoader()->loadIcon("no", KIcon::Small)); + m_pixInQuery = TQPixmap(KGlobal::iconLoader()->loadIcon("ok", KIcon::Small)); + m_pixInactive = TQPixmap(KGlobal::iconLoader()->loadIcon("no", KIcon::Small)); - delayTimer = new QTimer(this); - connect(delayTimer, SIGNAL(timeout()), this, SLOT(menuTriggerTimeout())); + delayTimer = new TQTimer(this); + connect(delayTimer, TQT_SIGNAL(timeout()), this, TQT_SLOT(menuTriggerTimeout())); - QHeader *header = horizontalHeader(); - connect(header, SIGNAL(pressed(int)), this, SLOT(headerPressEvent(int))); - connect(header, SIGNAL(released(int)), this, SLOT(headerReleaseEvent(int))); + TQHeader *header = horizontalHeader(); + connect(header, TQT_SIGNAL(pressed(int)), this, TQT_SLOT(headerPressEvent(int))); + connect(header, TQT_SIGNAL(released(int)), this, TQT_SLOT(headerReleaseEvent(int))); - connect(this, SIGNAL(currentChanged(int, int)), this, SLOT(slotCurrentChanged(int, int))); + connect(this, TQT_SIGNAL(currentChanged(int, int)), this, TQT_SLOT(slotCurrentChanged(int, int))); } @@ -76,26 +76,26 @@ void KVocTrainTable::setCurrentItem(int row) setCurrentRow(row, currentColumn()); } /* -QWidget* KVocTrainTable::beginEdit(int row, int col, bool replace) +TQWidget* KVocTrainTable::beginEdit(int row, int col, bool replace) { if (KApplication::dcopClient()->isApplicationRegistered("kxkb")) { if (m_doc) { - QString id = (col == KV_COL_ORG) ? m_doc->getOriginalIdent() : m_doc->getIdent(col - KV_EXTRA_COLS); + TQString id = (col == KV_COL_ORG) ? m_doc->getOriginalIdent() : m_doc->getIdent(col - KV_EXTRA_COLS); if (langs) { - QString kbLayout(langs->keyboardLayout(langs->indexShortId(id))); + TQString kbLayout(langs->keyboardLayout(langs->indexShortId(id))); kdDebug() << "Keyboard Layout: " << kbLayout << endl; if (!kbLayout.isEmpty()) { - QByteArray data, replyData; - QCString replyType; - QDataStream arg(data, IO_WriteOnly); + TQByteArray data, replyData; + TQCString replyType; + TQDataStream arg(data, IO_WriteOnly); arg << kbLayout; - if (!KApplication::dcopClient()->call("kxkb", "kxkb", "setLayout(QString)", data, replyType, replyData)) + if (!KApplication::dcopClient()->call("kxkb", "kxkb", "setLayout(TQString)", data, replyType, replyData)) { kdDebug() << "kxkb dcop error: beginEdit()" << endl; } @@ -103,12 +103,12 @@ QWidget* KVocTrainTable::beginEdit(int row, int col, bool replace) } } } - return QTable::beginEdit(row, col, replace); + return TQTable::beginEdit(row, col, replace); } void KVocTrainTable::endEdit(int row, int col, bool accept, bool replace) { - QTable::endEdit(row, col, accept, replace); + TQTable::endEdit(row, col, accept, replace); } */ void KVocTrainTable::sortByColumn(int header, bool alpha) { @@ -126,7 +126,7 @@ void KVocTrainTable::sortByColumn(int header, bool alpha) { return; } - QApplication::setOverrideCursor(waitCursor); + TQApplication::setOverrideCursor(waitCursor); clearSelection(); @@ -144,7 +144,7 @@ void KVocTrainTable::sortByColumn(int header, bool alpha) { repaintContents(); m_doc->setModified(); emit currentChanged(currentRow(), currentColumn()); - QApplication::restoreOverrideCursor(); + TQApplication::restoreOverrideCursor(); } void KVocTrainTable::sortByColumn_alpha(int header) @@ -166,7 +166,7 @@ void KVocTrainTable::sortByColumn_index(int header) void KVocTrainTable::setCurrentRow(int row, int col) { - QTable::setCurrentCell(row, col); + TQTable::setCurrentCell(row, col); } void KVocTrainTable::updateContents(int row, int col) @@ -236,7 +236,7 @@ void KVocTrainTable::setDoc(kvoctrainDoc * rows) } if (d == 0) { - defaultItem = new KVocTrainTableItem(this, QTableItem::OnTyping, rows); + defaultItem = new KVocTrainTableItem(this, TQTableItem::OnTyping, rows); } else { defaultItem = d; @@ -254,17 +254,17 @@ void KVocTrainTable::menuTriggerTimeout() int mt = triggerSect; triggerSect = -1; - QHeader *header = horizontalHeader(); + TQHeader *header = horizontalHeader(); int x = leftMargin(); for (int i = 0; i < mt; ++i) x += header->sectionSize(i); - QPoint mpos = mapToGlobal(QPoint(x, topMargin())); + TQPoint mpos = mapToGlobal(TQPoint(x, topMargin())); if (mt != KV_COL_MARK) emit rightButtonClicked(mt, mpos.x(), mpos.y()); - QMouseEvent me(QEvent::MouseButtonRelease, QPoint(0, 0), QMouseEvent::LeftButton, QMouseEvent::LeftButton); - QApplication::sendEvent(header, &me); + TQMouseEvent me(TQEvent::MouseButtonRelease, TQPoint(0, 0), TQMouseEvent::LeftButton, TQMouseEvent::LeftButton); + TQApplication::sendEvent(header, &me); } void KVocTrainTable::headerReleaseEvent(int /*sec*/) @@ -285,15 +285,15 @@ void KVocTrainTable::headerPressEvent(int sec) delayTimer->start(500, true); } -void KVocTrainTable::setFont(const QFont & font) +void KVocTrainTable::setFont(const TQFont & font) { - QTable::setFont(font); + TQTable::setFont(font); horizontalHeader()->setFont(KGlobalSettings::generalFont()); for (unsigned i = 0; i < (unsigned) numRows(); ++i) setRowHeight(i, fontMetrics().lineSpacing()); } -int cellAlignment(const QString & text) +int cellAlignment(const TQString & text) { bool num; bool ok1 = false; @@ -307,7 +307,7 @@ int cellAlignment(const QString & text) } -void KVocTrainTable::paintCell(QPainter * p, int row, int col, const QRect & cr, bool selected, const QColorGroup &cg) +void KVocTrainTable::paintCell(TQPainter * p, int row, int col, const TQRect & cr, bool selected, const TQColorGroup &cg) { if (cr.width() == 0 || cr.height() == 0) return; @@ -320,7 +320,7 @@ void KVocTrainTable::paintCell(QPainter * p, int row, int col, const QRect & cr, int x2 = w - 1; int y2 = h - 1; - p->fillRect( 0, 0, w, h, selected ? cg.brush( QColorGroup::Highlight ) : cg.brush( QColorGroup::Base ) ); + p->fillRect( 0, 0, w, h, selected ? cg.brush( TQColorGroup::Highlight ) : cg.brush( TQColorGroup::Base ) ); kvoctrainExpr *expr = getRow(row); if (expr) @@ -328,7 +328,7 @@ void KVocTrainTable::paintCell(QPainter * p, int row, int col, const QRect & cr, p->save(); //cell->paint(p, col, w, selected, m_doc, numCols() == KV_EXTRA_COLS+2 ? KV_COL_TRANS : currentColumn(), gradecols); - QColor color = KV_NORM_COLOR; + TQColor color = KV_NORM_COLOR; int current_col = numCols() == KV_EXTRA_COLS+2 ? KV_COL_TRANS : currentColumn(); if (Prefs::useGradeCol()) @@ -386,7 +386,7 @@ void KVocTrainTable::paintCell(QPainter * p, int row, int col, const QRect & cr, { case KV_COL_LESS: // lesson { - QString less_str; + TQString less_str; if (m_doc != 0 && expr->getLesson() != 0) less_str = m_doc->getLessonDescr(expr->getLesson()); p->drawText( 3, fontpos, w, p->fontMetrics().lineSpacing(), Qt::AlignLeft, less_str); @@ -410,23 +410,23 @@ void KVocTrainTable::paintCell(QPainter * p, int row, int col, const QRect & cr, case KV_COL_ORG: // original { - QString s = expr->getOriginal(); + TQString s = expr->getOriginal(); p->drawText(3, fontpos, w - 6, p->fontMetrics().lineSpacing(), cellAlignment(s), s); } break; default: // translation x - QString s = expr->getTranslation(col - KV_COL_ORG); + TQString s = expr->getTranslation(col - KV_COL_ORG); p->drawText(3, fontpos, w - 6, p->fontMetrics().lineSpacing(), cellAlignment(s), s); break; } p->restore(); } - QPen pen( p->pen() ); - int gridColor = style().styleHint( QStyle::SH_Table_GridLineColor, this ); + TQPen pen( p->pen() ); + int gridColor = style().styleHint( TQStyle::SH_Table_GridLineColor, this ); if (gridColor != -1) { - const QPalette &pal = palette(); + const TQPalette &pal = palette(); if (cg != colorGroup() && cg != pal.disabled() && cg != pal.inactive()) @@ -441,20 +441,20 @@ void KVocTrainTable::paintCell(QPainter * p, int row, int col, const QRect & cr, p->setPen( pen ); } -void KVocTrainTable::setItem(int row, int col, QTableItem * /*item*/) +void KVocTrainTable::setItem(int row, int col, TQTableItem * /*item*/) { // ignore item! updateContents(row, col); } -QTableItem * KVocTrainTable::item(int row, int col) const +TQTableItem * KVocTrainTable::item(int row, int col) const { if (defaultItem) defaultItem->setPosition(row, col); return defaultItem; } -void KVocTrainTable::keyPressEvent(QKeyEvent * e) +void KVocTrainTable::keyPressEvent(TQKeyEvent * e) { delayTimer->stop(); switch(e->key()) @@ -470,11 +470,11 @@ void KVocTrainTable::keyPressEvent(QKeyEvent * e) case Key_Down: case Key_Next: case Key_Prior: - QTable::keyPressEvent(e); + TQTable::keyPressEvent(e); break; case Key_Left: { - QTable::keyPressEvent(e); + TQTable::keyPressEvent(e); int topCell = rowAt(0); int lastRowVisible = QMIN(numRows(), rowAt(contentsHeight())); if (numCols() > 2) @@ -486,7 +486,7 @@ void KVocTrainTable::keyPressEvent(QKeyEvent * e) case Key_Shift: case Key_Alt: case Key_Control: // fallthrough - QTable::keyPressEvent(e); + TQTable::keyPressEvent(e); emit forwardKeyPressEvent(e); break; @@ -498,12 +498,12 @@ void KVocTrainTable::keyPressEvent(QKeyEvent * e) break; default: - QTable::keyPressEvent(e); + TQTable::keyPressEvent(e); break; } } -void KVocTrainTable::keyReleaseEvent(QKeyEvent * e) +void KVocTrainTable::keyReleaseEvent(TQKeyEvent * e) { delayTimer->stop(); switch(e->key()) @@ -511,20 +511,20 @@ void KVocTrainTable::keyReleaseEvent(QKeyEvent * e) case Key_Shift: case Key_Alt: case Key_Control: // fallthrough - QTable::keyPressEvent(e); + TQTable::keyPressEvent(e); emit forwardKeyReleaseEvent(e); break; } } -void KVocTrainTable::contentsMousePressEvent(QMouseEvent * e) +void KVocTrainTable::contentsMousePressEvent(TQMouseEvent * e) { delayTimer->stop(); int cc = columnAt(e->x()); int cr = rowAt(e->y()); int co = currentColumn(); - QTable::contentsMousePressEvent(e); + TQTable::contentsMousePressEvent(e); if(cc >= KV_EXTRA_COLS) { // update color of original when column changes and more than 1 translation @@ -542,10 +542,10 @@ void KVocTrainTable::contentsMousePressEvent(QMouseEvent * e) setCurrentCell(cr, cc); } -void KVocTrainTable::contentsMouseDoubleClickEvent(QMouseEvent * e) +void KVocTrainTable::contentsMouseDoubleClickEvent(TQMouseEvent * e) { delayTimer->stop(); - QTable::contentsMouseDoubleClickEvent(e); + TQTable::contentsMouseDoubleClickEvent(e); } void KVocTrainTable::activateNextCell() @@ -553,7 +553,7 @@ void KVocTrainTable::activateNextCell() int currRow = currentRow(); int currCol = currentColumn(); - QTableSelection currentSel = selection(0); + TQTableSelection currentSel = selection(0); int tr = currentSel.topRow(); int br = currentSel.bottomRow(); @@ -579,20 +579,20 @@ void KVocTrainTable::slotCurrentChanged(int row, int col) { if (m_doc) { - QString id = (col == KV_COL_ORG) ? m_doc->getOriginalIdent() : m_doc->getIdent(col - KV_EXTRA_COLS); + TQString id = (col == KV_COL_ORG) ? m_doc->getOriginalIdent() : m_doc->getIdent(col - KV_EXTRA_COLS); if (langs) { - QString kbLayout(langs->keyboardLayout(langs->indexShortId(id))); + TQString kbLayout(langs->keyboardLayout(langs->indexShortId(id))); //kdDebug() << "Keyboard Layout: " << kbLayout << endl; if (!kbLayout.isEmpty()) { - QByteArray data, replyData; - QCString replyType; - QDataStream arg(data, IO_WriteOnly); + TQByteArray data, replyData; + TQCString replyType; + TQDataStream arg(data, IO_WriteOnly); arg << kbLayout; - if (!KApplication::dcopClient()->call("kxkb", "kxkb", "setLayout(QString)", data, replyType, replyData)) + if (!KApplication::dcopClient()->call("kxkb", "kxkb", "setLayout(TQString)", data, replyType, replyData)) { kdDebug() << "kxkb dcop error: beginEdit()" << endl; } |