From a374efce3a207b39514be3c52264091400ce297e Mon Sep 17 00:00:00 2001 From: tpearson Date: Sat, 11 Jun 2011 04:44:41 +0000 Subject: TQt4 port kdeedu This enables compilation under both Qt3 and Qt4 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdeedu@1236073 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- kwordquiz/src/wqquiz.cpp | 94 ++++++++++++++++++++++++------------------------ 1 file changed, 47 insertions(+), 47 deletions(-) (limited to 'kwordquiz/src/wqquiz.cpp') diff --git a/kwordquiz/src/wqquiz.cpp b/kwordquiz/src/wqquiz.cpp index 23600567..1ba46076 100644 --- a/kwordquiz/src/wqquiz.cpp +++ b/kwordquiz/src/wqquiz.cpp @@ -23,20 +23,20 @@ #include "wqquiz.h" #include "prefs.h" -WQQuiz::WQQuiz(KWordQuizView * parent, const char *name) : TQObject(parent, name) +WTQQuiz::WTQQuiz(KWordQuizView * tqparent, const char *name) : TQObject(tqparent, name) { - m_table = parent; + m_table = tqparent; m_list.clear(); m_errorList.clear(); m_quizList.clear(); } -void WQQuiz::activateErrorList() +void WTQQuiz::activateErrorList() { m_list.clear(); - WQListItem l; + WTQListItem l; QuizList::iterator it; for ( it = m_errorList.begin(); it != m_errorList.end(); ++it ) @@ -47,7 +47,7 @@ void WQQuiz::activateErrorList() } -void WQQuiz::activateBaseList() +void WTQQuiz::activateBaseList() { m_list.clear(); @@ -64,7 +64,7 @@ void WQQuiz::activateBaseList() } -void WQQuiz::addToList(int aCol, int bCol) +void WTQQuiz::addToList(int aCol, int bCol) { //build a list of row numbers containing text in both columns @@ -85,8 +85,8 @@ void WQQuiz::addToList(int aCol, int bCol) IntList::ConstIterator it; for ( it = tempList.begin(); it != tempList.end(); ++it ) { - WQListItem *li; - li = new WQListItem(); + WTQListItem *li; + li = new WTQListItem(); li->setQuestion(aCol); li->setCorrect(1); li->setOneOp(*it); @@ -114,7 +114,7 @@ void WQQuiz::addToList(int aCol, int bCol) } -bool WQQuiz::init() +bool WTQQuiz::init() { bool result = false; @@ -196,7 +196,7 @@ bool WQQuiz::init() return true; } -void WQQuiz::listRandom() +void WTQQuiz::listRandom() { TQPtrList list; @@ -216,10 +216,10 @@ void WQQuiz::listRandom() m_quizList.append(items[i]); } -bool WQQuiz::checkAnswer(int i, const TQString & a) +bool WTQQuiz::checkAnswer(int i, const TQString & a) { bool result = false; - WQListItem li = m_list[i]; + WTQListItem li = m_list[i]; int j; if (li.question() == 0) { @@ -239,12 +239,12 @@ bool WQQuiz::checkAnswer(int i, const TQString & a) if (TQString(m_correctBlank).length() > 0) { TQStringList la, ls; - if (ans.find(";") > 0) + if (ans.tqfind(";") > 0) ls = TQStringList::split(";", ans); else ls.append(ans); - if (m_correctBlank.find(";") > 0) + if (m_correctBlank.tqfind(";") > 0) la = TQStringList::split(";", m_correctBlank); else la.append(m_correctBlank); @@ -292,11 +292,11 @@ bool WQQuiz::checkAnswer(int i, const TQString & a) return result; } -TQStringList WQQuiz::multiOptions(int i) +TQStringList WTQQuiz::multiOptions(int i) { TQString *s; TQStringList Result; - WQListItem li = m_list[i]; + WTQListItem li = m_list[i]; typedef TQPtrList LS; LS *ls; @@ -347,10 +347,10 @@ TQStringList WQQuiz::multiOptions(int i) return Result; } -TQString WQQuiz::quizIcon(int i, QuizIcon ico) +TQString WTQQuiz::quizIcon(int i, QuizIcon ico) { TQString s; - WQListItem li = m_list[i]; + WTQListItem li = m_list[i]; if (ico == qiLeftCol) { if (li.question() == 0) @@ -369,7 +369,7 @@ TQString WQQuiz::quizIcon(int i, QuizIcon ico) return s; } -TQString WQQuiz::yourAnswer(int i, const TQString & s) +TQString WTQQuiz::yourAnswer(int i, const TQString & s) { TQString result =""; @@ -377,17 +377,17 @@ TQString WQQuiz::yourAnswer(int i, const TQString & s) { TQStringList ls; - if (s.find(";") > 0) + if (s.tqfind(";") > 0) ls = TQStringList::split(";", s, true); else ls.append(s); - result = m_answerBlank.replace("..........", ""); + result = m_answerBlank.tqreplace("..........", ""); int offset = 0, counter = 0; while (offset >= 0) { - offset = result.find("", offset); + offset = result.tqfind("", offset); if (offset >= 0) { result.insert(offset + 3, ls[counter]); @@ -405,7 +405,7 @@ TQString WQQuiz::yourAnswer(int i, const TQString & s) return result; } -TQString WQQuiz::hint(int i) +TQString WTQQuiz::hint(int i) { if (TQString(m_correctBlank).length() > 0) { @@ -417,20 +417,20 @@ TQString WQQuiz::hint(int i) } } -void WQQuiz::setQuizType(QuizType qt) +void WTQQuiz::setQuizType(QuizType qt) { m_quizType = qt; } -void WQQuiz::setQuizMode(int qm) +void WTQQuiz::setQuizMode(int qm) { m_quizMode = qm; } -TQString WQQuiz::question(int i) +TQString WTQQuiz::question(int i) { - WQListItem li = m_list[i]; + WTQListItem li = m_list[i]; TQString s = m_table->text(li.oneOp(), li.question()); if (Prefs::enableBlanks()) { @@ -439,7 +439,7 @@ TQString WQQuiz::question(int i) } if (m_quizType != qtFlash && i > 0) { - WQListItem li2 = m_list[i - 1]; + WTQListItem li2 = m_list[i - 1]; emit checkingAnswer(li2.oneOp()); } else @@ -448,7 +448,7 @@ TQString WQQuiz::question(int i) return s; } -TQString WQQuiz::blankAnswer(int i) +TQString WTQQuiz::blankAnswer(int i) { TQString r = ""; @@ -458,7 +458,7 @@ TQString WQQuiz::blankAnswer(int i) if (m_quizType == qtQA && Prefs::enableBlanks()) { - WQListItem li = m_list[i]; + WTQListItem li = m_list[i]; int j; if (li.question() == 0) { @@ -474,7 +474,7 @@ TQString WQQuiz::blankAnswer(int i) rx.setMinimal(true); rx.setPattern("\\[.*\\]"); - r.replace(rx, ".........."); + r.tqreplace(rx, ".........."); if (r != tTemp) { @@ -486,9 +486,9 @@ TQString WQQuiz::blankAnswer(int i) if (offset >= 0) { if (m_correctBlank.length() > 0) - m_correctBlank = m_correctBlank + ";" + " " + tTemp.mid(offset + 1, tTemp.find(']', offset) - offset - 1); + m_correctBlank = m_correctBlank + ";" + " " + tTemp.mid(offset + 1, tTemp.tqfind(']', offset) - offset - 1); else - m_correctBlank = tTemp.mid(offset + 1, tTemp.find(']', offset) - offset - 1); + m_correctBlank = tTemp.mid(offset + 1, tTemp.tqfind(']', offset) - offset - 1); offset++; } } @@ -497,10 +497,10 @@ TQString WQQuiz::blankAnswer(int i) return m_answerBlank; } -TQString WQQuiz::answer(int i) +TQString WTQQuiz::answer(int i) { TQString s; - WQListItem li = m_list[i]; + WTQListItem li = m_list[i]; int j; if (li.question() == 0) { @@ -517,8 +517,8 @@ TQString WQQuiz::answer(int i) s = m_table->text(li.oneOp(), j); if (Prefs::enableBlanks()) { - s.replace("[", ""); - s.replace("]", ""); + s.tqreplace("[", ""); + s.tqreplace("]", ""); s.prepend(""); s.append(""); } @@ -535,16 +535,16 @@ TQString WQQuiz::answer(int i) return s; } -TQString WQQuiz::langQuestion(int i) +TQString WTQQuiz::langQuestion(int i) { - WQListItem li = m_list[i]; + WTQListItem li = m_list[i]; return m_table->horizontalHeader()->label(li.question()); } -TQString WQQuiz::langAnswer(int i) +TQString WTQQuiz::langAnswer(int i) { - WQListItem li = m_list[i]; + WTQListItem li = m_list[i]; int j; if (li.question() == 0) @@ -559,26 +559,26 @@ TQString WQQuiz::langAnswer(int i) return m_table->horizontalHeader()->label(j); } -int WQQuiz::kbAnswer(int i) +int WTQQuiz::kbAnswer(int i) { -/* WQListItem *li = m_list->at(i); +/* WTQListItem *li = m_list->at(i); if (li->question() == 0) { - //@todo return m_table ->layoutLeft(); + //@todo return m_table ->tqlayoutLeft(); } else { - //@todo return m_table -> layoutRight(); + //@todo return m_table -> tqlayoutRight(); }*/ return 0; } -int WQQuiz::questionCount() +int WTQQuiz::questionCount() { return m_questionCount; } -void WQQuiz::finish() +void WTQQuiz::finish() { emit checkingAnswer(-1); } -- cgit v1.2.1