diff options
Diffstat (limited to 'kgeography')
35 files changed, 429 insertions, 429 deletions
diff --git a/kgeography/src/answer.cpp b/kgeography/src/answer.cpp index a468333c..f4931df3 100644 --- a/kgeography/src/answer.cpp +++ b/kgeography/src/answer.cpp @@ -8,9 +8,9 @@ * (at your option) any later version. * ***************************************************************************/ -#include <qimage.h> -#include <qlabel.h> -#include <qlayout.h> +#include <tqimage.h> +#include <tqlabel.h> +#include <tqlayout.h> #include <kdialog.h> @@ -37,12 +37,12 @@ userAnswer &userAnswer::operator=(const userAnswer &r) return *this; } -void userAnswer::setQuestion(QVariant question) +void userAnswer::setQuestion(TQVariant question) { p_question = question; } -void userAnswer::setAnswer(QVariant answer) +void userAnswer::setAnswer(TQVariant answer) { p_answer = answer; } @@ -52,15 +52,15 @@ void userAnswer::setAnswerCorrect(bool correct) p_correct = correct; } -void userAnswer::setCorrectAnswer(QVariant correctAnswer) +void userAnswer::setCorrectAnswer(TQVariant correctAnswer) { p_correctAnswer = correctAnswer; } -void userAnswer::putWidgets(QWidget *w, QGridLayout *lay, int row) const +void userAnswer::putWidgets(TQWidget *w, TQGridLayout *lay, int row) const { - QWidget *widgets[3]; - const QVariant *v; + TQWidget *widgets[3]; + const TQVariant *v; for (int i = 0; i < 3; i++) { @@ -68,30 +68,30 @@ void userAnswer::putWidgets(QWidget *w, QGridLayout *lay, int row) const else if (i == 1) v = &p_answer; else v = &p_correctAnswer; - if (v -> type() == QVariant::String) + if (v -> type() == TQVariant::String) { - QLabel *l; - l = new QLabel(w); + TQLabel *l; + l = new TQLabel(w); l -> setText(v -> toString()); l -> setMargin(KDialog::marginHint() / 2); widgets[i] = l; } - else if (v -> type() == QVariant::Color) + else if (v -> type() == TQVariant::Color) { - QWidget *aux = new QWidget(w); - QHBoxLayout *lay = new QHBoxLayout(aux); + TQWidget *aux = new TQWidget(w); + TQHBoxLayout *lay = new TQHBoxLayout(aux); - QFrame *inner = new QFrame(aux); + TQFrame *inner = new TQFrame(aux); lay -> addWidget(inner); inner -> setBackgroundColor(v -> toColor()); inner -> setLineWidth(1); lay -> setMargin(KDialog::marginHint() / 2); widgets[i] = aux; } - else if (v -> type() == QVariant::Image) + else if (v -> type() == TQVariant::Image) { - QLabel *l; - l = new QLabel(w); + TQLabel *l; + l = new TQLabel(w); l -> setPixmap(v -> toImage()); l -> setAlignment(Qt::AlignHCenter); l -> setMargin(KDialog::marginHint() / 2); @@ -103,7 +103,7 @@ void userAnswer::putWidgets(QWidget *w, QGridLayout *lay, int row) const if (!p_correct) { - QColor back, fore; + TQColor back, fore; back = widgets[0] -> colorGroup().highlight(); fore = widgets[0] -> colorGroup().highlightedText(); for (int i = 0; i < 3; i++) diff --git a/kgeography/src/answer.h b/kgeography/src/answer.h index 02190ab4..b5169a0b 100644 --- a/kgeography/src/answer.h +++ b/kgeography/src/answer.h @@ -11,7 +11,7 @@ #ifndef RESULT_H #define RESULT_H -#include <qvariant.h> +#include <tqvariant.h> class QGridLayout; @@ -23,15 +23,15 @@ class userAnswer userAnswer &operator=(const userAnswer &qa); - void setQuestion(QVariant question); - void setAnswer(QVariant answer); + void setQuestion(TQVariant question); + void setAnswer(TQVariant answer); void setAnswerCorrect(bool correct); - void setCorrectAnswer(QVariant correctAnswer); + void setCorrectAnswer(TQVariant correctAnswer); - void putWidgets(QWidget *w, QGridLayout *lay, int row) const; + void putWidgets(TQWidget *w, TQGridLayout *lay, int row) const; private: - QVariant p_question, p_answer, p_correctAnswer; + TQVariant p_question, p_answer, p_correctAnswer; bool p_correct; }; diff --git a/kgeography/src/answersdialog.cpp b/kgeography/src/answersdialog.cpp index a9925b6d..c6d9d292 100644 --- a/kgeography/src/answersdialog.cpp +++ b/kgeography/src/answersdialog.cpp @@ -10,27 +10,27 @@ #include <klocale.h> -#include <qlabel.h> -#include <qlayout.h> -#include <qscrollview.h> +#include <tqlabel.h> +#include <tqlayout.h> +#include <tqscrollview.h> #include "answer.h" #include "answersdialog.h" -answersDialog::answersDialog(QWidget *parent, const QValueVector<userAnswer> &userAnswers, QString question, int correctAnswers) : KDialogBase(parent, 0, true, i18n("Your Answers Were"), Ok) +answersDialog::answersDialog(TQWidget *parent, const TQValueVector<userAnswer> &userAnswers, TQString question, int correctAnswers) : KDialogBase(parent, 0, true, i18n("Your Answers Were"), Ok) { - QLabel *l1, *l2, *l3; - QFont boldFont, bigFont; + TQLabel *l1, *l2, *l3; + TQFont boldFont, bigFont; uint totalAnswers; totalAnswers = userAnswers.count(); - p_sv = new QScrollView(this); + p_sv = new TQScrollView(this); setMainWidget(p_sv); - p_container = new QWidget(p_sv -> viewport()); + p_container = new TQWidget(p_sv -> viewport()); p_sv -> viewport() -> setPaletteBackgroundColor(p_container -> paletteBackgroundColor()); - QGridLayout *lay = new QGridLayout(p_container); + TQGridLayout *lay = new TQGridLayout(p_container); lay -> setColStretch(0, 1); lay -> setColStretch(4, 1); lay -> setRowStretch(totalAnswers + 4, 1); @@ -38,7 +38,7 @@ answersDialog::answersDialog(QWidget *parent, const QValueVector<userAnswer> &us // Title bigFont = p_container -> font(); bigFont.setPointSize(24); - l1 = new QLabel(question, p_container); + l1 = new TQLabel(question, p_container); l1 -> setFont(bigFont); l1 -> setAlignment(Qt::AlignCenter); lay->addMultiCellWidget(l1, 0, 0, 0, 4); @@ -47,11 +47,11 @@ answersDialog::answersDialog(QWidget *parent, const QValueVector<userAnswer> &us boldFont = p_container -> font(); boldFont.setBold(true); - l1 = new QLabel(i18n("Question"), p_container); + l1 = new TQLabel(i18n("Question"), p_container); l1 -> setFont(boldFont); - l2 = new QLabel(i18n("Your Answer"), p_container); + l2 = new TQLabel(i18n("Your Answer"), p_container); l2 -> setFont(boldFont); - l3 = new QLabel(i18n("Correct Answer"), p_container); + l3 = new TQLabel(i18n("Correct Answer"), p_container); l3 -> setFont(boldFont); l1 -> setMargin(KDialog::marginHint() / 2); l2 -> setMargin(KDialog::marginHint() / 2); @@ -65,9 +65,9 @@ answersDialog::answersDialog(QWidget *parent, const QValueVector<userAnswer> &us userAnswers[i].putWidgets(p_container, lay, i + 2); } - lay -> addItem(new QSpacerItem(20, 20, QSizePolicy::Fixed, QSizePolicy::Fixed), totalAnswers + 3, 2); + lay -> addItem(new TQSpacerItem(20, 20, TQSizePolicy::Fixed, TQSizePolicy::Fixed), totalAnswers + 3, 2); - l1 = new QLabel(i18n("You answered correctly %1 out of %2 questions.").arg(correctAnswers).arg(totalAnswers), p_container); + l1 = new TQLabel(i18n("You answered correctly %1 out of %2 questions.").arg(correctAnswers).arg(totalAnswers), p_container); l1 -> setAlignment(Qt::AlignCenter); lay->addMultiCellWidget(l1, totalAnswers + 4, totalAnswers + 4, 0, 4); @@ -75,12 +75,12 @@ answersDialog::answersDialog(QWidget *parent, const QValueVector<userAnswer> &us resize(500, 500); } -void answersDialog::showEvent(QShowEvent *) +void answersDialog::showEvent(TQShowEvent *) { positionContainer(); } -void answersDialog::resizeEvent(QResizeEvent *) +void answersDialog::resizeEvent(TQResizeEvent *) { positionContainer(); } diff --git a/kgeography/src/answersdialog.h b/kgeography/src/answersdialog.h index acd930a9..730a1142 100644 --- a/kgeography/src/answersdialog.h +++ b/kgeography/src/answersdialog.h @@ -13,7 +13,7 @@ #include <kdialogbase.h> -#include <qvaluevector.h> +#include <tqvaluevector.h> class QScrollView; class QWidget; @@ -23,17 +23,17 @@ class userAnswer; class answersDialog : public KDialogBase { public: - answersDialog(QWidget *parent, const QValueVector<userAnswer> &userAnswers, QString question, int correctAnswers); + answersDialog(TQWidget *parent, const TQValueVector<userAnswer> &userAnswers, TQString question, int correctAnswers); protected: - void showEvent(QShowEvent *e); - void resizeEvent(QResizeEvent *e); + void showEvent(TQShowEvent *e); + void resizeEvent(TQResizeEvent *e); private: void positionContainer(); - QWidget *p_container; - QScrollView *p_sv; + TQWidget *p_container; + TQScrollView *p_sv; }; #endif diff --git a/kgeography/src/askwidget.cpp b/kgeography/src/askwidget.cpp index d0d38548..87d1d09a 100644 --- a/kgeography/src/askwidget.cpp +++ b/kgeography/src/askwidget.cpp @@ -11,16 +11,16 @@ #include <klocale.h> #include <kmessagebox.h> -#include <qlabel.h> +#include <tqlabel.h> #include "askwidget.h" #include "map.h" -askWidget::askWidget(QWidget *parent, KGmap *m, QWidget *w, uint count, bool showLabel) : QWidget(parent), p_map(m), p_count(count) +askWidget::askWidget(TQWidget *parent, KGmap *m, TQWidget *w, uint count, bool showLabel) : TQWidget(parent), p_map(m), p_count(count) { if (showLabel) { - p_answers = new QLabel(w); + p_answers = new TQLabel(w); p_answers -> setAlignment(AlignTop | AlignHCenter); resetAnswers(); p_answers -> show(); @@ -38,7 +38,7 @@ int askWidget::correctAnswers() const return p_correctAnswers; } -QValueVector<userAnswer> askWidget::userAnswers() const +TQValueVector<userAnswer> askWidget::userAnswers() const { return p_userAnswers; } @@ -60,14 +60,14 @@ void askWidget::clearAsked() p_asked.clear(); } -QString askWidget::lastDivisionAsked() +TQString askWidget::lastDivisionAsked() { return p_asked.last(); } void askWidget::nextQuestion() { - QString aux; + TQString aux; if (p_asked.count() < p_count) { diff --git a/kgeography/src/askwidget.h b/kgeography/src/askwidget.h index 9e7450ae..5cc01943 100644 --- a/kgeography/src/askwidget.h +++ b/kgeography/src/askwidget.h @@ -11,8 +11,8 @@ #ifndef ASKWIDGET_H #define ASKWIDGET_H -#include <qvaluevector.h> -#include <qwidget.h> +#include <tqvaluevector.h> +#include <tqwidget.h> #include "answer.h" @@ -24,13 +24,13 @@ class askWidget : public QWidget { Q_OBJECT public: - askWidget(QWidget *parent, KGmap *m, QWidget *w, uint count, bool showLabel = true); + askWidget(TQWidget *parent, KGmap *m, TQWidget *w, uint count, bool showLabel = true); virtual ~askWidget(); - virtual QString getQuestionHook() const = 0; + virtual TQString getQuestionHook() const = 0; virtual bool isClickOnDivision() const { return false; } int correctAnswers() const; - QValueVector<userAnswer> userAnswers() const; + TQValueVector<userAnswer> userAnswers() const; public slots: virtual void setMovement(bool b); @@ -45,25 +45,25 @@ Q_OBJECT protected: void clearAsked(); - QString lastDivisionAsked(); + TQString lastDivisionAsked(); void nextQuestion(); - virtual void nextQuestionHook(const QString &division) = 0; + virtual void nextQuestionHook(const TQString &division) = 0; void questionAnswered(bool wasCorrect); void resetAnswers(); KGmap *p_map; userAnswer p_currentAnswer; - QLabel *p_answers; + TQLabel *p_answers; private: void updateLabel(); int p_correctAnswers, p_incorrectAnswers; - QValueVector<userAnswer> p_userAnswers; + TQValueVector<userAnswer> p_userAnswers; // the list of asked divisions - QStringList p_asked; + TQStringList p_asked; // the number of questions to do uint p_count; diff --git a/kgeography/src/boxasker.cpp b/kgeography/src/boxasker.cpp index 0634c622..dc6d526d 100644 --- a/kgeography/src/boxasker.cpp +++ b/kgeography/src/boxasker.cpp @@ -15,25 +15,25 @@ #include <klocale.h> #include <kpushbutton.h> -#include <qlabel.h> -#include <qlayout.h> -#include <qradiobutton.h> -#include <qvbuttongroup.h> +#include <tqlabel.h> +#include <tqlayout.h> +#include <tqradiobutton.h> +#include <tqvbuttongroup.h> #include "boxasker.h" #include "map.h" -boxAsker::boxAsker(QWidget *parent, KGmap *m, QWidget *w, uint count) : askWidget(parent, m, w, count) +boxAsker::boxAsker(TQWidget *parent, KGmap *m, TQWidget *w, uint count) : askWidget(parent, m, w, count) { - p_lay = new QVBoxLayout(this); + p_lay = new TQVBoxLayout(this); - QVButtonGroup *bg = new QVButtonGroup(this); - p_label = new QLabel(this); - p_rb = new QRadioButton*[4]; + TQVButtonGroup *bg = new TQVButtonGroup(this); + p_label = new TQLabel(this); + p_rb = new TQRadioButton*[4]; for(int i = 0; i < 4; i++) { - p_rb[i] = new QRadioButton(bg); - p_rb[i]->setFocusPolicy(QWidget::StrongFocus); + p_rb[i] = new TQRadioButton(bg); + p_rb[i]->setFocusPolicy(TQWidget::StrongFocus); } p_accept = new KPushButton(this); @@ -48,21 +48,21 @@ boxAsker::~boxAsker() delete[] p_rb; } -void boxAsker::setQuestion(const QString &q) +void boxAsker::setQuestion(const TQString &q) { p_label -> setText(q); } -void boxAsker::keyReleaseEvent(QKeyEvent *e) +void boxAsker::keyReleaseEvent(TQKeyEvent *e) { if (e -> key() == Qt::Key_Return || e -> key() == Qt::Key_Enter) checkAnswer(); else askWidget::keyReleaseEvent(e); } -void boxAsker::nextQuestionHook(const QString &division) +void boxAsker::nextQuestionHook(const TQString &division) { - QString otherDivision; - QStringList auxList; + TQString otherDivision; + TQStringList auxList; int i; setFocus(); @@ -122,7 +122,7 @@ void boxAsker::init() nextQuestion(); p_accept -> disconnect(); - connect(p_accept, SIGNAL(clicked()), this, SLOT(checkAnswer())); + connect(p_accept, TQT_SIGNAL(clicked()), this, TQT_SLOT(checkAnswer())); } #include "boxasker.moc" diff --git a/kgeography/src/boxasker.h b/kgeography/src/boxasker.h index a9391f43..f48878ef 100644 --- a/kgeography/src/boxasker.h +++ b/kgeography/src/boxasker.h @@ -23,19 +23,19 @@ class boxAsker : public askWidget { Q_OBJECT public: - boxAsker(QWidget *parent, KGmap *m, QWidget *w, uint count); + boxAsker(TQWidget *parent, KGmap *m, TQWidget *w, uint count); ~boxAsker(); protected: - virtual bool nextBoxAskerQuestionHook(const QString &division, int i, bool isAnswer) = 0; - void nextQuestionHook(const QString &division); - void setQuestion(const QString &q); + virtual bool nextBoxAskerQuestionHook(const TQString &division, int i, bool isAnswer) = 0; + void nextQuestionHook(const TQString &division); + void setQuestion(const TQString &q); virtual void setAnswerHook(int userSays) = 0; - void keyReleaseEvent(QKeyEvent *e); + void keyReleaseEvent(TQKeyEvent *e); - QVBoxLayout *p_lay; - QRadioButton **p_rb; + TQVBoxLayout *p_lay; + TQRadioButton **p_rb; protected slots: void init(); @@ -51,7 +51,7 @@ Q_OBJECT // the position the correct answer is in int p_position; - QLabel *p_label; + TQLabel *p_label; }; #endif diff --git a/kgeography/src/capitaldivisionasker.cpp b/kgeography/src/capitaldivisionasker.cpp index 623cffa4..ffea1407 100644 --- a/kgeography/src/capitaldivisionasker.cpp +++ b/kgeography/src/capitaldivisionasker.cpp @@ -10,17 +10,17 @@ #include <klocale.h> -#include <qradiobutton.h> +#include <tqradiobutton.h> #include "capitaldivisionasker.h" #include "map.h" -capitalDivisionAsker::capitalDivisionAsker(QWidget *parent, KGmap *m, QWidget *w, uint count) : boxAsker(parent, m, w, count) +capitalDivisionAsker::capitalDivisionAsker(TQWidget *parent, KGmap *m, TQWidget *w, uint count) : boxAsker(parent, m, w, count) { init(); } -bool capitalDivisionAsker::nextBoxAskerQuestionHook(const QString &division, int i, bool isAnswer) +bool capitalDivisionAsker::nextBoxAskerQuestionHook(const TQString &division, int i, bool isAnswer) { bool b; if (isAnswer) @@ -29,16 +29,16 @@ bool capitalDivisionAsker::nextBoxAskerQuestionHook(const QString &division, int p_currentAnswer.setQuestion(i18n(p_map -> getFileName().utf8(), p_capital.utf8())); p_currentAnswer.setCorrectAnswer(i18n(p_map -> getFileName().utf8(), division.utf8())); - QString sw = i18n("There are two ways of dealing with the translation of \"%1 is the capital of...\". The first option simply replaces %1 with the translated name of the relevant city. If the grammar of your language allows this, choose this option by setting the translation of this message to 1, and leave untranslated the translations of \"%1 is the capital of...\" that have the placename embedded (or translate them as - if you wish to show the file as fully translated. The second option is to translate all messages in full - this is likely to be required in the case of highly-inflected languages like Russian. To choose this option, set the translation of this message to 0, and translate all the messages.", "0"); + TQString sw = i18n("There are two ways of dealing with the translation of \"%1 is the capital of...\". The first option simply replaces %1 with the translated name of the relevant city. If the grammar of your language allows this, choose this option by setting the translation of this message to 1, and leave untranslated the translations of \"%1 is the capital of...\" that have the placename embedded (or translate them as - if you wish to show the file as fully translated. The second option is to translate all messages in full - this is likely to be required in the case of highly-inflected languages like Russian. To choose this option, set the translation of this message to 0, and translate all the messages.", "0"); if (sw == "1") { - QString capitalName = i18n(p_map -> getFileName().utf8(), p_capital.utf8()); - QString text = i18n("%1 is the capital of..."); + TQString capitalName = i18n(p_map -> getFileName().utf8(), p_capital.utf8()); + TQString text = i18n("%1 is the capital of..."); setQuestion(text.arg(capitalName)); } else { - QString s = QString("%1 is the capital of...").arg(p_capital); + TQString s = TQString("%1 is the capital of...").arg(p_capital); setQuestion(i18n(p_map -> getFileName().utf8(), s.utf8())); } p_rb[i] -> setText(i18n(p_map -> getFileName().utf8(), division.utf8())); @@ -68,7 +68,7 @@ void capitalDivisionAsker::setAnswerHook(int userSays) p_currentAnswer.setAnswer(p_rb[userSays] -> text()); } -QString capitalDivisionAsker::getQuestionHook() const +TQString capitalDivisionAsker::getQuestionHook() const { return i18n("Division From Its Capital"); } diff --git a/kgeography/src/capitaldivisionasker.h b/kgeography/src/capitaldivisionasker.h index 6464d62b..9d9b9ec8 100644 --- a/kgeography/src/capitaldivisionasker.h +++ b/kgeography/src/capitaldivisionasker.h @@ -18,15 +18,15 @@ class QLabel; class capitalDivisionAsker : public boxAsker { public: - capitalDivisionAsker(QWidget *parent, KGmap *m, QWidget *w, uint count); + capitalDivisionAsker(TQWidget *parent, KGmap *m, TQWidget *w, uint count); protected: - bool nextBoxAskerQuestionHook(const QString &division, int i, bool isAnswer); + bool nextBoxAskerQuestionHook(const TQString &division, int i, bool isAnswer); void setAnswerHook(int userSays); - QString getQuestionHook() const; + TQString getQuestionHook() const; private: - QString p_capital; + TQString p_capital; }; #endif diff --git a/kgeography/src/division.cpp b/kgeography/src/division.cpp index 733b6d3f..7ef70353 100644 --- a/kgeography/src/division.cpp +++ b/kgeography/src/division.cpp @@ -8,7 +8,7 @@ * (at your option) any later version. * ***************************************************************************/ -#include <qfile.h> +#include <tqfile.h> #include "division.h" @@ -16,7 +16,7 @@ division::division() { p_canAskAlways = true; p_canAskClickDivision = true; - p_flagFile = QString::null; + p_flagFile = TQString::null; } bool division::canAsk(bool clickDivisionMode) const @@ -25,7 +25,7 @@ bool division::canAsk(bool clickDivisionMode) const else return p_canAskAlways; } -QString division::getName() const +TQString division::getName() const { return p_name; } @@ -35,18 +35,18 @@ QRgb division::getRGB() const return p_color; } -QString division::getFlagFile() const +TQString division::getFlagFile() const { return p_flagFile; } -QString division::getCapital() const +TQString division::getCapital() const { if (p_capital.isEmpty()) return ""; return p_capital; } -void division::setCapital(const QString &name) +void division::setCapital(const TQString &name) { p_capital = name; } @@ -65,7 +65,7 @@ void division::setIgnore(bool ignore, bool canAskClickDivision) } } -void division::setName(const QString &name) +void division::setName(const TQString &name) { p_name = name; } @@ -75,8 +75,8 @@ void division::setRGB(int r, int g, int b) p_color = qRgb(r, g, b); } -bool division::setFlagFile(const QString &path) +bool division::setFlagFile(const TQString &path) { p_flagFile = path; - return QFile::exists(path); + return TQFile::exists(path); } diff --git a/kgeography/src/division.h b/kgeography/src/division.h index cc8119a3..69b347f3 100644 --- a/kgeography/src/division.h +++ b/kgeography/src/division.h @@ -11,8 +11,8 @@ #ifndef DIVISION_H #define DIVISION_H -#include <qcolor.h> -#include <qstring.h> +#include <tqcolor.h> +#include <tqstring.h> class division { @@ -20,19 +20,19 @@ class division division(); bool canAsk(bool clickDivisionMode) const; - QString getName() const; + TQString getName() const; QRgb getRGB() const; - QString getFlagFile() const; - QString getCapital() const; + TQString getFlagFile() const; + TQString getCapital() const; - void setCapital(const QString &name); + void setCapital(const TQString &name); void setIgnore(bool ignore, bool canAskClickDivision); - void setName(const QString &name); + void setName(const TQString &name); void setRGB(int r, int g, int b); - bool setFlagFile(const QString &path); + bool setFlagFile(const TQString &path); private: - QString p_name, p_flagFile, p_capital; + TQString p_name, p_flagFile, p_capital; QRgb p_color; bool p_canAskAlways, p_canAskClickDivision; }; diff --git a/kgeography/src/divisioncapitalasker.cpp b/kgeography/src/divisioncapitalasker.cpp index 0fcdb8b8..b87437a2 100644 --- a/kgeography/src/divisioncapitalasker.cpp +++ b/kgeography/src/divisioncapitalasker.cpp @@ -10,31 +10,31 @@ #include <klocale.h> -#include <qradiobutton.h> +#include <tqradiobutton.h> #include "divisioncapitalasker.h" #include "map.h" -divisionCapitalAsker::divisionCapitalAsker(QWidget *parent, KGmap *m, QWidget *w, uint count) : boxAsker(parent, m, w, count) +divisionCapitalAsker::divisionCapitalAsker(TQWidget *parent, KGmap *m, TQWidget *w, uint count) : boxAsker(parent, m, w, count) { init(); } -bool divisionCapitalAsker::nextBoxAskerQuestionHook(const QString &division, int i, bool isAnswer) +bool divisionCapitalAsker::nextBoxAskerQuestionHook(const TQString &division, int i, bool isAnswer) { bool b; if (isAnswer) { - QString sw = i18n("There are two ways of dealing with the translation of \"The capital of %1 is...\". The first option simply replaces %1 with the translated name of the relevant region. If the grammar of your language allows this, choose this option by setting the translation of this message to 1, and leave untranslated the translations of \"The capital of %1 is...\" that have the placename embedded (or translate them as - if you wish to show the file as fully translated. The second option is to translate all messages in full - this is likely to be required in the case of highly-inflected languages like Russian. To choose this option, set the translation of this message to 0, and translate all the messages.", "0"); + TQString sw = i18n("There are two ways of dealing with the translation of \"The capital of %1 is...\". The first option simply replaces %1 with the translated name of the relevant region. If the grammar of your language allows this, choose this option by setting the translation of this message to 1, and leave untranslated the translations of \"The capital of %1 is...\" that have the placename embedded (or translate them as - if you wish to show the file as fully translated. The second option is to translate all messages in full - this is likely to be required in the case of highly-inflected languages like Russian. To choose this option, set the translation of this message to 0, and translate all the messages.", "0"); if (sw == "1") { - QString divisionName = i18n(p_map -> getFileName().utf8(), division.utf8()); - QString text = i18n("The capital of %1 is..."); + TQString divisionName = i18n(p_map -> getFileName().utf8(), division.utf8()); + TQString text = i18n("The capital of %1 is..."); setQuestion(text.arg(divisionName)); } else { - QString s = QString("The capital of %1 is...").arg(division); + TQString s = TQString("The capital of %1 is...").arg(division); setQuestion(i18n(p_map -> getFileName().utf8(), s.utf8())); } p_currentAnswer.setQuestion(i18n(p_map -> getFileName().utf8(), division.utf8())); @@ -45,7 +45,7 @@ bool divisionCapitalAsker::nextBoxAskerQuestionHook(const QString &division, int } else { - QString capital; + TQString capital; capital = p_map -> getDivisionCapital(division); // There are crazy countries like Norway where two different divisions // have the same capital, avoid asking @@ -69,7 +69,7 @@ void divisionCapitalAsker::setAnswerHook(int userSays) p_currentAnswer.setAnswer(p_rb[userSays] -> text()); } -QString divisionCapitalAsker::getQuestionHook() const +TQString divisionCapitalAsker::getQuestionHook() const { return i18n("Capital of Division"); } diff --git a/kgeography/src/divisioncapitalasker.h b/kgeography/src/divisioncapitalasker.h index e63901c5..e4bc5514 100644 --- a/kgeography/src/divisioncapitalasker.h +++ b/kgeography/src/divisioncapitalasker.h @@ -16,15 +16,15 @@ class divisionCapitalAsker : public boxAsker { public: - divisionCapitalAsker(QWidget *parent, KGmap *m, QWidget *w, uint count); + divisionCapitalAsker(TQWidget *parent, KGmap *m, TQWidget *w, uint count); protected: - bool nextBoxAskerQuestionHook(const QString &division, int i, bool isAnswer); + bool nextBoxAskerQuestionHook(const TQString &division, int i, bool isAnswer); void setAnswerHook(int userSays); - QString getQuestionHook() const; + TQString getQuestionHook() const; private: - QString p_capital; + TQString p_capital; }; #endif diff --git a/kgeography/src/divisionflagasker.cpp b/kgeography/src/divisionflagasker.cpp index cc5f2430..79641b25 100644 --- a/kgeography/src/divisionflagasker.cpp +++ b/kgeography/src/divisionflagasker.cpp @@ -10,34 +10,34 @@ #include <klocale.h> -#include <qimage.h> -#include <qradiobutton.h> +#include <tqimage.h> +#include <tqradiobutton.h> #include "divisionflagasker.h" #include "map.h" -divisionFlagAsker::divisionFlagAsker(QWidget *parent, KGmap *m, QWidget *w, uint count) : boxAsker(parent, m, w, count) +divisionFlagAsker::divisionFlagAsker(TQWidget *parent, KGmap *m, TQWidget *w, uint count) : boxAsker(parent, m, w, count) { init(); } -bool divisionFlagAsker::nextBoxAskerQuestionHook(const QString &division, int i, bool isAnswer) +bool divisionFlagAsker::nextBoxAskerQuestionHook(const TQString &division, int i, bool isAnswer) { - QImage im(p_map -> getDivisionFlagFile(division)); + TQImage im(p_map -> getDivisionFlagFile(division)); im = im.smoothScale(im.width()/5, im.height()/5); p_rb[i] -> setPixmap(im); if (isAnswer) { - QString sw = i18n("There are two ways of dealing with the translation of \"The flag of %1 is...\". The first option simply replaces %1 with the translated name of the relevant region. If the grammar of your language allows this, choose this option by setting the translation of this message to 1, and leave untranslated the translations of \"The flag of %1 is...\" that have the placename embedded (or translate them as - if you wish to show the file as fully translated. The second option is to translate all messages in full - this is likely to be required in the case of highly-inflected languages like Russian. To choose this option, set the translation of this message to 0, and translate all the messages.", "0"); + TQString sw = i18n("There are two ways of dealing with the translation of \"The flag of %1 is...\". The first option simply replaces %1 with the translated name of the relevant region. If the grammar of your language allows this, choose this option by setting the translation of this message to 1, and leave untranslated the translations of \"The flag of %1 is...\" that have the placename embedded (or translate them as - if you wish to show the file as fully translated. The second option is to translate all messages in full - this is likely to be required in the case of highly-inflected languages like Russian. To choose this option, set the translation of this message to 0, and translate all the messages.", "0"); if (sw == "1") { - QString divisionName = i18n(p_map -> getFileName().utf8(), division.utf8()); - QString text = i18n("The flag of %1 is..."); + TQString divisionName = i18n(p_map -> getFileName().utf8(), division.utf8()); + TQString text = i18n("The flag of %1 is..."); setQuestion(text.arg(divisionName)); } else { - QString s = QString("The flag of %1 is...").arg(division); + TQString s = TQString("The flag of %1 is...").arg(division); setQuestion(i18n(p_map -> getFileName().utf8(), s.utf8())); } p_currentAnswer.setCorrectAnswer(im); @@ -51,7 +51,7 @@ void divisionFlagAsker::setAnswerHook(int userSays) p_currentAnswer.setAnswer(p_rb[userSays] -> pixmap() -> convertToImage()); } -QString divisionFlagAsker::getQuestionHook() const +TQString divisionFlagAsker::getQuestionHook() const { return i18n("Flag of Division"); } diff --git a/kgeography/src/divisionflagasker.h b/kgeography/src/divisionflagasker.h index a0611d28..5e1eaef2 100644 --- a/kgeography/src/divisionflagasker.h +++ b/kgeography/src/divisionflagasker.h @@ -16,12 +16,12 @@ class divisionFlagAsker : public boxAsker { public: - divisionFlagAsker(QWidget *parent, KGmap *m, QWidget *w, uint count); + divisionFlagAsker(TQWidget *parent, KGmap *m, TQWidget *w, uint count); protected: - bool nextBoxAskerQuestionHook(const QString &division, int i, bool isAnswer); + bool nextBoxAskerQuestionHook(const TQString &division, int i, bool isAnswer); void setAnswerHook(int userSays); - QString getQuestionHook() const; + TQString getQuestionHook() const; }; #endif diff --git a/kgeography/src/flagdivisionasker.cpp b/kgeography/src/flagdivisionasker.cpp index 365da9ef..f6c305ab 100644 --- a/kgeography/src/flagdivisionasker.cpp +++ b/kgeography/src/flagdivisionasker.cpp @@ -10,27 +10,27 @@ #include <klocale.h> -#include <qimage.h> -#include <qlayout.h> -#include <qradiobutton.h> +#include <tqimage.h> +#include <tqlayout.h> +#include <tqradiobutton.h> #include "flagdivisionasker.h" #include "map.h" -flagDivisionAsker::flagDivisionAsker(QWidget *parent, KGmap *m, QWidget *w, uint count) : boxAsker(parent, m, w, count) +flagDivisionAsker::flagDivisionAsker(TQWidget *parent, KGmap *m, TQWidget *w, uint count) : boxAsker(parent, m, w, count) { - p_flag = new QWidget(this); + p_flag = new TQWidget(this); p_lay -> insertWidget(0, p_flag); setQuestion(i18n("This flag belongs to:")); init(); } -bool flagDivisionAsker::nextBoxAskerQuestionHook(const QString &division, int i, bool isAnswer) +bool flagDivisionAsker::nextBoxAskerQuestionHook(const TQString &division, int i, bool isAnswer) { if (isAnswer) { // we put the flag image - QImage image(p_map -> getDivisionFlagFile(division)); + TQImage image(p_map -> getDivisionFlagFile(division)); p_flag -> setPaletteBackgroundPixmap(image); p_flag -> setFixedSize(image.size()); @@ -46,7 +46,7 @@ void flagDivisionAsker::setAnswerHook(int userSays) p_currentAnswer.setAnswer(p_rb[userSays] -> text()); } -QString flagDivisionAsker::getQuestionHook() const +TQString flagDivisionAsker::getQuestionHook() const { return i18n("Division From Its Flag"); } diff --git a/kgeography/src/flagdivisionasker.h b/kgeography/src/flagdivisionasker.h index 5e351f4c..dfd4f662 100644 --- a/kgeography/src/flagdivisionasker.h +++ b/kgeography/src/flagdivisionasker.h @@ -16,15 +16,15 @@ class flagDivisionAsker : public boxAsker { public: - flagDivisionAsker(QWidget *parent, KGmap *m, QWidget *w, uint count); + flagDivisionAsker(TQWidget *parent, KGmap *m, TQWidget *w, uint count); protected: - bool nextBoxAskerQuestionHook(const QString &division, int i, bool isAnswer); + bool nextBoxAskerQuestionHook(const TQString &division, int i, bool isAnswer); void setAnswerHook(int userSays); - QString getQuestionHook() const; + TQString getQuestionHook() const; private: - QWidget *p_flag; + TQWidget *p_flag; }; #endif diff --git a/kgeography/src/kgeography.cpp b/kgeography/src/kgeography.cpp index 26ce7819..33740e66 100644 --- a/kgeography/src/kgeography.cpp +++ b/kgeography/src/kgeography.cpp @@ -17,12 +17,12 @@ #include <kstdaction.h> #include <kmenubar.h> -#include <qlabel.h> -#include <qlayout.h> -#include <qvbox.h> -#include <qsize.h> -#include <qtimer.h> -#include <qwhatsthis.h> +#include <tqlabel.h> +#include <tqlayout.h> +#include <tqvbox.h> +#include <tqsize.h> +#include <tqtimer.h> +#include <tqwhatsthis.h> #include "answersdialog.h" #include "capitaldivisionasker.h" @@ -41,40 +41,40 @@ kgeography::kgeography() : KMainWindow(), p_firstShow(true), p_mustShowResultsDi p_map = 0; p_askWidget = 0; - p_bigWidget = new QHBox(this); + p_bigWidget = new TQHBox(this); - QVBox *p_leftWidget = new QVBox(p_bigWidget); - p_currentMap = new QLabel(p_leftWidget); + TQVBox *p_leftWidget = new TQVBox(p_bigWidget); + p_currentMap = new TQLabel(p_leftWidget); p_currentMap -> setAlignment(AlignCenter); p_consult = new KPushButton(i18n("&Browse Map"), p_leftWidget); - QWhatsThis::add(p_consult, i18n("In this section left click on any part of the map to learn about the divisions" )); + TQWhatsThis::add(p_consult, i18n("In this section left click on any part of the map to learn about the divisions" )); p_askMap = new KPushButton(i18n("&Click Division in Map..."), p_leftWidget); - QWhatsThis::add(p_askMap, i18n("In this challenge you are given a division name on the left under the menu and you must find it on the map and click on it")); + TQWhatsThis::add(p_askMap, i18n("In this challenge you are given a division name on the left under the menu and you must find it on the map and click on it")); p_askCapitalDivisions = new KPushButton(i18n("Guess Division From Its &Capital..."), p_leftWidget); - QWhatsThis::add(p_askCapitalDivisions, i18n("In this quiz you have to guess the division name given its capital")); + TQWhatsThis::add(p_askCapitalDivisions, i18n("In this quiz you have to guess the division name given its capital")); p_askDivisionCapitals = new KPushButton(i18n("Guess Capital of &Division..."), p_leftWidget); - QWhatsThis::add(p_askDivisionCapitals, i18n("In this quiz you have to guess the capital of a given division name")); + TQWhatsThis::add(p_askDivisionCapitals, i18n("In this quiz you have to guess the capital of a given division name")); p_askFlagDivisions = new KPushButton(i18n("&Guess Division From Its Flag..."), p_leftWidget); - QWhatsThis::add(p_askFlagDivisions, i18n("In this quiz you have to guess the division name given its flag")); + TQWhatsThis::add(p_askFlagDivisions, i18n("In this quiz you have to guess the division name given its flag")); p_askDivisionFlags = new KPushButton(i18n("G&uess Flag of Division..."), p_leftWidget); - QWhatsThis::add(p_askDivisionFlags, i18n("In this quiz you have to guess the flag of a division given its name")); - p_underLeftWidget = new QVBox(p_leftWidget); + TQWhatsThis::add(p_askDivisionFlags, i18n("In this quiz you have to guess the flag of a division given its name")); + p_underLeftWidget = new TQVBox(p_leftWidget); p_underLeftWidget -> layout() -> setSpacing(KDialog::spacingHint()); p_underLeftWidget -> layout() -> setMargin(KDialog::marginHint()); p_leftWidget -> setStretchFactor(p_underLeftWidget, 1); setCentralWidget(p_bigWidget); - connect(p_consult, SIGNAL(clicked()), this, SLOT(consult())); - connect(p_askMap, SIGNAL(clicked()), this, SLOT(askMap())); - connect(p_askCapitalDivisions, SIGNAL(clicked()), this, SLOT(askCapitalDivisions())); - connect(p_askDivisionCapitals, SIGNAL(clicked()), this, SLOT(askDivisionCapitals())); - connect(p_askFlagDivisions, SIGNAL(clicked()), this, SLOT(askFlagDivisions())); - connect(p_askDivisionFlags, SIGNAL(clicked()), this, SLOT(askDivisionFlags())); + connect(p_consult, TQT_SIGNAL(clicked()), this, TQT_SLOT(consult())); + connect(p_askMap, TQT_SIGNAL(clicked()), this, TQT_SLOT(askMap())); + connect(p_askCapitalDivisions, TQT_SIGNAL(clicked()), this, TQT_SLOT(askCapitalDivisions())); + connect(p_askDivisionCapitals, TQT_SIGNAL(clicked()), this, TQT_SLOT(askDivisionCapitals())); + connect(p_askFlagDivisions, TQT_SIGNAL(clicked()), this, TQT_SLOT(askFlagDivisions())); + connect(p_askDivisionFlags, TQT_SIGNAL(clicked()), this, TQT_SLOT(askDivisionFlags())); - KAction *a = KStdAction::open(this, SLOT(openMap()), actionCollection(), "openMap"); + KAction *a = KStdAction::open(this, TQT_SLOT(openMap()), actionCollection(), "openMap"); a -> setText(i18n("&Open Map...")); - KStdAction::quit(this, SLOT(close()), actionCollection(), "quit"); + KStdAction::quit(this, TQT_SLOT(close()), actionCollection(), "quit"); p_zoom = new KToggleAction(i18n("&Zoom"), "viewmagfit", 0, 0, 0, actionCollection(), "zoom_select"); p_zoom -> setEnabled(false); @@ -85,7 +85,7 @@ kgeography::kgeography() : KMainWindow(), p_firstShow(true), p_mustShowResultsDi p_move = new KToggleAction(i18n("&Move"), "move", 0, 0, 0, actionCollection(), "move"); p_move -> setEnabled(false); - new KAction(i18n("Disclaimer"), 0, this, SLOT(disclaimer()), actionCollection(), "disclaimer"); + new KAction(i18n("Disclaimer"), 0, this, TQT_SLOT(disclaimer()), actionCollection(), "disclaimer"); setupGUI(Keys | ToolBar | Save | Create); @@ -98,13 +98,13 @@ kgeography::~kgeography() delete p_map; } -void kgeography::showEvent(QShowEvent *) +void kgeography::showEvent(TQShowEvent *) { if (p_firstShow) { - QString file = kgeographySettings::self() -> lastMap(); + TQString file = kgeographySettings::self() -> lastMap(); - if (QFile::exists(file)) + if (TQFile::exists(file)) { mapReader reader; if (reader.parseMap(file)) @@ -132,7 +132,7 @@ void kgeography::showEvent(QShowEvent *) } // if anyone can explain why with the slot works and now without // i'll be glad to learn - QTimer::singleShot(0, this, SLOT(resizeMainWindow())); + TQTimer::singleShot(0, this, TQT_SLOT(resizeMainWindow())); // resizeMainWindow(); p_firstShow = false; @@ -257,25 +257,25 @@ void kgeography::removeOldAskWidget() p_move -> setChecked(false); } -QSize kgeography::getPreferredSize() +TQSize kgeography::getPreferredSize() { int ySize = 0; ySize = menuBar() -> size().height() + toolBar() -> size().height() + ((mapAsker*) p_askWidget)->mapSize().height(); - return QSize(p_underLeftWidget -> size().width() + ((mapAsker*) p_askWidget)->mapSize().width() + 1, ySize + 1); + return TQSize(p_underLeftWidget -> size().width() + ((mapAsker*) p_askWidget)->mapSize().width() + 1, ySize + 1); } void kgeography::putAskWidget() { p_bigWidget -> setStretchFactor(p_askWidget, 1); p_askWidget -> show(); - connect(p_askWidget, SIGNAL(setZoomActionChecked(bool)), p_zoom, SLOT(setChecked(bool))); - connect(p_zoom, SIGNAL(toggled(bool)), p_askWidget, SLOT(setZoom(bool))); - connect(p_zoomOriginal, SIGNAL(activated()), p_askWidget, SLOT(setOriginalZoom())); - connect(p_askWidget, SIGNAL(setMoveActionEnabled(bool)), p_move, SLOT(setEnabled(bool))); - connect(p_askWidget, SIGNAL(setMoveActionChecked(bool)), p_move, SLOT(setChecked(bool))); - connect(p_move, SIGNAL(toggled(bool)), p_askWidget, SLOT(setMovement(bool))); - connect(p_askWidget, SIGNAL(questionsEnded()), this, SLOT(showResultsDialog())); + connect(p_askWidget, TQT_SIGNAL(setZoomActionChecked(bool)), p_zoom, TQT_SLOT(setChecked(bool))); + connect(p_zoom, TQT_SIGNAL(toggled(bool)), p_askWidget, TQT_SLOT(setZoom(bool))); + connect(p_zoomOriginal, TQT_SIGNAL(activated()), p_askWidget, TQT_SLOT(setOriginalZoom())); + connect(p_askWidget, TQT_SIGNAL(setMoveActionEnabled(bool)), p_move, TQT_SLOT(setEnabled(bool))); + connect(p_askWidget, TQT_SIGNAL(setMoveActionChecked(bool)), p_move, TQT_SLOT(setChecked(bool))); + connect(p_move, TQT_SIGNAL(toggled(bool)), p_askWidget, TQT_SLOT(setMovement(bool))); + connect(p_askWidget, TQT_SIGNAL(questionsEnded()), this, TQT_SLOT(showResultsDialog())); } void kgeography::setMap(KGmap *m) @@ -287,16 +287,16 @@ void kgeography::setMap(KGmap *m) delete p_map; p_map = m; - QString sw = i18n("There are two ways of dealing with the translation of \"Current map: %1\". The first option simply replaces %1 with the translated name of the relevant region. If the grammar of your language allows this, choose this option by setting the translation of this message to 1, and leave untranslated the translations of \"Current map: %1\" that have the placename embedded (or translate them as - if you wish to show the file as fully translated. The second option is to translate all messages in full - this is likely to be required in the case of highly-inflected languages like Russian. To choose this option, set the translation of this message to 0, and translate all the messages.", "0"); + TQString sw = i18n("There are two ways of dealing with the translation of \"Current map: %1\". The first option simply replaces %1 with the translated name of the relevant region. If the grammar of your language allows this, choose this option by setting the translation of this message to 1, and leave untranslated the translations of \"Current map: %1\" that have the placename embedded (or translate them as - if you wish to show the file as fully translated. The second option is to translate all messages in full - this is likely to be required in the case of highly-inflected languages like Russian. To choose this option, set the translation of this message to 0, and translate all the messages.", "0"); if (sw == "1") { - QString mapName = i18n(p_map -> getFileName().utf8(), p_map -> getName().utf8()); - QString text = i18n("<qt>Current map:<br><b>%1<b></qt>"); + TQString mapName = i18n(p_map -> getFileName().utf8(), p_map -> getName().utf8()); + TQString text = i18n("<qt>Current map:<br><b>%1<b></qt>"); p_currentMap -> setText(text.arg(mapName)); } else { - QString s = QString("<qt>Current map:<br><b>%1</b></qt>").arg(p_map -> getName()); + TQString s = TQString("<qt>Current map:<br><b>%1</b></qt>").arg(p_map -> getName()); p_currentMap -> setText(i18n(p_map -> getFileName().utf8(), s.utf8())); } p_consult -> setEnabled(true); @@ -324,8 +324,8 @@ void kgeography::showResultsDialog() { p_mustShowResultsDialog = false; int ca = p_askWidget -> correctAnswers(); - QString q = p_askWidget -> getQuestionHook(); - QValueVector<userAnswer> ua = p_askWidget -> userAnswers(); + TQString q = p_askWidget -> getQuestionHook(); + TQValueVector<userAnswer> ua = p_askWidget -> userAnswers(); consult(); diff --git a/kgeography/src/kgeography.h b/kgeography/src/kgeography.h index 86e79cc5..008b36ba 100644 --- a/kgeography/src/kgeography.h +++ b/kgeography/src/kgeography.h @@ -32,7 +32,7 @@ Q_OBJECT ~kgeography(); protected: - void showEvent(QShowEvent *e); + void showEvent(TQShowEvent *e); private slots: void openMap(); @@ -48,14 +48,14 @@ Q_OBJECT void showResultsDialog(); private: - QSize getPreferredSize(); + TQSize getPreferredSize(); void putAskWidget(); void removeOldAskWidget(); void setMap(KGmap *m); - QHBox *p_bigWidget; - QVBox *p_underLeftWidget; + TQHBox *p_bigWidget; + TQVBox *p_underLeftWidget; KPushButton *p_consult; KPushButton *p_askCapitalDivisions; @@ -65,7 +65,7 @@ Q_OBJECT KPushButton *p_askDivisionFlags; KToggleAction *p_zoom, *p_move; KAction *p_zoomOriginal; - QLabel *p_currentMap; + TQLabel *p_currentMap; KGmap *p_map; askWidget *p_askWidget; diff --git a/kgeography/src/map.cpp b/kgeography/src/map.cpp index be681191..9cef054f 100644 --- a/kgeography/src/map.cpp +++ b/kgeography/src/map.cpp @@ -13,8 +13,8 @@ #include <kapplication.h> #include <klocale.h> -#include <qfile.h> -#include <qfileinfo.h> +#include <tqfile.h> +#include <tqfileinfo.h> #include "division.h" #include "map.h" @@ -26,7 +26,7 @@ KGmap::KGmap() KGmap::~KGmap() { - QMap<QRgb, division*>::iterator it; + TQMap<QRgb, division*>::iterator it; it = p_colorMap.begin(); while (it != p_colorMap.end()) { @@ -51,27 +51,27 @@ bool KGmap::addDivision(division *c) return b; } -void KGmap::setFile(const QString &s) +void KGmap::setFile(const TQString &s) { p_file = s; } -bool KGmap::setMapFile(const QString &s) +bool KGmap::setMapFile(const TQString &s) { p_mapFile = s; - return QFile::exists(s); + return TQFile::exists(s); } -void KGmap::setName(const QString &s) +void KGmap::setName(const TQString &s) { p_name = s; } uint KGmap::count(bool clickDivisionMode) const { - QValueList<division*> aux = p_nameMap.values(); - QValueList<division*>::const_iterator it = aux.begin(); - QValueList<division*>::const_iterator end = aux.end(); + TQValueList<division*> aux = p_nameMap.values(); + TQValueList<division*>::const_iterator it = aux.begin(); + TQValueList<division*>::const_iterator end = aux.end(); uint count = 0; for( ; it != end; ++it) { @@ -85,50 +85,50 @@ bool KGmap::hasAllFlags() const return p_hasAllFlags; } -QString KGmap::getDivisionFlagFile(const QString &s) const +TQString KGmap::getDivisionFlagFile(const TQString &s) const { return p_nameMap[s] -> getFlagFile(); } -QString KGmap::getDivisionCapital(const QString &s) const +TQString KGmap::getDivisionCapital(const TQString &s) const { return p_nameMap[s] -> getCapital(); } -QString KGmap::getFile() const +TQString KGmap::getFile() const { return p_file; } -QString KGmap::getFileName() const +TQString KGmap::getFileName() const { - QFileInfo fi(p_file); + TQFileInfo fi(p_file); return fi.fileName(); } -QString KGmap::getMapFile() const +TQString KGmap::getMapFile() const { return p_mapFile; } -QString KGmap::getName() const +TQString KGmap::getName() const { return p_name; } -QString KGmap::getRandomDivision(bool clickDivisionMode) const +TQString KGmap::getRandomDivision(bool clickDivisionMode) const { - QValueList<division*> aux; + TQValueList<division*> aux; int i = (int)((float)p_nameMap.size() * kapp -> random() / (RAND_MAX + 1.0)); aux = p_nameMap.values(); if (!aux[i] -> canAsk(clickDivisionMode)) return getRandomDivision(clickDivisionMode); else return aux[i] -> getName(); } -QString KGmap::getWhatIs(QRgb c, bool all) const +TQString KGmap::getWhatIs(QRgb c, bool all) const { // this is only asked from mapasker.cpp hence the true in canAsk - QMap<QRgb, division*>::const_iterator it; + TQMap<QRgb, division*>::const_iterator it; it = p_colorMap.find(c); if (it == p_colorMap.end()) return "nothing"; else @@ -139,10 +139,10 @@ QString KGmap::getWhatIs(QRgb c, bool all) const } } -QColor KGmap::getColor(const QString &s) const +TQColor KGmap::getColor(const TQString &s) const { - QValueList<division*> divisions; - QValueList<QRgb> colors; + TQValueList<division*> divisions; + TQValueList<QRgb> colors; division *d; int i; @@ -152,5 +152,5 @@ QColor KGmap::getColor(const QString &s) const i = 0; while(divisions[i] != d) i++; - return QColor(colors[i]); + return TQColor(colors[i]); } diff --git a/kgeography/src/map.h b/kgeography/src/map.h index 0eb08f53..7f606320 100644 --- a/kgeography/src/map.h +++ b/kgeography/src/map.h @@ -11,8 +11,8 @@ #ifndef MAP_H #define MAP_H -#include <qcolor.h> -#include <qmap.h> +#include <tqcolor.h> +#include <tqmap.h> class division; @@ -24,28 +24,28 @@ class KGmap bool addDivision(division *d); - void setFile(const QString &s); - bool setMapFile(const QString &s); - void setName(const QString &s); + void setFile(const TQString &s); + bool setMapFile(const TQString &s); + void setName(const TQString &s); // return the number of askable divisions uint count(bool clickDivisionMode) const; bool hasAllFlags() const; - QString getDivisionFlagFile(const QString &s) const; - QString getDivisionCapital(const QString &s) const; - QString getFile() const; - QString getFileName() const; - QString getMapFile() const; - QString getName() const; - QString getRandomDivision(bool clickDivisionMode) const; - QString getWhatIs(QRgb c, bool all) const; - QColor getColor(const QString &s) const; + TQString getDivisionFlagFile(const TQString &s) const; + TQString getDivisionCapital(const TQString &s) const; + TQString getFile() const; + TQString getFileName() const; + TQString getMapFile() const; + TQString getName() const; + TQString getRandomDivision(bool clickDivisionMode) const; + TQString getWhatIs(QRgb c, bool all) const; + TQColor getColor(const TQString &s) const; private: - QMap<QRgb, division*> p_colorMap; - QMap<QString, division*> p_nameMap; + TQMap<QRgb, division*> p_colorMap; + TQMap<TQString, division*> p_nameMap; - QString p_name, p_file, p_mapFile; + TQString p_name, p_file, p_mapFile; bool p_hasAllFlags; }; diff --git a/kgeography/src/mapasker.cpp b/kgeography/src/mapasker.cpp index aca0b379..27c7c83d 100644 --- a/kgeography/src/mapasker.cpp +++ b/kgeography/src/mapasker.cpp @@ -11,25 +11,25 @@ #include <klocale.h> #include <kmessagebox.h> -#include <qlabel.h> -#include <qlayout.h> -#include <qscrollbar.h> -#include <qstring.h> +#include <tqlabel.h> +#include <tqlayout.h> +#include <tqscrollbar.h> +#include <tqstring.h> #include "map.h" #include "mapasker.h" #include "mapwidget.h" -mapAsker::mapAsker(QWidget *parent, KGmap *m, QWidget *w, bool asker, uint count) : askWidget(parent, m, w, count, asker), p_popupManager(this), p_asker(asker), p_firstShow(true) +mapAsker::mapAsker(TQWidget *parent, KGmap *m, TQWidget *w, bool asker, uint count) : askWidget(parent, m, w, count, asker), p_popupManager(this), p_asker(asker), p_firstShow(true) { - QGridLayout *lay = new QGridLayout(this, 2, 2); + TQGridLayout *lay = new TQGridLayout(this, 2, 2); p_mapWidget = new mapWidget(this); lay -> addWidget(p_mapWidget, 0, 0); - p_hsb = new QScrollBar(Horizontal, this); + p_hsb = new TQScrollBar(Horizontal, this); lay -> addWidget(p_hsb, 1, 0); - p_vsb = new QScrollBar(Vertical, this); + p_vsb = new TQScrollBar(Vertical, this); lay -> addWidget(p_vsb, 0, 1); lay -> setRowStretch(2, 1); @@ -37,24 +37,24 @@ mapAsker::mapAsker(QWidget *parent, KGmap *m, QWidget *w, bool asker, uint count p_shouldClearPopup = false; - connect(p_mapWidget, SIGNAL(clicked(QRgb, const QPoint&)), this, SLOT(handleMapClick(QRgb, const QPoint&))); - connect(p_mapWidget, SIGNAL(setMoveActionChecked(bool)), this, SIGNAL(setMoveActionChecked(bool))); - connect(p_mapWidget, SIGNAL(setZoomActionChecked(bool)), this, SIGNAL(setZoomActionChecked(bool))); - connect(p_mapWidget, SIGNAL(setMoveActionEnabled(bool)), this, SIGNAL(setMoveActionEnabled(bool))); - connect(p_mapWidget, SIGNAL(setMoveActionEnabled(bool)), this, SLOT(showScrollBars(bool))); - connect(p_mapWidget, SIGNAL(updatePosition(int, int)), this, SLOT(setScrollBarsPosition(int, int))); - connect(p_mapWidget, SIGNAL(updateVisibleSize(int, int)), this, SLOT(setScrollBarsVisibleSize(int, int))); - connect(p_mapWidget, SIGNAL(updateMaximumSize(int, int)), this, SLOT(setScrollBarsMaximumSize(int, int))); + connect(p_mapWidget, TQT_SIGNAL(clicked(QRgb, const TQPoint&)), this, TQT_SLOT(handleMapClick(QRgb, const TQPoint&))); + connect(p_mapWidget, TQT_SIGNAL(setMoveActionChecked(bool)), this, TQT_SIGNAL(setMoveActionChecked(bool))); + connect(p_mapWidget, TQT_SIGNAL(setZoomActionChecked(bool)), this, TQT_SIGNAL(setZoomActionChecked(bool))); + connect(p_mapWidget, TQT_SIGNAL(setMoveActionEnabled(bool)), this, TQT_SIGNAL(setMoveActionEnabled(bool))); + connect(p_mapWidget, TQT_SIGNAL(setMoveActionEnabled(bool)), this, TQT_SLOT(showScrollBars(bool))); + connect(p_mapWidget, TQT_SIGNAL(updatePosition(int, int)), this, TQT_SLOT(setScrollBarsPosition(int, int))); + connect(p_mapWidget, TQT_SIGNAL(updateVisibleSize(int, int)), this, TQT_SLOT(setScrollBarsVisibleSize(int, int))); + connect(p_mapWidget, TQT_SIGNAL(updateMaximumSize(int, int)), this, TQT_SLOT(setScrollBarsMaximumSize(int, int))); - connect(p_hsb, SIGNAL(valueChanged(int)), p_mapWidget, SLOT(updateHPosition(int))); - connect(p_vsb, SIGNAL(valueChanged(int)), p_mapWidget, SLOT(updateVPosition(int))); + connect(p_hsb, TQT_SIGNAL(valueChanged(int)), p_mapWidget, TQT_SLOT(updateHPosition(int))); + connect(p_vsb, TQT_SIGNAL(valueChanged(int)), p_mapWidget, TQT_SLOT(updateVPosition(int))); if (asker) { - QBoxLayout *vbl = dynamic_cast<QBoxLayout*>(w -> layout()); - p_next = new QLabel(w); + TQBoxLayout *vbl = dynamic_cast<TQBoxLayout*>(w -> layout()); + p_next = new TQLabel(w); p_next -> setAlignment(AlignTop | AlignHCenter); - p_fill = new QWidget(w); + p_fill = new TQWidget(w); p_fill -> show(); vbl -> setStretchFactor(p_fill, 1); nextQuestion(); @@ -77,7 +77,7 @@ bool mapAsker::isAsker() const return p_answers; } -void mapAsker::mousePressEvent(QMouseEvent*) +void mapAsker::mousePressEvent(TQMouseEvent*) { p_popupManager.clear(); } @@ -100,9 +100,9 @@ void mapAsker::setOriginalZoom() p_popupManager.clear(); } -void mapAsker::handleMapClick(QRgb c, const QPoint &p) +void mapAsker::handleMapClick(QRgb c, const TQPoint &p) { - QString aux, cap; + TQString aux, cap; aux = p_map -> getWhatIs(c, !p_asker); if (aux == "nothing") KMessageBox::error(this, i18n("You have found a bug in a map. Please contact the author and tell the %1 map has nothing associated to color %2,%3,%4.").arg(p_map -> getFile()).arg(qRed(c)).arg(qGreen(c)).arg(qBlue(c))); else if (p_shouldClearPopup) @@ -112,7 +112,7 @@ void mapAsker::handleMapClick(QRgb c, const QPoint &p) } else if (!p_asker) { - QString flagFile; + TQString flagFile; cap = p_map -> getDivisionCapital(aux); if (!cap.isEmpty()) { @@ -128,7 +128,7 @@ void mapAsker::handleMapClick(QRgb c, const QPoint &p) } else if (!aux.isEmpty()) { - p_currentAnswer.setAnswer(QColor(c)); + p_currentAnswer.setAnswer(TQColor(c)); questionAnswered(aux == lastDivisionAsked()); nextQuestion(); } @@ -168,18 +168,18 @@ void mapAsker::setScrollBarsMaximumSize(int w, int h) p_vsbms = h; } -void mapAsker::nextQuestionHook(const QString &division) +void mapAsker::nextQuestionHook(const TQString &division) { - QString sw = i18n("There are two ways of dealing with the translation of \"Please click on: %1\". The first option simply replaces %1 with the translated name of the relevant region/city. If the grammar of your language allows this, choose this option by setting the translation of this message to 1, and leave untranslated the translations of \"Please click on: %1\" that have the placename embedded (or translate them as - if you wish to show the file as fully translated. The second option is to translate all messages in full - this is likely to be required in the case of highly-inflected languages like Russian. To choose this option, set the translation of this message to 0, and translate all the messages.", "0"); + TQString sw = i18n("There are two ways of dealing with the translation of \"Please click on: %1\". The first option simply replaces %1 with the translated name of the relevant region/city. If the grammar of your language allows this, choose this option by setting the translation of this message to 1, and leave untranslated the translations of \"Please click on: %1\" that have the placename embedded (or translate them as - if you wish to show the file as fully translated. The second option is to translate all messages in full - this is likely to be required in the case of highly-inflected languages like Russian. To choose this option, set the translation of this message to 0, and translate all the messages.", "0"); if (sw == "1") { - QString divisionName = i18n(p_map -> getFileName().utf8(), division.utf8()); - QString text = i18n("Please click on:\n%1"); + TQString divisionName = i18n(p_map -> getFileName().utf8(), division.utf8()); + TQString text = i18n("Please click on:\n%1"); p_next -> setText(text.arg(divisionName)); } else { - QString s = QString("Please click on:\n%1").arg(division); + TQString s = TQString("Please click on:\n%1").arg(division); p_next -> setText(i18n(p_map -> getFileName().utf8(), s.utf8())); } p_currentAnswer.setQuestion(i18n(p_map -> getFileName().utf8(), division.utf8())); @@ -187,12 +187,12 @@ void mapAsker::nextQuestionHook(const QString &division) p_currentAnswer.setCorrectAnswer(p_map -> getColor(division)); } -QString mapAsker::getQuestionHook() const +TQString mapAsker::getQuestionHook() const { return i18n("Division in Map"); } -void mapAsker::showEvent(QShowEvent *) +void mapAsker::showEvent(TQShowEvent *) { if (p_firstShow) { @@ -201,7 +201,7 @@ void mapAsker::showEvent(QShowEvent *) } } -QSize mapAsker::mapSize() const +TQSize mapAsker::mapSize() const { return p_mapWidget -> mapSize(); } diff --git a/kgeography/src/mapasker.h b/kgeography/src/mapasker.h index fbddae96..eba521b2 100644 --- a/kgeography/src/mapasker.h +++ b/kgeography/src/mapasker.h @@ -26,18 +26,18 @@ class mapAsker : public askWidget { Q_OBJECT public: - mapAsker(QWidget *parent, KGmap *m, QWidget *w, bool asker, uint count = 0); + mapAsker(TQWidget *parent, KGmap *m, TQWidget *w, bool asker, uint count = 0); ~mapAsker(); - QSize mapSize() const; + TQSize mapSize() const; bool isAsker() const; virtual bool isClickOnDivision() const { return true; } protected: - void nextQuestionHook(const QString &division); - void mousePressEvent(QMouseEvent *e); - QString getQuestionHook() const; - void showEvent(QShowEvent *e); + void nextQuestionHook(const TQString &division); + void mousePressEvent(TQMouseEvent *e); + TQString getQuestionHook() const; + void showEvent(TQShowEvent *e); public slots: void setMovement(bool b); @@ -45,16 +45,16 @@ Q_OBJECT void setOriginalZoom(); private slots: - void handleMapClick(QRgb c, const QPoint &p); + void handleMapClick(QRgb c, const TQPoint &p); void setScrollBarsPosition(int x, int y); void setScrollBarsVisibleSize(int w, int h); void setScrollBarsMaximumSize(int w, int h); void showScrollBars(bool b); private: - QLabel *p_next; - QWidget *p_fill; - QScrollBar *p_hsb, *p_vsb; + TQLabel *p_next; + TQWidget *p_fill; + TQScrollBar *p_hsb, *p_vsb; int p_hsbms, p_vsbms; //H and V maximum size for scrollbars infoWidget *p_infoWidget; diff --git a/kgeography/src/mapchooser.cpp b/kgeography/src/mapchooser.cpp index 57dcb1c9..11410d39 100644 --- a/kgeography/src/mapchooser.cpp +++ b/kgeography/src/mapchooser.cpp @@ -13,25 +13,25 @@ #include <kmessagebox.h> #include <kstandarddirs.h> -#include <qhbox.h> -#include <qimage.h> -#include <qlayout.h> +#include <tqhbox.h> +#include <tqimage.h> +#include <tqlayout.h> #include "mapchooser.h" -mapChooser::mapChooser(QWidget *parent) : KDialogBase(parent, 0, true, i18n("Choose Map to Use"), KDialogBase::Ok | KDialogBase::Cancel, KDialogBase::Ok, true) +mapChooser::mapChooser(TQWidget *parent) : KDialogBase(parent, 0, true, i18n("Choose Map to Use"), KDialogBase::Ok | KDialogBase::Cancel, KDialogBase::Ok, true) { - QHBox *mainHB; - QStringList list; + TQHBox *mainHB; + TQStringList list; KGmap *m; - QWidget *mapArea; - QGridLayout *mapLay; + TQWidget *mapArea; + TQGridLayout *mapLay; - mainHB = new QHBox(this); + mainHB = new TQHBox(this); mainHB -> setSpacing(KDialog::spacingHint()); list = KGlobal::dirs() -> findAllResources("appdata", "*.kgm"); - p_listBox = new QListBox(mainHB); - QStringList::iterator it; + p_listBox = new TQListBox(mainHB); + TQStringList::iterator it; for(it = list.begin(); it != list.end(); ++it) { if (!p_reader.parseMap(*it)) @@ -42,22 +42,22 @@ mapChooser::mapChooser(QWidget *parent) : KDialogBase(parent, 0, true, i18n("Cho else { m = p_reader.getMap(); - QString text = i18n(m -> getFileName().utf8(), m -> getName().utf8()); + TQString text = i18n(m -> getFileName().utf8(), m -> getName().utf8()); p_listBox -> insertItem(text); p_maps.insert(text, m); } } - mapArea = new QWidget(mainHB); + mapArea = new TQWidget(mainHB); mapArea -> setFixedSize(300, 225); - mapLay = new QGridLayout(mapArea, 3, 3); + mapLay = new TQGridLayout(mapArea, 3, 3); - p_image = new QWidget(mapArea); + p_image = new TQWidget(mapArea); mapLay -> addWidget(p_image, 1, 1); - connect(p_listBox, SIGNAL(highlighted(const QString&)), this, SLOT(putImage(const QString&))); - connect(p_listBox, SIGNAL(selected(int)), this, SLOT(slotOk())); + connect(p_listBox, TQT_SIGNAL(highlighted(const TQString&)), this, TQT_SLOT(putImage(const TQString&))); + connect(p_listBox, TQT_SIGNAL(selected(int)), this, TQT_SLOT(slotOk())); setMainWidget(mainHB); @@ -80,12 +80,12 @@ KGmap *mapChooser::getMap() return m; } -void mapChooser::putImage(const QString &mapName) +void mapChooser::putImage(const TQString &mapName) { KGmap *m; m = p_maps[mapName]; - QImage image(m -> getMapFile()); - image = image.smoothScale(300, 225, QImage::ScaleMin); + TQImage image(m -> getMapFile()); + image = image.smoothScale(300, 225, TQImage::ScaleMin); p_image -> setPaletteBackgroundPixmap(image); p_image -> setFixedSize(image.size()); } diff --git a/kgeography/src/mapchooser.h b/kgeography/src/mapchooser.h index 8fc5be08..a95d16ba 100644 --- a/kgeography/src/mapchooser.h +++ b/kgeography/src/mapchooser.h @@ -13,7 +13,7 @@ #include <kdialogbase.h> -#include <qdict.h> +#include <tqdict.h> #include "map.h" #include "mapparser.h" @@ -22,19 +22,19 @@ class mapChooser : public KDialogBase { Q_OBJECT public: - mapChooser(QWidget *parent); + mapChooser(TQWidget *parent); ~mapChooser(); KGmap *getMap(); private slots: - void putImage(const QString &mapName); + void putImage(const TQString &mapName); private: - QListBox *p_listBox; - QWidget *p_image; + TQListBox *p_listBox; + TQWidget *p_image; mapReader p_reader; - QDict<KGmap> p_maps; + TQDict<KGmap> p_maps; }; #endif diff --git a/kgeography/src/mapparser.cpp b/kgeography/src/mapparser.cpp index 97ca5306..8a4cf200 100644 --- a/kgeography/src/mapparser.cpp +++ b/kgeography/src/mapparser.cpp @@ -16,21 +16,21 @@ /* unitReader */ -mapReader::mapReader() : QXmlSimpleReader() +mapReader::mapReader() : TQXmlSimpleReader() { } -bool mapReader::parseMap(const QString &path) +bool mapReader::parseMap(const TQString &path) { - QString aux; + TQString aux; p_map = new KGmap(); p_map -> setFile(path); aux = path.left(path.findRev('/') + 1); // aux = path but without the file name mapParser handler(p_map, aux); - QFile xmlFile(path); + TQFile xmlFile(path); if (xmlFile.exists()) { - QXmlInputSource source(&xmlFile); + TQXmlInputSource source(&xmlFile); setContentHandler(&handler); if (parse(source)) return true; p_error = handler.errorString(); @@ -42,7 +42,7 @@ bool mapReader::parseMap(const QString &path) return false; } -QString mapReader::getError() +TQString mapReader::getError() { return p_error; } @@ -54,7 +54,7 @@ KGmap *mapReader::getMap() /* mapParser */ -mapParser::mapParser(KGmap *m, const QString &path) : QXmlDefaultHandler(), p_map(m), p_path(path) +mapParser::mapParser(KGmap *m, const TQString &path) : TQXmlDefaultHandler(), p_map(m), p_path(path) { } @@ -65,9 +65,9 @@ bool mapParser::startDocument() return true; } -bool mapParser::startElement(const QString&, const QString &name, const QString&, const QXmlAttributes&) +bool mapParser::startElement(const TQString&, const TQString &name, const TQString&, const TQXmlAttributes&) { - QString prev; + TQString prev; bool b = true; prev = getPreviousTag(); p_previousTags += ":" + name; @@ -131,9 +131,9 @@ bool mapParser::startElement(const QString&, const QString &name, const QString& return b; } -bool mapParser::endElement(const QString &, const QString &, const QString &) +bool mapParser::endElement(const TQString &, const TQString &, const TQString &) { - QString aux; + TQString aux; bool b; aux = getPreviousTag(); b = true; @@ -231,13 +231,13 @@ bool mapParser::endElement(const QString &, const QString &, const QString &) } else b = false; removeLastTag(); - p_contents = QString::null; + p_contents = TQString::null; return b; } -bool mapParser::characters(const QString &ch) +bool mapParser::characters(const TQString &ch) { - QString aux; + TQString aux; if (ch.simplifyWhiteSpace().length() == 0) return true; aux = getPreviousTag(); if (aux == "mapFile" || aux == "name" || aux == "red" || aux == "green" || aux == "blue" || aux == "ignore" || aux == "flag" || aux == "capital") @@ -251,7 +251,7 @@ bool mapParser::characters(const QString &ch) bool mapParser::endDocument() { - QString aux; + TQString aux; if (p_mapNameSet && p_mapFileSet) { return true; @@ -262,13 +262,13 @@ bool mapParser::endDocument() return false; } -QString mapParser::errorString() +TQString mapParser::errorString() { if (!p_error.isEmpty()) return p_error; return i18n("The XML document is malformed."); } -QString mapParser::getPreviousTag() const +TQString mapParser::getPreviousTag() const { return p_previousTags.right(p_previousTags.length() - p_previousTags.findRev(':') - 1); } diff --git a/kgeography/src/mapparser.h b/kgeography/src/mapparser.h index af3d6d1f..9db844ae 100644 --- a/kgeography/src/mapparser.h +++ b/kgeography/src/mapparser.h @@ -11,7 +11,7 @@ #ifndef MAPPARSER_H #define MAPPARSER_H -#include <qxml.h> +#include <tqxml.h> class division; class KGmap; @@ -21,28 +21,28 @@ class mapReader : public QXmlSimpleReader public: mapReader(); - bool parseMap(const QString &path); - QString getError(); + bool parseMap(const TQString &path); + TQString getError(); KGmap *getMap(); private: - QString p_error; + TQString p_error; KGmap *p_map; }; class mapParser : public QXmlDefaultHandler { public: - mapParser(KGmap *m, const QString &path); + mapParser(KGmap *m, const TQString &path); bool startDocument(); - bool startElement(const QString&, const QString&, const QString&, const QXmlAttributes&); - bool endElement(const QString &, const QString &name, const QString &); - bool characters(const QString &ch); + bool startElement(const TQString&, const TQString&, const TQString&, const TQXmlAttributes&); + bool endElement(const TQString &, const TQString &name, const TQString &); + bool characters(const TQString &ch); bool endDocument(); - QString errorString(); + TQString errorString(); private: - QString getPreviousTag() const; + TQString getPreviousTag() const; void removeLastTag(); division *p_division; @@ -50,8 +50,8 @@ class mapParser : public QXmlDefaultHandler KGmap *p_map; bool p_allowChars, p_mapNameSet, p_mapFileSet; bool p_divisionNameSet, p_colorSet, p_divisionIgnoreSet, p_flagFileSet, p_capitalSet; - const QString &p_path; - QString p_error, p_contents, p_previousTags; + const TQString &p_path; + TQString p_error, p_contents, p_previousTags; }; #endif diff --git a/kgeography/src/mapwidget.cpp b/kgeography/src/mapwidget.cpp index 754179ef..f551940f 100644 --- a/kgeography/src/mapwidget.cpp +++ b/kgeography/src/mapwidget.cpp @@ -14,12 +14,12 @@ #include <kapplication.h> #include <klocale.h> -#include <qcursor.h> -#include <qpainter.h> +#include <tqcursor.h> +#include <tqpainter.h> #include "mapwidget.h" -mapWidget::mapWidget(QWidget *parent) : QWidget(parent) +mapWidget::mapWidget(TQWidget *parent) : TQWidget(parent) { p_wantZoom = false; p_zooming = false; @@ -32,7 +32,7 @@ mapWidget::mapWidget(QWidget *parent) : QWidget(parent) p_scrollBarsVisible = 0; } -void mapWidget::init(const QString &path, int scrollBarWidth, int scrollBarHeight) +void mapWidget::init(const TQString &path, int scrollBarWidth, int scrollBarHeight) { p_scrollBarWidth = scrollBarWidth; p_scrollBarHeight = scrollBarHeight; @@ -61,7 +61,7 @@ void mapWidget::setMapZoom(bool b) } } -QSize mapWidget::sizeHint() const +TQSize mapWidget::sizeHint() const { return maximumSize(); } @@ -78,7 +78,7 @@ void mapWidget::updateVPosition(int value) updateShownImage(); } -void mapWidget::mousePressEvent(QMouseEvent *e) +void mapWidget::mousePressEvent(TQMouseEvent *e) { if (e -> button() == Qt::LeftButton) { @@ -97,7 +97,7 @@ void mapWidget::mousePressEvent(QMouseEvent *e) else { QRgb rgb; - QImage *currentImage; + TQImage *currentImage; currentImage = getCurrentImage(); @@ -115,19 +115,19 @@ void mapWidget::mousePressEvent(QMouseEvent *e) } } -void mapWidget::mouseMoveEvent(QMouseEvent *e) +void mapWidget::mouseMoveEvent(TQMouseEvent *e) { if (p_zooming) { - QPainter p(this); + TQPainter p(this); p.setRasterOp(Qt::XorROP); - p.setPen(QPen(Qt::white, 1, Qt::DotLine)); + p.setPen(TQPen(Qt::white, 1, Qt::DotLine)); // remove previous rectangle - p.drawRect(QRect(p_initial, p_prev)); + p.drawRect(TQRect(p_initial, p_prev)); // put new rectangle - p.drawRect(QRect(p_initial, e -> pos())); + p.drawRect(TQRect(p_initial, e -> pos())); p_prev = e -> pos(); } @@ -169,15 +169,15 @@ void mapWidget::mouseMoveEvent(QMouseEvent *e) } } -void mapWidget::mouseReleaseEvent(QMouseEvent *e) +void mapWidget::mouseReleaseEvent(TQMouseEvent *e) { if (p_zooming) { - QPainter p(this); - QRect r(p_initial, e -> pos()); + TQPainter p(this); + TQRect r(p_initial, e -> pos()); p.setRasterOp(Qt::XorROP); - p.setPen(QPen(Qt::white, 1, Qt::DotLine)); + p.setPen(TQPen(Qt::white, 1, Qt::DotLine)); // remove previous rectangle p.drawRect(r); @@ -234,7 +234,7 @@ void mapWidget::mouseReleaseEvent(QMouseEvent *e) } } -void mapWidget::resizeEvent(QResizeEvent *e) +void mapWidget::resizeEvent(TQResizeEvent *e) { if (p_originalImage.isNull()) return; @@ -271,7 +271,7 @@ void mapWidget::emitMoveActionEnabled() } } -QImage *mapWidget::getCurrentImage() +TQImage *mapWidget::getCurrentImage() { if (p_zoomedImageShown.isNull()) return &p_originalImage; else return &p_zoomedImageShown; @@ -281,7 +281,7 @@ void mapWidget::setOriginalImage() { setPaletteBackgroundPixmap(p_originalImage); erase(); - p_zoomedImageShown = QImage(); + p_zoomedImageShown = TQImage(); p_lastFactorX = 1; p_lastFactorY = 1; p_zoomX = 0; @@ -324,7 +324,7 @@ void mapWidget::updateShownImage() } } -QSize mapWidget::mapSize() const +TQSize mapWidget::mapSize() const { return p_originalImage.size(); } diff --git a/kgeography/src/mapwidget.h b/kgeography/src/mapwidget.h index 282fa1b4..1bc37cb3 100644 --- a/kgeography/src/mapwidget.h +++ b/kgeography/src/mapwidget.h @@ -11,23 +11,23 @@ #ifndef MAPWIDGET_H #define MAPWIDGET_H -#include <qimage.h> -#include <qpoint.h> -#include <qwidget.h> +#include <tqimage.h> +#include <tqpoint.h> +#include <tqwidget.h> class mapWidget : public QWidget { Q_OBJECT public: - mapWidget(QWidget *parent); + mapWidget(TQWidget *parent); - void init(const QString &path, int scrollBarWidth, int scrollBarHeight); + void init(const TQString &path, int scrollBarWidth, int scrollBarHeight); void setMapMove(bool b); void setMapZoom(bool b); - QSize sizeHint() const; - QSize mapSize() const; + TQSize sizeHint() const; + TQSize mapSize() const; public slots: void updateHPosition(int value); @@ -38,29 +38,29 @@ Q_OBJECT void setMoveActionChecked(bool b); void setZoomActionChecked(bool b); void setMoveActionEnabled(bool b); - void clicked(QRgb, const QPoint&); + void clicked(QRgb, const TQPoint&); void updatePosition(int X, int Y); void updateVisibleSize(int w, int h); void updateMaximumSize(int w, int h); protected: - void mousePressEvent(QMouseEvent *e); - void mouseMoveEvent(QMouseEvent *e); - void mouseReleaseEvent(QMouseEvent *e); - void resizeEvent(QResizeEvent *e); + void mousePressEvent(TQMouseEvent *e); + void mouseMoveEvent(TQMouseEvent *e); + void mouseReleaseEvent(TQMouseEvent *e); + void resizeEvent(TQResizeEvent *e); private: void emitMoveActionEnabled(); - QImage *getCurrentImage(); + TQImage *getCurrentImage(); void updateShownImage(); - QImage p_originalImage, p_zoomedImageShown; + TQImage p_originalImage, p_zoomedImageShown; bool p_zooming, p_wantZoom, p_moving, p_wantMove; - QPoint p_initial, p_prev; // rubberbanding and moving + TQPoint p_initial, p_prev; // rubberbanding and moving int p_zoomX, p_zoomY, p_zoomW, p_zoomH; double p_lastFactorX, p_lastFactorY; // useful to not do that many updateShownImage - QSize p_oldSize; + TQSize p_oldSize; int p_oldZoomX, p_oldZoomY, p_oldZoomW, p_oldZoomH; int p_scrollBarWidth, p_scrollBarHeight; bool p_scrollBarsVisible; diff --git a/kgeography/src/mypopup.cpp b/kgeography/src/mypopup.cpp index c7dede67..b9f1c78e 100644 --- a/kgeography/src/mypopup.cpp +++ b/kgeography/src/mypopup.cpp @@ -8,57 +8,57 @@ * (at your option) any later version. * ***************************************************************************/ -#include <qlabel.h> -#include <qlayout.h> -#include <qimage.h> -#include <qpixmap.h> +#include <tqlabel.h> +#include <tqlayout.h> +#include <tqimage.h> +#include <tqpixmap.h> #include "mypopup.h" -myPopup::myPopup(QWidget *parent, const QString &text, const QString &text2, const QString &flagFile) : QFrame(parent) +myPopup::myPopup(TQWidget *parent, const TQString &text, const TQString &text2, const TQString &flagFile) : TQFrame(parent) { - QHBoxLayout *lay = new QHBoxLayout(this); + TQHBoxLayout *lay = new TQHBoxLayout(this); lay -> setMargin(4); lay -> setSpacing(4); - QWidget *vbox = new QWidget(this); + TQWidget *vbox = new TQWidget(this); lay -> addWidget(vbox); - QVBoxLayout *vboxLayout = new QVBoxLayout(vbox); + TQVBoxLayout *vboxLayout = new TQVBoxLayout(vbox); vboxLayout -> setMargin(0); vboxLayout -> setSpacing(0); - QLabel *l = new QLabel(text, vbox); + TQLabel *l = new TQLabel(text, vbox); vboxLayout -> addWidget(l); if (!text2.isNull()) { - QLabel *l2 = new QLabel(text2, vbox); + TQLabel *l2 = new TQLabel(text2, vbox); l2 -> setAlignment(Qt::AlignCenter); vboxLayout -> addWidget(l2); } if (!flagFile.isNull()) { - QLabel *flag = new QLabel(this); + TQLabel *flag = new TQLabel(this); lay -> addWidget(flag); - QImage flagImg(flagFile); + TQImage flagImg(flagFile); flag -> setPixmap(flagImg.smoothScale(flagImg.width() / 5, flagImg. height() / 5)); flag -> setAlignment(Qt::AlignCenter); } l -> setAlignment(Qt::AlignCenter); - QFont f = l -> font(); + TQFont f = l -> font(); f.setBold(true); l -> setFont(f); - setFrameStyle(QFrame::Box | QFrame::Plain); + setFrameStyle(TQFrame::Box | TQFrame::Plain); setLineWidth(2); setFixedSize(sizeHint()); } -void myPopup::mousePressEvent(QMouseEvent *) +void myPopup::mousePressEvent(TQMouseEvent *) { emit deleteMe(); } diff --git a/kgeography/src/mypopup.h b/kgeography/src/mypopup.h index 3b0dd421..c768a308 100644 --- a/kgeography/src/mypopup.h +++ b/kgeography/src/mypopup.h @@ -11,7 +11,7 @@ #ifndef MYPOPUP_H #define MYPOPUP_H -#include <qframe.h> +#include <tqframe.h> class myPopup : public QFrame { @@ -19,13 +19,13 @@ Q_OBJECT friend class popupManager; private: - myPopup(QWidget *parent, const QString &text, const QString &text2 = QString::null, const QString &flagFile = QString::null); + myPopup(TQWidget *parent, const TQString &text, const TQString &text2 = TQString::null, const TQString &flagFile = TQString::null); signals: void deleteMe(); protected: - void mousePressEvent(QMouseEvent *); + void mousePressEvent(TQMouseEvent *); }; #endif diff --git a/kgeography/src/popupmanager.cpp b/kgeography/src/popupmanager.cpp index 4b19d4d5..1a457f81 100644 --- a/kgeography/src/popupmanager.cpp +++ b/kgeography/src/popupmanager.cpp @@ -11,13 +11,13 @@ #include "mypopup.h" #include "popupmanager.h" -popupManager::popupManager(QWidget *parent) +popupManager::popupManager(TQWidget *parent) { p_parent = parent; p_mp = 0; } -void popupManager::show(const QString &text, const QString &text2, const QPoint &p, const QString &flagFile) +void popupManager::show(const TQString &text, const TQString &text2, const TQPoint &p, const TQString &flagFile) { delete p_mp; @@ -25,7 +25,7 @@ void popupManager::show(const QString &text, const QString &text2, const QPoint init(p); } -void popupManager::show(const QString &text, const QString &text2, const QPoint &p) +void popupManager::show(const TQString &text, const TQString &text2, const TQPoint &p) { delete p_mp; @@ -33,7 +33,7 @@ void popupManager::show(const QString &text, const QString &text2, const QPoint init(p); } -void popupManager::show(const QString &text, const QPoint &p) +void popupManager::show(const TQString &text, const TQPoint &p) { delete p_mp; @@ -50,7 +50,7 @@ void popupManager::clear() } } -void popupManager::init(const QPoint &p) +void popupManager::init(const TQPoint &p) { int x, y, maxX, maxY; maxX = p_parent -> width() - p_mp -> width(); @@ -61,7 +61,7 @@ void popupManager::init(const QPoint &p) else y = maxY; p_mp -> move(x, y); p_mp -> show(); - connect(p_mp, SIGNAL(deleteMe()), this, SLOT(clear())); + connect(p_mp, TQT_SIGNAL(deleteMe()), this, TQT_SLOT(clear())); } #include "popupmanager.moc" diff --git a/kgeography/src/popupmanager.h b/kgeography/src/popupmanager.h index 8fdfeef7..b66d574d 100644 --- a/kgeography/src/popupmanager.h +++ b/kgeography/src/popupmanager.h @@ -11,7 +11,7 @@ #ifndef POPUPMANAGER_H #define POPUPMANAGER_H -#include <qobject.h> +#include <tqobject.h> class QWidget; @@ -21,25 +21,25 @@ class popupManager : public QObject { Q_OBJECT public: - popupManager(QWidget *parent); + popupManager(TQWidget *parent); // shows text at p and the flag - void show(const QString &text, const QString &text2, const QPoint &p, const QString &flagFile); + void show(const TQString &text, const TQString &text2, const TQPoint &p, const TQString &flagFile); // shows text at p - void show(const QString &text, const QString &text2, const QPoint &p); + void show(const TQString &text, const TQString &text2, const TQPoint &p); // shows text at p - void show(const QString &text, const QPoint &p); + void show(const TQString &text, const TQPoint &p); public slots: void clear(); private: - void init(const QPoint &p); + void init(const TQPoint &p); myPopup *p_mp; - QWidget *p_parent; + TQWidget *p_parent; }; #endif diff --git a/kgeography/src/script.cpp b/kgeography/src/script.cpp index b23d31d0..bae8e3c8 100644 --- a/kgeography/src/script.cpp +++ b/kgeography/src/script.cpp @@ -10,10 +10,10 @@ #include <stdio.h> -#include <qdir.h> -#include <qdom.h> -#include <qstring.h> -#include <qstringlist.h> +#include <tqdir.h> +#include <tqdom.h> +#include <tqstring.h> +#include <tqstringlist.h> int main(int argc, char *argv[]) { @@ -23,26 +23,26 @@ int main(int argc, char *argv[]) return 1; } - QDir d(argv[1], "*.kgm"); + TQDir d(argv[1], "*.kgm"); if (!d.exists()) return 2; - QFile *output = new QFile(argv[2]); + TQFile *output = new TQFile(argv[2]); output->open(IO_WriteOnly | IO_Truncate); - QTextStream os(output); - os.setEncoding(QTextStream::UnicodeUTF8); + TQTextStream os(output); + os.setEncoding(TQTextStream::UnicodeUTF8); - QStringList files = d.entryList(); - QStringList::const_iterator it; - QDomDocument dd; + TQStringList files = d.entryList(); + TQStringList::const_iterator it; + TQDomDocument dd; for (it = files.begin(); it != files.end(); ++it) { - QFile *f = new QFile(d.absPath() + "/" + *it); + TQFile *f = new TQFile(d.absPath() + "/" + *it); f -> open(IO_ReadOnly); dd.setContent(f); - QDomNode n, n2, n3, n4, n5; - QDomNodeList nodes = dd.firstChild().childNodes(); + TQDomNode n, n2, n3, n4, n5; + TQDomNodeList nodes = dd.firstChild().childNodes(); for (uint i = 0; i < nodes.count(); i++) { n = nodes.item(i); |