From 0a6e0958c03e41c87b15557b6f407874f20c2f8d Mon Sep 17 00:00:00 2001 From: tpearson Date: Sat, 31 Jul 2010 19:39:55 +0000 Subject: Trinity Qt initial conversion git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdeedu@1157642 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- kwordquiz/src/dlglanguage.cpp | 8 +- kwordquiz/src/dlglanguage.h | 6 +- kwordquiz/src/dlgrc.cpp | 8 +- kwordquiz/src/dlgrc.h | 2 +- kwordquiz/src/dlgsort.cpp | 6 +- kwordquiz/src/dlgsort.h | 4 +- kwordquiz/src/dlgspecchar.cpp | 14 +-- kwordquiz/src/dlgspecchar.h | 14 +-- kwordquiz/src/flashview.cpp | 14 +-- kwordquiz/src/flashview.h | 4 +- kwordquiz/src/keduvocdata.cpp | 36 +++--- kwordquiz/src/keduvocdata.h | 22 ++-- kwordquiz/src/kvtmlwriter.cpp | 32 ++--- kwordquiz/src/kvtmlwriter.h | 18 +-- kwordquiz/src/kwordquiz.cpp | 236 +++++++++++++++++------------------ kwordquiz/src/kwordquiz.h | 14 +-- kwordquiz/src/kwordquizdoc.cpp | 82 ++++++------ kwordquiz/src/kwordquizdoc.h | 4 +- kwordquiz/src/kwordquizprefs.cpp | 70 +++++------ kwordquiz/src/kwordquizprefs.h | 4 +- kwordquiz/src/kwordquizview.cpp | 188 ++++++++++++++-------------- kwordquiz/src/kwordquizview.h | 38 +++--- kwordquiz/src/kwqnewstuff.cpp | 30 ++--- kwordquiz/src/kwqnewstuff.h | 12 +- kwordquiz/src/main.cpp | 4 +- kwordquiz/src/multipleview.cpp | 16 +-- kwordquiz/src/multipleview.h | 2 +- kwordquiz/src/paukerreader.cpp | 32 ++--- kwordquiz/src/paukerreader.h | 22 ++-- kwordquiz/src/prefcardappearance.cpp | 16 +-- kwordquiz/src/prefcardappearance.h | 12 +- kwordquiz/src/prefcharacter.cpp | 2 +- kwordquiz/src/prefcharacter.h | 2 +- kwordquiz/src/prefeditor.cpp | 2 +- kwordquiz/src/prefeditor.h | 2 +- kwordquiz/src/prefquiz.cpp | 6 +- kwordquiz/src/prefquiz.h | 2 +- kwordquiz/src/qaview.cpp | 32 ++--- kwordquiz/src/qaview.h | 4 +- kwordquiz/src/wqlreader.cpp | 28 ++--- kwordquiz/src/wqlreader.h | 34 ++--- kwordquiz/src/wqlwriter.cpp | 42 +++---- kwordquiz/src/wqlwriter.h | 20 +-- kwordquiz/src/wqprintdialogpage.cpp | 40 +++--- kwordquiz/src/wqprintdialogpage.h | 16 +-- kwordquiz/src/wqquiz.cpp | 76 +++++------ kwordquiz/src/wqquiz.h | 28 ++--- kwordquiz/src/wqscore.cpp | 16 +-- kwordquiz/src/wqscore.h | 10 +- kwordquiz/src/wqundo.h | 20 +-- 50 files changed, 676 insertions(+), 676 deletions(-) (limited to 'kwordquiz') diff --git a/kwordquiz/src/dlglanguage.cpp b/kwordquiz/src/dlglanguage.cpp index 97a8e6c1..f142ee64 100644 --- a/kwordquiz/src/dlglanguage.cpp +++ b/kwordquiz/src/dlglanguage.cpp @@ -18,12 +18,12 @@ #include #include -#include +#include #include "prefs.h" #include "dlglanguage.h" -DlgLanguage::DlgLanguage(QWidget *parent, const char *name, bool modal): KDialogBase(Swallow, i18n("Column Titles"), Ok|Cancel, Ok, parent, name, modal, true) +DlgLanguage::DlgLanguage(TQWidget *parent, const char *name, bool modal): KDialogBase(Swallow, i18n("Column Titles"), Ok|Cancel, Ok, parent, name, modal, true) { dlgBase = new DlgLanguageBase( this, "Dlg" ); setMainWidget(dlgBase); @@ -49,7 +49,7 @@ DlgLanguage::~DlgLanguage() } -void DlgLanguage::setLanguage(int index, const QString &lang) { +void DlgLanguage::setLanguage(int index, const TQString &lang) { if (index == 1) { dlgBase->txtLanguage1 -> setText(lang); } @@ -60,7 +60,7 @@ void DlgLanguage::setLanguage(int index, const QString &lang) { } -QString DlgLanguage::Language(int index){ +TQString DlgLanguage::Language(int index){ if (index == 1) { completion1->addItem(dlgBase->txtLanguage1 -> text()); Prefs::setColumnTitles1(completion1->items()); diff --git a/kwordquiz/src/dlglanguage.h b/kwordquiz/src/dlglanguage.h index 8dfba91d..d158f52b 100644 --- a/kwordquiz/src/dlglanguage.h +++ b/kwordquiz/src/dlglanguage.h @@ -29,11 +29,11 @@ class KCompletion; class DlgLanguage : public KDialogBase { Q_OBJECT public: - DlgLanguage(QWidget *parent = 0, const char *name = 0, bool modal=true); + DlgLanguage(TQWidget *parent = 0, const char *name = 0, bool modal=true); ~DlgLanguage(); - void setLanguage(int index, const QString &lang); - QString Language(int index); + void setLanguage(int index, const TQString &lang); + TQString Language(int index); private: DlgLanguageBase *dlgBase; diff --git a/kwordquiz/src/dlgrc.cpp b/kwordquiz/src/dlgrc.cpp index 07694b63..9fa996e3 100644 --- a/kwordquiz/src/dlgrc.cpp +++ b/kwordquiz/src/dlgrc.cpp @@ -19,7 +19,7 @@ #include "dlgrc.h" -DlgRC::DlgRC(QWidget *parent, const char *name, bool modal): KDialogBase(Swallow, i18n("Rows & Columns"), Ok|Cancel, Ok, parent, name, modal, true) +DlgRC::DlgRC(TQWidget *parent, const char *name, bool modal): KDialogBase(Swallow, i18n("Rows & Columns"), Ok|Cancel, Ok, parent, name, modal, true) { dlgBase = new DlgRCBase( this, "Dlg" ); setMainWidget(dlgBase); @@ -33,17 +33,17 @@ DlgRC::~DlgRC() void DlgRC::setNumRows( int r ) { - dlgBase->txtNumRows->setText(QString::number(r, 10)); + dlgBase->txtNumRows->setText(TQString::number(r, 10)); } void DlgRC::setRowHeight( int h ) { - dlgBase->txtRowHeight->setText(QString::number(h, 10)); + dlgBase->txtRowHeight->setText(TQString::number(h, 10)); } void DlgRC::setColWidth( int w ) { - dlgBase->txtColWidth->setText(QString::number(w, 10)); + dlgBase->txtColWidth->setText(TQString::number(w, 10)); } int DlgRC::numRows( ) diff --git a/kwordquiz/src/dlgrc.h b/kwordquiz/src/dlgrc.h index 3bf3c077..b54fa64c 100644 --- a/kwordquiz/src/dlgrc.h +++ b/kwordquiz/src/dlgrc.h @@ -28,7 +28,7 @@ class DlgRC : public KDialogBase { Q_OBJECT public: - DlgRC(QWidget *parent = 0, const char *name = 0, bool modal=true); + DlgRC(TQWidget *parent = 0, const char *name = 0, bool modal=true); ~DlgRC(); void setNumRows(int r); diff --git a/kwordquiz/src/dlgsort.cpp b/kwordquiz/src/dlgsort.cpp index cb96c945..20221468 100644 --- a/kwordquiz/src/dlgsort.cpp +++ b/kwordquiz/src/dlgsort.cpp @@ -16,12 +16,12 @@ #include -#include +#include #include "dlgsort.h" -DlgSort::DlgSort(QWidget *parent, const char *name, bool modal): KDialogBase(Swallow, i18n("Sort"), Ok|Cancel, Ok, parent, name, modal, true) +DlgSort::DlgSort(TQWidget *parent, const char *name, bool modal): KDialogBase(Swallow, i18n("Sort"), Ok|Cancel, Ok, parent, name, modal, true) { dlgBase = new DlgSortBase( this, "Dlg" ); setMainWidget(dlgBase); @@ -45,7 +45,7 @@ bool DlgSort::ascending( ) return dlgBase->optAscending->isChecked(); } -void DlgSort::setLanguage( int index, const QString & lang ) +void DlgSort::setLanguage( int index, const TQString & lang ) { if (index == 1) { dlgBase->optLang1 -> setText("&1 " + lang); diff --git a/kwordquiz/src/dlgsort.h b/kwordquiz/src/dlgsort.h index 8642eb62..181cf75b 100644 --- a/kwordquiz/src/dlgsort.h +++ b/kwordquiz/src/dlgsort.h @@ -29,12 +29,12 @@ class DlgSort : public KDialogBase Q_OBJECT public: - DlgSort(QWidget *parent = 0, const char *name = 0, bool modal=true); + DlgSort(TQWidget *parent = 0, const char *name = 0, bool modal=true); ~DlgSort(); bool base(); bool ascending(); - void setLanguage(int index, const QString &lang); + void setLanguage(int index, const TQString &lang); private: DlgSortBase *dlgBase; diff --git a/kwordquiz/src/dlgspecchar.cpp b/kwordquiz/src/dlgspecchar.cpp index e35fe236..79dd2da0 100644 --- a/kwordquiz/src/dlgspecchar.cpp +++ b/kwordquiz/src/dlgspecchar.cpp @@ -16,13 +16,13 @@ #include "dlgspecchar.h" -#include +#include #include #include #include -DlgSpecChar::DlgSpecChar( QWidget *parent, const char *name, const QString &_font, const QChar &_chr, bool _modal ) +DlgSpecChar::DlgSpecChar( TQWidget *parent, const char *name, const TQString &_font, const TQChar &_chr, bool _modal ) : KDialogBase( Plain, i18n("Select Character"), User1 | Cancel, User1 , parent, name, _modal ) { initDialog(_chr,_font,true); @@ -32,16 +32,16 @@ DlgSpecChar::DlgSpecChar( QWidget *parent, const char *name, const QString &_fon } -void DlgSpecChar::initDialog(const QChar &_chr, const QString &_font, bool /*_enableFont*/) +void DlgSpecChar::initDialog(const TQChar &_chr, const TQString &_font, bool /*_enableFont*/) { - QWidget *page = plainPage(); + TQWidget *page = plainPage(); - grid = new QGridLayout( page, 1, 1, KDialog::marginHint(), KDialog::spacingHint() ); + grid = new TQGridLayout( page, 1, 1, KDialog::marginHint(), KDialog::spacingHint() ); int t = (_chr.unicode()/256); charSelect = new KCharSelect( page, "", _font, _chr, t); - connect(charSelect, SIGNAL(doubleClicked()),this, SLOT(slotDoubleClicked())); + connect(charSelect, TQT_SIGNAL(doubleClicked()),this, TQT_SLOT(slotDoubleClicked())); charSelect->resize( charSelect->sizeHint() ); charSelect->enableFontCombo( false ); grid->addWidget( charSelect, 0, 0 ); @@ -61,7 +61,7 @@ void DlgSpecChar::closeDialog() KDialogBase::close(); } -QChar DlgSpecChar::chr() +TQChar DlgSpecChar::chr() { return charSelect->chr(); } diff --git a/kwordquiz/src/dlgspecchar.h b/kwordquiz/src/dlgspecchar.h index f2a18c8d..daf91d97 100644 --- a/kwordquiz/src/dlgspecchar.h +++ b/kwordquiz/src/dlgspecchar.h @@ -33,17 +33,17 @@ class DlgSpecChar : public KDialogBase Q_OBJECT public: //constructor when you want to insert multi char - DlgSpecChar( QWidget *parent, const char *name, const QString &_font, - const QChar &_chr, bool _modal=true ); + DlgSpecChar( TQWidget *parent, const char *name, const TQString &_font, + const TQChar &_chr, bool _modal=true ); ~DlgSpecChar(); // internal - QChar chr(); + TQChar chr(); void closeDialog(); private: - void initDialog(const QChar &_chr, const QString &_font, bool _enableFont); + void initDialog(const TQChar &_chr, const TQString &_font, bool _enableFont); private slots: void slotUser1(); @@ -51,13 +51,13 @@ private slots: protected: // dialog objects - QGridLayout *grid; + TQGridLayout *grid; KButtonBox *bbox; - QPushButton *bOk, *bCancel; + TQPushButton *bOk, *bCancel; KCharSelect *charSelect; signals: - void insertChar(QChar); + void insertChar(TQChar); }; #endif diff --git a/kwordquiz/src/flashview.cpp b/kwordquiz/src/flashview.cpp index df6a39ae..eafa5294 100644 --- a/kwordquiz/src/flashview.cpp +++ b/kwordquiz/src/flashview.cpp @@ -14,7 +14,7 @@ * * ***************************************************************************/ -#include +#include #include #include @@ -25,12 +25,12 @@ #include "prefs.h" -FlashView::FlashView(QWidget *parent, const char *name, WFlags f) +FlashView::FlashView(TQWidget *parent, const char *name, WFlags f) : FlashViewBase(parent, name, f) { m_score = new WQScore(); - m_timer = new QTimer(this); - connect(m_timer, SIGNAL(timeout()), this, SLOT(slotTimer())); + m_timer = new TQTimer(this); + connect(m_timer, TQT_SIGNAL(timeout()), this, TQT_SLOT(slotTimer())); } @@ -126,7 +126,7 @@ void FlashView::slotFlip() fraCard->setPaletteForegroundColor(Prefs::frontFrameColor()); linFlash->setPaletteForegroundColor(Prefs::frontFrameColor()); linFlash->setPaletteBackgroundColor(Prefs::frontCardColor()); - //linFlash->setPaletteForegroundColor(QColor(255, 0, 0)); + //linFlash->setPaletteForegroundColor(TQColor(255, 0, 0)); showFront(m_question); m_showFirst = false; } @@ -140,7 +140,7 @@ void FlashView::slotFlip() fraCard->setPaletteForegroundColor(Prefs::backFrameColor()); linFlash->setPaletteForegroundColor(Prefs::backFrameColor()); linFlash->setPaletteBackgroundColor(Prefs::backCardColor()); - //linFlash->setPaletteForegroundColor(QColor(0, 0, 255)); + //linFlash->setPaletteForegroundColor(TQColor(0, 0, 255)); showBack(m_question); m_showFirst = true; } @@ -178,7 +178,7 @@ void FlashView::slotRepeat() */ void FlashView::updateScore() { - QString s; + TQString s; s = s.setNum(m_quiz->questionCount(), 10); lblScoreCount->setText(s); picCount->setPixmap(KGlobal::iconLoader()->loadIcon("kwordquiz", KIcon::Panel)); diff --git a/kwordquiz/src/flashview.h b/kwordquiz/src/flashview.h index 9fa26db9..c6135df5 100644 --- a/kwordquiz/src/flashview.h +++ b/kwordquiz/src/flashview.h @@ -32,7 +32,7 @@ class FlashView : public FlashViewBase { Q_OBJECT public: - FlashView(QWidget *parent = 0, const char *name = 0, WFlags f = 0); + FlashView(TQWidget *parent = 0, const char *name = 0, WFlags f = 0); ~FlashView(); @@ -60,7 +60,7 @@ private: KAction* actRepeat; KAction* actRestart; - QTimer* m_timer; + TQTimer* m_timer; int m_question; int m_error; diff --git a/kwordquiz/src/keduvocdata.cpp b/kwordquiz/src/keduvocdata.cpp index 4d46d7d9..48b20f8e 100644 --- a/kwordquiz/src/keduvocdata.cpp +++ b/kwordquiz/src/keduvocdata.cpp @@ -18,7 +18,7 @@ #include "keduvocdata.h" -#include +#include #include @@ -33,7 +33,7 @@ KEduVocDataItem::KEduVocDataItem() } -KEduVocDataItem::KEduVocDataItem(QDomElement &entry) +KEduVocDataItem::KEduVocDataItem(TQDomElement &entry) { domElement = entry; } @@ -43,39 +43,39 @@ KEduVocDataItem::~KEduVocDataItem() } -QString KEduVocDataItem::originalText() const +TQString KEduVocDataItem::originalText() const { return getText("o"); } -QString KEduVocDataItem::translatedText() const +TQString KEduVocDataItem::translatedText() const { return getText("t"); } // protected methods -QString KEduVocDataItem::getText(const QString &tagName) const +TQString KEduVocDataItem::getText(const TQString &tagName) const { if(!domElement.isNull()) { - QDomNodeList list = domElement.elementsByTagName(tagName); + TQDomNodeList list = domElement.elementsByTagName(tagName); if(list.count() > 0) { - QDomElement element = list.item(0).toElement(); + TQDomElement element = list.item(0).toElement(); if(!element.isNull()) { return element.text(); } else - return QString::null; + return TQString::null; } else - return QString::null; + return TQString::null; } else - return QString::null; + return TQString::null; } //////////////////////////////////////////////////////////////////////////////// @@ -88,24 +88,24 @@ QString KEduVocDataItem::getText(const QString &tagName) const */ KEduVocData::KEduVocData() { - document = new QDomDocument(); + document = new TQDomDocument(); } -KEduVocDataItemList KEduVocData::parse(const QString &fileName) +KEduVocDataItemList KEduVocData::parse(const TQString &fileName) { KEduVocDataItemList list; - //QDomDocument document; - QFile file(fileName); + //TQDomDocument document; + TQFile file(fileName); document->setContent(&file); - QDomNodeList entries = document->elementsByTagName("e"); + TQDomNodeList entries = document->elementsByTagName("e"); // loop through the "e" (entry) tags looking for data for(uint i = 0 ; i < entries.count() ; i++) { // get an entry to operate on - QDomElement entry = entries.item(i).toElement(); + TQDomElement entry = entries.item(i).toElement(); // if the "node" is in fact an element -- i.e. not null if(!entry.isNull()) { @@ -148,7 +148,7 @@ int KEduVocData::numRows() /*! \fn KEduVocData::language(int col) */ -QString KEduVocData::language(int col) +TQString KEduVocData::language(int col) { if (!document->isNull()) if (col == 0) @@ -156,7 +156,7 @@ QString KEduVocData::language(int col) else return document -> documentElement().namedItem("e").namedItem("t").toElement().attribute("l"); else - return QString::null; + return TQString::null; } diff --git a/kwordquiz/src/keduvocdata.h b/kwordquiz/src/keduvocdata.h index 968f3243..f9f28257 100644 --- a/kwordquiz/src/keduvocdata.h +++ b/kwordquiz/src/keduvocdata.h @@ -19,40 +19,40 @@ Boston, MA 02110-1301, USA. */ -#include -#include +#include +#include class KEduVocDataItem { public: KEduVocDataItem(); - KEduVocDataItem(QDomElement &entry); + KEduVocDataItem(TQDomElement &entry); virtual ~KEduVocDataItem(); - QString originalText() const; - QString translatedText() const; + TQString originalText() const; + TQString translatedText() const; protected: - QString getText(const QString &tagName) const; + TQString getText(const TQString &tagName) const; private: - QDomElement domElement; + TQDomElement domElement; }; -typedef QValueList KEduVocDataItemList; +typedef TQValueList KEduVocDataItemList; class KEduVocData { public: KEduVocData(); - KEduVocDataItemList parse(const QString &fileName); + KEduVocDataItemList parse(const TQString &fileName); int colWidth(int col); int numRows(); - QString language(int col); + TQString language(int col); private: - QDomDocument* document; + TQDomDocument* document; }; #endif diff --git a/kwordquiz/src/kvtmlwriter.cpp b/kwordquiz/src/kvtmlwriter.cpp index 8ad93797..787cabab 100644 --- a/kwordquiz/src/kvtmlwriter.cpp +++ b/kwordquiz/src/kvtmlwriter.cpp @@ -16,13 +16,13 @@ #include "kvtmlwriter.h" -KVTMLWriter::KVTMLWriter(QFile *file) +KVTMLWriter::KVTMLWriter(TQFile *file) { outputFile = file; if(outputFile->open(IO_WriteOnly)) { outputStream.setDevice(outputFile); - outputStream.setEncoding(QTextStream::UnicodeUTF8); + outputStream.setEncoding(TQTextStream::UnicodeUTF8); outputStream << "" << endl; outputStream << "" << endl; @@ -30,11 +30,11 @@ KVTMLWriter::KVTMLWriter(QFile *file) } /*! - \fn KVTMLWriter::addHeader(const QString &generator, int cols, int rows, const QString &title) + \fn KVTMLWriter::addHeader(const TQString &generator, int cols, int rows, const TQString &title) */ -void KVTMLWriter::addHeader(const QString &generator, int cols, int rows, const QString &title) +void KVTMLWriter::addHeader(const TQString &generator, int cols, int rows, const TQString &title) { - QString s = QString("") + TQString s = TQString("") .arg(generator) .arg(cols) .arg(rows) @@ -44,16 +44,16 @@ void KVTMLWriter::addHeader(const QString &generator, int cols, int rows, const } /*! - \fn KVTMLWriter::addFirstItem(const QString &ll, int lwidth, const QString &left, const QString &rl, int rwidth, const QString &right) + \fn KVTMLWriter::addFirstItem(const TQString &ll, int lwidth, const TQString &left, const TQString &rl, int rwidth, const TQString &right) */ -void KVTMLWriter::addFirstItem(const QString &ll, int lwidth, const QString &left, const QString &rl, int rwidth, const QString &right) +void KVTMLWriter::addFirstItem(const TQString &ll, int lwidth, const TQString &left, const TQString &rl, int rwidth, const TQString &right) { outputStream << " " << endl; - QString s = QString(" ") + TQString s = TQString(" ") .arg(lwidth) .arg(ll); outputStream << s << escape(left) << "" << endl; - s = QString(" ") + s = TQString(" ") .arg(rwidth) .arg(rl); outputStream << s << escape(right) << "" << endl; @@ -61,9 +61,9 @@ void KVTMLWriter::addFirstItem(const QString &ll, int lwidth, const QString &lef } /*! - \fn KVTMLWriter::addItem(const QString &left, const QString &right) + \fn KVTMLWriter::addItem(const TQString &left, const TQString &right) */ -void KVTMLWriter::addItem(const QString &left, const QString &right) +void KVTMLWriter::addItem(const TQString &left, const TQString &right) { outputStream << " " << endl; outputStream << " " << escape(left) << "" << endl; @@ -78,12 +78,12 @@ KVTMLWriter::~KVTMLWriter() outputFile->close(); } -QString KVTMLWriter::escape( const QString & s) +TQString KVTMLWriter::escape( const TQString & s) { - QString result = s; - result.replace(QChar('&'), "&"); //must be done first - result.replace(QChar('<'), "<"); - result.replace(QChar('>'), ">"); + TQString result = s; + result.replace(TQChar('&'), "&"); //must be done first + result.replace(TQChar('<'), "<"); + result.replace(TQChar('>'), ">"); return result; } diff --git a/kwordquiz/src/kvtmlwriter.h b/kwordquiz/src/kvtmlwriter.h index 7ff9fa37..ccf18071 100644 --- a/kwordquiz/src/kvtmlwriter.h +++ b/kwordquiz/src/kvtmlwriter.h @@ -17,24 +17,24 @@ #ifndef KVTMLWRITER_H #define KVTMLWRITER_H -#include -#include +#include +#include /** @author Peter Hedlund */ class KVTMLWriter{ public: - KVTMLWriter(QFile *file); + KVTMLWriter(TQFile *file); ~KVTMLWriter(); - void addFirstItem(const QString &ll, int lwidth, const QString &left, const QString &rl, int rwidth, const QString &right); - void addHeader(const QString &generator, int cols, int rows, const QString &title); - void addItem(const QString &left, const QString &right); + void addFirstItem(const TQString &ll, int lwidth, const TQString &left, const TQString &rl, int rwidth, const TQString &right); + void addHeader(const TQString &generator, int cols, int rows, const TQString &title); + void addItem(const TQString &left, const TQString &right); private: - QString escape(const QString &); - QFile *outputFile; - QTextStream outputStream; + TQString escape(const TQString &); + TQFile *outputFile; + TQTextStream outputStream; }; #endif diff --git a/kwordquiz/src/kwordquiz.cpp b/kwordquiz/src/kwordquiz.cpp index 1c384d9c..9dde6a0c 100644 --- a/kwordquiz/src/kwordquiz.cpp +++ b/kwordquiz/src/kwordquiz.cpp @@ -16,9 +16,9 @@ ***************************************************************************/ // // include files for QT -#include -#include -#include +#include +#include +#include // include files for KDE #include @@ -54,7 +54,7 @@ #define ID_MENU_QUIZ 1001 -KWordQuizApp::KWordQuizApp(QWidget* , const char* name):KMainWindow(0, name) +KWordQuizApp::KWordQuizApp(TQWidget* , const char* name):KMainWindow(0, name) { /////////////////////////////////////////////////////////////////// @@ -105,117 +105,117 @@ void KWordQuizApp::initActions() KAction* configNotifications; KAction* configApp; - fileNew = KStdAction::openNew(this, SLOT(slotFileNew()), actionCollection()); + fileNew = KStdAction::openNew(this, TQT_SLOT(slotFileNew()), actionCollection()); fileNew->setWhatsThis(i18n("Creates a new blank vocabulary document")); fileNew->setToolTip(fileNew->whatsThis()); - fileOpen = KStdAction::open(this, SLOT(slotFileOpen()), actionCollection()); + fileOpen = KStdAction::open(this, TQT_SLOT(slotFileOpen()), actionCollection()); fileOpen->setWhatsThis(i18n("Opens an existing vocabulary document")); fileOpen->setToolTip(fileOpen->whatsThis()); - fileOpenRecent = KStdAction::openRecent(this, SLOT(slotFileOpenRecent(const KURL&)), actionCollection()); + fileOpenRecent = KStdAction::openRecent(this, TQT_SLOT(slotFileOpenRecent(const KURL&)), actionCollection()); - fileGHNS = new KAction(i18n("&Get New Vocabularies..."), "knewstuff", "CTRL+G", this, SLOT(slotFileGHNS()), actionCollection(), "file_ghns"); + fileGHNS = new KAction(i18n("&Get New Vocabularies..."), "knewstuff", "CTRL+G", this, TQT_SLOT(slotFileGHNS()), actionCollection(), "file_ghns"); fileGHNS->setWhatsThis(i18n("Downloads new vocabularies")); fileGHNS->setToolTip(fileGHNS->whatsThis()); - fileSave = KStdAction::save(this, SLOT(slotFileSave()), actionCollection()); + fileSave = KStdAction::save(this, TQT_SLOT(slotFileSave()), actionCollection()); fileSave->setWhatsThis(i18n("Saves the active vocabulary document")); fileSave->setToolTip(fileSave->whatsThis()); - fileSaveAs = KStdAction::saveAs(this, SLOT(slotFileSaveAs()), actionCollection()); + fileSaveAs = KStdAction::saveAs(this, TQT_SLOT(slotFileSaveAs()), actionCollection()); fileSaveAs->setWhatsThis(i18n("Saves the active vocabulary document with a different name")); fileSaveAs->setToolTip(fileSaveAs->whatsThis()); - fileClose = KStdAction::close(this, SLOT(slotFileClose()), actionCollection()); + fileClose = KStdAction::close(this, TQT_SLOT(slotFileClose()), actionCollection()); fileClose->setWhatsThis(i18n("Closes the active vocabulary document")); fileClose->setToolTip(fileClose->whatsThis()); - filePrint = KStdAction::print(this, SLOT(slotFilePrint()), actionCollection()); + filePrint = KStdAction::print(this, TQT_SLOT(slotFilePrint()), actionCollection()); filePrint->setWhatsThis(i18n("Prints the active vocabulary document")); filePrint->setToolTip(filePrint->whatsThis()); - fileQuit = KStdAction::quit(this, SLOT(slotFileQuit()), actionCollection()); + fileQuit = KStdAction::quit(this, TQT_SLOT(slotFileQuit()), actionCollection()); fileQuit->setWhatsThis(i18n("Quits KWordQuiz")); fileQuit->setToolTip(fileQuit->whatsThis()); - editUndo = KStdAction::undo(this, SLOT(slotEditUndo()), actionCollection()); + editUndo = KStdAction::undo(this, TQT_SLOT(slotEditUndo()), actionCollection()); editUndo->setWhatsThis(i18n("Undoes the last command")); editUndo->setToolTip(editUndo->whatsThis()); - editCut = KStdAction::cut(this, SLOT(slotEditCut()), actionCollection()); + editCut = KStdAction::cut(this, TQT_SLOT(slotEditCut()), actionCollection()); editCut->setWhatsThis(i18n("Cuts the text from the selected cells and places it on the clipboard")); editCut->setToolTip(editCut->whatsThis()); - editCopy = KStdAction::copy(this, SLOT(slotEditCopy()), actionCollection()); + editCopy = KStdAction::copy(this, TQT_SLOT(slotEditCopy()), actionCollection()); editCopy->setWhatsThis(i18n("Copies the text from the selected cells and places it on the clipboard")); editCopy->setToolTip(editCopy->whatsThis()); - editPaste = KStdAction::paste(this, SLOT(slotEditPaste()), actionCollection()); + editPaste = KStdAction::paste(this, TQT_SLOT(slotEditPaste()), actionCollection()); editPaste->setWhatsThis(i18n("Pastes previously cut or copied text from the clipboard into the selected cells")); editPaste->setToolTip(editPaste->whatsThis()); - editClear = KStdAction::clear(this, SLOT(slotEditClear()), actionCollection()); + editClear = KStdAction::clear(this, TQT_SLOT(slotEditClear()), actionCollection()); editClear->setWhatsThis(i18n("Clears the content of the selected cells")); editClear->setToolTip(editClear->whatsThis()); - editInsert = new KAction(i18n("&Insert Row"), "insert_table_row", "CTRL+I", this, SLOT(slotEditInsert()), actionCollection(),"edit_insert"); + editInsert = new KAction(i18n("&Insert Row"), "insert_table_row", "CTRL+I", this, TQT_SLOT(slotEditInsert()), actionCollection(),"edit_insert"); editInsert->setWhatsThis(i18n("Inserts a new row above the current row")); editInsert->setToolTip(editInsert->whatsThis()); - editDelete = new KAction(i18n("&Delete Row"), "delete_table_row", "CTRL+K", this, SLOT(slotEditDelete()), actionCollection(),"edit_delete"); + editDelete = new KAction(i18n("&Delete Row"), "delete_table_row", "CTRL+K", this, TQT_SLOT(slotEditDelete()), actionCollection(),"edit_delete"); editDelete->setWhatsThis(i18n("Deletes the selected row(s)")); editDelete->setToolTip(editDelete->whatsThis()); - editMarkBlank = new KAction(i18n("&Mark as Blank"), "markasblank", "CTRL+M", this, SLOT(slotEditMarkBlank()), actionCollection(),"edit_mark_blank"); + editMarkBlank = new KAction(i18n("&Mark as Blank"), "markasblank", "CTRL+M", this, TQT_SLOT(slotEditMarkBlank()), actionCollection(),"edit_mark_blank"); editMarkBlank->setWhatsThis(i18n("Marks the current or selected word as a blank for Fill-in-the-blank")); editMarkBlank->setToolTip(editMarkBlank->whatsThis()); - editUnmarkBlank = new KAction(i18n("&Unmark Blanks"), "unmarkasblank", 0, this, SLOT(slotEditUnmarkBlank()), actionCollection(),"edit_unmark_blank"); + editUnmarkBlank = new KAction(i18n("&Unmark Blanks"), "unmarkasblank", 0, this, TQT_SLOT(slotEditUnmarkBlank()), actionCollection(),"edit_unmark_blank"); editUnmarkBlank->setWhatsThis(i18n("Removes blanks from the current or selected word")); editUnmarkBlank->setToolTip(editUnmarkBlank->whatsThis()); - //@todo implement editFind = KStdAction::find(this, SLOT(slotEditFind()), actionCollection()); + //@todo implement editFind = KStdAction::find(this, TQT_SLOT(slotEditFind()), actionCollection()); - vocabLanguages = new KAction(i18n("&Column Titles..."), "languages", "CTRL+L", this, SLOT(slotVocabLanguages()), actionCollection(),"vocab_languages"); + vocabLanguages = new KAction(i18n("&Column Titles..."), "languages", "CTRL+L", this, TQT_SLOT(slotVocabLanguages()), actionCollection(),"vocab_languages"); vocabLanguages->setWhatsThis(i18n("Defines the column titles for the active vocabulary")); vocabLanguages->setToolTip(vocabLanguages->whatsThis()); - vocabFont = new KAction(i18n("&Font..."), "fonts", 0, this, SLOT(slotVocabFont()), actionCollection(),"vocab_font"); + vocabFont = new KAction(i18n("&Font..."), "fonts", 0, this, TQT_SLOT(slotVocabFont()), actionCollection(),"vocab_font"); vocabFont->setWhatsThis(i18n("Defines the font used by the editor")); vocabFont->setToolTip(vocabFont->whatsThis()); - //@todo implement vocabKeyboard = new KAction(i18n("&Keyboard..."), "kxkb", 0, this, SLOT(slotVocabKeyboard()), actionCollection(),"vocab_keyboard"); + //@todo implement vocabKeyboard = new KAction(i18n("&Keyboard..."), "kxkb", 0, this, TQT_SLOT(slotVocabKeyboard()), actionCollection(),"vocab_keyboard"); - vocabRC = new KAction(i18n("&Rows/Columns..."), "rowcol", 0, this, SLOT(slotVocabRC()), actionCollection(),"vocab_rc"); + vocabRC = new KAction(i18n("&Rows/Columns..."), "rowcol", 0, this, TQT_SLOT(slotVocabRC()), actionCollection(),"vocab_rc"); vocabRC->setWhatsThis(i18n("Defines the number of rows, row heights, and column widths for the active vocabulary")); vocabRC->setToolTip(vocabRC->whatsThis()); - vocabSort = new KAction(i18n("&Sort..."), "sort_incr", 0, this, SLOT(slotVocabSort()), actionCollection(),"vocab_sort"); + vocabSort = new KAction(i18n("&Sort..."), "sort_incr", 0, this, TQT_SLOT(slotVocabSort()), actionCollection(),"vocab_sort"); vocabSort->setWhatsThis(i18n("Sorts the vocabulary in ascending or descending order based on the left or right column")); vocabSort->setToolTip(vocabSort->whatsThis()); - vocabShuffle = new KAction(i18n("Sh&uffle"), "shuffle", 0, this, SLOT(slotVocabShuffle()), actionCollection(),"vocab_shuffle"); + vocabShuffle = new KAction(i18n("Sh&uffle"), "shuffle", 0, this, TQT_SLOT(slotVocabShuffle()), actionCollection(),"vocab_shuffle"); vocabShuffle->setWhatsThis(i18n("Shuffles the entries of the active vocabulary")); vocabShuffle->setToolTip(vocabShuffle->whatsThis()); - mode = new KToolBarPopupAction(i18n("Change Mode"), "mode1", 0, this, SLOT(slotMode0()), actionCollection(),"mode_0"); + mode = new KToolBarPopupAction(i18n("Change Mode"), "mode1", 0, this, TQT_SLOT(slotMode0()), actionCollection(),"mode_0"); mode->setWhatsThis(i18n("Changes the mode used in quiz sessions")); mode->setToolTip(mode->whatsThis()); KPopupMenu *popup = mode->popupMenu(); popup->clear(); - popup->insertItem(KGlobal::iconLoader()->loadIconSet("mode1", KIcon::Toolbar), "", this, SLOT(slotMode1()), 0, 0); - popup->insertItem(KGlobal::iconLoader()->loadIconSet("mode2", KIcon::Toolbar), "", this, SLOT(slotMode2()), 0, 1); - popup->insertItem(KGlobal::iconLoader()->loadIconSet("mode3", KIcon::Toolbar), "", this, SLOT(slotMode3()), 0, 2); - popup->insertItem(KGlobal::iconLoader()->loadIconSet("mode4", KIcon::Toolbar), "", this, SLOT(slotMode4()), 0, 3); - popup->insertItem(KGlobal::iconLoader()->loadIconSet("mode5", KIcon::Toolbar), "", this, SLOT(slotMode5()), 0, 4); - - mode1 = new KToggleAction("", "mode1", 0, this, SLOT(slotMode1()), actionCollection(),"mode_1"); - mode2 = new KToggleAction("", "mode2", 0, this, SLOT(slotMode2()), actionCollection(),"mode_2"); - mode3 = new KToggleAction("", "mode3", 0, this, SLOT(slotMode3()), actionCollection(),"mode_3"); - mode4 = new KToggleAction("", "mode4", 0, this, SLOT(slotMode4()), actionCollection(),"mode_4"); - mode5 = new KToggleAction("", "mode5", 0, this, SLOT(slotMode5()), actionCollection(),"mode_5"); + popup->insertItem(KGlobal::iconLoader()->loadIconSet("mode1", KIcon::Toolbar), "", this, TQT_SLOT(slotMode1()), 0, 0); + popup->insertItem(KGlobal::iconLoader()->loadIconSet("mode2", KIcon::Toolbar), "", this, TQT_SLOT(slotMode2()), 0, 1); + popup->insertItem(KGlobal::iconLoader()->loadIconSet("mode3", KIcon::Toolbar), "", this, TQT_SLOT(slotMode3()), 0, 2); + popup->insertItem(KGlobal::iconLoader()->loadIconSet("mode4", KIcon::Toolbar), "", this, TQT_SLOT(slotMode4()), 0, 3); + popup->insertItem(KGlobal::iconLoader()->loadIconSet("mode5", KIcon::Toolbar), "", this, TQT_SLOT(slotMode5()), 0, 4); + + mode1 = new KToggleAction("", "mode1", 0, this, TQT_SLOT(slotMode1()), actionCollection(),"mode_1"); + mode2 = new KToggleAction("", "mode2", 0, this, TQT_SLOT(slotMode2()), actionCollection(),"mode_2"); + mode3 = new KToggleAction("", "mode3", 0, this, TQT_SLOT(slotMode3()), actionCollection(),"mode_3"); + mode4 = new KToggleAction("", "mode4", 0, this, TQT_SLOT(slotMode4()), actionCollection(),"mode_4"); + mode5 = new KToggleAction("", "mode5", 0, this, TQT_SLOT(slotMode5()), actionCollection(),"mode_5"); mode1->setWhatsThis(i18n("Selects this mode")); mode2->setWhatsThis(i18n("Selects this mode")); mode3->setWhatsThis(i18n("Selects this mode")); @@ -227,19 +227,19 @@ void KWordQuizApp::initActions() mode4->setToolTip(mode4->whatsThis()); mode5->setToolTip(mode5->whatsThis()); - quizEditor = new KAction(i18n("&Editor"), "editor", "F6", this, SLOT(slotQuizEditor()), actionCollection(),"quiz_editor"); + quizEditor = new KAction(i18n("&Editor"), "editor", "F6", this, TQT_SLOT(slotQuizEditor()), actionCollection(),"quiz_editor"); quizEditor->setWhatsThis(i18n("Activates the vocabulary editor")); quizEditor->setToolTip(quizEditor->whatsThis()); - quizFlash = new KAction(i18n("&Flashcard"), "flash", "F7", this, SLOT(slotQuizFlash()), actionCollection(),"quiz_flash"); + quizFlash = new KAction(i18n("&Flashcard"), "flash", "F7", this, TQT_SLOT(slotQuizFlash()), actionCollection(),"quiz_flash"); quizFlash->setWhatsThis(i18n("Starts a flashcard session using the active vocabulary")); quizFlash->setToolTip(quizFlash->whatsThis()); - quizMultiple = new KAction(i18n("&Multiple Choice"), "multiple", "F8", this, SLOT(slotQuizMultiple()), actionCollection(),"quiz_multiple"); + quizMultiple = new KAction(i18n("&Multiple Choice"), "multiple", "F8", this, TQT_SLOT(slotQuizMultiple()), actionCollection(),"quiz_multiple"); quizMultiple->setWhatsThis(i18n("Starts a multiple choice session using the active vocabulary")); quizMultiple->setToolTip(quizMultiple->whatsThis()); - quizQA = new KAction(i18n("&Question && Answer"), "qa", "F9", this, SLOT(slotQuizQA()), actionCollection(),"quiz_qa"); + quizQA = new KAction(i18n("&Question && Answer"), "qa", "F9", this, TQT_SLOT(slotQuizQA()), actionCollection(),"quiz_qa"); quizQA->setWhatsThis(i18n("Starts a question and answer session using the active vocabulary")); quizQA->setToolTip(quizQA->whatsThis()); @@ -267,26 +267,26 @@ void KWordQuizApp::initActions() quizRepeatErrors->setWhatsThis(i18n("Repeats all incorrectly answered questions")); quizRepeatErrors->setToolTip(quizRepeatErrors->whatsThis()); - configNotifications = KStdAction::configureNotifications(this, SLOT(slotConfigureNotifications()), actionCollection()); + configNotifications = KStdAction::configureNotifications(this, TQT_SLOT(slotConfigureNotifications()), actionCollection()); configNotifications->setWhatsThis(i18n("Configures sound and other notifications for certain events")); configNotifications->setToolTip(configNotifications->whatsThis()); - configApp = KStdAction::preferences(this, SLOT( slotConfigure()), actionCollection()); + configApp = KStdAction::preferences(this, TQT_SLOT( slotConfigure()), actionCollection()); configApp->setWhatsThis(i18n("Specifies preferences for the vocabulary editor and quiz sessions")); configApp->setToolTip(configApp->whatsThis()); - charMapper = new QSignalMapper(this); - connect(charMapper, SIGNAL(mapped(int)), this, SLOT(slotInsertChar(int))); + charMapper = new TQSignalMapper(this); + connect(charMapper, TQT_SIGNAL(mapped(int)), this, TQT_SLOT(slotInsertChar(int))); - specialChar1 = new KAction(i18n("Special Character 1"), "", "CTRL+1", charMapper, SLOT(map()), actionCollection(), "char_1") ; - specialChar2 = new KAction(i18n("Special Character 2"), 0, "CTRL+2", charMapper, SLOT(map()), actionCollection(), "char_2") ; - specialChar3 = new KAction(i18n("Special Character 3"), 0, "CTRL+3", charMapper, SLOT(map()), actionCollection(), "char_3") ; - specialChar4 = new KAction(i18n("Special Character 4"), 0, "CTRL+4", charMapper, SLOT(map()), actionCollection(), "char_4") ; - specialChar5 = new KAction(i18n("Special Character 5"), 0, "CTRL+5", charMapper, SLOT(map()), actionCollection(), "char_5") ; - specialChar6 = new KAction(i18n("Special Character 6"), 0, "CTRL+6", charMapper, SLOT(map()), actionCollection(), "char_6") ; - specialChar7 = new KAction(i18n("Special Character 7"), 0, "CTRL+7", charMapper, SLOT(map()), actionCollection(), "char_7") ; - specialChar8 = new KAction(i18n("Special Character 8"), 0, "CTRL+8", charMapper, SLOT(map()), actionCollection(), "char_8") ; - specialChar9 = new KAction(i18n("Special Character 9"), 0, "CTRL+9", charMapper, SLOT(map()), actionCollection(), "char_9") ; + specialChar1 = new KAction(i18n("Special Character 1"), "", "CTRL+1", charMapper, TQT_SLOT(map()), actionCollection(), "char_1") ; + specialChar2 = new KAction(i18n("Special Character 2"), 0, "CTRL+2", charMapper, TQT_SLOT(map()), actionCollection(), "char_2") ; + specialChar3 = new KAction(i18n("Special Character 3"), 0, "CTRL+3", charMapper, TQT_SLOT(map()), actionCollection(), "char_3") ; + specialChar4 = new KAction(i18n("Special Character 4"), 0, "CTRL+4", charMapper, TQT_SLOT(map()), actionCollection(), "char_4") ; + specialChar5 = new KAction(i18n("Special Character 5"), 0, "CTRL+5", charMapper, TQT_SLOT(map()), actionCollection(), "char_5") ; + specialChar6 = new KAction(i18n("Special Character 6"), 0, "CTRL+6", charMapper, TQT_SLOT(map()), actionCollection(), "char_6") ; + specialChar7 = new KAction(i18n("Special Character 7"), 0, "CTRL+7", charMapper, TQT_SLOT(map()), actionCollection(), "char_7") ; + specialChar8 = new KAction(i18n("Special Character 8"), 0, "CTRL+8", charMapper, TQT_SLOT(map()), actionCollection(), "char_8") ; + specialChar9 = new KAction(i18n("Special Character 9"), 0, "CTRL+9", charMapper, TQT_SLOT(map()), actionCollection(), "char_9") ; charMapper->setMapping(specialChar1, 1); charMapper->setMapping(specialChar2, 2); @@ -299,12 +299,12 @@ void KWordQuizApp::initActions() charMapper->setMapping(specialChar9, 9); actionCollection()->setHighlightingEnabled(true); - connect(actionCollection(), SIGNAL(actionStatusText(const QString &)), this, SLOT(slotStatusMsg(const QString &))); - connect(actionCollection(), SIGNAL(actionHighlighted(KAction *, bool)), this, SLOT(slotActionHighlighted(KAction *, bool))); + connect(actionCollection(), TQT_SIGNAL(actionStatusText(const TQString &)), this, TQT_SLOT(slotStatusMsg(const TQString &))); + connect(actionCollection(), TQT_SIGNAL(actionHighlighted(KAction *, bool)), this, TQT_SLOT(slotActionHighlighted(KAction *, bool))); updateSpecialCharIcons(); if (!initialGeometrySet()) - resize( QSize(650, 500).expandedTo(minimumSizeHint())); + resize( TQSize(650, 500).expandedTo(minimumSizeHint())); setupGUI(ToolBar | Keys | StatusBar | Create); setAutoSaveSettings(); @@ -333,8 +333,8 @@ void KWordQuizApp::initView() setCentralWidget(m_editView); setCaption(doc->URL().fileName(),false); m_editView->setFont(Prefs::editorFont()); - connect(m_editView, SIGNAL(undoChange(const QString&, bool )), this, SLOT(slotUndoChange(const QString&, bool))); - connect(m_editView, SIGNAL(contextMenuRequested(int, int, const QPoint &)), this, SLOT(slotContextMenuRequested(int, int, const QPoint& ))); + connect(m_editView, TQT_SIGNAL(undoChange(const TQString&, bool )), this, TQT_SLOT(slotUndoChange(const TQString&, bool))); + connect(m_editView, TQT_SIGNAL(contextMenuRequested(int, int, const TQPoint &)), this, TQT_SLOT(slotContextMenuRequested(int, int, const TQPoint& ))); } void KWordQuizApp::openURL(const KURL& url) @@ -419,8 +419,8 @@ void KWordQuizApp::saveProperties(KConfig *_cfg) KURL url=doc->URL(); _cfg->writeEntry("filename", url.url()); _cfg->writeEntry("modified", doc->isModified()); - QString tempname = kapp->tempSaveName(url.url()); - QString tempurl= KURL::encode_string(tempname); + TQString tempname = kapp->tempSaveName(url.url()); + TQString tempurl= KURL::encode_string(tempname); KURL _url(tempurl); doc->saveDocument(_url); } @@ -429,13 +429,13 @@ void KWordQuizApp::saveProperties(KConfig *_cfg) void KWordQuizApp::readProperties(KConfig* _cfg) { - QString filename = _cfg->readEntry("filename", ""); + TQString filename = _cfg->readEntry("filename", ""); KURL url(filename); bool modified = _cfg->readBoolEntry("modified", false); if(modified) { bool canRecover; - QString tempname = kapp->checkRecoverFile(filename, canRecover); + TQString tempname = kapp->checkRecoverFile(filename, canRecover); KURL _url(tempname); if(canRecover) @@ -443,7 +443,7 @@ void KWordQuizApp::readProperties(KConfig* _cfg) doc->openDocument(_url); doc->setModified(); setCaption(_url.fileName(),true); - QFile::remove(tempname); + TQFile::remove(tempname); } } else @@ -472,7 +472,7 @@ bool KWordQuizApp::queryExit() } ///////////////////////////////////////////////////////////////////// -// SLOT IMPLEMENTATION +// TQT_SLOT IMPLEMENTATION ///////////////////////////////////////////////////////////////////// void KWordQuizApp::slotFileNew() @@ -493,16 +493,16 @@ void KWordQuizApp::slotFileOpen() { slotStatusMsg(i18n("Opening file...")); - QCheckBox * cb = new QCheckBox(i18n("&Join selected files into one list"), 0, 0); + TQCheckBox * cb = new TQCheckBox(i18n("&Join selected files into one list"), 0, 0); cb -> setChecked(false); - QString filter = i18n("*.kvtml *.wql *.xml.gz *.csv|All Supported Documents\n*.kvtml|KDE Vocabulary Document\n*.wql|KWordQuiz Document\n*.xml.gz|Pauker Lesson\n*.csv|Comma-Separated Values"); - KFileDialog *fd = new KFileDialog(QString::null, filter, this, 0, true, cb); + TQString filter = i18n("*.kvtml *.wql *.xml.gz *.csv|All Supported Documents\n*.kvtml|KDE Vocabulary Document\n*.wql|KWordQuiz Document\n*.xml.gz|Pauker Lesson\n*.csv|Comma-Separated Values"); + KFileDialog *fd = new KFileDialog(TQString::null, filter, this, 0, true, cb); fd -> setOperationMode(KFileDialog::Opening); fd -> setMode(KFile::Files | KFile::ExistingOnly); fd -> setCaption(i18n("Open Vocabulary Document")); - if (fd->exec() == QDialog::Accepted) + if (fd->exec() == TQDialog::Accepted) { KURL::List l = fd -> selectedURLs(); bool append = ((cb -> isChecked()) && (l.count() > 1)); @@ -584,12 +584,12 @@ bool KWordQuizApp::saveAsFileName( ) bool success = false; - QString filter = i18n("*.kvtml|KDE Vocabulary Document\n*.wql|KWordQuiz Document\n*.csv|Comma-Separated Values\n*.html|Hypertext Markup Language"); - KFileDialog *fd = new KFileDialog(QString::null, filter, this, 0, true); + TQString filter = i18n("*.kvtml|KDE Vocabulary Document\n*.wql|KWordQuiz Document\n*.csv|Comma-Separated Values\n*.html|Hypertext Markup Language"); + KFileDialog *fd = new KFileDialog(TQString::null, filter, this, 0, true); fd -> setOperationMode(KFileDialog::Saving); fd -> setCaption(i18n("Save Vocabulary Document As")); - if (fd->exec() == QDialog::Accepted) + if (fd->exec() == TQDialog::Accepted) { KURL url = fd -> selectedURL(); if(!url.isEmpty()){ @@ -607,10 +607,10 @@ bool KWordQuizApp::saveAsFileName( ) url = KURL(url.path() + ".kvtml"); } - QFileInfo fileinfo(url.path()); + TQFileInfo fileinfo(url.path()); if (fileinfo.exists() && KMessageBox::warningContinueCancel(0, i18n("The file
%1
already exists. Do you want to overwrite it?
") - .arg(url.path()),QString::null,i18n("Overwrite")) == KMessageBox::Cancel) + .arg(url.path()),TQString::null,i18n("Overwrite")) == KMessageBox::Cancel) { // do nothing } @@ -691,7 +691,7 @@ void KWordQuizApp::slotFileQuit() } } -void KWordQuizApp::slotUndoChange( const QString & text, bool enabled ) +void KWordQuizApp::slotUndoChange( const TQString & text, bool enabled ) { editUndo->setText(text); editUndo->setEnabled(enabled); @@ -956,7 +956,7 @@ void KWordQuizApp::updateSession(WQQuiz::QuizType qt) break; case WQQuiz::qtFlash: m_quiz = new WQQuiz(m_editView); - connect(m_quiz, SIGNAL(checkingAnswer(int )), m_editView, SLOT(slotCheckedAnswer(int ))); + connect(m_quiz, TQT_SIGNAL(checkingAnswer(int )), m_editView, TQT_SLOT(slotCheckedAnswer(int ))); m_quiz ->setQuizType(WQQuiz::qtFlash); m_quiz->setQuizMode(Prefs::mode()); if (m_quiz -> init()) @@ -964,12 +964,12 @@ void KWordQuizApp::updateSession(WQQuiz::QuizType qt) m_editView->saveCurrentSelection(true); m_editView->hide(); m_flashView = new FlashView(this); - connect(quizCheck, SIGNAL(activated()), m_flashView, SLOT(slotFlip())); - connect(flashKnow, SIGNAL(activated()), m_flashView, SLOT(slotKnow())); - connect(flashDontKnow, SIGNAL(activated()), m_flashView, SLOT(slotDontKnow())); - connect(quizRestart, SIGNAL(activated()), m_flashView, SLOT(slotRestart())); - connect(quizRepeatErrors, SIGNAL(activated()), m_flashView, SLOT(slotRepeat())); - connect(this, SIGNAL(settingsChanged()), m_flashView, SLOT(slotApplySettings())); + connect(quizCheck, TQT_SIGNAL(activated()), m_flashView, TQT_SLOT(slotFlip())); + connect(flashKnow, TQT_SIGNAL(activated()), m_flashView, TQT_SLOT(slotKnow())); + connect(flashDontKnow, TQT_SIGNAL(activated()), m_flashView, TQT_SLOT(slotDontKnow())); + connect(quizRestart, TQT_SIGNAL(activated()), m_flashView, TQT_SLOT(slotRestart())); + connect(quizRepeatErrors, TQT_SIGNAL(activated()), m_flashView, TQT_SLOT(slotRepeat())); + connect(this, TQT_SIGNAL(settingsChanged()), m_flashView, TQT_SLOT(slotApplySettings())); setCentralWidget(m_flashView); m_flashView -> setQuiz(m_quiz); @@ -984,7 +984,7 @@ void KWordQuizApp::updateSession(WQQuiz::QuizType qt) break; case WQQuiz::qtMultiple: m_quiz = new WQQuiz(m_editView); - connect(m_quiz, SIGNAL(checkingAnswer(int )), m_editView, SLOT(slotCheckedAnswer(int ))); + connect(m_quiz, TQT_SIGNAL(checkingAnswer(int )), m_editView, TQT_SLOT(slotCheckedAnswer(int ))); m_quiz ->setQuizType(WQQuiz::qtMultiple); m_quiz->setQuizMode(Prefs::mode()); if (m_quiz -> init()) @@ -992,10 +992,10 @@ void KWordQuizApp::updateSession(WQQuiz::QuizType qt) m_editView->saveCurrentSelection(true); m_editView->hide(); m_multipleView = new MultipleView(this); - connect(quizCheck, SIGNAL(activated()), m_multipleView, SLOT(slotCheck())); - connect(quizRestart, SIGNAL(activated()), m_multipleView, SLOT(slotRestart())); - connect(quizRepeatErrors, SIGNAL(activated()), m_multipleView, SLOT(slotRepeat())); - connect(this, SIGNAL(settingsChanged()), m_multipleView, SLOT(slotApplySettings())); + connect(quizCheck, TQT_SIGNAL(activated()), m_multipleView, TQT_SLOT(slotCheck())); + connect(quizRestart, TQT_SIGNAL(activated()), m_multipleView, TQT_SLOT(slotRestart())); + connect(quizRepeatErrors, TQT_SIGNAL(activated()), m_multipleView, TQT_SLOT(slotRepeat())); + connect(this, TQT_SIGNAL(settingsChanged()), m_multipleView, TQT_SLOT(slotApplySettings())); setCentralWidget(m_multipleView); @@ -1011,7 +1011,7 @@ void KWordQuizApp::updateSession(WQQuiz::QuizType qt) break; case WQQuiz::qtQA: m_quiz = new WQQuiz(m_editView); - connect(m_quiz, SIGNAL(checkingAnswer(int )), m_editView, SLOT(slotCheckedAnswer(int ))); + connect(m_quiz, TQT_SIGNAL(checkingAnswer(int )), m_editView, TQT_SLOT(slotCheckedAnswer(int ))); m_quiz ->setQuizType(WQQuiz::qtQA); m_quiz->setQuizMode(Prefs::mode()); if (m_quiz -> init()) @@ -1019,11 +1019,11 @@ void KWordQuizApp::updateSession(WQQuiz::QuizType qt) m_editView->saveCurrentSelection(true); m_editView->hide(); m_qaView = new QAView(this); - connect(quizCheck, SIGNAL(activated()), m_qaView, SLOT(slotCheck())); - connect(qaHint, SIGNAL(activated()), m_qaView, SLOT(slotHint())); - connect(quizRestart, SIGNAL(activated()), m_qaView, SLOT(slotRestart())); - connect(quizRepeatErrors, SIGNAL(activated()), m_qaView, SLOT(slotRepeat())); - connect(this, SIGNAL(settingsChanged()), m_qaView, SLOT(slotApplySettings())); + connect(quizCheck, TQT_SIGNAL(activated()), m_qaView, TQT_SLOT(slotCheck())); + connect(qaHint, TQT_SIGNAL(activated()), m_qaView, TQT_SLOT(slotHint())); + connect(quizRestart, TQT_SIGNAL(activated()), m_qaView, TQT_SLOT(slotRestart())); + connect(quizRepeatErrors, TQT_SIGNAL(activated()), m_qaView, TQT_SLOT(slotRepeat())); + connect(this, TQT_SIGNAL(settingsChanged()), m_qaView, TQT_SLOT(slotApplySettings())); setCentralWidget(m_qaView); @@ -1055,7 +1055,7 @@ void KWordQuizApp::slotConfigure() //KConfigDialog didn't find an instance of this dialog, so lets create it : KWordQuizPrefs* dialog = new KWordQuizPrefs( this, "settings", Prefs::self() ); - connect(dialog, SIGNAL(settingsChanged()), this, SLOT(slotApplyPreferences())); + connect(dialog, TQT_SIGNAL(settingsChanged()), this, TQT_SLOT(slotApplyPreferences())); dialog->show(); } @@ -1072,43 +1072,43 @@ void KWordQuizApp::slotApplyPreferences() void KWordQuizApp::updateSpecialCharIcons( ) { for (int i = 0; i < 9; i++){ - KAction * act = actionCollection()->action(QString("char_" + QString::number(i + 1)).latin1()); + KAction * act = actionCollection()->action(TQString("char_" + TQString::number(i + 1)).latin1()); act->setIcon(charIcon(Prefs::specialCharacters()[i])); act->setToolTip(i18n("Inserts the character %1").arg(Prefs::specialCharacters()[i])); } } -QString KWordQuizApp::charIcon(const QChar & c) +TQString KWordQuizApp::charIcon(const TQChar & c) { ///Create a name and path for the icon - QString s = locateLocal("icon", "char" + QString::number(c.unicode()) + ".png"); + TQString s = locateLocal("icon", "char" + TQString::number(c.unicode()) + ".png"); ///No need to redraw if it already exists if (KStandardDirs::exists(s)) return s; - QRect r(4, 4, 120, 120); + TQRect r(4, 4, 120, 120); ///A font to draw the character with - QFont font("sans"); + TQFont font("sans"); font.setPixelSize(100); - font.setWeight(QFont::Bold); + font.setWeight(TQFont::Bold); ///Create the pixmap - QPixmap pm(128, 128); + TQPixmap pm(128, 128); pm.fill(Qt::white); - QPainter p(&pm); + TQPainter p(&pm); p.setFont(font); p.setPen(Qt::blue); - p.drawText(r, Qt::AlignCenter, (QString) c); + p.drawText(r, Qt::AlignCenter, (TQString) c); ///Create transparency mask - QBitmap bm(128, 128); + TQBitmap bm(128, 128); bm.fill(Qt::color0); - QPainter b(&bm); + TQPainter b(&bm); b.setFont(font); b.setPen(Qt::color1); - b.drawText(r, Qt::AlignCenter, (QString) c); + b.drawText(r, Qt::AlignCenter, (TQString) c); ///Mask the pixmap pm.setMask(bm); @@ -1119,7 +1119,7 @@ QString KWordQuizApp::charIcon(const QChar & c) return s; } -void KWordQuizApp::slotStatusMsg(const QString &text) +void KWordQuizApp::slotStatusMsg(const TQString &text) { statusBar()->clear(); statusBar()->message(text); @@ -1131,7 +1131,7 @@ void KWordQuizApp::slotStatusMsg(const QString &text) void KWordQuizApp::updateMode(int m) { if (m_quiz != 0) - if (KMessageBox::warningContinueCancel(this, i18n("This will restart your quiz. Do you wish to continue?"), QString::null, KStdGuiItem::cont(), "askModeQuiz") != KMessageBox::Continue) + if (KMessageBox::warningContinueCancel(this, i18n("This will restart your quiz. Do you wish to continue?"), TQString::null, KStdGuiItem::cont(), "askModeQuiz") != KMessageBox::Continue) { mode1->setChecked(Prefs::mode() == 1); mode2->setChecked(Prefs::mode() == 2); @@ -1142,8 +1142,8 @@ void KWordQuizApp::updateMode(int m) } Prefs::setMode(m); - QString s1 = m_editView -> horizontalHeader()->label(0); - QString s2 = m_editView -> horizontalHeader()->label(1); + TQString s1 = m_editView -> horizontalHeader()->label(0); + TQString s2 = m_editView -> horizontalHeader()->label(1); mode1->setText(i18n("&1 %1 -> %2 In Order").arg(s1).arg(s2)); mode2->setText(i18n("&2 %1 -> %2 In Order").arg(s2).arg(s1)); @@ -1170,7 +1170,7 @@ void KWordQuizApp::updateMode(int m) popup->changeItem(3, i18n("&4 %1 -> %2 Randomly").arg(s2).arg(s1)); popup->changeItem(4, i18n("&5 %1 <-> %2 Randomly").arg(s1).arg(s2)); - QString s; + TQString s; mode->setIcon("mode" + s.setNum(Prefs::mode())); switch( Prefs::mode() ){ @@ -1210,10 +1210,10 @@ void KWordQuizApp::slotActionHighlighted( KAction * action, bool hl) slotStatusMsg(i18n("Ready")); } -void KWordQuizApp::slotContextMenuRequested(int row, int col, const QPoint & pos) +void KWordQuizApp::slotContextMenuRequested(int row, int col, const TQPoint & pos) { - QWidget *w = factory()->container("editor_popup", this); - QPopupMenu *popup = static_cast(w); + TQWidget *w = factory()->container("editor_popup", this); + TQPopupMenu *popup = static_cast(w); popup->exec(pos); } diff --git a/kwordquiz/src/kwordquiz.h b/kwordquiz/src/kwordquiz.h index 85c474b2..66e7b440 100644 --- a/kwordquiz/src/kwordquiz.h +++ b/kwordquiz/src/kwordquiz.h @@ -24,7 +24,7 @@ #endif // include files for Qt -#include +#include // include files for KDE #include @@ -66,7 +66,7 @@ class KWordQuizApp : public KMainWindow public: /** construtor of KWordQuizApp, calls all init functions to create the application. */ - KWordQuizApp(QWidget* parent=0, const char* name=0); + KWordQuizApp(TQWidget* parent=0, const char* name=0); ~KWordQuizApp(); /** opens a file specified by commandline option */ @@ -212,18 +212,18 @@ class KWordQuizApp : public KMainWindow /** changes the statusbar contents for the standard label permanently, used to indicate current actions. * @param text the text that is displayed in the statusbar */ - void slotStatusMsg(const QString &text); + void slotStatusMsg(const TQString &text); /** applies changes from the preferences dialog */ void slotApplyPreferences(); - void slotUndoChange(const QString & text, bool enabled); + void slotUndoChange(const TQString & text, bool enabled); void slotInsertChar(int i); void slotActionHighlighted(KAction *, bool); - void slotContextMenuRequested(int, int, const QPoint &); + void slotContextMenuRequested(int, int, const TQPoint &); private: WQQuiz::QuizType m_quizType; @@ -297,7 +297,7 @@ class KWordQuizApp : public KMainWindow KAction* qaHint; - QSignalMapper* charMapper; + TQSignalMapper* charMapper; KAction* specialChar1; KAction* specialChar2; KAction* specialChar3; @@ -315,7 +315,7 @@ class KWordQuizApp : public KMainWindow void updateSession(WQQuiz::QuizType qt); void updateActions(WQQuiz::QuizType qt); void updateSpecialCharIcons(); - QString charIcon(const QChar &); + TQString charIcon(const TQChar &); void openURL(const KURL& url); }; diff --git a/kwordquiz/src/kwordquizdoc.cpp b/kwordquiz/src/kwordquizdoc.cpp index 6666bbc8..f5309636 100644 --- a/kwordquiz/src/kwordquizdoc.cpp +++ b/kwordquiz/src/kwordquizdoc.cpp @@ -36,9 +36,9 @@ //QList *KWordQuizDoc::pViewList = 0L; //KWordQuizView *KWordQuizDoc::m_view; -KWordQuizDoc::KWordQuizDoc(QWidget *parent, const char *name) : QObject(parent, name) +KWordQuizDoc::KWordQuizDoc(TQWidget *parent, const char *name) : TQObject(parent, name) { - connect(KDirWatch::self(), SIGNAL(dirty(const QString& )), this, SLOT(slotModifiedOnDisk(const QString& ))); + connect(KDirWatch::self(), TQT_SIGNAL(dirty(const TQString& )), this, TQT_SLOT(slotModifiedOnDisk(const TQString& ))); /* if(!pViewList) { pViewList = new QList(); @@ -156,10 +156,10 @@ bool KWordQuizDoc::newDocument() bool KWordQuizDoc::openDocument(const KURL& url, bool append, int index) { - QString tmpfile; + TQString tmpfile; if (KIO::NetAccess::download( url, tmpfile, 0 )) { - QFile file(tmpfile); + TQFile file(tmpfile); if (!file.open(IO_ReadOnly)) { KMessageBox::error(0, i18n("Cannot open file
%1
").arg(url.path())); @@ -171,7 +171,7 @@ bool KWordQuizDoc::openDocument(const KURL& url, bool append, int index) else doc_url = url; - QTable* g = m_view; + TQTable* g = m_view; g->setUpdatesEnabled(false); int i = 0; @@ -186,7 +186,7 @@ bool KWordQuizDoc::openDocument(const KURL& url, bool append, int index) if (!dataList.isEmpty()) { g->setNumRows(dataList.count() + i); - QString s; + TQString s; PaukerDataItemList::ConstIterator end(dataList.end()); for(PaukerDataItemList::ConstIterator dataIt = dataList.begin(); dataIt != end; ++dataIt) { @@ -219,7 +219,7 @@ bool KWordQuizDoc::openDocument(const KURL& url, bool append, int index) g->setColumnWidth(0, kvtmldoc->colWidth(0)); g->setColumnWidth(1, kvtmldoc->colWidth(1)); } - QString s; + TQString s; KEduVocDataItemList::ConstIterator end(dataList.end()); for(KEduVocDataItemList::ConstIterator dataIt = dataList.begin(); dataIt != end; ++dataIt) { @@ -256,7 +256,7 @@ bool KWordQuizDoc::openDocument(const KURL& url, bool append, int index) g->selectCells(wqldoc->startRow(), wqldoc->startCol(), wqldoc->endRow(), wqldoc->endCol()); Prefs::setSpecialCharacters(wqldoc->specialCharacters()); } - QString s; + TQString s; KWqlDataItemList::ConstIterator end(dataList.end()); for(KWqlDataItemList::ConstIterator dataIt = dataList.begin(); dataIt != end; ++dataIt) { @@ -274,14 +274,14 @@ bool KWordQuizDoc::openDocument(const KURL& url, bool append, int index) if (url.path().right(4) == ".csv") { - QTextStream ts(&file); - ts.setEncoding(QTextStream::UnicodeUTF8); + TQTextStream ts(&file); + ts.setEncoding(TQTextStream::UnicodeUTF8); - QString f = ts.read(); - QStringList fl = QStringList::split('\n', f, true); + TQString f = ts.read(); + TQStringList fl = TQStringList::split('\n', f, true); g->setNumRows(fl.count() - 1 + i); - QStringList sl = QStringList::split(",", fl[0], true); + TQStringList sl = TQStringList::split(",", fl[0], true); if (!append) { @@ -293,7 +293,7 @@ bool KWordQuizDoc::openDocument(const KURL& url, bool append, int index) for(int j = 1; j < fl.count(); j++) { - QStringList sl = QStringList::split(",", fl[j], true); + TQStringList sl = TQStringList::split(",", fl[j], true); if (!sl[0].isEmpty()) g->setText(i + j - 1, 0, sl[0]); if (!sl[1].isEmpty()) @@ -305,7 +305,7 @@ bool KWordQuizDoc::openDocument(const KURL& url, bool append, int index) KIO::NetAccess::removeTempFile( tmpfile ); //Apply word wrap to cell with text - QTableItem* itm; + TQTableItem* itm; for (int r = 0; r <= g->numRows() -1; ++r) { itm = g->item(r, 0); @@ -329,7 +329,7 @@ bool KWordQuizDoc::openDocument(const KURL& url, bool append, int index) bool KWordQuizDoc::saveDocument(const KURL& url, const char *format /*=0*/) { - QFile file(url.path()); + TQFile file(url.path()); if (!file.open(IO_WriteOnly)) { KMessageBox::error(0, i18n("Cannot write to file
%1
") @@ -339,15 +339,15 @@ bool KWordQuizDoc::saveDocument(const KURL& url, const char *format /*=0*/) return false; } - QTable* g = m_view; - QString s = ""; + TQTable* g = m_view; + TQString s = ""; int w = 0; if (url.path().right(6) == ".kvtml") { file.close(); KVTMLWriter writer(&file); - writer.addHeader(QString("kwordquiz %1").arg(KWQ_VERSION), 2, g->numRows(), url.fileName()); + writer.addHeader(TQString("kwordquiz %1").arg(KWQ_VERSION), 2, g->numRows(), url.fileName()); writer.addFirstItem(g->horizontalHeader()->label(0), g->columnWidth(0), g->text(w, 0), g->horizontalHeader()->label(1), g->columnWidth(1), g->text(w, 1)); w++; int r = g->numRows(); @@ -367,7 +367,7 @@ bool KWordQuizDoc::saveDocument(const KURL& url, const char *format /*=0*/) writer.writeGridInfo(g->verticalHeader()->width(), g->columnWidth(0), g->columnWidth(1), g->numRows()); if (g->numSelections() > 0) { - QTableSelection qts = g->selection(0); + TQTableSelection qts = g->selection(0); writer.writeSelection(qts.leftCol(), qts.topRow(), qts.rightCol(), qts.bottomRow()); } else @@ -385,8 +385,8 @@ bool KWordQuizDoc::saveDocument(const KURL& url, const char *format /*=0*/) if (url.path().right(4) == ".csv") { - QTextStream ts(&file); - ts.setEncoding(QTextStream::UnicodeUTF8); + TQTextStream ts(&file); + ts.setEncoding(TQTextStream::UnicodeUTF8); ts << g->horizontalHeader()->label(0) << "," << g->horizontalHeader()->label(1) << endl; int i = 0; @@ -400,13 +400,13 @@ bool KWordQuizDoc::saveDocument(const KURL& url, const char *format /*=0*/) if (url.path().right(5) == ".html") { - QString cw1 = "width: " + QString::number(g->columnWidth(0)) + "; "; - QString cw2 = "width: " + QString::number(g->columnWidth(1)) + "; "; + TQString cw1 = "width: " + TQString::number(g->columnWidth(0)) + "; "; + TQString cw2 = "width: " + TQString::number(g->columnWidth(1)) + "; "; - QString fn = "font-family: '" + g->font().family() + "'; "; - QString fs = "font-size: " + QString::number(g->font().pointSize()) + "pt; "; - QString fb; - QString fi; + TQString fn = "font-family: '" + g->font().family() + "'; "; + TQString fs = "font-size: " + TQString::number(g->font().pointSize()) + "pt; "; + TQString fb; + TQString fi; if (g->font().bold()) fb = "font-weight: bold; "; @@ -418,15 +418,15 @@ bool KWordQuizDoc::saveDocument(const KURL& url, const char *format /*=0*/) else fi = "font-style: normal; "; - QString hstyle0 = "style=\"text-align: right; width: " + QString::number(g->verticalHeader()->sectionSize(0)) + "; font-size: 12pt; background-color: darkgray\""; - QString hstyle1 = "style=\"" + cw1 + "font-size: 12pt; background-color: darkgray\""; - QString hstyle2 = "style=\"" + cw2 + "font-size: 12pt; background-color: darkgray\""; + TQString hstyle0 = "style=\"text-align: right; width: " + TQString::number(g->verticalHeader()->sectionSize(0)) + "; font-size: 12pt; background-color: darkgray\""; + TQString hstyle1 = "style=\"" + cw1 + "font-size: 12pt; background-color: darkgray\""; + TQString hstyle2 = "style=\"" + cw2 + "font-size: 12pt; background-color: darkgray\""; - QString style1 = "style=\"" + cw1 + fn + fs + fb + fi + "background-color: white\""; - QString style2 = "style=\"" + cw2 + fn + fs + fb + fi + "background-color: white\""; + TQString style1 = "style=\"" + cw1 + fn + fs + fb + fi + "background-color: white\""; + TQString style2 = "style=\"" + cw2 + fn + fs + fb + fi + "background-color: white\""; - QTextStream ts(&file); - ts.setEncoding(QTextStream::UnicodeUTF8); + TQTextStream ts(&file); + ts.setEncoding(TQTextStream::UnicodeUTF8); ts << "" << endl; ts << "" << endl; @@ -439,7 +439,7 @@ bool KWordQuizDoc::saveDocument(const KURL& url, const char *format /*=0*/) ts << "" << endl; - ts << "" << endl; + ts << "" << endl; ts << "" << endl; ts << "" << endl; ts << "" << endl; @@ -449,8 +449,8 @@ bool KWordQuizDoc::saveDocument(const KURL& url, const char *format /*=0*/) int r = g->numRows(); while (i < r) { - ts << "" << endl; - ts << "" << endl; + ts << "" << endl; + ts << "" << endl; ts << "" << endl; ts << "" << endl; ts << "" << endl; @@ -474,13 +474,13 @@ void KWordQuizDoc::deleteContents() { } -void KWordQuizDoc::slotModifiedOnDisk( const QString & path) +void KWordQuizDoc::slotModifiedOnDisk( const TQString & path) { /*@todo this code doesn't work very well. Have to look in more detail on how Kate does it. if (doc_url.path() == path) { - QString str = i18n("The file %1 was changed (modified) on disc by another program!\n\n").arg(doc_url.fileName()); - int i = KMessageBox::warningYesNoCancel(0, str + i18n("Do you want to reload the modified file? Data loss may occur."),QString::null,i18n("Reload"),i18n("Do Not Reload")); + TQString str = i18n("The file %1 was changed (modified) on disc by another program!\n\n").arg(doc_url.fileName()); + int i = KMessageBox::warningYesNoCancel(0, str + i18n("Do you want to reload the modified file? Data loss may occur."),TQString::null,i18n("Reload"),i18n("Do Not Reload")); if ( i == KMessageBox::Yes) openDocument(doc_url); } diff --git a/kwordquiz/src/kwordquizdoc.h b/kwordquiz/src/kwordquizdoc.h index 28e75419..b79879fc 100644 --- a/kwordquiz/src/kwordquizdoc.h +++ b/kwordquiz/src/kwordquizdoc.h @@ -45,7 +45,7 @@ class KWordQuizDoc : public QObject Q_OBJECT public: /** Constructor for the fileclass of the application */ - KWordQuizDoc(QWidget *parent, const char *name=0); + KWordQuizDoc(TQWidget *parent, const char *name=0); /** Destructor for the fileclass of the application */ ~KWordQuizDoc(); @@ -79,7 +79,7 @@ class KWordQuizDoc : public QObject * As this view normally repaints itself, it is excluded from the paintEvent. */ void slotUpdateAllViews(KWordQuizView *sender); - void slotModifiedOnDisk(const QString &); + void slotModifiedOnDisk(const TQString &); public: /** the list of the views currently connected to the document */ diff --git a/kwordquiz/src/kwordquizprefs.cpp b/kwordquiz/src/kwordquizprefs.cpp index 932868cd..61380e68 100644 --- a/kwordquiz/src/kwordquizprefs.cpp +++ b/kwordquiz/src/kwordquizprefs.cpp @@ -15,12 +15,12 @@ * * ***************************************************************************/ -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include #include #include @@ -41,7 +41,7 @@ #include "kwordquiz.h" #include "dlgspecchar.h" -KWordQuizPrefs::KWordQuizPrefs(QWidget *parent, const char *name, KConfigSkeleton *config, DialogType dialogType, int /*dialogButtons*/, ButtonCode /*defaultButton*/, bool /*modal*/) +KWordQuizPrefs::KWordQuizPrefs(TQWidget *parent, const char *name, KConfigSkeleton *config, DialogType dialogType, int /*dialogButtons*/, ButtonCode /*defaultButton*/, bool /*modal*/) : KConfigDialog(parent, name, config, dialogType, Default|Ok|Apply|Cancel|Help, Ok, false) { m_config = config; @@ -60,19 +60,19 @@ KWordQuizPrefs::KWordQuizPrefs(QWidget *parent, const char *name, KConfigSkelet m_dlgSpecChar = 0L; - connect(m_prefCharacter->lstCharacters, SIGNAL(selectionChanged()), this, SLOT(slotCharListSelectionChanged())); - connect(m_prefCharacter->btnCharacter, SIGNAL(clicked()), this, SLOT(slotSelectSpecChar())); + connect(m_prefCharacter->lstCharacters, TQT_SIGNAL(selectionChanged()), this, TQT_SLOT(slotCharListSelectionChanged())); + connect(m_prefCharacter->btnCharacter, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotSelectSpecChar())); KWordQuizApp *win=(KWordQuizApp *) parent; int i=0; KConfigSkeletonItem * item = m_config->findItem("SpecialCharacters"); - QString ds = item->property().toString(); + TQString ds = item->property().toString(); - for ( QListViewItemIterator it = m_prefCharacter->lstCharacters; it.current(); ++it) + for ( TQListViewItemIterator it = m_prefCharacter->lstCharacters; it.current(); ++it) { - it.current()->setText(2, (QString) ds[i++] ) ; - it.current()->setText(1, win->actionCollection()->action(QString("char_" + QString::number(i)).latin1())->shortcut().toString()); + it.current()->setText(2, (TQString) ds[i++] ) ; + it.current()->setText(1, win->actionCollection()->action(TQString("char_" + TQString::number(i)).latin1())->shortcut().toString()); } m_prefCharacter->lstCharacters->setSelected(m_prefCharacter->lstCharacters->firstChild(), true); @@ -89,15 +89,15 @@ void KWordQuizPrefs::slotCharListSelectionChanged() void KWordQuizPrefs::slotSelectSpecChar( ) { KConfigSkeletonItem * item = m_config->findItem("EditorFont"); - QString f = item->property().toFont().family(); - QString s = m_prefCharacter->lstCharacters->currentItem()->text(2); - QChar c = s[0]; + TQString f = item->property().toFont().family(); + TQString s = m_prefCharacter->lstCharacters->currentItem()->text(2); + TQChar c = s[0]; if (m_dlgSpecChar == 0) { m_dlgSpecChar = new DlgSpecChar( this, "insert special char", f, c, true ); - connect(m_dlgSpecChar, SIGNAL(insertChar(QChar)), this, SLOT(slotSpecChar(QChar))); - connect(m_dlgSpecChar, SIGNAL(finished()), this, SLOT(slotDlgSpecCharClosed())); + connect(m_dlgSpecChar, TQT_SIGNAL(insertChar(TQChar)), this, TQT_SLOT(slotSpecChar(TQChar))); + connect(m_dlgSpecChar, TQT_SIGNAL(finished()), this, TQT_SLOT(slotDlgSpecCharClosed())); } m_dlgSpecChar->show(); } @@ -106,14 +106,14 @@ void KWordQuizPrefs::slotDlgSpecCharClosed() { if ( m_dlgSpecChar ) { - disconnect(m_dlgSpecChar, SIGNAL(insertChar(QChar)), this, SLOT(slotSpecChar(QChar))); - disconnect(m_dlgSpecChar, SIGNAL(finished()), this, SLOT(slotDlgSpecCharClosed())); + disconnect(m_dlgSpecChar, TQT_SIGNAL(insertChar(TQChar)), this, TQT_SLOT(slotSpecChar(TQChar))); + disconnect(m_dlgSpecChar, TQT_SIGNAL(finished()), this, TQT_SLOT(slotDlgSpecCharClosed())); m_dlgSpecChar->deleteLater(); m_dlgSpecChar = 0L; } } -void KWordQuizPrefs::slotSpecChar(QChar c) +void KWordQuizPrefs::slotSpecChar(TQChar c) { m_prefCharacter->lstCharacters->currentItem()->setText(2, c); m_prefCharacter->lblPreview->setText(m_prefCharacter->lstCharacters->currentItem()->text(2)); @@ -124,14 +124,14 @@ bool KWordQuizPrefs::hasChanged() { bool result; - QString s; - for (QListViewItemIterator it = m_prefCharacter->lstCharacters; it.current(); ++it) + TQString s; + for (TQListViewItemIterator it = m_prefCharacter->lstCharacters; it.current(); ++it) { s.append(it.current()->text(2)); } KConfigSkeletonItem * item = m_config->findItem("SpecialCharacters"); - QString ds = item->property().toString(); + TQString ds = item->property().toString(); if (ds == s.stripWhiteSpace()) result = KConfigDialog::hasChanged(); @@ -146,14 +146,14 @@ bool KWordQuizPrefs::isDefault() bool bUseDefaults = m_config->useDefaults(true); bool result; - QString s; - for (QListViewItemIterator it = m_prefCharacter->lstCharacters; it.current(); ++it) + TQString s; + for (TQListViewItemIterator it = m_prefCharacter->lstCharacters; it.current(); ++it) { s.append(it.current()->text(2)); } KConfigSkeletonItem * item = m_config->findItem("SpecialCharacters"); - QString ds = item->property().toString(); + TQString ds = item->property().toString(); if (ds == s.stripWhiteSpace()) result = KConfigDialog::isDefault(); @@ -166,14 +166,14 @@ bool KWordQuizPrefs::isDefault() void KWordQuizPrefs::updateSettings( ) { - QString s; - for (QListViewItemIterator it = m_prefCharacter->lstCharacters; it.current(); ++it) + TQString s; + for (TQListViewItemIterator it = m_prefCharacter->lstCharacters; it.current(); ++it) { s.append(it.current()->text(2)); } KConfigSkeletonItem * item = m_config->findItem("SpecialCharacters"); - item->setProperty(QVariant(s)); + item->setProperty(TQVariant(s)); emit settingsChanged(); } @@ -182,19 +182,19 @@ void KWordQuizPrefs::updateWidgetsDefault( ) { bool bUseDefaults = m_config->useDefaults(true); - QString s; - for (QListViewItemIterator it = m_prefCharacter->lstCharacters; it.current(); ++it) + TQString s; + for (TQListViewItemIterator it = m_prefCharacter->lstCharacters; it.current(); ++it) { s.append(it.current()->text(2)); } KConfigSkeletonItem * item = m_config->findItem("SpecialCharacters"); - QString ds = item->property().toString(); + TQString ds = item->property().toString(); int i=0; - for (QListViewItemIterator it = m_prefCharacter->lstCharacters; it.current(); ++it) + for (TQListViewItemIterator it = m_prefCharacter->lstCharacters; it.current(); ++it) { - it.current()->setText(2, (QString) ds[i++] ) ; + it.current()->setText(2, (TQString) ds[i++] ) ; } m_prefCharacter->lblPreview->setText(m_prefCharacter->lstCharacters->currentItem()->text(2)); m_config->useDefaults(bUseDefaults); diff --git a/kwordquiz/src/kwordquizprefs.h b/kwordquiz/src/kwordquizprefs.h index f53e30d8..3afd5f9f 100644 --- a/kwordquiz/src/kwordquizprefs.h +++ b/kwordquiz/src/kwordquizprefs.h @@ -34,7 +34,7 @@ class KWordQuizPrefs : public KConfigDialog { Q_OBJECT public: - KWordQuizPrefs(QWidget *parent=0, const char *name=0, KConfigSkeleton *config=0, DialogType dialogType=IconList, + KWordQuizPrefs(TQWidget *parent=0, const char *name=0, KConfigSkeleton *config=0, DialogType dialogType=IconList, int dialogButtons=Default|Ok|Apply|Cancel|Help, ButtonCode defaultButton=Ok, bool modal=false); protected slots: @@ -45,7 +45,7 @@ private slots: void slotCharListSelectionChanged(); void slotDlgSpecCharClosed(); void slotSelectSpecChar(); - void slotSpecChar(QChar); + void slotSpecChar(TQChar); protected: bool hasChanged(); diff --git a/kwordquiz/src/kwordquizview.cpp b/kwordquiz/src/kwordquizview.cpp index 69e2046b..0096f591 100644 --- a/kwordquiz/src/kwordquizview.cpp +++ b/kwordquiz/src/kwordquizview.cpp @@ -16,10 +16,10 @@ ***************************************************************************/ // include files for Qt -#include -#include -#include -#include +#include +#include +#include +#include // include files for KDE #include //i18n @@ -37,9 +37,9 @@ #include "dlgrc.h" #include "dlgspecchar.h" -QValueList *KWordQuizView::m_undoList = 0L; +TQValueList *KWordQuizView::m_undoList = 0L; -KWQTableItem::KWQTableItem(QTable* table, EditType et, const QString & text) : QTableItem(table, et, text) +KWQTableItem::KWQTableItem(TQTable* table, EditType et, const TQString & text) : TQTableItem(table, et, text) {} int KWQTableItem::alignment() const @@ -55,16 +55,16 @@ int KWQTableItem::alignment() const return (num ? Qt::AlignRight : Qt::AlignAuto) | Qt::AlignVCenter; } -KWordQuizView::KWordQuizView(QWidget *parent, const char *name) : QTable(parent, name) +KWordQuizView::KWordQuizView(TQWidget *parent, const char *name) : TQTable(parent, name) { if(!m_undoList) - m_undoList = new QValueList(); + m_undoList = new TQValueList(); setNumCols(2); setNumRows(50); setColumnWidth(1, 250); setColumnWidth(0, 250); - setSelectionMode(QTable::Single); + setSelectionMode(TQTable::Single); horizontalHeader()->setLabel(0, i18n("Column 1")); horizontalHeader()->setLabel(1, i18n("Column 2")); setMinimumSize(0, 0); //This seems to improve resizing of main window @@ -83,7 +83,7 @@ KWordQuizDoc *KWordQuizView::getDocument() const void KWordQuizView::print(KPrinter *pPrinter) { - QPainter painter; + TQPainter painter; //type 0 Vocabulary list //type 1 Vocabulary exam @@ -121,7 +121,7 @@ void KWordQuizView::print(KPrinter *pPrinter) int lPos = marg; int tPos = marg + horizontalHeader()->height(); - QRect w = painter.window(); + TQRect w = painter.window(); doNewPage(painter, res, type); @@ -169,7 +169,7 @@ void KWordQuizView::print(KPrinter *pPrinter) painter.drawLine(lPos, tPos, lPos + gridWidth, tPos); painter.setFont(KGlobalSettings::generalFont()); - painter.drawText(lPos, tPos, cw0 - pad, rowHeight(rc), AlignRight | AlignVCenter, QString::number(rc + 1)); + painter.drawText(lPos, tPos, cw0 - pad, rowHeight(rc), AlignRight | AlignVCenter, TQString::number(rc + 1)); painter.setFont(font()); painter.drawText(lPos + cw0 + pad, tPos, cw1, rowHeight(rc), AlignAuto | AlignVCenter | WordBreak, text(rc, 0)); @@ -192,7 +192,7 @@ void KWordQuizView::print(KPrinter *pPrinter) painter.end(); } -void KWordQuizView::doNewPage( QPainter & painter, int res, int type ) +void KWordQuizView::doNewPage( TQPainter & painter, int res, int type ) { int cw0 = verticalHeader()->width(); int cw1 = columnWidth(0); @@ -205,7 +205,7 @@ void KWordQuizView::doNewPage( QPainter & painter, int res, int type ) if (type == 1) cw3 = 50; - QRect w = painter.window(); + TQRect w = painter.window(); painter.setFont(KGlobalSettings::generalFont()); @@ -220,8 +220,8 @@ void KWordQuizView::doNewPage( QPainter & painter, int res, int type ) if (type == 1) { - QString score = i18n("Name:_____________________________ Date:__________"); - QRect r = painter.boundingRect(0, 0, 0, 0, AlignAuto, score); + TQString score = i18n("Name:_____________________________ Date:__________"); + TQRect r = painter.boundingRect(0, 0, 0, 0, AlignAuto, score); painter.drawText(w.width() - r.width() - marg, marg - 20, score); } @@ -235,13 +235,13 @@ void KWordQuizView::doNewPage( QPainter & painter, int res, int type ) } -void KWordQuizView::doEndOfPage( QPainter & painter, int vPos, int pageNum, int res, int type ) +void KWordQuizView::doEndOfPage( TQPainter & painter, int vPos, int pageNum, int res, int type ) { int marg = res; painter.setFont(KGlobalSettings::generalFont()); - QRect w = painter.window(); - QRect r = painter.boundingRect(0, 0, 0, 0, AlignAuto, QString::number(pageNum)); - painter.drawText((w.width()/2) - (r.width()/2), w.height() - marg + 20, QString::number(pageNum)); + TQRect w = painter.window(); + TQRect r = painter.boundingRect(0, 0, 0, 0, AlignAuto, TQString::number(pageNum)); + painter.drawText((w.width()/2) - (r.width()/2), w.height() - marg + 20, TQString::number(pageNum)); if (type == 2) return; @@ -284,10 +284,10 @@ bool KWordQuizView::gridIsEmpty() return true; } -QWidget * KWordQuizView::beginEdit( int row, int col, bool replace ) +TQWidget * KWordQuizView::beginEdit( int row, int col, bool replace ) { m_currentText = text(row, col); - cellEditor = QTable::beginEdit(row, col, replace); + cellEditor = TQTable::beginEdit(row, col, replace); if (cellEditor) cellEditor->installEventFilter(this); return cellEditor; @@ -300,12 +300,12 @@ void KWordQuizView::endEdit( int row, int col, bool accept, bool replace ) if (cellWidget(row, col) != 0) //if edited the cellWidget still exists { - if (((QLineEdit *) cellWidget(row, col))->text() != m_currentText) + if (((TQLineEdit *) cellWidget(row, col))->text() != m_currentText) addUndo(i18n("&Undo Entry")); - QTable::endEdit(row, col, accept, replace); //this will destroy the cellWidget + TQTable::endEdit(row, col, accept, replace); //this will destroy the cellWidget if (!text(row, col).isEmpty()) { - QTableItem* itm; + TQTableItem* itm; itm = item(row, col); itm->setWordWrap(true); adjustRow(row); @@ -322,7 +322,7 @@ void KWordQuizView::adjustRow( int row ) // we want to make the row high enough to display content, but // if the user already made it even higher we keep that height int rh = rowHeight(row); - QTable::adjustRow(row); + TQTable::adjustRow(row); if (rh > rowHeight(row)) setRowHeight(row, rh); } @@ -341,8 +341,8 @@ void KWordQuizView::saveCurrentSelection(bool clear = true) } else { - QTableSelection* ts; - ts = new QTableSelection(m_currentRow, m_currentCol, m_currentRow, m_currentCol); + TQTableSelection* ts; + ts = new TQTableSelection(m_currentRow, m_currentCol, m_currentRow, m_currentCol); m_currentSel = *ts; } } @@ -351,8 +351,8 @@ void KWordQuizView::doEditUndo( ) { if (isEditing()) { - if (((QLineEdit *) cellWidget(currentRow(), currentColumn()))->isUndoAvailable()) - ((QLineEdit *) cellWidget(currentRow(), currentColumn()))->undo(); + if (((TQLineEdit *) cellWidget(currentRow(), currentColumn()))->isUndoAvailable()) + ((TQLineEdit *) cellWidget(currentRow(), currentColumn()))->undo(); } else { @@ -370,7 +370,7 @@ void KWordQuizView::doEditUndo( ) setCurrentCell(undo.currentRow(), undo.currentCol()); addSelection(undo.selection()); - QString s; + TQString s; int i = 0; KWqlDataItemList dataList = undo.list(); KWqlDataItemList::ConstIterator end(dataList.end()); @@ -404,7 +404,7 @@ void KWordQuizView::doEditCut( ) { if (isEditing()) { - ((QLineEdit *) cellWidget(currentRow(), currentColumn()))->cut(); + ((TQLineEdit *) cellWidget(currentRow(), currentColumn()))->cut(); } else { @@ -423,12 +423,12 @@ void KWordQuizView::doEditCopy( ) bool mod = getDocument()->isModified(); if (isEditing()) { - ((QLineEdit *) cellWidget(currentRow(), currentColumn()))->copy(); + ((TQLineEdit *) cellWidget(currentRow(), currentColumn()))->copy(); } else { saveCurrentSelection(false); - QString s; + TQString s; for (int r = m_currentSel.topRow(); r <= m_currentSel.bottomRow(); ++r) { for (int c = m_currentSel.leftCol(); c <= m_currentSel.rightCol(); ++c) @@ -444,7 +444,7 @@ void KWordQuizView::doEditPaste( ) { if (isEditing()) { - ((QLineEdit *) cellWidget(currentRow(), currentColumn()))->paste(); + ((TQLineEdit *) cellWidget(currentRow(), currentColumn()))->paste(); } else { @@ -457,9 +457,9 @@ void KWordQuizView::doEditPaste( ) if (lc == rc && tr == br) //one cell selected { - QString s = kapp->clipboard()->text(); - QStringList sl; - sl = QStringList::split("\n", s); + TQString s = kapp->clipboard()->text(); + TQStringList sl; + sl = TQStringList::split("\n", s); uint r = numRows() - tr; @@ -477,12 +477,12 @@ void KWordQuizView::doEditPaste( ) uint i = 0; int ar = tr; - QStringList sr; + TQStringList sr; while(i < sl.count() && br <= numRows() ) { int ac = lc; - sr = QStringList::split("\t", sl[i]); + sr = TQStringList::split("\t", sl[i]); int c = 0; while (ac <= rc) { @@ -498,17 +498,17 @@ void KWordQuizView::doEditPaste( ) } else { - QString s = kapp->clipboard()->text(); - QStringList sl; - sl = QStringList::split("\n", s); + TQString s = kapp->clipboard()->text(); + TQStringList sl; + sl = TQStringList::split("\n", s); uint i = 0; int ar = tr; - QStringList sr; + TQStringList sr; while(i < sl.count() && ar <= br ) { int ac = lc; - sr = QStringList::split("\t", sl[i]); + sr = TQStringList::split("\t", sl[i]); int c = 0; while (ac <= rc) { @@ -522,7 +522,7 @@ void KWordQuizView::doEditPaste( ) } //restore selection - addSelection(QTableSelection(tr, lc, br, rc)); + addSelection(TQTableSelection(tr, lc, br, rc)); setCurrentCell(m_currentRow, m_currentCol); } getDocument()->setModified(true); @@ -532,7 +532,7 @@ void KWordQuizView::doEditClear( ) { if (isEditing()) { - ((QLineEdit *) cellWidget(currentRow(), currentColumn()))->clear(); + ((TQLineEdit *) cellWidget(currentRow(), currentColumn()))->clear(); } else { @@ -552,7 +552,7 @@ void KWordQuizView::doEditInsert( ) saveCurrentSelection(); insertRows(m_currentSel.topRow(), m_currentSel.bottomRow() - m_currentSel.topRow() + 1); - addSelection(QTableSelection(m_currentSel.topRow(), m_currentSel.leftCol(), m_currentSel.bottomRow(), m_currentSel.rightCol())); + addSelection(TQTableSelection(m_currentSel.topRow(), m_currentSel.leftCol(), m_currentSel.bottomRow(), m_currentSel.rightCol())); setCurrentCell(m_currentRow, m_currentCol); setUpdatesEnabled(true); repaintContents(); @@ -578,7 +578,7 @@ void KWordQuizView::doEditDelete( ) br = numRows(); //adjust for new numRows //restore selection as much as possible - addSelection(QTableSelection(tr, m_currentSel.leftCol(), br, m_currentSel.rightCol())); + addSelection(TQTableSelection(tr, m_currentSel.leftCol(), br, m_currentSel.rightCol())); setCurrentCell(m_currentRow, m_currentCol); getDocument()->setModified(true); } @@ -587,7 +587,7 @@ const char delim_start = '['; const char delim_end = ']'; -bool KWordQuizView::checkForBlank( const QString & s, bool blank ) +bool KWordQuizView::checkForBlank( const TQString & s, bool blank ) { if (!blank) return true; @@ -595,8 +595,8 @@ bool KWordQuizView::checkForBlank( const QString & s, bool blank ) bool result = false; int openCount = 0; int closeCount = 0; - QMemArray openPos(0); - QMemArray closePos(0); + TQMemArray openPos(0); + TQMemArray closePos(0); for (uint i = 0; i<= s.length(); ++i) { @@ -631,10 +631,10 @@ void KWordQuizView::doEditMarkBlank( ) if (isEditing()) { addUndo(i18n("&Undo Mark Blank")); - QLineEdit * l = (QLineEdit *) cellWidget(currentRow(), currentColumn()); + TQLineEdit * l = (TQLineEdit *) cellWidget(currentRow(), currentColumn()); if (l->text().length() > 0) { - QString s = l->text(); + TQString s = l->text(); int cp = l->cursorPosition(); if (!l->hasSelectedText()) { @@ -661,7 +661,7 @@ void KWordQuizView::doEditMarkBlank( ) if (l->hasSelectedText()) { - QString st = l->selectedText(); + TQString st = l->selectedText(); int len = st.length(); st = st.prepend(delim_start); st = st.append(delim_end); @@ -677,15 +677,15 @@ void KWordQuizView::doEditMarkBlank( ) void KWordQuizView::doEditUnmarkBlank( ) { addUndo(i18n("&Undo Unmark Blank")); - QString s; + TQString s; if (isEditing()) { - QLineEdit * l = (QLineEdit *) cellWidget(currentRow(), currentColumn()); + TQLineEdit * l = (TQLineEdit *) cellWidget(currentRow(), currentColumn()); if (l->hasSelectedText()) { - QString ls = l->text(); + TQString ls = l->text(); s = l->selectedText(); int len = s.length(); s.remove(delim_start); @@ -755,7 +755,7 @@ bool KWordQuizView::checkSyntax(bool all, bool blanks) for (int r = r1; r <= r2; ++r) for(int c = c1 ; c <= c2 ; ++c ) { - QString s = text(r, c); + TQString s = text(r, c); if (s.length() > 0) for (uint i = 0; i <= s.length(); ++i) if (s[i] == delim_start || s[i] == delim_end) @@ -783,7 +783,7 @@ void KWordQuizView::doVocabSort( ) getDocument()->setModified(true); } //restore selection - addSelection(QTableSelection(m_currentSel.topRow(), m_currentSel.leftCol(), m_currentSel.bottomRow(), m_currentSel.rightCol())); + addSelection(TQTableSelection(m_currentSel.topRow(), m_currentSel.leftCol(), m_currentSel.bottomRow(), m_currentSel.rightCol())); setCurrentCell(m_currentRow, m_currentCol); } @@ -802,7 +802,7 @@ void KWordQuizView::doVocabShuffle( ) count--; } //restore selection - addSelection(QTableSelection(m_currentSel.topRow(), m_currentSel.leftCol(), m_currentSel.bottomRow(), m_currentSel.rightCol())); + addSelection(TQTableSelection(m_currentSel.topRow(), m_currentSel.leftCol(), m_currentSel.bottomRow(), m_currentSel.rightCol())); setCurrentCell(m_currentRow, m_currentCol); setUpdatesEnabled(true); repaintContents(); @@ -814,7 +814,7 @@ void KWordQuizView::doVocabRC( ) saveCurrentSelection(); DlgRC* dlg; dlg = new DlgRC(this, "dlg_rc", true); - //dlg->setInitialSize(QSize(225, 230), true); + //dlg->setInitialSize(TQSize(225, 230), true); dlg->setNumRows(numRows()); dlg->setRowHeight(rowHeight(m_currentRow)); dlg->setColWidth(columnWidth(m_currentCol)); @@ -831,19 +831,19 @@ void KWordQuizView::doVocabRC( ) setColumnWidth(i, dlg->colWidth()); getDocument()->setModified(true); } - addSelection(QTableSelection(m_currentSel.topRow(), m_currentSel.leftCol(), m_currentSel.bottomRow(), m_currentSel.rightCol())); + addSelection(TQTableSelection(m_currentSel.topRow(), m_currentSel.leftCol(), m_currentSel.bottomRow(), m_currentSel.rightCol())); setCurrentCell(m_currentRow, m_currentCol); } void KWordQuizView::doVocabSpecChar( ) { - QString f = font().family(); - QChar c=' '; + TQString f = font().family(); + TQChar c=' '; if (dlgSpecChar==0) { dlgSpecChar = new DlgSpecChar( this, "insert special char", f, c, false ); - connect( dlgSpecChar, SIGNAL(insertChar(QChar)), this, SLOT(slotSpecChar(QChar))); - connect( dlgSpecChar, SIGNAL( finished() ), this, SLOT( slotDlgSpecCharClosed() ) ); + connect( dlgSpecChar, TQT_SIGNAL(insertChar(TQChar)), this, TQT_SLOT(slotSpecChar(TQChar))); + connect( dlgSpecChar, TQT_SIGNAL( finished() ), this, TQT_SLOT( slotDlgSpecCharClosed() ) ); } dlgSpecChar->show(); } @@ -852,22 +852,22 @@ void KWordQuizView::slotDlgSpecCharClosed( ) { if ( dlgSpecChar ) { - disconnect( dlgSpecChar, SIGNAL(insertChar(QChar)), this, SLOT(slotSpecChar(QChar))); - disconnect( dlgSpecChar, SIGNAL( finished() ), this, SLOT( slotDlgSpecCharClosed() ) ); + disconnect( dlgSpecChar, TQT_SIGNAL(insertChar(TQChar)), this, TQT_SLOT(slotSpecChar(TQChar))); + disconnect( dlgSpecChar, TQT_SIGNAL( finished() ), this, TQT_SLOT( slotDlgSpecCharClosed() ) ); dlgSpecChar->deleteLater(); dlgSpecChar = 0L; } } -void KWordQuizView::slotSpecChar(const QChar & c) +void KWordQuizView::slotSpecChar(const TQChar & c) { if (isEditing()) { - QLineEdit * l = (QLineEdit *) cellWidget(currentRow(), currentColumn()); + TQLineEdit * l = (TQLineEdit *) cellWidget(currentRow(), currentColumn()); if (l->hasSelectedText()) { - QString ls = l->text(); - QString s = l->selectedText(); + TQString ls = l->text(); + TQString s = l->selectedText(); int len = s.length(); int ss = l->selectionStart(); ls = ls.replace(ss, len, c); @@ -876,7 +876,7 @@ void KWordQuizView::slotSpecChar(const QChar & c) } else { - QString s = l->text(); + TQString s = l->text(); int i = l->cursorPosition(); s.insert(i, c); l->setText(s); @@ -886,8 +886,8 @@ void KWordQuizView::slotSpecChar(const QChar & c) else { editCell(currentRow(), currentColumn(), true); - ((QLineEdit *) cellWidget(currentRow(), currentColumn()))->setText(c); - ((QLineEdit *) cellWidget(currentRow(), currentColumn()))->setCursorPosition(1); + ((TQLineEdit *) cellWidget(currentRow(), currentColumn()))->setText(c); + ((TQLineEdit *) cellWidget(currentRow(), currentColumn()))->setCursorPosition(1); } } @@ -926,7 +926,7 @@ void KWordQuizView::activateNextCell( ) } else //a larger selection, move within it { - //addSelection(QTableSelection(m_currentSel.topRow(), m_currentSel.leftCol(), m_currentSel.bottomRow(), m_currentSel.rightCol())); + //addSelection(TQTableSelection(m_currentSel.topRow(), m_currentSel.leftCol(), m_currentSel.bottomRow(), m_currentSel.rightCol())); switch(Prefs::enterMove()) { case 0: @@ -959,7 +959,7 @@ void KWordQuizView::activateNextCell( ) } } -void KWordQuizView::addUndo( const QString & caption ) +void KWordQuizView::addUndo( const TQString & caption ) { while (m_undoList->count() > 10) { @@ -993,27 +993,27 @@ void KWordQuizView::addUndo( const QString & caption ) emit undoChange(caption, true); } -void KWordQuizView::setFont( const QFont & font) +void KWordQuizView::setFont( const TQFont & font) { - QTable::setFont(font); + TQTable::setFont(font); horizontalHeader()->setFont(KGlobalSettings::generalFont()); verticalHeader()->setFont(KGlobalSettings::generalFont()); for (int i = 0; i < numRows(); ++i) adjustRow(i); //setRowHeight(i, fontMetrics().lineSpacing() ); } -void KWordQuizView::paintCell( QPainter * p, int row, int col, const QRect & cr, bool selected, const QColorGroup & cg ) +void KWordQuizView::paintCell( TQPainter * p, int row, int col, const TQRect & cr, bool selected, const TQColorGroup & cg ) { - QColorGroup g (cg); + TQColorGroup g (cg); if (Prefs::enableBlanks()) if (!checkForBlank(text(row, col), true)) - g.setColor(QColorGroup::Text, Qt::red); + g.setColor(TQColorGroup::Text, Qt::red); - QTable::paintCell (p, row, col, cr, selected, g ); + TQTable::paintCell (p, row, col, cr, selected, g ); } -void KWordQuizView::keyPressEvent( QKeyEvent * e) +void KWordQuizView::keyPressEvent( TQKeyEvent * e) { /*if (isEditing()) if (e->key() == Key_Tab) @@ -1030,7 +1030,7 @@ void KWordQuizView::keyPressEvent( QKeyEvent * e) activateNextCell(); return; } - QTable::keyPressEvent(e); + TQTable::keyPressEvent(e); } void KWordQuizView::slotCheckedAnswer( int i ) @@ -1038,7 +1038,7 @@ void KWordQuizView::slotCheckedAnswer( int i ) if (i == -1) { clearSelection(); - addSelection(QTableSelection(m_currentSel.topRow(), m_currentSel.leftCol(), m_currentSel.bottomRow(), m_currentSel.rightCol())); + addSelection(TQTableSelection(m_currentSel.topRow(), m_currentSel.leftCol(), m_currentSel.bottomRow(), m_currentSel.rightCol())); setCurrentCell(m_currentRow, m_currentCol); } else @@ -1049,13 +1049,13 @@ void KWordQuizView::slotCheckedAnswer( int i ) } } -bool KWordQuizView::eventFilter( QObject * o, QEvent * e ) +bool KWordQuizView::eventFilter( TQObject * o, TQEvent * e ) { if (o == cellEditor) { - if ( e->type() == QEvent::KeyPress ) + if ( e->type() == TQEvent::KeyPress ) { - QKeyEvent *k = (QKeyEvent *)e; + TQKeyEvent *k = (TQKeyEvent *)e; if (k->key() == Key_Tab) { endEdit(currentRow(), currentColumn(), true, true); @@ -1064,18 +1064,18 @@ bool KWordQuizView::eventFilter( QObject * o, QEvent * e ) } } } - return QTable::eventFilter(o, e); + return TQTable::eventFilter(o, e); } -void KWordQuizView::setText(int row, int col, const QString & text) +void KWordQuizView::setText(int row, int col, const TQString & text) { - QTableItem *itm = item(row, col); + TQTableItem *itm = item(row, col); if (itm) { itm->setText(text); itm->updateEditor(row, col); updateCell(row, col); } else { - KWQTableItem *i = new KWQTableItem(this, QTableItem::OnTyping, text); + KWQTableItem *i = new KWQTableItem(this, TQTableItem::OnTyping, text); setItem(row, col, i); } } diff --git a/kwordquiz/src/kwordquizview.h b/kwordquiz/src/kwordquizview.h index 6e963064..00289925 100644 --- a/kwordquiz/src/kwordquizview.h +++ b/kwordquiz/src/kwordquizview.h @@ -23,7 +23,7 @@ #endif // include files for Qt -#include +#include #include @@ -44,7 +44,7 @@ class DlgSpecChar; class KWQTableItem :public QTableItem { public: - KWQTableItem( QTable* table, EditType et, const QString & text ); + KWQTableItem( TQTable* table, EditType et, const TQString & text ); virtual int alignment() const; }; @@ -53,7 +53,7 @@ class KWordQuizView : public QTable Q_OBJECT public: /** Constructor for the main view */ - KWordQuizView(QWidget *parent = 0, const char *name=0); + KWordQuizView(TQWidget *parent = 0, const char *name=0); /** Destructor for the main view */ ~KWordQuizView(); @@ -65,14 +65,14 @@ class KWordQuizView : public QTable KWordQuizDoc *getDocument() const; //Reimplemented from QTable - void paintCell ( QPainter * p, int row, int col, const QRect & cr, bool selected, const QColorGroup & cg ); - void setFont( const QFont &); - void setText( int row, int col, const QString &text ); + void paintCell ( TQPainter * p, int row, int col, const TQRect & cr, bool selected, const TQColorGroup & cg ); + void setFont( const TQFont &); + void setText( int row, int col, const TQString &text ); /** contains the implementation for printing functionality */ void print(KPrinter *pPrinter); bool gridIsEmpty(); - void addUndo(const QString & caption); + void addUndo(const TQString & caption); void doEditUndo(); void doEditCut(); void doEditCopy(); @@ -89,35 +89,35 @@ class KWordQuizView : public QTable bool checkSyntax(bool all, bool blanks); void saveCurrentSelection(bool clear); protected: - QWidget * beginEdit(int row, int col, bool replace); + TQWidget * beginEdit(int row, int col, bool replace); void endEdit ( int row, int col, bool accept, bool replace ); void activateNextCell(); - void keyPressEvent( QKeyEvent* ); - bool eventFilter( QObject*, QEvent* ); + void keyPressEvent( TQKeyEvent* ); + bool eventFilter( TQObject*, TQEvent* ); public slots: void adjustRow(int row); - void slotSpecChar(const QChar &); + void slotSpecChar(const TQChar &); void slotCheckedAnswer(int ); private slots: void slotDlgSpecCharClosed(); signals: - void undoChange(const QString & text, bool enabled); + void undoChange(const TQString & text, bool enabled); private: int m_currentRow; int m_currentCol; - QString m_currentText; - QTableSelection m_currentSel; + TQString m_currentText; + TQTableSelection m_currentSel; DlgSpecChar* dlgSpecChar; - QWidget * cellEditor; + TQWidget * cellEditor; /** the list of the undo objects */ - static QValueList *m_undoList; + static TQValueList *m_undoList; - void doNewPage(QPainter & painter, int res, int type); - void doEndOfPage(QPainter & painter, int vPos, int pageNum, int res, int type); - bool checkForBlank(const QString & s, bool blank); + void doNewPage(TQPainter & painter, int res, int type); + void doEndOfPage(TQPainter & painter, int vPos, int pageNum, int res, int type); + bool checkForBlank(const TQString & s, bool blank); }; #endif // KWORDQUIZVIEW_H diff --git a/kwordquiz/src/kwqnewstuff.cpp b/kwordquiz/src/kwqnewstuff.cpp index cc8310a7..05da32af 100644 --- a/kwordquiz/src/kwqnewstuff.cpp +++ b/kwordquiz/src/kwqnewstuff.cpp @@ -15,7 +15,7 @@ * * ***************************************************************************/ -#include +#include #include #include @@ -27,68 +27,68 @@ #include "kwqnewstuff.h" #include "prefs.h" -KWQNewStuff::KWQNewStuff(QWidget *parent, const char *name) : QObject(), KNewStuff("kdeedu/vocabulary", parent) +KWQNewStuff::KWQNewStuff(TQWidget *parent, const char *name) : TQObject(), KNewStuff("kdeedu/vocabulary", parent) { m_app = (KWordQuizApp *) parent; } -bool KWQNewStuff::install(const QString & fileName) +bool KWQNewStuff::install(const TQString & fileName) { m_app->slotFileOpenRecent(KURL(fileName)); return true; } -bool KWQNewStuff::createUploadFile(const QString & fileName) +bool KWQNewStuff::createUploadFile(const TQString & fileName) { return true; } -QString KWQNewStuff::destinationPath(KNS::Entry * entry) +TQString KWQNewStuff::destinationPath(KNS::Entry * entry) { if (entry) { KURL url = entry->payload(); - QString fileName = url.fileName(); + TQString fileName = url.fileName(); - QString path = Prefs::installPath(); //default is Vocabularies which will be created in the user's home directory - QString file; + TQString path = Prefs::installPath(); //default is Vocabularies which will be created in the user's home directory + TQString file; if (path.isEmpty()) file = KNewStuff::downloadDestination(entry); //fall back on a temp file, should never happen else { - file = QDir::home().path() + "/" + path + "/"; + file = TQDir::home().path() + "/" + path + "/"; KStandardDirs::makeDir(file); //ensure the directory exists file += fileName; } return file; } else - return QString::null; + return TQString::null; } -QString KWQNewStuff::downloadDestination(KNS::Entry * entry) +TQString KWQNewStuff::downloadDestination(KNS::Entry * entry) { - QString file = destinationPath(entry); + TQString file = destinationPath(entry); if (KStandardDirs::exists(file)) { int result = KMessageBox::questionYesNo(parentWidget(), i18n("The file '%1' already exists. Do you want to overwrite it?") .arg(file), - QString::null, + TQString::null, i18n("Overwrite"),i18n("Do Not Overwrite")); if (result == KMessageBox::No) - return QString::null; + return TQString::null; } KMessageBox::information(parentWidget(), i18n("The selected file will now be downloaded and saved as\n'%1'.") .arg(file), - QString::null, + TQString::null, "NewStuffDownloadLocation"); return file; } diff --git a/kwordquiz/src/kwqnewstuff.h b/kwordquiz/src/kwqnewstuff.h index eb91044a..f3ae82c1 100644 --- a/kwordquiz/src/kwqnewstuff.h +++ b/kwordquiz/src/kwqnewstuff.h @@ -25,11 +25,11 @@ class KWordQuizApp; /** @author Peter Hedlund */ -class KWQNewStuff : public QObject, public KNewStuff +class KWQNewStuff : public TQObject, public KNewStuff { Q_OBJECT public: - KWQNewStuff(QWidget *parent = 0, const char *name = 0); + KWQNewStuff(TQWidget *parent = 0, const char *name = 0); /** Installs a downloaded file according to the application's configuration. @@ -37,7 +37,7 @@ public: @param fileName filename of the donwloaded file @return @c true in case of installation success, @c false otherwise */ - bool install(const QString &fileName); + bool install(const TQString &fileName); /** Creates a file suitable for upload. @@ -47,7 +47,7 @@ public: @param fileName the name of the file to upload after its creation @return @c true in case of creation success, @c false otherwise */ - bool createUploadFile(const QString &fileName); + bool createUploadFile(const TQString &fileName); /** Queries the preferred destination file for a download. @@ -55,10 +55,10 @@ public: @param entry a Hotstuff data entry @return destination filename, or 0 to return directory only */ - QString downloadDestination(KNS::Entry *entry); + TQString downloadDestination(KNS::Entry *entry); private: - QString destinationPath(KNS::Entry *entry); + TQString destinationPath(KNS::Entry *entry); KWordQuizApp * m_app; }; diff --git a/kwordquiz/src/main.cpp b/kwordquiz/src/main.cpp index 57fefbfd..3de695a8 100644 --- a/kwordquiz/src/main.cpp +++ b/kwordquiz/src/main.cpp @@ -67,7 +67,7 @@ int main(int argc, char *argv[]) if (args->count()) { kwordquiz->openDocumentFile(args->arg(args->count() - 1)); - QCString mode = args->getOption("mode"); + TQCString mode = args->getOption("mode"); if (!mode.isEmpty()) { if (mode == "1") @@ -81,7 +81,7 @@ int main(int argc, char *argv[]) if (mode == "5") kwordquiz->slotMode5(); } - QCString go_to = args->getOption("goto"); + TQCString go_to = args->getOption("goto"); if (!go_to.isEmpty()) { if (go_to == "flash") diff --git a/kwordquiz/src/multipleview.cpp b/kwordquiz/src/multipleview.cpp index 9c050a86..3920c12a 100644 --- a/kwordquiz/src/multipleview.cpp +++ b/kwordquiz/src/multipleview.cpp @@ -16,8 +16,8 @@ Boston, MA 02110-1301, USA. */ -#include -#include +#include +#include #include #include @@ -27,7 +27,7 @@ #include "multipleview.h" #include "prefs.h" -MultipleView::MultipleView(QWidget *parent, const char *name, WFlags f) +MultipleView::MultipleView(TQWidget *parent, const char *name, WFlags f) : MultipleViewBase(parent, name, f) { m_score = new WQScore(); @@ -91,7 +91,7 @@ void MultipleView::slotCheck() if (win->actionCollection()->action("quiz_check")->isEnabled()) { - QString ans; + TQString ans; bool oneIsChecked = false; if (opt1->isChecked()) @@ -221,7 +221,7 @@ void MultipleView::slotRepeat() void MultipleView::updateScore() { - QString s; + TQString s; s = s.setNum(m_quiz->questionCount(), 10); lblScoreCount->setText(s); picCount->setPixmap(KGlobal::iconLoader()->loadIcon("kwordquiz", KIcon::Panel)); @@ -261,10 +261,10 @@ void MultipleView::showQuestion(int i) //opt2->setFont(m_quiz->fontAnswer(i)); //opt3->setFont(m_quiz->fontAnswer(i)); - QStringList sl = m_quiz->multiOptions(i); - QString s[10]; + TQStringList sl = m_quiz->multiOptions(i); + TQString s[10]; int j = 0; - for(QStringList::Iterator it = sl.begin(); it != sl.end(); ++it) + for(TQStringList::Iterator it = sl.begin(); it != sl.end(); ++it) { s[j] = *it; j++; diff --git a/kwordquiz/src/multipleview.h b/kwordquiz/src/multipleview.h index c5b1cd16..7d4f06de 100644 --- a/kwordquiz/src/multipleview.h +++ b/kwordquiz/src/multipleview.h @@ -30,7 +30,7 @@ class MultipleView : public MultipleViewBase { Q_OBJECT public: - MultipleView(QWidget *parent = 0, const char *name = 0, WFlags f = 0); + MultipleView(TQWidget *parent = 0, const char *name = 0, WFlags f = 0); ~MultipleView(); diff --git a/kwordquiz/src/paukerreader.cpp b/kwordquiz/src/paukerreader.cpp index 95bcf7cc..df34a8d7 100644 --- a/kwordquiz/src/paukerreader.cpp +++ b/kwordquiz/src/paukerreader.cpp @@ -18,8 +18,8 @@ #include "paukerreader.h" -#include -#include +#include +#include #include #include @@ -28,7 +28,7 @@ PaukerDataItem::PaukerDataItem() { } -PaukerDataItem::PaukerDataItem(QDomElement &entry) +PaukerDataItem::PaukerDataItem(TQDomElement &entry) { domElement = entry; } @@ -37,37 +37,37 @@ PaukerDataItem::~PaukerDataItem() { } -QString PaukerDataItem::frontSide() const +TQString PaukerDataItem::frontSide() const { return getText("FrontSide"); } -QString PaukerDataItem::backSide() const +TQString PaukerDataItem::backSide() const { return getText("BackSide"); } -QString PaukerDataItem::getText(const QString &tagName) const +TQString PaukerDataItem::getText(const TQString &tagName) const { if(!domElement.isNull()) { - QDomNodeList list = domElement.elementsByTagName(tagName); + TQDomNodeList list = domElement.elementsByTagName(tagName); if(list.count() > 0) { - QDomElement element = list.item(0).toElement(); + TQDomElement element = list.item(0).toElement(); if(!element.isNull()) { return element.text(); } else - return QString::null; + return TQString::null; } else - return QString::null; + return TQString::null; } else - return QString::null; + return TQString::null; } /*! @@ -75,23 +75,23 @@ QString PaukerDataItem::getText(const QString &tagName) const */ PaukerData::PaukerData() { - document = new QDomDocument(); + document = new TQDomDocument(); } -PaukerDataItemList PaukerData::parse(const QString &fileName) +PaukerDataItemList PaukerData::parse(const TQString &fileName) { PaukerDataItemList list; - QIODevice * file = KFilterDev::deviceForFile(fileName); + TQIODevice * file = KFilterDev::deviceForFile(fileName); document->setContent(file); - QDomNodeList entries = document->elementsByTagName("Card"); + TQDomNodeList entries = document->elementsByTagName("Card"); // loop through the "Card" tags looking for data for(uint i = 0 ; i < entries.count() ; i++) { // get an entry to operate on - QDomElement entry = entries.item(i).toElement(); + TQDomElement entry = entries.item(i).toElement(); // if the "node" is in fact an element -- i.e. not null if(!entry.isNull()) { diff --git a/kwordquiz/src/paukerreader.h b/kwordquiz/src/paukerreader.h index 95a3241c..2049e062 100644 --- a/kwordquiz/src/paukerreader.h +++ b/kwordquiz/src/paukerreader.h @@ -19,39 +19,39 @@ Boston, MA 02110-1301, USA. */ -#include -#include +#include +#include class PaukerDataItem { public: PaukerDataItem(); - PaukerDataItem(QDomElement &entry); + PaukerDataItem(TQDomElement &entry); virtual ~PaukerDataItem(); - QString frontSide() const; - QString backSide() const; + TQString frontSide() const; + TQString backSide() const; protected: - QString getText(const QString &tagName) const; + TQString getText(const TQString &tagName) const; private: - QDomElement domElement; + TQDomElement domElement; }; -typedef QValueList PaukerDataItemList; +typedef TQValueList PaukerDataItemList; class PaukerData { public: PaukerData(); - PaukerDataItemList parse(const QString &fileName); + PaukerDataItemList parse(const TQString &fileName); int colWidth(int col); int numRows(); - QString language(int col); + TQString language(int col); private: - QDomDocument* document; + TQDomDocument* document; }; #endif diff --git a/kwordquiz/src/prefcardappearance.cpp b/kwordquiz/src/prefcardappearance.cpp index 165abeab..e2e08f2a 100644 --- a/kwordquiz/src/prefcardappearance.cpp +++ b/kwordquiz/src/prefcardappearance.cpp @@ -9,8 +9,8 @@ // Copyright: See COPYING file that comes with this distribution // // -#include -#include +#include +#include #include #include @@ -18,7 +18,7 @@ #include "prefcardappearance.h" -PrefCardAppearance::PrefCardAppearance(QWidget *parent, const char *name) +PrefCardAppearance::PrefCardAppearance(TQWidget *parent, const char *name) : PrefCardAppearanceBase(parent, name) { widgetStack->raiseWidget(frontStackPage); @@ -37,17 +37,17 @@ void PrefCardAppearance::slotFlipButtonClicked( ) widgetStack->raiseWidget(frontStackPage); } -void PrefCardAppearance::slotFontChanged(const QFont & font) +void PrefCardAppearance::slotFontChanged(const TQFont & font) { textLabel->setFont(font); } -void PrefCardAppearance::slotTextColorChanged( const QColor & color) +void PrefCardAppearance::slotTextColorChanged( const TQColor & color) { textLabel->setPaletteForegroundColor(color); } -void PrefCardAppearance::slotCardColorChanged( const QColor & color) +void PrefCardAppearance::slotCardColorChanged( const TQColor & color) { cardFrame->setPaletteBackgroundColor(color); titleLabel->setPaletteBackgroundColor(color); @@ -55,13 +55,13 @@ void PrefCardAppearance::slotCardColorChanged( const QColor & color) line->setPaletteBackgroundColor(color); } -void PrefCardAppearance::slotFrameColorChanged( const QColor & color) +void PrefCardAppearance::slotFrameColorChanged( const TQColor & color) { cardFrame->setPaletteForegroundColor(color); line->setPaletteForegroundColor(color); } -void PrefCardAppearance::slotAboutToShowWidget(QWidget * widget) +void PrefCardAppearance::slotAboutToShowWidget(TQWidget * widget) { if (widget == backStackPage) { diff --git a/kwordquiz/src/prefcardappearance.h b/kwordquiz/src/prefcardappearance.h index 14c1d70b..b152155c 100644 --- a/kwordquiz/src/prefcardappearance.h +++ b/kwordquiz/src/prefcardappearance.h @@ -21,16 +21,16 @@ class PrefCardAppearance : public PrefCardAppearanceBase { Q_OBJECT public: - PrefCardAppearance(QWidget *parent = 0, const char *name = 0); + PrefCardAppearance(TQWidget *parent = 0, const char *name = 0); ~PrefCardAppearance(); public slots: void slotFlipButtonClicked(); - void slotFontChanged(const QFont &); - void slotTextColorChanged(const QColor &); - void slotCardColorChanged(const QColor &); - void slotFrameColorChanged(const QColor &); - void slotAboutToShowWidget(QWidget *); + void slotFontChanged(const TQFont &); + void slotTextColorChanged(const TQColor &); + void slotCardColorChanged(const TQColor &); + void slotFrameColorChanged(const TQColor &); + void slotAboutToShowWidget(TQWidget *); }; #endif diff --git a/kwordquiz/src/prefcharacter.cpp b/kwordquiz/src/prefcharacter.cpp index 7197b798..7ef819d4 100644 --- a/kwordquiz/src/prefcharacter.cpp +++ b/kwordquiz/src/prefcharacter.cpp @@ -18,7 +18,7 @@ #include "prefcharacter.h" -PrefCharacter::PrefCharacter(QWidget *parent, const char *name) +PrefCharacter::PrefCharacter(TQWidget *parent, const char *name) : PrefCharacterBase(parent, name) { } diff --git a/kwordquiz/src/prefcharacter.h b/kwordquiz/src/prefcharacter.h index c863093e..eb46f2e3 100644 --- a/kwordquiz/src/prefcharacter.h +++ b/kwordquiz/src/prefcharacter.h @@ -28,7 +28,7 @@ class PrefCharacter : public PrefCharacterBase { Q_OBJECT public: - PrefCharacter(QWidget *parent = 0, const char *name = 0); + PrefCharacter(TQWidget *parent = 0, const char *name = 0); ~PrefCharacter(); }; diff --git a/kwordquiz/src/prefeditor.cpp b/kwordquiz/src/prefeditor.cpp index 2ff2a92e..3fc69802 100644 --- a/kwordquiz/src/prefeditor.cpp +++ b/kwordquiz/src/prefeditor.cpp @@ -19,7 +19,7 @@ #include "prefeditor.h" -PrefEditor::PrefEditor(QWidget *parent, const char *name, WFlags f) +PrefEditor::PrefEditor(TQWidget *parent, const char *name, WFlags f) : PrefEditorBase(parent, name, f) { } diff --git a/kwordquiz/src/prefeditor.h b/kwordquiz/src/prefeditor.h index 762e4afe..c84b3364 100644 --- a/kwordquiz/src/prefeditor.h +++ b/kwordquiz/src/prefeditor.h @@ -29,7 +29,7 @@ class PrefEditor : public PrefEditorBase Q_OBJECT public: - PrefEditor(QWidget *parent, const char *name=0, WFlags f=0); + PrefEditor(TQWidget *parent, const char *name=0, WFlags f=0); ~PrefEditor(); }; diff --git a/kwordquiz/src/prefquiz.cpp b/kwordquiz/src/prefquiz.cpp index ebd62cb3..cfb07aae 100644 --- a/kwordquiz/src/prefquiz.cpp +++ b/kwordquiz/src/prefquiz.cpp @@ -16,15 +16,15 @@ Boston, MA 02110-1301, USA. */ -#include -#include +#include +#include #include #include "prefquiz.h" -PrefQuiz::PrefQuiz(QWidget *parent, const char *name, WFlags f) +PrefQuiz::PrefQuiz(TQWidget *parent, const char *name, WFlags f) : PrefQuizBase(parent, name, f) { kcfg_FlipDelay -> setEnabled(kcfg_AutoFlip->isChecked()); diff --git a/kwordquiz/src/prefquiz.h b/kwordquiz/src/prefquiz.h index baee69ac..9d7174c4 100644 --- a/kwordquiz/src/prefquiz.h +++ b/kwordquiz/src/prefquiz.h @@ -29,7 +29,7 @@ class PrefQuiz : public PrefQuizBase Q_OBJECT public: - PrefQuiz(QWidget *parent, const char *name=0, WFlags f=0); + PrefQuiz(TQWidget *parent, const char *name=0, WFlags f=0); ~PrefQuiz(); }; diff --git a/kwordquiz/src/qaview.cpp b/kwordquiz/src/qaview.cpp index 9e4deca9..4660df9f 100644 --- a/kwordquiz/src/qaview.cpp +++ b/kwordquiz/src/qaview.cpp @@ -16,7 +16,7 @@ Boston, MA 02110-1301, USA. */ -#include +#include #include #include @@ -27,24 +27,24 @@ #include "prefs.h" #include "kwordquiz.h" -QString highlightError(const QString & c, const QString & e) +TQString highlightError(const TQString & c, const TQString & e) { if (c == e) return c; - QString s = c; + TQString s = c; if (s.left(4) == "" && e.left(4) != "") s = s.mid(4, s.length() - 9); if (s == e) return s; - QString result = ""; + TQString result = ""; int i = 0; while (s[i] == e[i]) result.append(e[i++]); result.append(""); - QString result2 = ""; + TQString result2 = ""; int j = s.length() - 1; int k = e.length() - 1; while (s[j] == e[k] && k > i) @@ -63,7 +63,7 @@ QString highlightError(const QString & c, const QString & e) } -QAView::QAView(QWidget *parent, const char *name, WFlags f):QAViewBase(parent, name, f) +QAView::QAView(TQWidget *parent, const char *name, WFlags f):QAViewBase(parent, name, f) { m_score = new WQScore(); } @@ -90,8 +90,8 @@ void QAView::init() picCorrect -> clear(); picError -> clear(); - QFont f = Prefs::editorFont(); - f.setWeight(QFont::Normal); + TQFont f = Prefs::editorFont(); + f.setWeight(TQFont::Normal); lblQuestion -> setFont(f); //lblQuestion -> font().setBold(false); lblAnswerBlank -> setFont(f); @@ -202,8 +202,8 @@ void QAView::slotCheck() void QAView::slotHint() { - QString answer = txtAnswer->text(); - QString correctAnswer = m_quiz->hint(m_question); + TQString answer = txtAnswer->text(); + TQString correctAnswer = m_quiz->hint(m_question); if (correctAnswer.left(4) == "") { correctAnswer = correctAnswer.remove(""); @@ -242,7 +242,7 @@ void QAView::slotRepeat() void QAView::updateScore() { - QString s; + TQString s; s = s.setNum(m_quiz->questionCount(), 10); lblScoreCount->setText(s); picCount->setPixmap(KGlobal::iconLoader()->loadIcon("kwordquiz", KIcon::Panel)); @@ -278,7 +278,7 @@ void QAView::showQuestion(int i) lblAnswerLanguage -> setText(m_quiz ->langAnswer(i)); - if (!QString(m_quiz ->blankAnswer(i)).isEmpty()) + if (!TQString(m_quiz ->blankAnswer(i)).isEmpty()) { lblAnswerBlank->show(); //lblAnswerBlank->setFont(m_quiz->fontAnswer(i)); @@ -301,14 +301,14 @@ void QAView::slotApplySettings( ) updateScore(); } -void QAView::slotSpecChar( const QChar & c) +void QAView::slotSpecChar( const TQChar & c) { if (txtAnswer->hasFocus()) { if (txtAnswer->hasSelectedText()) { - QString ls = txtAnswer->text(); - QString s = txtAnswer->selectedText(); + TQString ls = txtAnswer->text(); + TQString s = txtAnswer->selectedText(); int len = s.length(); int ss = txtAnswer->selectionStart(); ls = ls.replace(ss, len, c); @@ -317,7 +317,7 @@ void QAView::slotSpecChar( const QChar & c) } else { - QString s = txtAnswer->text(); + TQString s = txtAnswer->text(); int i = txtAnswer->cursorPosition(); s.insert(i, c); txtAnswer->setText(s); diff --git a/kwordquiz/src/qaview.h b/kwordquiz/src/qaview.h index 9ba26fdf..f18567ec 100644 --- a/kwordquiz/src/qaview.h +++ b/kwordquiz/src/qaview.h @@ -33,7 +33,7 @@ class QAView : public QAViewBase { Q_OBJECT public: - QAView(QWidget *parent = 0, const char *name = 0, WFlags f = 0); + QAView(TQWidget *parent = 0, const char *name = 0, WFlags f = 0); ~QAView(); @@ -46,7 +46,7 @@ public slots: void slotRepeat(); void slotRestart(); void slotApplySettings(); - void slotSpecChar(const QChar &); + void slotSpecChar(const TQChar &); private: WQQuiz *m_quiz; diff --git a/kwordquiz/src/wqlreader.cpp b/kwordquiz/src/wqlreader.cpp index 5d60a186..7eef97c7 100644 --- a/kwordquiz/src/wqlreader.cpp +++ b/kwordquiz/src/wqlreader.cpp @@ -14,8 +14,8 @@ * * ***************************************************************************/ -#include -#include +#include +#include #include #include @@ -27,7 +27,7 @@ KWqlDataItem::KWqlDataItem() } -KWqlDataItem::KWqlDataItem(const QString &front, const QString &back, int height) +KWqlDataItem::KWqlDataItem(const TQString &front, const TQString &back, int height) { m_front = front; m_back = back; @@ -47,15 +47,15 @@ WqlReader::WqlReader() } -KWqlDataItemList WqlReader::parse(const QString &fileName) +KWqlDataItemList WqlReader::parse(const TQString &fileName) { KWqlDataItemList list; - QFile file(fileName); + TQFile file(fileName); file.open(IO_ReadOnly); - QTextStream ts(&file); - ts.setEncoding(QTextStream::Latin1); + TQTextStream ts(&file); + ts.setEncoding(TQTextStream::Latin1); - QString s = ""; + TQString s = ""; s=ts.readLine(); if (s != "WordQuiz") { @@ -76,7 +76,7 @@ KWqlDataItemList WqlReader::parse(const QString &fileName) while (ts.readLine() != "[Font Info]"); s = ts.readLine(); int p = s.find("=", 0); - QString fam = s.right(s.length() - (p + 1)); + TQString fam = s.right(s.length() - (p + 1)); fam = fam.mid(1, fam.length() - 2); //g->font().setFamily(s); @@ -91,7 +91,7 @@ KWqlDataItemList WqlReader::parse(const QString &fileName) int b = 0; if (s == "1") { - b = QFont::Bold; + b = TQFont::Bold; } s = ts.readLine(); @@ -99,7 +99,7 @@ KWqlDataItemList WqlReader::parse(const QString &fileName) s = s.right(s.length() - (p + 1)); bool it = (s == "1"); - QFont m_font(fam, ps, b, it); + TQFont m_font(fam, ps, b, it); while (ts.readLine() != "[Character Info]"); s = ts.readLine(); @@ -158,12 +158,12 @@ KWqlDataItemList WqlReader::parse(const QString &fileName) { s = ts.readLine(); p = s.find("[", 0); - QString r = s.mid(p + 1, 10); + TQString r = s.mid(p + 1, 10); int h = r.toInt(0, 10); s = s.left(p); s = s.stripWhiteSpace(); - QString b; + TQString b; b = ts.readLine(); KWqlDataItem item(s, b, h /15); @@ -189,7 +189,7 @@ int WqlReader::colWidth(int col) /*! \fn WqlReader::language(int col) */ -QString WqlReader::language(int col) +TQString WqlReader::language(int col) { if (col == 0) return m_language1; diff --git a/kwordquiz/src/wqlreader.h b/kwordquiz/src/wqlreader.h index 37920f5d..79096956 100644 --- a/kwordquiz/src/wqlreader.h +++ b/kwordquiz/src/wqlreader.h @@ -20,45 +20,45 @@ @author Peter Hedlund */ -#include -#include -#include +#include +#include +#include class KWqlDataItem { public: KWqlDataItem(); - KWqlDataItem(const QString &front, const QString &back, int height); + KWqlDataItem(const TQString &front, const TQString &back, int height); virtual ~KWqlDataItem(); - QString frontText() const {return m_front;} - QString backText() const {return m_back;} + TQString frontText() const {return m_front;} + TQString backText() const {return m_back;} int rowHeight() const {return m_height;} private: - QString m_front; - QString m_back; + TQString m_front; + TQString m_back; int m_height; }; -typedef QValueList KWqlDataItemList; +typedef TQValueList KWqlDataItemList; class WqlReader{ public: WqlReader(); - KWqlDataItemList parse(const QString &fileName); + KWqlDataItemList parse(const TQString &fileName); int colWidth(int col); int numRows() {return m_numRows;} int startCol() {return m_topLeft;} int startRow() {return m_topRight;} int endCol() {return m_bottomLeft;} int endRow() {return m_bottomRight;} - QString language(int col); - QFont font() {return m_font;} - QString specialCharacters() {return m_specialCharacters;} + TQString language(int col); + TQFont font() {return m_font;} + TQString specialCharacters() {return m_specialCharacters;} private: - QFont m_font; + TQFont m_font; int m_colWidth1; int m_colWidth2; int m_numRows; @@ -66,9 +66,9 @@ private: int m_topRight; int m_bottomLeft; int m_bottomRight; - QString m_language1; - QString m_language2; - QString m_specialCharacters; + TQString m_language1; + TQString m_language2; + TQString m_specialCharacters; }; diff --git a/kwordquiz/src/wqlwriter.cpp b/kwordquiz/src/wqlwriter.cpp index 6428036e..e5314201 100644 --- a/kwordquiz/src/wqlwriter.cpp +++ b/kwordquiz/src/wqlwriter.cpp @@ -17,40 +17,40 @@ #define winendl "\r\n" -WqlWriter::WqlWriter(QFile *file) +WqlWriter::WqlWriter(TQFile *file) { outputFile = file; if(outputFile->open(IO_WriteOnly)) { outputStream.setDevice(outputFile); - outputStream.setEncoding(QTextStream::Latin1); + outputStream.setEncoding(TQTextStream::Latin1); outputStream << "WordQuiz" << winendl; outputStream << "5.9.0" << winendl << winendl; } } -void WqlWriter::writeFont( const QFont & font ) +void WqlWriter::writeFont( const TQFont & font ) { outputStream << "[Font Info]" << winendl; outputStream << "FontName1=\"" << font.family() << "\"" << winendl; - outputStream << "FontSize1=" << QString::number(font.pointSize()) << winendl; - outputStream << QString("FontBold1=%1").arg(font.bold() ? "1" : "0") < -#include -#include +#include +#include +#include /** @author Peter Hedlund */ class WqlWriter{ public: - WqlWriter(QFile *file); + WqlWriter(TQFile *file); ~WqlWriter(); - void writeFont(const QFont & font); - void writeCharacters(const QString & s); + void writeFont(const TQFont & font); + void writeCharacters(const TQString & s); void writeGridInfo(int col0, int col1, int col2, int numRows); void writeSelection(int lc, int tr, int rc, int br); - void writeFirstItem(const QString &ll, const QString &rl); - void writeItem(const QString &left, const QString &right, int rh); + void writeFirstItem(const TQString &ll, const TQString &rl); + void writeItem(const TQString &left, const TQString &right, int rh); private: - QFile *outputFile; - QTextStream outputStream; + TQFile *outputFile; + TQTextStream outputStream; }; #endif diff --git a/kwordquiz/src/wqprintdialogpage.cpp b/kwordquiz/src/wqprintdialogpage.cpp index 2e5710d1..e9baebcc 100644 --- a/kwordquiz/src/wqprintdialogpage.cpp +++ b/kwordquiz/src/wqprintdialogpage.cpp @@ -16,41 +16,41 @@ Boston, MA 02110-1301, USA. */ -#include -#include -#include -#include +#include +#include +#include +#include #include #include "wqprintdialogpage.h" -WQPrintDialogPage::WQPrintDialogPage(QWidget *parent, const char *name ) +WQPrintDialogPage::WQPrintDialogPage(TQWidget *parent, const char *name ) : KPrintDialogPage( parent, name ) { setTitle(i18n("Vocabulary Options")); - QGridLayout * l = new QGridLayout( this, 1, 1, 11, 6); + TQGridLayout * l = new TQGridLayout( this, 1, 1, 11, 6); - g = new QButtonGroup(i18n("Select Type of Printout"), this ); + g = new TQButtonGroup(i18n("Select Type of Printout"), this ); g->setColumnLayout(0, Qt::Vertical ); g->layout()->setSpacing( 6 ); g->layout()->setMargin( 11 ); - QGridLayout * v = new QGridLayout( g->layout() ); + TQGridLayout * v = new TQGridLayout( g->layout() ); v->setAlignment( Qt::AlignTop ); - rb0 = new QRadioButton(i18n("Vocabulary &list"), g ); + rb0 = new TQRadioButton(i18n("Vocabulary &list"), g ); v->addWidget( rb0, 0, 0 ); - rb1 = new QRadioButton(i18n("Vocabulary e&xam"), g); + rb1 = new TQRadioButton(i18n("Vocabulary e&xam"), g); v->addWidget( rb1, 1, 0 ); - rb2 = new QRadioButton(i18n("&Flashcards"), g); + rb2 = new TQRadioButton(i18n("&Flashcards"), g); v->addWidget( rb2, 2, 0 ); l->addWidget( g, 0, 0 ); - QWhatsThis::add(g, i18n("Specify type of printout to make")); - QWhatsThis::add(rb0, i18n("Select to print the vocabulary as displayed in the editor")); - QWhatsThis::add(rb1, i18n("Select to print the vocabulary as a vocabulary exam")); - QWhatsThis::add(rb2, i18n("Select to print flashcards")); + TQWhatsThis::add(g, i18n("Specify type of printout to make")); + TQWhatsThis::add(rb0, i18n("Select to print the vocabulary as displayed in the editor")); + TQWhatsThis::add(rb1, i18n("Select to print the vocabulary as a vocabulary exam")); + TQWhatsThis::add(rb2, i18n("Select to print flashcards")); } @@ -58,14 +58,14 @@ WQPrintDialogPage::~WQPrintDialogPage() { } -void WQPrintDialogPage::getOptions(QMap< QString, QString > & opts, bool incldef) +void WQPrintDialogPage::getOptions(TQMap< TQString, TQString > & opts, bool incldef) { - opts[ "kde-kwordquiz-type" ] = QString::number(g->selectedId()); + opts[ "kde-kwordquiz-type" ] = TQString::number(g->selectedId()); } -void WQPrintDialogPage::setOptions(const QMap< QString, QString > & opts ) +void WQPrintDialogPage::setOptions(const TQMap< TQString, TQString > & opts ) { - QString type = opts[ "kde-kwordquiz-type" ]; + TQString type = opts[ "kde-kwordquiz-type" ]; switch (type.toInt()) { case 0: rb0->setChecked(true); break; @@ -74,7 +74,7 @@ void WQPrintDialogPage::setOptions(const QMap< QString, QString > & opts ) } } -bool WQPrintDialogPage::isValid(const QString & msg ) +bool WQPrintDialogPage::isValid(const TQString & msg ) { return true; } diff --git a/kwordquiz/src/wqprintdialogpage.h b/kwordquiz/src/wqprintdialogpage.h index a7834241..3a52aa6e 100644 --- a/kwordquiz/src/wqprintdialogpage.h +++ b/kwordquiz/src/wqprintdialogpage.h @@ -31,19 +31,19 @@ class WQPrintDialogPage : public KPrintDialogPage { Q_OBJECT public: - WQPrintDialogPage( QWidget *parent = 0, const char *name = 0 ); + WQPrintDialogPage( TQWidget *parent = 0, const char *name = 0 ); ~WQPrintDialogPage(); //reimplement virtual functions - void getOptions(QMap& opts, bool incldef = false); - void setOptions(const QMap& opts); - bool isValid(const QString& msg ); + void getOptions(TQMap& opts, bool incldef = false); + void setOptions(const TQMap& opts); + bool isValid(const TQString& msg ); private: - QButtonGroup * g; - QRadioButton * rb0; - QRadioButton * rb1; - QRadioButton * rb2; + TQButtonGroup * g; + TQRadioButton * rb0; + TQRadioButton * rb1; + TQRadioButton * rb2; }; #endif diff --git a/kwordquiz/src/wqquiz.cpp b/kwordquiz/src/wqquiz.cpp index 23399e5e..23600567 100644 --- a/kwordquiz/src/wqquiz.cpp +++ b/kwordquiz/src/wqquiz.cpp @@ -18,12 +18,12 @@ #include -#include +#include #include "wqquiz.h" #include "prefs.h" -WQQuiz::WQQuiz(KWordQuizView * parent, const char *name) : QObject(parent, name) +WQQuiz::WQQuiz(KWordQuizView * parent, const char *name) : TQObject(parent, name) { m_table = parent; @@ -68,7 +68,7 @@ void WQQuiz::addToList(int aCol, int bCol) { //build a list of row numbers containing text in both columns - typedef QValueList IntList; + typedef TQValueList IntList; IntList tempList; for (int current = 0; current < m_table ->numRows(); ++current) { @@ -198,7 +198,7 @@ bool WQQuiz::init() void WQQuiz::listRandom() { - QPtrList list; + TQPtrList list; for(int i = 0; i < m_quizList.count(); i++) list.append((void*) i); @@ -216,7 +216,7 @@ void WQQuiz::listRandom() m_quizList.append(items[i]); } -bool WQQuiz::checkAnswer(int i, const QString & a) +bool WQQuiz::checkAnswer(int i, const TQString & a) { bool result = false; WQListItem li = m_list[i]; @@ -229,23 +229,23 @@ bool WQQuiz::checkAnswer(int i, const QString & a) { j= 0; } - QString ans = a; - QString tTemp = m_table -> text(li.oneOp(), j); + TQString ans = a; + TQString tTemp = m_table -> text(li.oneOp(), j); tTemp = tTemp.stripWhiteSpace(); ans = ans.stripWhiteSpace(); if (m_quizType == qtQA) { - if (QString(m_correctBlank).length() > 0) + if (TQString(m_correctBlank).length() > 0) { - QStringList la, ls; + TQStringList la, ls; if (ans.find(";") > 0) - ls = QStringList::split(";", ans); + ls = TQStringList::split(";", ans); else ls.append(ans); if (m_correctBlank.find(";") > 0) - la = QStringList::split(";", m_correctBlank); + la = TQStringList::split(";", m_correctBlank); else la.append(m_correctBlank); @@ -292,15 +292,15 @@ bool WQQuiz::checkAnswer(int i, const QString & a) return result; } -QStringList WQQuiz::multiOptions(int i) +TQStringList WQQuiz::multiOptions(int i) { - QString *s; - QStringList Result; + TQString *s; + TQStringList Result; WQListItem li = m_list[i]; - typedef QPtrList LS; + typedef TQPtrList LS; LS *ls; - ls = new QPtrList(); + ls = new TQPtrList(); int j; if (li.question() == 0) @@ -312,7 +312,7 @@ QStringList WQQuiz::multiOptions(int i) j= 0; } - s= new QString(m_table->text(li.oneOp(), j)); + s= new TQString(m_table->text(li.oneOp(), j)); if (Prefs::enableBlanks()) { s->remove("["); @@ -320,7 +320,7 @@ QStringList WQQuiz::multiOptions(int i) } ls->append(s); - s = new QString(m_table->text(li.twoOp(), j)); + s = new TQString(m_table->text(li.twoOp(), j)); if (Prefs::enableBlanks()) { s->remove("["); @@ -328,7 +328,7 @@ QStringList WQQuiz::multiOptions(int i) } ls->append(s); - s = new QString(m_table->text(li.threeOp(), j)); + s = new TQString(m_table->text(li.threeOp(), j)); if (Prefs::enableBlanks()) { s->remove("["); @@ -347,9 +347,9 @@ QStringList WQQuiz::multiOptions(int i) return Result; } -QString WQQuiz::quizIcon(int i, QuizIcon ico) +TQString WQQuiz::quizIcon(int i, QuizIcon ico) { - QString s; + TQString s; WQListItem li = m_list[i]; if (ico == qiLeftCol) { @@ -369,16 +369,16 @@ QString WQQuiz::quizIcon(int i, QuizIcon ico) return s; } -QString WQQuiz::yourAnswer(int i, const QString & s) +TQString WQQuiz::yourAnswer(int i, const TQString & s) { - QString result =""; + TQString result =""; - if (QString(m_answerBlank).length() > 0) + if (TQString(m_answerBlank).length() > 0) { - QStringList ls; + TQStringList ls; if (s.find(";") > 0) - ls = QStringList::split(";", s, true); + ls = TQStringList::split(";", s, true); else ls.append(s); @@ -405,9 +405,9 @@ QString WQQuiz::yourAnswer(int i, const QString & s) return result; } -QString WQQuiz::hint(int i) +TQString WQQuiz::hint(int i) { - if (QString(m_correctBlank).length() > 0) + if (TQString(m_correctBlank).length() > 0) { return m_correctBlank; } @@ -428,10 +428,10 @@ void WQQuiz::setQuizMode(int qm) } -QString WQQuiz::question(int i) +TQString WQQuiz::question(int i) { WQListItem li = m_list[i]; - QString s = m_table->text(li.oneOp(), li.question()); + TQString s = m_table->text(li.oneOp(), li.question()); if (Prefs::enableBlanks()) { s.remove("["); @@ -448,13 +448,13 @@ QString WQQuiz::question(int i) return s; } -QString WQQuiz::blankAnswer(int i) +TQString WQQuiz::blankAnswer(int i) { - QString r = ""; + TQString r = ""; m_correctBlank = ""; m_answerBlank = ""; - QString tTemp; + TQString tTemp; if (m_quizType == qtQA && Prefs::enableBlanks()) { @@ -470,7 +470,7 @@ QString WQQuiz::blankAnswer(int i) } tTemp = m_table->text(li.oneOp(), j); r = tTemp; - QRegExp rx; + TQRegExp rx; rx.setMinimal(true); rx.setPattern("\\[.*\\]"); @@ -497,9 +497,9 @@ QString WQQuiz::blankAnswer(int i) return m_answerBlank; } -QString WQQuiz::answer(int i) +TQString WQQuiz::answer(int i) { - QString s; + TQString s; WQListItem li = m_list[i]; int j; if (li.question() == 0) @@ -535,13 +535,13 @@ QString WQQuiz::answer(int i) return s; } -QString WQQuiz::langQuestion(int i) +TQString WQQuiz::langQuestion(int i) { WQListItem li = m_list[i]; return m_table->horizontalHeader()->label(li.question()); } -QString WQQuiz::langAnswer(int i) +TQString WQQuiz::langAnswer(int i) { WQListItem li = m_list[i]; diff --git a/kwordquiz/src/wqquiz.h b/kwordquiz/src/wqquiz.h index 94f77f4f..d86c9fa0 100644 --- a/kwordquiz/src/wqquiz.h +++ b/kwordquiz/src/wqquiz.h @@ -19,7 +19,7 @@ #ifndef WQQUIZ_H #define WQQUIZ_H -#include +#include #include "wqlistitem.h" #include "kwordquizview.h" @@ -28,7 +28,7 @@ @author Peter Hedlund */ -typedef QValueList QuizList; +typedef TQValueList QuizList; class WQQuiz : public QObject { @@ -44,11 +44,11 @@ class WQQuiz : public QObject bool init(); void finish(); - bool checkAnswer(int i, const QString & ); - QStringList multiOptions(int i); - QString quizIcon(int i, QuizIcon ico); - QString yourAnswer(int i, const QString & s); - QString hint(int i); + bool checkAnswer(int i, const TQString & ); + TQStringList multiOptions(int i); + TQString quizIcon(int i, QuizIcon ico); + TQString yourAnswer(int i, const TQString & s); + TQString hint(int i); QuizType quizType() const {return m_quizType;} void setQuizType(QuizType qt); @@ -57,11 +57,11 @@ class WQQuiz : public QObject void setQuizMode(int qm); int questionCount(); - QString question(int i); - QString blankAnswer(int i); - QString answer(int i); - QString langQuestion(int i); - QString langAnswer(int i); + TQString question(int i); + TQString blankAnswer(int i); + TQString answer(int i); + TQString langQuestion(int i); + TQString langAnswer(int i); int kbAnswer(int i); @@ -77,8 +77,8 @@ class WQQuiz : public QObject QuizList m_quizList; QuizType m_quizType; - QString m_correctBlank; - QString m_answerBlank; + TQString m_correctBlank; + TQString m_answerBlank; void addToList(int aCol, int bCol); void listRandom(); diff --git a/kwordquiz/src/wqscore.cpp b/kwordquiz/src/wqscore.cpp index 420a002d..80cb3960 100644 --- a/kwordquiz/src/wqscore.cpp +++ b/kwordquiz/src/wqscore.cpp @@ -58,9 +58,9 @@ void WQScore::countIncrement(CountDirection d) /*! \fn WQScore::answerText() */ -QString WQScore::answerText() +TQString WQScore::answerText() { - QString s; + TQString s; if (m_percent) { float f = ((m_answerCount * 100.0) / m_questionCount); @@ -82,9 +82,9 @@ QString WQScore::answerText() /*! \fn WQScore::correctText() */ -QString WQScore::correctText() +TQString WQScore::correctText() { - QString s; + TQString s; if (m_percent) { if (m_correct > 0) @@ -104,9 +104,9 @@ QString WQScore::correctText() /*! \fn WQScore::errorText() */ -QString WQScore::errorText() +TQString WQScore::errorText() { - QString s; + TQString s; if (m_percent) { if (m_error > 0) @@ -126,9 +126,9 @@ QString WQScore::errorText() /*! \fn WQScore::valueToString(int i) */ -QString WQScore::valueToString(int i) +TQString WQScore::valueToString(int i) { - QString s = ""; //return empty string for 0 + TQString s = ""; //return empty string for 0 if (i > 0) s = s.setNum(i, 10); diff --git a/kwordquiz/src/wqscore.h b/kwordquiz/src/wqscore.h index 6e493c58..46c4651d 100644 --- a/kwordquiz/src/wqscore.h +++ b/kwordquiz/src/wqscore.h @@ -17,7 +17,7 @@ #ifndef WQSCORE_H #define WQSCORE_H -#include +#include /** @author Peter Hedlund @@ -33,9 +33,9 @@ public: void setQuestionCount(int c); void countIncrement(CountDirection d); - QString answerText(); - QString correctText(); - QString errorText(); + TQString answerText(); + TQString correctText(); + TQString errorText(); private: @@ -44,7 +44,7 @@ private: int m_error; int m_correct; int m_answerCount; - QString valueToString(int i); + TQString valueToString(int i); }; #endif diff --git a/kwordquiz/src/wqundo.h b/kwordquiz/src/wqundo.h index cc30425c..d9b5e9c7 100644 --- a/kwordquiz/src/wqundo.h +++ b/kwordquiz/src/wqundo.h @@ -16,7 +16,7 @@ #ifndef WQUNDO_H #define WQUNDO_H -#include +#include #include "wqlreader.h" @@ -25,8 +25,8 @@ */ class WQUndo{ public: - QFont font() const {return m_font;} - void setFont(const QFont & font) {m_font = font;} + TQFont font() const {return m_font;} + void setFont(const TQFont & font) {m_font = font;} int colWidth0() {return m_colWidth0;} void setColWidth0(int cw) {m_colWidth0 = cw;} @@ -41,27 +41,27 @@ public: void setCurrentRow(int r) {m_currentRow = r;} int currentCol() {return m_currentCol;} void setCurrentCol(int c) {m_currentCol = c;} - QTableSelection selection() const {return m_selection;} - void setSelection(const QTableSelection & sel) {m_selection = sel;} + TQTableSelection selection() const {return m_selection;} + void setSelection(const TQTableSelection & sel) {m_selection = sel;} KWqlDataItemList list() const {return m_list;} void setList(const KWqlDataItemList & list) {m_list = list;} - QString text() const {return m_text;} - void setText(const QString & s) {m_text = s;} + TQString text() const {return m_text;} + void setText(const TQString & s) {m_text = s;} private: - QFont m_font; + TQFont m_font; int m_colWidth0; int m_colWidth1; int m_colWidth2; int m_numRows; int m_currentRow; int m_currentCol; - QTableSelection m_selection; + TQTableSelection m_selection; KWqlDataItemList m_list; - QString m_text; + TQString m_text; }; #endif -- cgit v1.2.1

" << g->horizontalHeader()->label(0) << "

" + g->horizontalHeader()->label(1) << "

" << QString::number(i + 1) << "

" << TQString::number(i + 1) << "

" << g->text(i, 0) << "

" << g->text(i, 1) << "