summaryrefslogtreecommitdiffstats
path: root/kwordquiz/src/qaview.cpp
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-06-11 04:44:41 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-06-11 04:44:41 +0000
commita374efce3a207b39514be3c52264091400ce297e (patch)
tree77bdf654b55826d4f59b53a5621310206bcaead1 /kwordquiz/src/qaview.cpp
parentf81a494f3957d5cf38c787973415597941934727 (diff)
downloadtdeedu-a374efce3a207b39514be3c52264091400ce297e.tar.gz
tdeedu-a374efce3a207b39514be3c52264091400ce297e.zip
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
Diffstat (limited to 'kwordquiz/src/qaview.cpp')
-rw-r--r--kwordquiz/src/qaview.cpp44
1 files changed, 22 insertions, 22 deletions
diff --git a/kwordquiz/src/qaview.cpp b/kwordquiz/src/qaview.cpp
index 4660df9f..b67e176b 100644
--- a/kwordquiz/src/qaview.cpp
+++ b/kwordquiz/src/qaview.cpp
@@ -63,23 +63,23 @@ TQString highlightError(const TQString & c, const TQString & e)
}
-QAView::QAView(TQWidget *parent, const char *name, WFlags f):QAViewBase(parent, name, f)
+TQAView::TQAView(TQWidget *tqparent, const char *name, WFlags f):QAViewBase(tqparent, name, f)
{
- m_score = new WQScore();
+ m_score = new WTQScore();
}
-QAView::~QAView()
+TQAView::~TQAView()
{
delete txtAnswer; //Fixes #122110 on PCLOS and Ubuntu
}
-void QAView::setQuiz(WQQuiz *quiz)
+void TQAView::setQuiz(WTQQuiz *quiz)
{
m_quiz = quiz;
}
-void QAView::init()
+void TQAView::init()
{
m_score -> setQuestionCount(m_quiz->questionCount());
m_score -> setAsPercent(Prefs::percent());
@@ -116,7 +116,7 @@ void QAView::init()
picYourAnswer->clear();
picCorrectAnswer->clear();
- KWordQuizApp *win=(KWordQuizApp *) parent();
+ KWordQuizApp *win=(KWordQuizApp *) tqparent();
win->actionCollection()->action("quiz_check")->setEnabled(true);
win->actionCollection()->action("qa_hint")->setEnabled(true);
win->actionCollection()->action("quiz_repeat_errors")->setEnabled(false);
@@ -127,9 +127,9 @@ void QAView::init()
txtAnswer->setFocus();
}
-void QAView::slotCheck()
+void TQAView::slotCheck()
{
- KWordQuizApp *win=(KWordQuizApp *) parent();
+ KWordQuizApp *win=(KWordQuizApp *) tqparent();
if (win->actionCollection()->action("quiz_check")->isEnabled())
{
bool fIsCorrect;
@@ -155,7 +155,7 @@ void QAView::slotCheck()
lblCorrectHeader->clear();
picCorrectAnswer->clear();
lblCorrect->clear();
- m_score->countIncrement(WQScore::cdCorrect);
+ m_score->countIncrement(WTQScore::cdCorrect);
updateScore();
KNotifyClient::event(winId(), "QuizCorrect", i18n("Your answer was correct!"));
}
@@ -168,7 +168,7 @@ void QAView::slotCheck()
lblCorrect->setText(m_quiz->answer(m_question));
picCorrectAnswer->setPixmap(KGlobal::iconLoader()->loadIcon("check", KIcon::Panel));
lblCorrectHeader->setText(i18n("Correct Answer"));
- m_score->countIncrement(WQScore::cdError);
+ m_score->countIncrement(WTQScore::cdError);
updateScore();
KNotifyClient::event(winId(), "QuizError", i18n("Your answer was incorrect."));
}
@@ -200,7 +200,7 @@ void QAView::slotCheck()
}
}
-void QAView::slotHint()
+void TQAView::slotHint()
{
TQString answer = txtAnswer->text();
TQString correctAnswer = m_quiz->hint(m_question);
@@ -228,19 +228,19 @@ void QAView::slotHint()
m_hintUsed = true;
}
-void QAView::slotRestart()
+void TQAView::slotRestart()
{
m_quiz->activateBaseList();
init();
}
-void QAView::slotRepeat()
+void TQAView::slotRepeat()
{
m_quiz->activateErrorList();
init();
}
-void QAView::updateScore()
+void TQAView::updateScore()
{
TQString s;
s = s.setNum(m_quiz->questionCount(), 10);
@@ -265,16 +265,16 @@ void QAView::updateScore()
/*!
- \fn QAView::showQuestion(int i)
+ \fn TQAView::showQuestion(int i)
*/
-void QAView::showQuestion(int i)
+void TQAView::showQuestion(int i)
{
//m_quiz->setColumn(i);
lblQuestionLanguage -> setText(m_quiz ->langQuestion(i));
lblQuestion -> setText(m_quiz ->question(i));
//lblQuestion -> setFont(m_quiz->fontQuestion(i));
- picQuestion->setPixmap(KGlobal::iconLoader()->loadIcon(m_quiz->quizIcon(i, WQQuiz::qiLeftCol), KIcon::Panel));
+ picQuestion->setPixmap(KGlobal::iconLoader()->loadIcon(m_quiz->quizIcon(i, WTQQuiz::qiLeftCol), KIcon::Panel));
lblAnswerLanguage -> setText(m_quiz ->langAnswer(i));
@@ -290,18 +290,18 @@ void QAView::showQuestion(int i)
//txtAnswer->setFont(m_quiz->fontAnswer(i));
txtAnswer -> setText("");
- picAnswer->setPixmap(KGlobal::iconLoader()->loadIcon(m_quiz->quizIcon(i, WQQuiz::qiRightCol), KIcon::Panel));
+ picAnswer->setPixmap(KGlobal::iconLoader()->loadIcon(m_quiz->quizIcon(i, WTQQuiz::qiRightCol), KIcon::Panel));
- //@todo handle keyboard layouts
+ //@todo handle keyboard tqlayouts
}
-void QAView::slotApplySettings( )
+void TQAView::slotApplySettings( )
{
m_score ->setAsPercent(Prefs::percent());
updateScore();
}
-void QAView::slotSpecChar( const TQChar & c)
+void TQAView::slotSpecChar( const TQChar & c)
{
if (txtAnswer->hasFocus())
{
@@ -311,7 +311,7 @@ void QAView::slotSpecChar( const TQChar & c)
TQString s = txtAnswer->selectedText();
int len = s.length();
int ss = txtAnswer->selectionStart();
- ls = ls.replace(ss, len, c);
+ ls = ls.tqreplace(ss, len, c);
txtAnswer->setText(ls);
txtAnswer->setSelection(ss, 1);
}