|
|
@ -63,23 +63,23 @@ TQString highlightError(const TQString & c, const TQString & e)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
TQAView::TQAView(TQWidget *tqparent, const char *name, WFlags f):QAViewBase(tqparent, name, f)
|
|
|
|
QAView::QAView(TQWidget *tqparent, const char *name, WFlags f):QAViewBase(tqparent, name, f)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
m_score = new WTQScore();
|
|
|
|
m_score = new WTQScore();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
TQAView::~TQAView()
|
|
|
|
QAView::~QAView()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
delete txtAnswer; //Fixes #122110 on PCLOS and Ubuntu
|
|
|
|
delete txtAnswer; //Fixes #122110 on PCLOS and Ubuntu
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void TQAView::setQuiz(WQQuiz *quiz)
|
|
|
|
void QAView::setQuiz(WQQuiz *quiz)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
m_quiz = quiz;
|
|
|
|
m_quiz = quiz;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void TQAView::init()
|
|
|
|
void QAView::init()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
m_score -> setQuestionCount(m_quiz->questionCount());
|
|
|
|
m_score -> setQuestionCount(m_quiz->questionCount());
|
|
|
|
m_score -> setAsPercent(Prefs::percent());
|
|
|
|
m_score -> setAsPercent(Prefs::percent());
|
|
|
@ -127,7 +127,7 @@ void TQAView::init()
|
|
|
|
txtAnswer->setFocus();
|
|
|
|
txtAnswer->setFocus();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void TQAView::slotCheck()
|
|
|
|
void QAView::slotCheck()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
KWordQuizApp *win=(KWordQuizApp *) tqparent();
|
|
|
|
KWordQuizApp *win=(KWordQuizApp *) tqparent();
|
|
|
|
if (win->actionCollection()->action("quiz_check")->isEnabled())
|
|
|
|
if (win->actionCollection()->action("quiz_check")->isEnabled())
|
|
|
@ -200,7 +200,7 @@ void TQAView::slotCheck()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void TQAView::slotHint()
|
|
|
|
void QAView::slotHint()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
TQString answer = txtAnswer->text();
|
|
|
|
TQString answer = txtAnswer->text();
|
|
|
|
TQString correctAnswer = m_quiz->hint(m_question);
|
|
|
|
TQString correctAnswer = m_quiz->hint(m_question);
|
|
|
@ -228,19 +228,19 @@ void TQAView::slotHint()
|
|
|
|
m_hintUsed = true;
|
|
|
|
m_hintUsed = true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void TQAView::slotRestart()
|
|
|
|
void QAView::slotRestart()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
m_quiz->activateBaseList();
|
|
|
|
m_quiz->activateBaseList();
|
|
|
|
init();
|
|
|
|
init();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void TQAView::slotRepeat()
|
|
|
|
void QAView::slotRepeat()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
m_quiz->activateErrorList();
|
|
|
|
m_quiz->activateErrorList();
|
|
|
|
init();
|
|
|
|
init();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void TQAView::updateScore()
|
|
|
|
void QAView::updateScore()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
TQString s;
|
|
|
|
TQString s;
|
|
|
|
s = s.setNum(m_quiz->questionCount(), 10);
|
|
|
|
s = s.setNum(m_quiz->questionCount(), 10);
|
|
|
@ -265,9 +265,9 @@ void TQAView::updateScore()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*!
|
|
|
|
/*!
|
|
|
|
\fn TQAView::showQuestion(int i)
|
|
|
|
\fn QAView::showQuestion(int i)
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
void TQAView::showQuestion(int i)
|
|
|
|
void QAView::showQuestion(int i)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
//m_quiz->setColumn(i);
|
|
|
|
//m_quiz->setColumn(i);
|
|
|
|
lblQuestionLanguage -> setText(m_quiz ->langQuestion(i));
|
|
|
|
lblQuestionLanguage -> setText(m_quiz ->langQuestion(i));
|
|
|
@ -295,13 +295,13 @@ void TQAView::showQuestion(int i)
|
|
|
|
//@todo handle keyboard tqlayouts
|
|
|
|
//@todo handle keyboard tqlayouts
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void TQAView::slotApplySettings( )
|
|
|
|
void QAView::slotApplySettings( )
|
|
|
|
{
|
|
|
|
{
|
|
|
|
m_score ->setAsPercent(Prefs::percent());
|
|
|
|
m_score ->setAsPercent(Prefs::percent());
|
|
|
|
updateScore();
|
|
|
|
updateScore();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void TQAView::slotSpecChar( const TQChar & c)
|
|
|
|
void QAView::slotSpecChar( const TQChar & c)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (txtAnswer->hasFocus())
|
|
|
|
if (txtAnswer->hasFocus())
|
|
|
|
{
|
|
|
|
{
|
|
|
|