diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-07-31 19:39:55 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-07-31 19:39:55 +0000 |
commit | 0a6e0958c03e41c87b15557b6f407874f20c2f8d (patch) | |
tree | 2cdd58c4013b1be09cfcbb4ddae2b05712b9aeee /keduca | |
parent | 83f9dfafc157ff7823804b3ff457b43d021a5b4b (diff) | |
download | tdeedu-0a6e0958c03e41c87b15557b6f407874f20c2f8d.tar.gz tdeedu-0a6e0958c03e41c87b15557b6f407874f20c2f8d.zip |
Trinity Qt initial conversion
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdeedu@1157642 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'keduca')
33 files changed, 609 insertions, 609 deletions
diff --git a/keduca/keduca/kcheckeduca.cpp b/keduca/keduca/kcheckeduca.cpp index 8fe6b557..a75c8478 100644 --- a/keduca/keduca/kcheckeduca.cpp +++ b/keduca/keduca/kcheckeduca.cpp @@ -18,10 +18,10 @@ #include "kcheckeduca.h" #include "kcheckeduca.moc" -#include <qstyle.h> +#include <tqstyle.h> #include <kaccelmanager.h> -KCheckEduca::KCheckEduca(QWidget *parent, const char *name ) : QCheckBox(parent,name) +KCheckEduca::KCheckEduca(TQWidget *parent, const char *name ) : TQCheckBox(parent,name) { _doc = 0; KAcceleratorManager::setNoAccel( this ); @@ -33,21 +33,21 @@ KCheckEduca::~KCheckEduca() } /** */ -void KCheckEduca::drawButtonLabel( QPainter *p){ +void KCheckEduca::drawButtonLabel( TQPainter *p){ int x, y, w, h; int extra_width, indicator_width; extra_width = 8; - indicator_width = style().pixelMetric(QStyle::PM_IndicatorWidth, 0); + indicator_width = style().pixelMetric(TQStyle::PM_IndicatorWidth, 0); y = 0; x = indicator_width + extra_width; //### w = width() - x; h = height(); - QRect cr(x,y,w,h); + TQRect cr(x,y,w,h); - _doc = new QSimpleRichText( text(), font() ); + _doc = new TQSimpleRichText( text(), font() ); _doc->setWidth( 10 ); _doc->setWidth(p, cr.width() ); @@ -61,25 +61,25 @@ void KCheckEduca::drawButtonLabel( QPainter *p){ yo = (cr.height()-rh)/2; if ( !isEnabled() ) { - QColorGroup cg = colorGroup(); - cg.setColor( QColorGroup::Text, cg.light() ); + TQColorGroup cg = colorGroup(); + cg.setColor( TQColorGroup::Text, cg.light() ); _doc->draw(p, cr.x()+xo+1, cr.y()+yo+1, cr, cg, 0); } _doc->draw(p, cr.x()+xo, cr.y()+yo, cr, colorGroup(), 0); if ( hasFocus() ) { -// QRect br = style().itemRect( p, x, y, rw, rh+yo, +// TQRect br = style().itemRect( p, x, y, rw, rh+yo, // AlignLeft|AlignVCenter|ShowPrefix, // isEnabled(), // pixmap(), text().visual() ); - QRect br(x,y,rw,rh+yo); + TQRect br(x,y,rw,rh+yo); br.setLeft( br.left()-3 ); br.setRight( br.right()+2 ); br.setTop( br.top()-2 ); br.setBottom( br.bottom()+2); - br = br.intersect( QRect(0,0,rw, rh+yo ) ); + br = br.intersect( TQRect(0,0,rw, rh+yo ) ); - style().drawPrimitive( QStyle::PE_FocusRect, p, br, colorGroup()); + style().drawPrimitive( TQStyle::PE_FocusRect, p, br, colorGroup()); } } diff --git a/keduca/keduca/kcheckeduca.h b/keduca/keduca/kcheckeduca.h index a874b62d..32ff3b81 100644 --- a/keduca/keduca/kcheckeduca.h +++ b/keduca/keduca/kcheckeduca.h @@ -18,27 +18,27 @@ #ifndef KCHECKEDUCA_H #define KCHECKEDUCA_H -#include <qcheckbox.h> +#include <tqcheckbox.h> -#include <qsimplerichtext.h> +#include <tqsimplerichtext.h> /**KCheck with wordwrap and rich text support *@author Javier Campos Morales */ -class KCheckEduca : public QCheckBox { +class KCheckEduca : public TQCheckBox { Q_OBJECT public: - KCheckEduca(QWidget *parent=0, const char *name=0); + KCheckEduca(TQWidget *parent=0, const char *name=0); ~KCheckEduca(); protected: - void drawButtonLabel( QPainter *); + void drawButtonLabel( TQPainter *); private: /** Rich text */ - QSimpleRichText *_doc; + TQSimpleRichText *_doc; }; #endif diff --git a/keduca/keduca/keduca.cpp b/keduca/keduca/keduca.cpp index 8abc874b..2ab99ea0 100644 --- a/keduca/keduca/keduca.cpp +++ b/keduca/keduca/keduca.cpp @@ -28,9 +28,9 @@ #include <kparts/componentfactory.h> -#include <qlabel.h> +#include <tqlabel.h> -Keduca::Keduca( QWidget* parent, const char *name, WFlags f ) +Keduca::Keduca( TQWidget* parent, const char *name, WFlags f ) : KParts::MainWindow( parent, name, f ), _part( 0 ) { setXMLFile( "keducaui.rc" ); @@ -53,7 +53,7 @@ Keduca::Keduca( QWidget* parent, const char *name, WFlags f ) kdFatal() << "The library \"libkeducapart\" could not be found. Aborting." << endl; } if (!initialGeometrySet()) - resize( QSize(550, 450).expandedTo(minimumSizeHint())); + resize( TQSize(550, 450).expandedTo(minimumSizeHint())); } Keduca::~Keduca() @@ -63,17 +63,17 @@ Keduca::~Keduca() void Keduca::setupActions() { - KStdAction::open( this, SLOT( slotFileOpen() ), actionCollection() ); - (void)new KAction( i18n( "Open &Gallery..." ), 0, 0, this, SLOT( slotGallery() ), + KStdAction::open( this, TQT_SLOT( slotFileOpen() ), actionCollection() ); + (void)new KAction( i18n( "Open &Gallery..." ), 0, 0, this, TQT_SLOT( slotGallery() ), actionCollection(), "open_gallery" ); - _recentFiles = KStdAction::openRecent(this, SLOT ( slotFileOpenURL(const KURL &) ), + _recentFiles = KStdAction::openRecent(this, TQT_SLOT ( slotFileOpenURL(const KURL &) ), actionCollection()); - KStdAction::quit(kapp, SLOT( quit() ), actionCollection()); + KStdAction::quit(kapp, TQT_SLOT( quit() ), actionCollection()); } void Keduca::slotFileOpen() { - KURL url = KFileDialog::getOpenURL( QString::null, "application/x-edu", this, i18n("Open Educa File") ); + KURL url = KFileDialog::getOpenURL( TQString::null, "application/x-edu", this, i18n("Open Educa File") ); if( !url.isEmpty() ) slotFileOpenURL( url ); } @@ -125,6 +125,6 @@ void Keduca::initGallery(const KURL &urlFile) if( !urlFile.url().isEmpty() ) galleries.putURL( urlFile ); - if( galleries.exec() == QDialog::Accepted ) + if( galleries.exec() == TQDialog::Accepted ) slotFileOpenURL( galleries.getURL() ); } diff --git a/keduca/keduca/keduca.h b/keduca/keduca/keduca.h index c5c5c99b..a997d36e 100644 --- a/keduca/keduca/keduca.h +++ b/keduca/keduca/keduca.h @@ -37,7 +37,7 @@ class Keduca : public KParts::MainWindow public: /** construtor */ - Keduca(QWidget* parent=0, const char *name=0, WFlags f = WType_TopLevel | WDestructiveClose); + Keduca(TQWidget* parent=0, const char *name=0, WFlags f = WType_TopLevel | WDestructiveClose); /** destructor */ ~Keduca(); /** Open gallery window */ diff --git a/keduca/keduca/keduca_part.cpp b/keduca/keduca/keduca_part.cpp index c5d13f68..bc9e5485 100644 --- a/keduca/keduca/keduca_part.cpp +++ b/keduca/keduca/keduca_part.cpp @@ -34,9 +34,9 @@ typedef KParts::GenericFactory<KEducaPart> KEducaPartFactory; K_EXPORT_COMPONENT_FACTORY( libkeducapart, KEducaPartFactory ) -KEducaPart::KEducaPart( QWidget *parentWidget, const char *widgetName, - QObject *parent, const char *name, - const QStringList &/*args*/ ) +KEducaPart::KEducaPart( TQWidget *parentWidget, const char *widgetName, + TQObject *parent, const char *name, + const TQStringList &/*args*/ ) : KParts::ReadOnlyPart( parent, name ) { setInstance( KEducaPartFactory::instance() ); @@ -71,7 +71,7 @@ bool KEducaPart::openFile() void KEducaPart::setupActions() { - KStdAction::preferences( this, SLOT( slotConfigure() ), actionCollection(), "configure" ); + KStdAction::preferences( this, TQT_SLOT( slotConfigure() ), actionCollection(), "configure" ); } void KEducaPart::slotConfigure() @@ -83,7 +83,7 @@ void KEducaPart::slotConfigure() ConfigDialogBase *confDlg = new ConfigDialogBase( 0, "ConfigDialogBase" ); dialog->addPage( confDlg, i18n("General"), "keduca" ); - connect( dialog, SIGNAL( settingsChanged() ), SLOT( updateConfiguration() ) ); + connect( dialog, TQT_SIGNAL( settingsChanged() ), TQT_SLOT( updateConfiguration() ) ); dialog->show(); } diff --git a/keduca/keduca/keduca_part.h b/keduca/keduca/keduca_part.h index 98a720fc..418209a8 100644 --- a/keduca/keduca/keduca_part.h +++ b/keduca/keduca/keduca_part.h @@ -40,8 +40,8 @@ class KEducaPart : public KParts::ReadOnlyPart /* * Constructor. */ - KEducaPart( QWidget *parentWidget, const char *widgetName, QObject *parent, - const char *name, const QStringList &args ); + KEducaPart( TQWidget *parentWidget, const char *widgetName, TQObject *parent, + const char *name, const TQStringList &args ); /* * Destructor. diff --git a/keduca/keduca/keducaprefs.cpp b/keduca/keduca/keducaprefs.cpp index b43f59e2..bdd07677 100644 --- a/keduca/keduca/keducaprefs.cpp +++ b/keduca/keduca/keducaprefs.cpp @@ -22,12 +22,12 @@ #include <kiconloader.h> #include <kconfig.h> -#include <qlayout.h> -#include <qvbox.h> -#include <qbuttongroup.h> +#include <tqlayout.h> +#include <tqvbox.h> +#include <tqbuttongroup.h> -KEducaPrefs::KEducaPrefs(QWidget *parent, const char *name, bool modal ) : KDialogBase(IconList, i18n("Configure"), Ok|Cancel, Ok, parent, name, modal, true) +KEducaPrefs::KEducaPrefs(TQWidget *parent, const char *name, bool modal ) : KDialogBase(IconList, i18n("Configure"), Ok|Cancel, Ok, parent, name, modal, true) { setPageGeneral(); configRead(); @@ -38,43 +38,43 @@ KEducaPrefs::~KEducaPrefs(){} /** Set page general */ void KEducaPrefs::setPageGeneral() { - QVBox *mainFrame = addVBoxPage( i18n("Miscellaneous"), i18n("Various Settings"), DesktopIcon("misc")); + TQVBox *mainFrame = addVBoxPage( i18n("Miscellaneous"), i18n("Various Settings"), DesktopIcon("misc")); - QButtonGroup *buttonGroup1 = new QButtonGroup( mainFrame, "ButtonGroup1" ); + TQButtonGroup *buttonGroup1 = new TQButtonGroup( mainFrame, "ButtonGroup1" ); buttonGroup1->setTitle( i18n( "General" ) ); buttonGroup1->setColumnLayout(0, Qt::Vertical ); buttonGroup1->layout()->setSpacing( 0 ); buttonGroup1->layout()->setMargin( 0 ); - QVBoxLayout *buttonGroup1Layout = new QVBoxLayout( buttonGroup1->layout() ); + TQVBoxLayout *buttonGroup1Layout = new TQVBoxLayout( buttonGroup1->layout() ); buttonGroup1Layout->setAlignment( Qt::AlignTop ); buttonGroup1Layout->setSpacing( 6 ); buttonGroup1Layout->setMargin( 11 ); - _resultAfterNext = new QRadioButton( buttonGroup1, "RadioButton1" ); + _resultAfterNext = new TQRadioButton( buttonGroup1, "RadioButton1" ); _resultAfterNext->setText( i18n( "Show results of the answer after press next" ) ); buttonGroup1Layout->addWidget( _resultAfterNext ); - _resultAfterFinish = new QRadioButton( buttonGroup1, "RadioButton2" ); + _resultAfterFinish = new TQRadioButton( buttonGroup1, "RadioButton2" ); _resultAfterFinish->setText( i18n( "Show results when finish the test" ) ); buttonGroup1Layout->addWidget( _resultAfterFinish ); - QGroupBox *GroupBox1 = new QGroupBox( mainFrame, "GroupBox7" ); + TQGroupBox *GroupBox1 = new TQGroupBox( mainFrame, "GroupBox7" ); GroupBox1->setTitle( i18n( "Order" ) ); GroupBox1->setColumnLayout(0, Qt::Vertical ); GroupBox1->layout()->setSpacing( 0 ); GroupBox1->layout()->setMargin( 0 ); - QVBoxLayout *GroupBox1Layout = new QVBoxLayout( GroupBox1->layout() ); + TQVBoxLayout *GroupBox1Layout = new TQVBoxLayout( GroupBox1->layout() ); GroupBox1Layout->setAlignment( Qt::AlignTop ); GroupBox1Layout->setSpacing( 6 ); GroupBox1Layout->setMargin( 11 ); - _randomQuestions = new QCheckBox( GroupBox1, "CheckBox1" ); + _randomQuestions = new TQCheckBox( GroupBox1, "CheckBox1" ); _randomQuestions->setText( i18n( "Show questions in random order" ) ); GroupBox1Layout->addWidget( _randomQuestions ); - _randomAnswers = new QCheckBox( GroupBox1, "CheckBox2" ); + _randomAnswers = new TQCheckBox( GroupBox1, "CheckBox2" ); _randomAnswers->setText( i18n( "Show answers in random order" ) ); GroupBox1Layout->addWidget( _randomAnswers ); } @@ -84,7 +84,7 @@ void KEducaPrefs::configRead() { KConfig *config = KGlobal::config(); config->setGroup("Options"); - QSize defaultSize(500,400); + TQSize defaultSize(500,400); resize( config->readSizeEntry("Geometry", &defaultSize ) ); config->readBoolEntry("ResultFinish", true ) ? _resultAfterFinish->setChecked(true) : _resultAfterNext->setChecked(true); config->readBoolEntry("RandomQuestions", false ) ? _randomQuestions->setChecked(true) : _randomQuestions->setChecked(false); diff --git a/keduca/keduca/keducaprefs.h b/keduca/keduca/keducaprefs.h index b1493798..39efb2e2 100644 --- a/keduca/keduca/keducaprefs.h +++ b/keduca/keduca/keducaprefs.h @@ -20,8 +20,8 @@ #include <kdialogbase.h> -#include <qradiobutton.h> -#include <qcheckbox.h> +#include <tqradiobutton.h> +#include <tqcheckbox.h> /** Preferences for KEduca TestMaster (class KEduca) *@author Javier Campos @@ -31,7 +31,7 @@ class KEducaPrefs : public KDialogBase { Q_OBJECT public: - KEducaPrefs(QWidget *parent=0, const char *name=0, bool modal=true); + KEducaPrefs(TQWidget *parent=0, const char *name=0, bool modal=true); ~KEducaPrefs(); private: @@ -48,11 +48,11 @@ private: // Private attributes /** Show result after next */ - QRadioButton *_resultAfterNext; + TQRadioButton *_resultAfterNext; /** Show results after finish */ - QRadioButton *_resultAfterFinish; - QCheckBox *_randomQuestions; - QCheckBox *_randomAnswers; + TQRadioButton *_resultAfterFinish; + TQCheckBox *_randomQuestions; + TQCheckBox *_randomAnswers; private slots: /** Push ok button */ diff --git a/keduca/keduca/keducaview.cpp b/keduca/keduca/keducaview.cpp index cd6c1782..5c07c9c3 100644 --- a/keduca/keduca/keducaview.cpp +++ b/keduca/keduca/keducaview.cpp @@ -32,13 +32,13 @@ #include <kdebug.h> #include <kio/netaccess.h> -#include <qtimer.h> -#include <qlayout.h> -#include <qlabel.h> -#include <qtextedit.h> +#include <tqtimer.h> +#include <tqlayout.h> +#include <tqlabel.h> +#include <tqtextedit.h> -KEducaView::KEducaView( QWidget *parent, const char *name ) - : QWidgetStack( parent, name ), _keducaFile( 0 ), _timeoutTimer( 0 ) +KEducaView::KEducaView( TQWidget *parent, const char *name ) + : TQWidgetStack( parent, name ), _keducaFile( 0 ), _timeoutTimer( 0 ) { init(); } @@ -58,43 +58,43 @@ KEducaView::~KEducaView() void KEducaView::init() { // Intro Screen - _introWidget = new QLabel( this, "introScreen" ); + _introWidget = new TQLabel( this, "introScreen" ); _introWidget->setBackgroundColor( Qt::white ); _introWidget->setAlignment( AlignCenter ); - _introWidget->setPixmap( QPixmap( locate("data","keduca/pics/keduca_init.png") ) ); + _introWidget->setPixmap( TQPixmap( locate("data","keduca/pics/keduca_init.png") ) ); addWidget( _introWidget, 0 ); // Info Widget - _infoWidget = new QVBox( this, "infoWidget" ); - _viewInfo = new QTextEdit( _infoWidget ); + _infoWidget = new TQVBox( this, "infoWidget" ); + _viewInfo = new TQTextEdit( _infoWidget ); _viewInfo->setReadOnly( true ); _buttonStartTest = new KPushButton( i18n( "&Start Test" ), _infoWidget ); - connect( _buttonStartTest, SIGNAL( clicked() ), SLOT( slotButtonNext() ) ); + connect( _buttonStartTest, TQT_SIGNAL( clicked() ), TQT_SLOT( slotButtonNext() ) ); addWidget( _infoWidget, 1 ); // Question Widget - _questionWidget = new QVBox( this, "questionWidget" ); - _split = new QSplitter( QSplitter::Vertical, _questionWidget ); + _questionWidget = new TQVBox( this, "questionWidget" ); + _split = new TQSplitter( TQSplitter::Vertical, _questionWidget ); _questionText = new KQuestion( _split, "kquestion" ); _buttonGroup = new KGroupEduca( _split, "ButtonGroup" ); _buttonGroup->setRadioButtonExclusive( true ); _buttonNext = new KPushButton( i18n( "&Next >>" ), _questionWidget, "ButtonNext" ); - connect( _buttonNext, SIGNAL( clicked() ), SLOT( slotButtonNext() ) ); + connect( _buttonNext, TQT_SIGNAL( clicked() ), TQT_SLOT( slotButtonNext() ) ); addWidget( _questionWidget, 2 ); // Results Widget - _resultsWidget = new QVBox( this, "resultsWidget" ); - _viewResults = new QTextEdit( _resultsWidget ); + _resultsWidget = new TQVBox( this, "resultsWidget" ); + _viewResults = new TQTextEdit( _resultsWidget ); _viewResults->setReadOnly( true ); _buttonSave = new KPushButton( i18n( "&Save Results..." ), _resultsWidget ); - connect( _buttonSave, SIGNAL( clicked() ), SLOT( slotButtonSave() ) ); + connect( _buttonSave, TQT_SIGNAL( clicked() ), TQT_SLOT( slotButtonSave() ) ); /* FIXME: This is a hack * The results widget can be shown only in the end of the test (when you should be shown the * option to save the results) or at the middle of the test, after each question (when there should * be a "Next" button). */ _buttonResultsNext = new KPushButton( i18n( "&Next >>" ), _resultsWidget ); - connect( _buttonResultsNext, SIGNAL( clicked() ), SLOT( slotButtonNext() ) ); + connect( _buttonResultsNext, TQT_SIGNAL( clicked() ), TQT_SLOT( slotButtonNext() ) ); _buttonResultsNext->hide(); addWidget( _resultsWidget, 3 ); @@ -147,19 +147,19 @@ void KEducaView::slotButtonNext() /** Button Save action */ void KEducaView::slotButtonSave() { - KFileDialog *dialog=new KFileDialog(QString::null, QString::null, this, "file dialog", true); + KFileDialog *dialog=new KFileDialog(TQString::null, TQString::null, this, "file dialog", true); dialog->setCaption( i18n("Save Results As") ); dialog->setKeepLocation( true ); dialog->setOperationMode( KFileDialog::Saving ); - QStringList mimeFilter( "text/html"); + TQStringList mimeFilter( "text/html"); dialog->setMimeFilter( mimeFilter ); KURL newURL; - QString outputFormat ("text/html"); + TQString outputFormat ("text/html"); bool bOk; do { bOk=true; - if(dialog->exec()==QDialog::Accepted) { + if(dialog->exec()==TQDialog::Accepted) { newURL=dialog->selectedURL(); outputFormat=dialog->currentMimeFilter(); } @@ -170,9 +170,9 @@ void KEducaView::slotButtonSave() } kdDebug()<<"Requested saving to file "<<newURL.prettyURL() <<endl; - if ( QFileInfo( newURL.path() ).extension().isEmpty() ) { + if ( TQFileInfo( newURL.path() ).extension().isEmpty() ) { // No more extensions in filters. We need to get it from the mimetype. - QString extension = ".html"; + TQString extension = ".html"; newURL.setPath( newURL.path() + extension ); } @@ -199,7 +199,7 @@ void KEducaView::slotButtonSave() /** Show record, returns false if there is no record to show. */ void KEducaView::showRecord() { - QString questionTextTemp = ""; + TQString questionTextTemp = ""; raiseWidget( _questionWidget ); @@ -233,14 +233,14 @@ void KEducaView::showRecord() if( Settings::randomAnswers() ) { _randomAnswers.clear(); - QValueList<unsigned int> tmpRandom; + TQValueList<unsigned int> tmpRandom; unsigned int index; for( index = 0 ; index < _keducaFile->recordAnswerCount() ; index ++ ) { tmpRandom.append( index ); } for( index = 0 ; index < _keducaFile->recordAnswerCount() ; index ++ ) { unsigned int random = rand() % tmpRandom.count(); - QValueList<unsigned int>::iterator itTmpRandom = tmpRandom.begin(); + TQValueList<unsigned int>::iterator itTmpRandom = tmpRandom.begin(); for( unsigned int i = 0; i < random; i++) { ++itTmpRandom; } _keducaFile->recordAnswerAt( (*itTmpRandom) ); _randomAnswers.append( (*itTmpRandom) ); @@ -274,9 +274,9 @@ void KEducaView::showRecord() { if (!_timeoutTimer) { - _timeoutTimer = new QTimer(this); - connect(_timeoutTimer, SIGNAL(timeout()), - this, SLOT(questionTimedOut())); + _timeoutTimer = new TQTimer(this); + connect(_timeoutTimer, TQT_SIGNAL(timeout()), + this, TQT_SLOT(questionTimedOut())); } _timeoutTimer->start(1000*timeout); _questionText->countdown(timeout); @@ -295,7 +295,7 @@ void KEducaView::questionTimedOut() } /** Show results */ -void KEducaView::showResults( const QString &text ) +void KEducaView::showResults( const TQString &text ) { _viewResults->setText( text ); @@ -317,15 +317,15 @@ void KEducaView::showResults( const QString &text ) void KEducaView::setResults() { bool isCorrect = true; - QString yourAnswer = ""; - QString correctAnswer = ""; - QValueList<uint>::iterator itRandom = _randomAnswers.begin(); + TQString yourAnswer = ""; + TQString correctAnswer = ""; + TQValueList<uint>::iterator itRandom = _randomAnswers.begin(); Settings::randomAnswers() ? _keducaFile->recordAnswerAt(*itRandom) : _keducaFile->recordAnswerFirst(); for( unsigned index = 0 ; index < _keducaFile->recordAnswerCount() ; index++ ) { - QString answertext = _keducaFile->getAnswer( FileRead::AF_TEXT ); + TQString answertext = _keducaFile->getAnswer( FileRead::AF_TEXT ); if( !answertext.isEmpty() ) { if(_buttonGroup->isChecked(index) != _keducaFile->getAnswerValue()) @@ -366,9 +366,9 @@ void KEducaView::setResults() } /** Set results */ -QString KEducaView::setFinalResult() +TQString KEducaView::setFinalResult() { - QString finalResult = ""; + TQString finalResult = ""; if( !_keducaFile->isResult() ) return ""; @@ -437,36 +437,36 @@ void KEducaView::configWrite() } /** current Status Points */ -QString KEducaView::currentStatusPoints() +TQString KEducaView::currentStatusPoints() { - QString tempStatus; + TQString tempStatus; tempStatus = insertTable() + insertRow( i18n("Statistics"), true, 4) + insertRow( i18n("Correct questions"), - QString().setNum( _correctAnswer ), + TQString().setNum( _correctAnswer ), i18n("Incorrect questions"), - QString().setNum( _incorrectAnswer ), true); + TQString().setNum( _incorrectAnswer ), true); if( _keducaFile->getTotalPoints() > 0 ) tempStatus += insertRow( i18n("Total points"), true, 4 ) + insertRow( i18n("Correct points"), - QString().setNum( _correctPoints ), + TQString().setNum( _correctPoints ), i18n("Incorrect points"), - QString().setNum( _incorrectPoints ), true ); + TQString().setNum( _incorrectPoints ), true ); if( _keducaFile->getTotalTime() > 0 ) tempStatus += insertRow( i18n("Time"), true, 4 ) + insertRow( i18n("Total time"), - QString().setNum( _keducaFile->getTotalTime() ), + TQString().setNum( _keducaFile->getTotalTime() ), i18n("Time in tests"), - QString().setNum( _currentTime ), true ); + TQString().setNum( _currentTime ), true ); tempStatus += insertTableClose(); return tempStatus; } /** Set HTML table view with correct and incorrect answers */ -QString KEducaView::getTableQuestion( bool isCorrect, const QString &correct, const QString &incorrect) +TQString KEducaView::getTableQuestion( bool isCorrect, const TQString &correct, const TQString &incorrect) { _currentResults = "<TABLE WIDTH=100% BORDER=0><TR><TD VALIGN=TOP WIDTH=70><IMG WIDTH=64 HEIGHT=64 SRC="; if( isCorrect ) @@ -518,7 +518,7 @@ bool KEducaView::questionNext() if( _randomQuestions.count() > 0 ) { unsigned int randomQuestion = rand() % _randomQuestions.count(); - QValueList<uint>::iterator itRandom = _randomQuestions.begin(); + TQValueList<uint>::iterator itRandom = _randomQuestions.begin(); for( unsigned int i = 0; i < randomQuestion; ++i) { ++itRandom; } _keducaFile->recordAt( (*itRandom) ); @@ -530,10 +530,10 @@ bool KEducaView::questionNext() } /** Get document information */ -QString KEducaView::getInformation() +TQString KEducaView::getInformation() { - QString tmp = ""; + TQString tmp = ""; if ( _keducaFile ) { @@ -564,15 +564,15 @@ QString KEducaView::getInformation() } /** Init table with title and colspan */ -QString KEducaView::insertTable( const QString &title, unsigned int col){ - QString tmp; +TQString KEducaView::insertTable( const TQString &title, unsigned int col){ + TQString tmp; tmp = "<TABLE WIDTH=100% BORDER=0 CELLSPACING=0 BGCOLOR=#EEEEDD>"; if( !title.isEmpty() ) { tmp += "<TR><TD "; - if( col > 0 ) tmp += "COLSPAN=" + QString().setNum( col ) + " "; + if( col > 0 ) tmp += "COLSPAN=" + TQString().setNum( col ) + " "; tmp += "ALIGN=CENTER><FONT COLOR=#222211><B>" + title @@ -582,10 +582,10 @@ QString KEducaView::insertTable( const QString &title, unsigned int col){ } /** Insert row */ -QString KEducaView::insertRow( const QString &text, bool title, unsigned colSpan ){ - QString tmp; +TQString KEducaView::insertRow( const TQString &text, bool title, unsigned colSpan ){ + TQString tmp; tmp = "<TR><TD"; - if( colSpan>0 ) tmp+= " COLSPAN=" + QString().setNum(colSpan); + if( colSpan>0 ) tmp+= " COLSPAN=" + TQString().setNum(colSpan); if( title ) tmp += " ALIGN=CENTER"; tmp += ">"; if( title ) tmp += "<B>"; @@ -596,8 +596,8 @@ QString KEducaView::insertRow( const QString &text, bool title, unsigned colSpan } /** Insert row */ -QString KEducaView::insertRow( const QString &label, const QString &field, bool formBased ){ - QString tmp; +TQString KEducaView::insertRow( const TQString &label, const TQString &field, bool formBased ){ + TQString tmp; tmp = "<TR><TD"; if( formBased ) tmp += " ALIGN=RIGHT"; tmp += ">" + label; @@ -606,8 +606,8 @@ QString KEducaView::insertRow( const QString &label, const QString &field, bool return tmp; } -QString KEducaView::insertRow( const QString &label1, const QString &field1, const QString &label2, const QString &field2, bool formBased ){ - QString tmp; +TQString KEducaView::insertRow( const TQString &label1, const TQString &field1, const TQString &label2, const TQString &field2, bool formBased ){ + TQString tmp; tmp = "<TR><TD"; if( formBased ) tmp += " ALIGN=RIGHT"; tmp += ">" + label1; @@ -623,7 +623,7 @@ QString KEducaView::insertRow( const QString &label1, const QString &field1, con /** Close current table */ -QString KEducaView::insertTableClose(){ +TQString KEducaView::insertTableClose(){ return "</TABLE>"; } diff --git a/keduca/keduca/keducaview.h b/keduca/keduca/keducaview.h index 78bce53c..d710ef4f 100644 --- a/keduca/keduca/keducaview.h +++ b/keduca/keduca/keducaview.h @@ -20,9 +20,9 @@ #include <kurl.h> -#include <qlayout.h> -#include <qsplitter.h> -#include <qwidgetstack.h> +#include <tqlayout.h> +#include <tqsplitter.h> +#include <tqwidgetstack.h> class QTimer; class QTextEdit; @@ -45,7 +45,7 @@ class KEducaView : public QWidgetStack Q_OBJECT public: - KEducaView(QWidget *parent=0, const char *name=0); + KEducaView(TQWidget *parent=0, const char *name=0); ~KEducaView(); /** Open url */ bool openURL( const KURL &url); @@ -60,35 +60,35 @@ private: /** Show record, returns false if there is no record to show. */ void showRecord(); /** Show results */ - void showResults( const QString &text ); + void showResults( const TQString &text ); /** Set results */ void setResults(); /** Set results */ - QString setFinalResult(); + TQString setFinalResult(); /** Write settings */ void configWrite(); /** current results Points */ - QString currentStatusPoints(); + TQString currentStatusPoints(); /** Set HTML table view with correct and incorrect answers */ - QString getTableQuestion( bool isCorrect, const QString &correct, const QString &incorrect); + TQString getTableQuestion( bool isCorrect, const TQString &correct, const TQString &incorrect); /** Define the next questions (random, secuencial) */ bool questionNext(); - QString getInformation(); + TQString getInformation(); /** Init table with title and colspan */ - QString insertTable( const QString &title = "", unsigned int col=0); + TQString insertTable( const TQString &title = "", unsigned int col=0); /** Insert row */ - QString insertRow( const QString &text, bool title, unsigned int colSpan=0 ); - QString insertRow( const QString &label, const QString &field, bool formBased ); - QString insertRow( const QString &label1, const QString &field1, const QString &label2, const QString &field2, bool formBased ); + TQString insertRow( const TQString &text, bool title, unsigned int colSpan=0 ); + TQString insertRow( const TQString &label, const TQString &field, bool formBased ); + TQString insertRow( const TQString &label1, const TQString &field1, const TQString &label2, const TQString &field2, bool formBased ); /** Close current table */ - QString insertTableClose(); + TQString insertTableClose(); // Private attributes /** Widgets */ - QLabel *_introWidget; - QWidget *_infoWidget, *_questionWidget, *_resultsWidget; + TQLabel *_introWidget; + TQWidget *_infoWidget, *_questionWidget, *_resultsWidget; /** Push Buttons */ KPushButton *_buttonNext; KPushButton *_buttonSave; @@ -101,21 +101,21 @@ private: /** A question text with pixmaps and movies support */ KQuestion *_questionText; /** A question text with pixmaps and movies support */ - QTextEdit *_viewResults; - QTextEdit *_viewInfo; + TQTextEdit *_viewResults; + TQTextEdit *_viewInfo; /** Current record */ int _keducaFileIndex; /** Current results */ - QString _results; + TQString _results; /** Main vbox */ - QVBoxLayout *_vbox2; + TQVBoxLayout *_vbox2; /** Main splitt */ - QSplitter *_split; + TQSplitter *_split; /** Current results */ - QString _currentResults; + TQString _currentResults; /** If is init window */ bool _isInitStatus; - QTimer *_timeoutTimer; + TQTimer *_timeoutTimer; /** Num of correct answers */ int _correctAnswer; /** Number of incorrect answers */ @@ -133,9 +133,9 @@ private: /** Show random answers */ bool _showRandomAnswers; /** Save real order by random questions */ - QValueList<uint> _randomQuestions; + TQValueList<uint> _randomQuestions; /** Save real order by random answers */ - QValueList<uint> _randomAnswers; + TQValueList<uint> _randomAnswers; private slots: /** Button Next action */ void slotButtonNext(); diff --git a/keduca/keduca/kgroupeduca.cpp b/keduca/keduca/kgroupeduca.cpp index 7cdb8b38..9f7a2413 100644 --- a/keduca/keduca/kgroupeduca.cpp +++ b/keduca/keduca/kgroupeduca.cpp @@ -22,13 +22,13 @@ #include <klocale.h> -KGroupEduca::KGroupEduca(QWidget *parent, const char *name ) : QVButtonGroup(i18n("Answers"), parent, name) +KGroupEduca::KGroupEduca(TQWidget *parent, const char *name ) : TQVButtonGroup(i18n("Answers"), parent, name) { - _sv = new QScrollView(this); - _sv->setVScrollBarMode(QScrollView::Auto); - _sv->setHScrollBarMode(QScrollView::Auto); - _sv->setFrameStyle( QFrame::NoFrame | QFrame::Plain ); - _vbox2 = new QVBox( _sv->viewport() ); + _sv = new TQScrollView(this); + _sv->setVScrollBarMode(TQScrollView::Auto); + _sv->setHScrollBarMode(TQScrollView::Auto); + _sv->setFrameStyle( TQFrame::NoFrame | TQFrame::Plain ); + _vbox2 = new TQVBox( _sv->viewport() ); _vbox2->setSpacing( 6 ); _vbox2->setMargin( 11 ); _sv->viewport()->setBackgroundMode( _vbox2->backgroundMode() ); @@ -41,9 +41,9 @@ KGroupEduca::~KGroupEduca(){ } /** Insert a check or radio button */ -void KGroupEduca::insertAnswer( const QString& text) +void KGroupEduca::insertAnswer( const TQString& text) { - QButton *answer = 0; + TQButton *answer = 0; switch( _typeMode ) { @@ -54,7 +54,7 @@ void KGroupEduca::insertAnswer( const QString& text) answer = new KCheckEduca( _vbox2 ); break; } - answer->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)5, (QSizePolicy::SizeType)0 ) ); + answer->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)5, (TQSizePolicy::SizeType)0 ) ); answer->setText( text ); answer->show(); insert(answer); @@ -72,7 +72,7 @@ void KGroupEduca::clearAnswers() unsigned int maxButton = count(); for( unsigned int i=0 ; i<maxButton ; ++i ) { - QButton *tmpButton; + TQButton *tmpButton; if( (tmpButton = find(i)) ) remove(tmpButton); delete tmpButton; diff --git a/keduca/keduca/kgroupeduca.h b/keduca/keduca/kgroupeduca.h index f0dbd904..532bb890 100644 --- a/keduca/keduca/kgroupeduca.h +++ b/keduca/keduca/kgroupeduca.h @@ -18,23 +18,23 @@ #ifndef KGROUPEDUCA_H #define KGROUPEDUCA_H -#include <qvbuttongroup.h> -#include <qscrollview.h> -#include <qvbox.h> +#include <tqvbuttongroup.h> +#include <tqscrollview.h> +#include <tqvbox.h> /** *@author Javier Campos Morales */ -class KGroupEduca : public QVButtonGroup { +class KGroupEduca : public TQVButtonGroup { Q_OBJECT public: enum ButtonType { Radio, Check }; - KGroupEduca(QWidget *parent=0, const char *name=0); + KGroupEduca(TQWidget *parent=0, const char *name=0); ~KGroupEduca(); /** Insert a check or radio button */ - void insertAnswer( const QString& text); + void insertAnswer( const TQString& text); /** Set type */ void setType(ButtonType Type); /** Clear all kradio or kcheck answers */ @@ -43,13 +43,13 @@ public: bool isChecked(int id); protected: - QVBox* _vbox2; + TQVBox* _vbox2; private: // Private attributes - QScrollView *_sv; + TQScrollView *_sv; /** Type mode */ ButtonType _typeMode; }; diff --git a/keduca/keduca/kquestion.cpp b/keduca/keduca/kquestion.cpp index 262f89b3..69a90fdd 100644 --- a/keduca/keduca/kquestion.cpp +++ b/keduca/keduca/kquestion.cpp @@ -19,16 +19,16 @@ #include "kquestion.h" #include "kquestion.moc" -#include <qlayout.h> -#include <qpixmap.h> -#include <qvbox.h> -#include <qtimer.h> +#include <tqlayout.h> +#include <tqpixmap.h> +#include <tqvbox.h> +#include <tqtimer.h> #include <kprogress.h> #include <klocale.h> -KQuestion::KQuestion( QWidget *parent, const char *name ) - : QHBox( parent, name ), _countdownTimer( 0 ) +KQuestion::KQuestion( TQWidget *parent, const char *name ) + : TQHBox( parent, name ), _countdownTimer( 0 ) { initGUI(); } @@ -40,37 +40,37 @@ KQuestion::~KQuestion() /** Init graphical interface */ void KQuestion::initGUI() { - setFrameShape( QFrame::Box ); - setFrameShadow( QFrame::Plain ); - setPalette( QPalette( Qt::white ) ); + setFrameShape( TQFrame::Box ); + setFrameShadow( TQFrame::Plain ); + setPalette( TQPalette( Qt::white ) ); - QVBox *picBox = new QVBox( this ); + TQVBox *picBox = new TQVBox( this ); - _picture = new QLabel( picBox, "PixmapLabel1" ); + _picture = new TQLabel( picBox, "PixmapLabel1" ); _picture->setScaledContents( FALSE ); - _picture->setPalette( QPalette( Qt::white ) ); + _picture->setPalette( TQPalette( Qt::white ) ); _countdownWidget = new KProgress( picBox ); - _countdownWidget->setSizePolicy( QSizePolicy( QSizePolicy::Preferred, - QSizePolicy::Preferred ) ); + _countdownWidget->setSizePolicy( TQSizePolicy( TQSizePolicy::Preferred, + TQSizePolicy::Preferred ) ); _countdownWidget->setFormat( i18n( "%v seconds left" ) ); - _view = new QTextEdit( this, "TextView1" ); + _view = new TQTextEdit( this, "TextView1" ); _view->setReadOnly( true ); - _view->setFrameShape( QTextEdit::NoFrame ); - _view->setHScrollBarMode( QTextEdit::AlwaysOff ); - _view->setTextFormat( QTextEdit::RichText ); - _view->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)7, true ) ); + _view->setFrameShape( TQTextEdit::NoFrame ); + _view->setHScrollBarMode( TQTextEdit::AlwaysOff ); + _view->setTextFormat( TQTextEdit::RichText ); + _view->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)7, (TQSizePolicy::SizeType)7, true ) ); } /** Set text */ -void KQuestion::setText( const QString &text) +void KQuestion::setText( const TQString &text) { _view->setText( text ); } /** Set pixmap */ -void KQuestion::setPixmap( const QPixmap pixmap) +void KQuestion::setPixmap( const TQPixmap pixmap) { _picture->setPixmap( pixmap ); } @@ -83,9 +83,9 @@ void KQuestion::countdown(int starttime) { if (!_countdownTimer) { - _countdownTimer = new QTimer(this); - connect(_countdownTimer, SIGNAL(timeout()), - this, SLOT(countDownOne())); + _countdownTimer = new TQTimer(this); + connect(_countdownTimer, TQT_SIGNAL(timeout()), + this, TQT_SLOT(countDownOne())); } _countdownTimer->start(1000); // make one step less than time passes by in seconds diff --git a/keduca/keduca/kquestion.h b/keduca/keduca/kquestion.h index 1753375e..2cd53a30 100644 --- a/keduca/keduca/kquestion.h +++ b/keduca/keduca/kquestion.h @@ -19,9 +19,9 @@ #ifndef KQUESTION_H #define KQUESTION_H -#include <qhbox.h> -#include <qtextedit.h> -#include <qlabel.h> +#include <tqhbox.h> +#include <tqtextedit.h> +#include <tqlabel.h> class QTimer; class KProgress; @@ -35,12 +35,12 @@ class KQuestion : public QHBox Q_OBJECT public: - KQuestion(QWidget *parent=0, const char *name=0); + KQuestion(TQWidget *parent=0, const char *name=0); ~KQuestion(); /** Set pixmap */ - void setPixmap( const QPixmap pixmap); + void setPixmap( const TQPixmap pixmap); /** Set text */ - void setText( const QString &text); + void setText( const TQString &text); /** show a countdown, starting at "starttime" and counting down to 0, each second one count. @@ -67,10 +67,10 @@ private: // Private attributes /** Main View */ - QTextEdit *_view; + TQTextEdit *_view; /** Main Picture */ - QLabel *_picture; - QTimer *_countdownTimer; + TQLabel *_picture; + TQTimer *_countdownTimer; KProgress *_countdownWidget; int _currentCount; int _totalCount; diff --git a/keduca/keduca/kradioeduca.cpp b/keduca/keduca/kradioeduca.cpp index 94f26eeb..89b3e830 100644 --- a/keduca/keduca/kradioeduca.cpp +++ b/keduca/keduca/kradioeduca.cpp @@ -17,10 +17,10 @@ #include "kradioeduca.h" #include "kradioeduca.moc" -#include <qstyle.h> +#include <tqstyle.h> #include <kaccelmanager.h> -KRadioEduca::KRadioEduca(QWidget *parent, const char *name) : QRadioButton(parent,name) +KRadioEduca::KRadioEduca(TQWidget *parent, const char *name) : TQRadioButton(parent,name) { _doc=0; KAcceleratorManager::setNoAccel(this); @@ -32,21 +32,21 @@ KRadioEduca::~KRadioEduca() } /** reimpl */ -void KRadioEduca::drawButtonLabel( QPainter *p) +void KRadioEduca::drawButtonLabel( TQPainter *p) { int x, y, w, h; int extra_width, indicator_width; extra_width = 8; - indicator_width = style().pixelMetric(QStyle::PM_ExclusiveIndicatorWidth, 0); + indicator_width = style().pixelMetric(TQStyle::PM_ExclusiveIndicatorWidth, 0); y = 0; x = indicator_width + extra_width; //### w = width() - x; h = height(); - QRect cr(x,y,w,h); + TQRect cr(x,y,w,h); - _doc = new QSimpleRichText( text(), font() ); + _doc = new TQSimpleRichText( text(), font() ); _doc->setWidth( 10 ); _doc->setWidth(p, cr.width() ); @@ -60,24 +60,24 @@ void KRadioEduca::drawButtonLabel( QPainter *p) yo = (cr.height()-rh)/2; if (!isEnabled() ) { - QColorGroup cg = colorGroup(); - cg.setColor( QColorGroup::Text, cg.light() ); + TQColorGroup cg = colorGroup(); + cg.setColor( TQColorGroup::Text, cg.light() ); _doc->draw(p, cr.x()+xo+1, cr.y()+yo+1, cr, cg, 0); } _doc->draw(p, cr.x()+xo, cr.y()+yo, cr, colorGroup(), 0); if ( hasFocus() ) { -// QRect br = style().itemRect( p, x, y, rw, rh+yo, +// TQRect br = style().itemRect( p, x, y, rw, rh+yo, // AlignLeft|AlignVCenter|ShowPrefix, // isEnabled(), // pixmap(), text().visual() ); - QRect br(x,y,rw,rh+yo); + TQRect br(x,y,rw,rh+yo); br.setLeft( br.left()-3 ); br.setRight( br.right()+2 ); br.setTop( br.top()-2 ); br.setBottom( br.bottom()+2); - br = br.intersect( QRect(0,0,rw, rh+yo ) ); - style().drawPrimitive( QStyle::PE_FocusRect, p, br, colorGroup()); + br = br.intersect( TQRect(0,0,rw, rh+yo ) ); + style().drawPrimitive( TQStyle::PE_FocusRect, p, br, colorGroup()); } } diff --git a/keduca/keduca/kradioeduca.h b/keduca/keduca/kradioeduca.h index b17276d9..f23c74a1 100644 --- a/keduca/keduca/kradioeduca.h +++ b/keduca/keduca/kradioeduca.h @@ -19,17 +19,17 @@ #define KRADIOEDUCA_H -#include <qradiobutton.h> -#include <qsimplerichtext.h> +#include <tqradiobutton.h> +#include <tqsimplerichtext.h> -/**QRadioButton with wordwrap and richtext features +/**TQRadioButton with wordwrap and richtext features *@author Javier Campos Morales */ -class KRadioEduca : public QRadioButton { +class KRadioEduca : public TQRadioButton { Q_OBJECT public: - KRadioEduca(QWidget *parent=0, const char *name=0); + KRadioEduca(TQWidget *parent=0, const char *name=0); ~KRadioEduca(); protected: @@ -37,14 +37,14 @@ protected: // Protected methods /** reimpl */ - void drawButtonLabel( QPainter *p); + void drawButtonLabel( TQPainter *p); private: // Private attributes /** Rich Text */ - QSimpleRichText *_doc; + TQSimpleRichText *_doc; }; diff --git a/keduca/keduca/main.cpp b/keduca/keduca/main.cpp index 9b33280b..ec7f8063 100644 --- a/keduca/keduca/main.cpp +++ b/keduca/keduca/main.cpp @@ -19,7 +19,7 @@ #include <kaboutdata.h> #include <kdebug.h> -#include <qfileinfo.h> +#include <tqfileinfo.h> #include "keduca.h" static const char description[] = I18N_NOOP("Form-based tests and exams"); @@ -56,7 +56,7 @@ int main(int argc, char *argv[]) if ( args->count() > 0 ) { - if( QFileInfo( KURL(args->url(0)).url() ).extension() == "edugallery" ) + if( TQFileInfo( KURL(args->url(0)).url() ).extension() == "edugallery" ) keducaTestMaster->initGallery( args->url(0) ); else keducaTestMaster->slotFileOpenURL( args->url(0) ); diff --git a/keduca/keducabuilder/kcontroladdedit.cpp b/keduca/keducabuilder/kcontroladdedit.cpp index 76715e27..f8b60562 100644 --- a/keduca/keducabuilder/kcontroladdedit.cpp +++ b/keduca/keducabuilder/kcontroladdedit.cpp @@ -28,10 +28,10 @@ //#include <.h> // Qt includes -#include <qlabel.h> -#include <qtextedit.h> +#include <tqlabel.h> +#include <tqtextedit.h> -KControlAddEdit::KControlAddEdit(QWidget *parent, const char *name, bool modal, WFlags f) +KControlAddEdit::KControlAddEdit(TQWidget *parent, const char *name, bool modal, WFlags f) : KControlAddEditBase(parent, name, modal, f), _currentAnswerItem(0) { @@ -90,16 +90,16 @@ void KControlAddEdit::fillPage() _keducaFile->recordAnswerFirst(); while( !_keducaFile->recordAnswerEOF() ) { - QListViewItem *newItem = new QListViewItem(_listAnswers); + TQListViewItem *newItem = new TQListViewItem(_listAnswers); newItem->setText(0,_keducaFile->getAnswer( FileRead::AF_TEXT )); newItem->setText(1,_keducaFile->getAnswerValue()?i18n("True"):i18n("False")); - newItem->setText(2,QString::number(_keducaFile->getAnswerPoints())); + newItem->setText(2,TQString::number(_keducaFile->getAnswerPoints())); _keducaFile->recordAnswerNext(); }; } -void KControlAddEdit::setCurrentAnswerItem(QListViewItem *item) +void KControlAddEdit::setCurrentAnswerItem(TQListViewItem *item) { _currentAnswerItem = item; if (item) @@ -114,12 +114,12 @@ void KControlAddEdit::slotAddAnswer() if( !_answerText->text().isEmpty() ) { // add new listview item - QListViewItem *newItem = _currentAnswerItem + TQListViewItem *newItem = _currentAnswerItem ? _currentAnswerItem - : new QListViewItem(_listAnswers,_listAnswers->lastItem()); + : new TQListViewItem(_listAnswers,_listAnswers->lastItem()); newItem->setText(0,_answerText->text()); newItem->setText(1,_answerValue->currentItem() == 1 ?i18n("True"):i18n("False")); - newItem->setText(2,QString::number(_answerPoints->value())); + newItem->setText(2,TQString::number(_answerPoints->value())); // reset values newItem->setSelected(false); @@ -150,7 +150,7 @@ void KControlAddEdit::slotRemoveAnswer() /** Button Up */ void KControlAddEdit::slotMoveUpAnswer() { - QListViewItem *item = _listAnswers->currentItem(); + TQListViewItem *item = _listAnswers->currentItem(); if (item && item->itemAbove()) item->itemAbove()->moveItem(item); @@ -162,7 +162,7 @@ void KControlAddEdit::slotMoveUpAnswer() /** Button Down */ void KControlAddEdit::slotMoveDownAnswer() { - QListViewItem *item = _listAnswers->currentItem(); + TQListViewItem *item = _listAnswers->currentItem(); if (item) item->moveItem(item->itemBelow()); @@ -171,7 +171,7 @@ void KControlAddEdit::slotMoveDownAnswer() _buttonDown->setEnabled(item->itemBelow()!=0); } -void KControlAddEdit::slotAnswerSelected(QListViewItem *item) +void KControlAddEdit::slotAnswerSelected(TQListViewItem *item) { if (!item) return; @@ -198,7 +198,7 @@ void KControlAddEdit::accept() addQuestion(); configWrite(); - done( QDialog::Accepted ); + done( TQDialog::Accepted ); } /** Add question with form data */ @@ -213,7 +213,7 @@ void KControlAddEdit::addQuestion() _keducaFile->setQuestion( FileRead::QF_EXPLAIN, _questionExplain->text() ); _keducaFile->clearAnswers(); - QListViewItem *item = _listAnswers->firstChild(); + TQListViewItem *item = _listAnswers->firstChild(); while (item) { _keducaFile->setAnswer( item->text(0), // The Answer text @@ -227,7 +227,7 @@ void KControlAddEdit::configRead() { KConfig *config = KGlobal::config(); config->setGroup("AddModify Window"); - QSize defaultSize(500,400); + TQSize defaultSize(500,400); resize( config->readSizeEntry("Geometry", &defaultSize ) ); } @@ -255,18 +255,18 @@ void KControlAddEdit::slotDataChanged() /** Preview image */ -void KControlAddEdit::slotPreviewImage( const QString &text) +void KControlAddEdit::slotPreviewImage( const TQString &text) { if( text.isEmpty() ) { _questionPreview->setText(""); _answerPreview->setText(""); return; } - _questionPreview->setPixmap( QPixmap( text ) ); - _answerPreview->setPixmap( QPixmap( text ) ); + _questionPreview->setPixmap( TQPixmap( text ) ); + _answerPreview->setPixmap( TQPixmap( text ) ); } /** show current Page */ -void KControlAddEdit::showPage(QWidget *page) +void KControlAddEdit::showPage(TQWidget *page) { - QWizard::showPage(page); + TQWizard::showPage(page); slotDataChanged(); if ( page == _pageQuestion ) { diff --git a/keduca/keducabuilder/kcontroladdedit.h b/keduca/keducabuilder/kcontroladdedit.h index d700ec43..3144f41e 100644 --- a/keduca/keducabuilder/kcontroladdedit.h +++ b/keduca/keducabuilder/kcontroladdedit.h @@ -37,12 +37,12 @@ class KControlAddEdit : public KControlAddEditBase { Q_OBJECT public: - KControlAddEdit(QWidget *parent = 0, const char *name = 0, bool modal = true, WFlags f = 0); + KControlAddEdit(TQWidget *parent = 0, const char *name = 0, bool modal = true, WFlags f = 0); ~KControlAddEdit(); /** Init keducaFile pointer and EditMode */ void init(FileRead *keducaFile, bool editMode); /** show current Page */ - void showPage(QWidget *page); + void showPage(TQWidget *page); private: @@ -58,14 +58,14 @@ private: void configWrite(); /** Read config settings */ void configRead(); - void setCurrentAnswerItem(QListViewItem *item); + void setCurrentAnswerItem(TQListViewItem *item); void resetAnswerValues(); // Private attributes /** Pointer to keduca of kcontrol page */ FileRead *_keducaFile; /** The currently selected answer item, important for editing of the answer*/ - QListViewItem *_currentAnswerItem; + TQListViewItem *_currentAnswerItem; /** Is a edit modify? */ bool _editMode; @@ -73,7 +73,7 @@ private slots: /** Accept changes */ void accept(); /** An Answer has been selected */ - void slotAnswerSelected(QListViewItem *item); + void slotAnswerSelected(TQListViewItem *item); /** Remove answer */ void slotRemoveAnswer(); /** Button insert */ @@ -85,7 +85,7 @@ private slots: /** Question or Answer data changed */ void slotDataChanged(); /** Preview image */ - void slotPreviewImage( const QString & ); + void slotPreviewImage( const TQString & ); /** Change question type */ void slotQuestionTypeChanged( int index ); }; diff --git a/keduca/keducabuilder/kcontrolheader.cpp b/keduca/keducabuilder/kcontrolheader.cpp index d7a2090a..bdb1e0bb 100644 --- a/keduca/keducabuilder/kcontrolheader.cpp +++ b/keduca/keducabuilder/kcontrolheader.cpp @@ -24,10 +24,10 @@ #include <klineedit.h> #include <kcombobox.h> -#include <qlayout.h> -#include <qlabel.h> +#include <tqlayout.h> +#include <tqlabel.h> -KControlHeader::KControlHeader(FileRead *keducaFile, QWidget *parent, const char *name ) : KDialogBase(Swallow, i18n("Document Information"), Ok|Cancel, Ok, parent, name, true, true) +KControlHeader::KControlHeader(FileRead *keducaFile, TQWidget *parent, const char *name ) : KDialogBase(Swallow, i18n("Document Information"), Ok|Cancel, Ok, parent, name, true, true) { _keducaFile = keducaFile; init(); @@ -39,122 +39,122 @@ KControlHeader::~KControlHeader(){} /** Init graphical interface */ void KControlHeader::init() { - QWidget *mainView = new QWidget(this); + TQWidget *mainView = new TQWidget(this); - QVBoxLayout *Form2Layout = new QVBoxLayout( mainView ); + TQVBoxLayout *Form2Layout = new TQVBoxLayout( mainView ); Form2Layout->setSpacing( 6 ); Form2Layout->setMargin( 0 ); - QFrame *Frame16 = new QFrame( mainView, "Frame16" ); - Frame16->setMinimumSize( QSize( 0, 50 ) ); - Frame16->setMaximumSize( QSize( 32767, 50 ) ); - Frame16->setFrameShape( QFrame::Box ); - Frame16->setFrameShadow( QFrame::Plain ); - Frame16->setPalette( QPalette( QColor(255, 255, 255) ) ); - QHBoxLayout *Frame16Layout = new QHBoxLayout( Frame16 ); + TQFrame *Frame16 = new TQFrame( mainView, "Frame16" ); + Frame16->setMinimumSize( TQSize( 0, 50 ) ); + Frame16->setMaximumSize( TQSize( 32767, 50 ) ); + Frame16->setFrameShape( TQFrame::Box ); + Frame16->setFrameShadow( TQFrame::Plain ); + Frame16->setPalette( TQPalette( TQColor(255, 255, 255) ) ); + TQHBoxLayout *Frame16Layout = new TQHBoxLayout( Frame16 ); Frame16Layout->setSpacing( 6 ); Frame16Layout->setMargin( 1 ); - QFrame *Frame17 = new QFrame( Frame16, "Frame17" ); - Frame17->setMinimumSize( QSize( 125, 0 ) ); - Frame17->setMaximumSize( QSize( 125, 32767 ) ); - Frame17->setFrameShape( QFrame::NoFrame ); - Frame17->setFrameShadow( QFrame::Raised ); - Frame17->setBackgroundPixmap( QPixmap(locate("appdata","pics/bk_frame.png") ) ); - QVBoxLayout *Frame17Layout = new QVBoxLayout( Frame17 ); + TQFrame *Frame17 = new TQFrame( Frame16, "Frame17" ); + Frame17->setMinimumSize( TQSize( 125, 0 ) ); + Frame17->setMaximumSize( TQSize( 125, 32767 ) ); + Frame17->setFrameShape( TQFrame::NoFrame ); + Frame17->setFrameShadow( TQFrame::Raised ); + Frame17->setBackgroundPixmap( TQPixmap(locate("appdata","pics/bk_frame.png") ) ); + TQVBoxLayout *Frame17Layout = new TQVBoxLayout( Frame17 ); Frame17Layout->setSpacing( 6 ); Frame17Layout->setMargin( 11 ); - QLabel *TextLabel1 = new QLabel( Frame17, "TextLabel1" ); + TQLabel *TextLabel1 = new TQLabel( Frame17, "TextLabel1" ); TextLabel1->setText( "<b style=\"text-decoration:underline;\">"+i18n("Information")+"</b>" ); - TextLabel1->setBackgroundPixmap( QPixmap(locate("appdata","pics/bk_frame.png") ) ); + TextLabel1->setBackgroundPixmap( TQPixmap(locate("appdata","pics/bk_frame.png") ) ); Frame17Layout->addWidget( TextLabel1 ); Frame16Layout->addWidget( Frame17 ); - QSpacerItem* spacer = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum ); + TQSpacerItem* spacer = new TQSpacerItem( 20, 20, TQSizePolicy::Expanding, TQSizePolicy::Minimum ); Frame16Layout->addItem( spacer ); - QLabel *TextLabel2 = new QLabel( Frame16, "TextLabel2" ); + TQLabel *TextLabel2 = new TQLabel( Frame16, "TextLabel2" ); TextLabel2->setText( i18n( "Description and rules of the project." ) ); - TextLabel2->setPalette( QPalette( QColor(255, 255, 255) ) ); + TextLabel2->setPalette( TQPalette( TQColor(255, 255, 255) ) ); Frame16Layout->addWidget( TextLabel2 ); Form2Layout->addWidget( Frame16 ); - QGroupBox *GroupBox7 = new QGroupBox( mainView, "GroupBox7" ); + TQGroupBox *GroupBox7 = new TQGroupBox( mainView, "GroupBox7" ); GroupBox7->setTitle( i18n( "Description" ) ); GroupBox7->setColumnLayout(0, Qt::Vertical ); GroupBox7->layout()->setSpacing( 0 ); GroupBox7->layout()->setMargin( 0 ); - QVBoxLayout *GroupBox7Layout = new QVBoxLayout( GroupBox7->layout() ); + TQVBoxLayout *GroupBox7Layout = new TQVBoxLayout( GroupBox7->layout() ); GroupBox7Layout->setAlignment( Qt::AlignTop ); GroupBox7Layout->setSpacing( 6 ); GroupBox7Layout->setMargin( 11 ); - QGridLayout *Layout13 = new QGridLayout; + TQGridLayout *Layout13 = new QGridLayout; Layout13->setSpacing( 6 ); Layout13->setMargin( 0 ); - QLabel *TextLabel10 = new QLabel( GroupBox7, "TextLabel10" ); + TQLabel *TextLabel10 = new TQLabel( GroupBox7, "TextLabel10" ); TextLabel10->setText( i18n( "Type:" )); - TextLabel10->setAlignment( int( QLabel::AlignVCenter | QLabel::AlignRight ) ); + TextLabel10->setAlignment( int( TQLabel::AlignVCenter | TQLabel::AlignRight ) ); Layout13->addWidget( TextLabel10, 2, 0 ); - QHBoxLayout *Layout12 = new QHBoxLayout; + TQHBoxLayout *Layout12 = new QHBoxLayout; Layout12->setSpacing( 6 ); Layout12->setMargin( 0 ); _headerType = new KComboBox( FALSE, GroupBox7, "_headerType" ); Layout12->addWidget( _headerType ); - QLabel *TextLabel11 = new QLabel( GroupBox7, "TextLabel11" ); + TQLabel *TextLabel11 = new TQLabel( GroupBox7, "TextLabel11" ); TextLabel11->setText( i18n( "Level:" )); - TextLabel11->setAlignment( int( QLabel::AlignVCenter | QLabel::AlignRight ) ); + TextLabel11->setAlignment( int( TQLabel::AlignVCenter | TQLabel::AlignRight ) ); Layout12->addWidget( TextLabel11 ); _headerLevel = new KComboBox( FALSE, GroupBox7, "_headerLevel" ); Layout12->addWidget( _headerLevel ); Layout13->addLayout( Layout12, 2, 1 ); - QLabel *TextLabel12 = new QLabel( GroupBox7, "TextLabel12" ); + TQLabel *TextLabel12 = new TQLabel( GroupBox7, "TextLabel12" ); TextLabel12->setText( i18n( "Language:" )); - TextLabel12->setAlignment( int( QLabel::AlignVCenter | QLabel::AlignRight ) ); + TextLabel12->setAlignment( int( TQLabel::AlignVCenter | TQLabel::AlignRight ) ); Layout13->addWidget( TextLabel12, 3, 0 ); _headerLang = new KLanguageCombo( GroupBox7, "_headerLang" ); loadCountryList( _headerLang ); Layout13->addWidget( _headerLang, 3, 1 ); - QLabel *TextLabel9 = new QLabel( GroupBox7, "TextLabel9" ); + TQLabel *TextLabel9 = new TQLabel( GroupBox7, "TextLabel9" ); TextLabel9->setText( i18n( "Category:" )); - TextLabel9->setAlignment( int( QLabel::AlignVCenter | QLabel::AlignRight ) ); + TextLabel9->setAlignment( int( TQLabel::AlignVCenter | TQLabel::AlignRight ) ); Layout13->addWidget( TextLabel9, 1, 0 ); _headerCategory = new KComboBox( true, GroupBox7, "_headerCategory" ); Layout13->addWidget( _headerCategory, 1, 1 ); - _headerTitle = new QLineEdit( GroupBox7, "_headerTitle" ); + _headerTitle = new TQLineEdit( GroupBox7, "_headerTitle" ); Layout13->addWidget( _headerTitle, 0, 1 ); - QLabel *TextLabel8 = new QLabel( GroupBox7, "TextLabel8" ); + TQLabel *TextLabel8 = new TQLabel( GroupBox7, "TextLabel8" ); TextLabel8->setText( i18n( "Title:" )); - TextLabel8->setAlignment( int( QLabel::AlignVCenter | QLabel::AlignRight ) ); + TextLabel8->setAlignment( int( TQLabel::AlignVCenter | TQLabel::AlignRight ) ); Layout13->addWidget( TextLabel8, 0, 0 ); GroupBox7Layout->addLayout( Layout13 ); Form2Layout->addWidget( GroupBox7 ); - QGroupBox *GroupBox8 = new QGroupBox( mainView, "GroupBox8" ); + TQGroupBox *GroupBox8 = new TQGroupBox( mainView, "GroupBox8" ); GroupBox8->setTitle( i18n( "Picture" ) ); GroupBox8->setColumnLayout(0, Qt::Vertical ); GroupBox8->layout()->setSpacing( 0 ); GroupBox8->layout()->setMargin( 0 ); - QHBoxLayout *GroupBox8Layout = new QHBoxLayout( GroupBox8->layout() ); + TQHBoxLayout *GroupBox8Layout = new TQHBoxLayout( GroupBox8->layout() ); GroupBox8Layout->setAlignment( Qt::AlignTop ); GroupBox8Layout->setSpacing( 6 ); GroupBox8Layout->setMargin( 11 ); - QLabel *TextLabel13 = new QLabel( GroupBox8, "TextLabel13" ); + TQLabel *TextLabel13 = new TQLabel( GroupBox8, "TextLabel13" ); TextLabel13->setText( i18n( "Default picture:" )); GroupBox8Layout->addWidget( TextLabel13 ); @@ -162,43 +162,43 @@ void KControlHeader::init() GroupBox8Layout->addWidget( _headerPicture ); Form2Layout->addWidget( GroupBox8 ); - QGroupBox *GroupBox6 = new QGroupBox( mainView, "GroupBox6" ); + TQGroupBox *GroupBox6 = new TQGroupBox( mainView, "GroupBox6" ); GroupBox6->setTitle( i18n( "Author" ) ); GroupBox6->setColumnLayout(0, Qt::Vertical ); GroupBox6->layout()->setSpacing( 0 ); GroupBox6->layout()->setMargin( 0 ); - QGridLayout *GroupBox6Layout = new QGridLayout( GroupBox6->layout() ); + TQGridLayout *GroupBox6Layout = new TQGridLayout( GroupBox6->layout() ); GroupBox6Layout->setAlignment( Qt::AlignTop ); GroupBox6Layout->setSpacing( 6 ); GroupBox6Layout->setMargin( 11 ); - _headerName = new QLineEdit( GroupBox6, "_headerName" ); + _headerName = new TQLineEdit( GroupBox6, "_headerName" ); GroupBox6Layout->addWidget( _headerName, 0, 1 ); - _headerEmail = new QLineEdit( GroupBox6, "_headerEmail" ); + _headerEmail = new TQLineEdit( GroupBox6, "_headerEmail" ); GroupBox6Layout->addWidget( _headerEmail, 1, 1 ); - QLabel *TextLabel7 = new QLabel( GroupBox6, "TextLabel7" ); + TQLabel *TextLabel7 = new TQLabel( GroupBox6, "TextLabel7" ); TextLabel7->setText( i18n( "Web page:" )); - TextLabel7->setAlignment( int( QLabel::AlignVCenter | QLabel::AlignRight ) ); + TextLabel7->setAlignment( int( TQLabel::AlignVCenter | TQLabel::AlignRight ) ); GroupBox6Layout->addWidget( TextLabel7, 2, 0 ); - QLabel *TextLabel6 = new QLabel( GroupBox6, "TextLabel6" ); + TQLabel *TextLabel6 = new TQLabel( GroupBox6, "TextLabel6" ); TextLabel6->setText( i18n( "Email:" )); - TextLabel6->setAlignment( int( QLabel::AlignVCenter | QLabel::AlignRight ) ); + TextLabel6->setAlignment( int( TQLabel::AlignVCenter | TQLabel::AlignRight ) ); GroupBox6Layout->addWidget( TextLabel6, 1, 0 ); - QLabel *TextLabel5 = new QLabel( GroupBox6, "TextLabel5" ); + TQLabel *TextLabel5 = new TQLabel( GroupBox6, "TextLabel5" ); TextLabel5->setText( i18n( "Name:" )); - TextLabel5->setAlignment( int( QLabel::AlignVCenter | QLabel::AlignRight ) ); + TextLabel5->setAlignment( int( TQLabel::AlignVCenter | TQLabel::AlignRight ) ); GroupBox6Layout->addWidget( TextLabel5, 0, 0 ); - _headerWWW = new QLineEdit( GroupBox6, "_headerWWW" ); + _headerWWW = new TQLineEdit( GroupBox6, "_headerWWW" ); GroupBox6Layout->addWidget( _headerWWW, 2, 1 ); Form2Layout->addWidget( GroupBox6 ); @@ -223,7 +223,7 @@ void KControlHeader::init() /** Insert header */ void KControlHeader::insertHeader() { - QStringList tmpResult = _defaultCategories.grep( _headerCategory->currentText() ); + TQStringList tmpResult = _defaultCategories.grep( _headerCategory->currentText() ); if( tmpResult.count() == 0 ) { KConfig *appconfig = KGlobal::config(); @@ -235,8 +235,8 @@ void KControlHeader::insertHeader() _keducaFile->setHeader( "category", _headerCategory->currentText() ); _keducaFile->setHeader( "title", _headerTitle->text() ); _keducaFile->setHeader( "image", _headerPicture->url() ); - _keducaFile->setHeader( "type", QString().setNum( _headerType->currentItem() + 1 ) ); - _keducaFile->setHeader( "level", QString().setNum( _headerLevel->currentItem() + 1 ) ); + _keducaFile->setHeader( "type", TQString().setNum( _headerType->currentItem() + 1 ) ); + _keducaFile->setHeader( "level", TQString().setNum( _headerLevel->currentItem() + 1 ) ); _keducaFile->setHeader( "language", _headerLang->currentTag() ); _keducaFile->setHeader( "name", _headerName->text() ); _keducaFile->setHeader( "email", _headerEmail->text() ); @@ -246,19 +246,19 @@ void KControlHeader::insertHeader() /** Load country list */ void KControlHeader::loadCountryList(KLanguageCombo *combo) { - QString sub = QString::fromLatin1("l10n/"); + TQString sub = TQString::fromLatin1("l10n/"); // clear the list combo->clear(); - QStringList regionlist = KGlobal::dirs()->findAllResources("locale", sub + QString::fromLatin1("*.desktop")); + TQStringList regionlist = KGlobal::dirs()->findAllResources("locale", sub + TQString::fromLatin1("*.desktop")); regionlist.sort(); - for ( QStringList::ConstIterator it = regionlist.begin(); + for ( TQStringList::ConstIterator it = regionlist.begin(); it != regionlist.end(); ++it ) { - QString tag = *it; + TQString tag = *it; int index; index = tag.findRev('/'); @@ -268,25 +268,25 @@ void KControlHeader::loadCountryList(KLanguageCombo *combo) if (index != -1) tag.truncate(index); KSimpleConfig entry(*it); - entry.setGroup(QString::fromLatin1("KCM Locale")); - QString name = entry.readEntry(QString::fromLatin1("Name")); + entry.setGroup(TQString::fromLatin1("KCM Locale")); + TQString name = entry.readEntry(TQString::fromLatin1("Name")); combo->insertSubmenu( name, '-' + tag, sub ); } // add all languages to the list - QStringList countrylist = KGlobal::dirs()->findAllResources("locale", sub + QString::fromLatin1("*/entry.desktop")); + TQStringList countrylist = KGlobal::dirs()->findAllResources("locale", sub + TQString::fromLatin1("*/entry.desktop")); countrylist.sort(); - for ( QStringList::ConstIterator it = countrylist.begin(); + for ( TQStringList::ConstIterator it = countrylist.begin(); it != countrylist.end(); ++it ) { KSimpleConfig entry(*it); - entry.setGroup(QString::fromLatin1("KCM Locale")); - QString name = entry.readEntry(QString::fromLatin1("Name")); - QString submenu = '-' + entry.readEntry(QString::fromLatin1("Region")); + entry.setGroup(TQString::fromLatin1("KCM Locale")); + TQString name = entry.readEntry(TQString::fromLatin1("Name")); + TQString submenu = '-' + entry.readEntry(TQString::fromLatin1("Region")); - QString tag = *it; + TQString tag = *it; int index = tag.findRev('/'); tag.truncate(index); index = tag.findRev('/'); @@ -312,12 +312,12 @@ void KControlHeader::configRead() config->setGroup("UserInfo"); if( _keducaFile->getHeader( "name" ).isEmpty() ) - _headerName->setText(config->readEntry("FullName", QString::null )); + _headerName->setText(config->readEntry("FullName", TQString::null )); else _headerName->setText( _keducaFile->getHeader("name") ); if( _keducaFile->getHeader( "email" ).isEmpty() ) - _headerEmail->setText(config->readEntry("EmailAddress", QString::null )); + _headerEmail->setText(config->readEntry("EmailAddress", TQString::null )); else _headerEmail->setText( _keducaFile->getHeader("email") ); @@ -349,19 +349,19 @@ void KControlHeader::configRead() _headerType->insertItem( i18n("Slidershow") ); _headerType->insertItem( i18n("Exam") ); _headerType->insertItem( i18n("Psychotechnic Test") ); - if( QString(_keducaFile->getHeader("type")).toInt() > 0 ) _headerType->setCurrentItem( QString(_keducaFile->getHeader("type")).toInt() -1 ); + if( TQString(_keducaFile->getHeader("type")).toInt() > 0 ) _headerType->setCurrentItem( TQString(_keducaFile->getHeader("type")).toInt() -1 ); _headerLevel->insertItem( i18n("Easy") ); _headerLevel->insertItem( i18n("Normal") ); _headerLevel->insertItem( i18n("Expert") ); _headerLevel->insertItem( i18n("Supreme") ); - if( QString(_keducaFile->getHeader("level")).toInt() >0 ) _headerLevel->setCurrentItem( QString(_keducaFile->getHeader("level")).toInt() -1 ); + if( TQString(_keducaFile->getHeader("level")).toInt() >0 ) _headerLevel->setCurrentItem( TQString(_keducaFile->getHeader("level")).toInt() -1 ); _headerPicture->setURL( _keducaFile->getHeader("image") ); _headerTitle->setText( _keducaFile->getHeader("title") ); appconfig->setGroup("kcontrolheader"); - QSize *defaultSize = new QSize(500,400); + TQSize *defaultSize = new TQSize(500,400); resize( appconfig->readSizeEntry("Geometry", defaultSize ) ); delete config; } diff --git a/keduca/keducabuilder/kcontrolheader.h b/keduca/keducabuilder/kcontrolheader.h index 86752ae0..ff1e64ff 100644 --- a/keduca/keducabuilder/kcontrolheader.h +++ b/keduca/keducabuilder/kcontrolheader.h @@ -35,7 +35,7 @@ class KControlHeader : public KDialogBase { Q_OBJECT public: - KControlHeader(FileRead *keducaFile, QWidget *parent=0, const char *name=0); + KControlHeader(FileRead *keducaFile, TQWidget *parent=0, const char *name=0); ~KControlHeader(); private: @@ -45,7 +45,7 @@ private: /** Keduca pointer */ FileRead *_keducaFile; /** Title */ - QLineEdit *_headerTitle; + TQLineEdit *_headerTitle; /** Header type */ KComboBox *_headerType; /** Header category */ @@ -57,13 +57,13 @@ private: /** Header picture */ KURLRequester *_headerPicture; /** Header name */ - QLineEdit *_headerName; + TQLineEdit *_headerName; /** Header email */ - QLineEdit *_headerEmail; + TQLineEdit *_headerEmail; /** Header www */ - QLineEdit *_headerWWW; + TQLineEdit *_headerWWW; /** Default categories */ - QStringList _defaultCategories; + TQStringList _defaultCategories; // Private methods diff --git a/keduca/keducabuilder/keducabuilder.cpp b/keduca/keducabuilder/keducabuilder.cpp index 08487cc9..fa7da986 100644 --- a/keduca/keducabuilder/keducabuilder.cpp +++ b/keduca/keducabuilder/keducabuilder.cpp @@ -32,10 +32,10 @@ #include <kmessagebox.h> #include <kprinter.h> -#include <qlayout.h> -#include <qcheckbox.h> -#include <qpaintdevicemetrics.h> -#include <qpainter.h> +#include <tqlayout.h> +#include <tqcheckbox.h> +#include <tqpaintdevicemetrics.h> +#include <tqpainter.h> static const char* const keducabuilder_data[] = { "15 16 4 1", @@ -60,7 +60,7 @@ static const char* const keducabuilder_data[] = { ".#############.", "..............."}; -KEducaBuilder::KEducaBuilder(QWidget* parent, const char *name, WFlags f ) +KEducaBuilder::KEducaBuilder(TQWidget* parent, const char *name, WFlags f ) : KMainWindow(parent,name,f), _nativeFormat("application/x-edu") { @@ -81,29 +81,29 @@ KEducaBuilder::~KEducaBuilder() /** Init graphical interface */ void KEducaBuilder::init() { - QWidget *mainView = new QWidget(this, "mainview"); + TQWidget *mainView = new TQWidget(this, "mainview"); - QVBoxLayout *form2Layout = new QVBoxLayout( mainView ); + TQVBoxLayout *form2Layout = new TQVBoxLayout( mainView ); form2Layout->setSpacing( 2 ); form2Layout->setMargin( 0 ); - _split = new QSplitter( mainView ); - _split->setOrientation( QSplitter::Vertical ); + _split = new TQSplitter( mainView ); + _split->setOrientation( TQSplitter::Vertical ); _listAnswer = new KListBox( _split, "_listAnswer" ); - _listAnswer->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)7, _listAnswer->sizePolicy().hasHeightForWidth() ) ); - connect( _listAnswer, SIGNAL( highlighted(QListBoxItem *) ), this, SLOT( slotPreview(QListBoxItem *) ) ); - connect( _listAnswer, SIGNAL( doubleClicked(QListBoxItem *) ), this, SLOT( slotEditbyList(QListBoxItem *) ) ); + _listAnswer->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)7, (TQSizePolicy::SizeType)7, _listAnswer->sizePolicy().hasHeightForWidth() ) ); + connect( _listAnswer, TQT_SIGNAL( highlighted(TQListBoxItem *) ), this, TQT_SLOT( slotPreview(TQListBoxItem *) ) ); + connect( _listAnswer, TQT_SIGNAL( doubleClicked(TQListBoxItem *) ), this, TQT_SLOT( slotEditbyList(TQListBoxItem *) ) ); - _preview = new QTextView( _split, "_preview" ); - _preview->setFrameShape( QTextView::NoFrame ); + _preview = new TQTextView( _split, "_preview" ); + _preview->setFrameShape( TQTextView::NoFrame ); _preview->setLineWidth( 1 ); form2Layout->addWidget( _split ); setCentralWidget( mainView ); if (!initialGeometrySet()) - resize( QSize(500, 400).expandedTo(minimumSizeHint())); + resize( TQSize(500, 400).expandedTo(minimumSizeHint())); setupGUI( ToolBar | Keys | StatusBar | Create, "keducabuilderui.rc" ); setAutoSaveSettings(); } @@ -111,21 +111,21 @@ void KEducaBuilder::init() /** Init menu bar settings */ void KEducaBuilder::initMenuBar() { - KStdAction::openNew(this, SLOT( slotFileOpenNew() ), actionCollection()); - KStdAction::open (this, SLOT( slotFileOpen() ), actionCollection()); - (void)new KAction(i18n("Open &Gallery..."), 0, 0, this, SLOT( slotGallery() ), actionCollection(), "open_gallery"); - _recentFiles = KStdAction::openRecent(this, SLOT ( slotFileOpenURL(const KURL &)), actionCollection()); - KStdAction::save (this, SLOT( slotFileSave() ), actionCollection()); - KStdAction::saveAs (this, SLOT( slotFileSaveAs() ), actionCollection()); - KStdAction::print (this, SLOT( slotFilePrint() ), actionCollection()); - (void)new KAction(i18n("Document Info"), "info", 0, this, SLOT( slotHeader() ), actionCollection(), "info_doc"); - KStdAction::quit(this, SLOT( close() ), actionCollection()); - - (void)new KAction(i18n("&Add..."), "addquestion", 0, this, SLOT( slotAdd() ), actionCollection(), "question_add"); - (void)new KAction(i18n("&Edit..."), "editquestion", 0, this, SLOT( slotEdit() ), actionCollection(), "question_edit"); - (void)new KAction(i18n("&Remove"), "delquestion", 0, this, SLOT( slotRemove() ), actionCollection(), "question_remove"); - (void)new KAction(i18n("&Up"), "up", 0, this, SLOT( slotUp() ), actionCollection(), "question_up"); - (void)new KAction(i18n("&Down"), "down", 0, this, SLOT( slotDown() ), actionCollection(), "question_down"); + KStdAction::openNew(this, TQT_SLOT( slotFileOpenNew() ), actionCollection()); + KStdAction::open (this, TQT_SLOT( slotFileOpen() ), actionCollection()); + (void)new KAction(i18n("Open &Gallery..."), 0, 0, this, TQT_SLOT( slotGallery() ), actionCollection(), "open_gallery"); + _recentFiles = KStdAction::openRecent(this, TQT_SLOT ( slotFileOpenURL(const KURL &)), actionCollection()); + KStdAction::save (this, TQT_SLOT( slotFileSave() ), actionCollection()); + KStdAction::saveAs (this, TQT_SLOT( slotFileSaveAs() ), actionCollection()); + KStdAction::print (this, TQT_SLOT( slotFilePrint() ), actionCollection()); + (void)new KAction(i18n("Document Info"), "info", 0, this, TQT_SLOT( slotHeader() ), actionCollection(), "info_doc"); + KStdAction::quit(this, TQT_SLOT( close() ), actionCollection()); + + (void)new KAction(i18n("&Add..."), "addquestion", 0, this, TQT_SLOT( slotAdd() ), actionCollection(), "question_add"); + (void)new KAction(i18n("&Edit..."), "editquestion", 0, this, TQT_SLOT( slotEdit() ), actionCollection(), "question_edit"); + (void)new KAction(i18n("&Remove"), "delquestion", 0, this, TQT_SLOT( slotRemove() ), actionCollection(), "question_remove"); + (void)new KAction(i18n("&Up"), "up", 0, this, TQT_SLOT( slotUp() ), actionCollection(), "question_up"); + (void)new KAction(i18n("&Down"), "down", 0, this, TQT_SLOT( slotDown() ), actionCollection(), "question_down"); } /** Delete current document and start new */ @@ -148,7 +148,7 @@ void KEducaBuilder::slotFileOpenNew() /** Open new document. */ void KEducaBuilder::slotFileOpen() { - KURL url = KFileDialog::getOpenURL( QString::null, _nativeFormat, this, i18n("Open Educa File") ); + KURL url = KFileDialog::getOpenURL( TQString::null, _nativeFormat, this, i18n("Open Educa File") ); if( !url.isEmpty() ) slotFileOpenURL( url ); @@ -160,7 +160,7 @@ void KEducaBuilder::slotFileOpenURL( const KURL &url ) if (!currentFileMayBeReplaced()) return; - QPixmap image0( ( const char** ) keducabuilder_data ); + TQPixmap image0( ( const char** ) keducabuilder_data ); delete _keducaFile; _keducaFile = new FileRead(); if( !_keducaFile->openFile(url) ) { return; } @@ -177,10 +177,10 @@ void KEducaBuilder::slotFileOpenURL( const KURL &url ) } /** Item select */ -void KEducaBuilder::slotPreview( QListBoxItem *item ) +void KEducaBuilder::slotPreview( TQListBoxItem *item ) { // bool match = false; - QString tmpListanswer; + TQString tmpListanswer; // FIND THE SELECT RECORD if( !item ) return; @@ -318,7 +318,7 @@ bool KEducaBuilder::queryClose () /** Add question */ void KEducaBuilder::slotAdd() { - QPixmap image0( ( const char** ) keducabuilder_data ); + TQPixmap image0( ( const char** ) keducabuilder_data ); KControlAddEdit edit(this); edit.init( _keducaFile, false ); @@ -334,7 +334,7 @@ void KEducaBuilder::slotEdit() { if( _listAnswer->currentItem() == -1 ) return; - QPixmap image0( ( const char** ) keducabuilder_data ); + TQPixmap image0( ( const char** ) keducabuilder_data ); KControlAddEdit edit(this); edit.init( _keducaFile, true ); @@ -359,10 +359,10 @@ void KEducaBuilder::slotUp() int current = _listAnswer->currentItem(); if( current < 1 ) return; - QPixmap image0( ( const char** ) keducabuilder_data ); + TQPixmap image0( ( const char** ) keducabuilder_data ); _keducaFile->recordSwap( true ); - QString tmpString = _listAnswer->text( current-1 ); + TQString tmpString = _listAnswer->text( current-1 ); _listAnswer->changeItem( image0, _listAnswer->text( current ), current-1 ); _listAnswer->changeItem( image0, tmpString, current ); _listAnswer->setCurrentItem( current-1 ); @@ -374,10 +374,10 @@ void KEducaBuilder::slotDown() int current = _listAnswer->currentItem(); if( current == -1 || current == (signed)(_listAnswer->count()-1) ) return; - QPixmap image0( ( const char** ) keducabuilder_data ); + TQPixmap image0( ( const char** ) keducabuilder_data ); _keducaFile->recordSwap( true ); - QString tmpString = _listAnswer->text( current+1 ); + TQString tmpString = _listAnswer->text( current+1 ); _listAnswer->changeItem( image0, _listAnswer->text( current ), current+1 ); _listAnswer->changeItem( image0, tmpString, current ); _listAnswer->setCurrentItem( current+1 ); @@ -406,22 +406,22 @@ bool KEducaBuilder::fileSaveAs() { if( !checkSave() ) return false; - QCheckBox *saveCompressedCheckBox = new QCheckBox( i18n( "Compress the file" ), 0 ); + TQCheckBox *saveCompressedCheckBox = new TQCheckBox( i18n( "Compress the file" ), 0 ); saveCompressedCheckBox->setChecked( true ); - KFileDialog *dialog=new KFileDialog(QString::null, QString::null, this, "file dialog", true, saveCompressedCheckBox); + KFileDialog *dialog=new KFileDialog(TQString::null, TQString::null, this, "file dialog", true, saveCompressedCheckBox); dialog->setCaption( i18n("Save Document As") ); dialog->setKeepLocation( true ); dialog->setOperationMode( KFileDialog::Saving ); - QStringList mimeFilter(_nativeFormat); + TQStringList mimeFilter(_nativeFormat); dialog->setMimeFilter( mimeFilter, _nativeFormat ); KURL newURL; - QString outputFormat (_nativeFormat); + TQString outputFormat (_nativeFormat); bool bOk; do { bOk=true; - if(dialog->exec()==QDialog::Accepted) { + if(dialog->exec()==TQDialog::Accepted) { newURL=dialog->selectedURL(); outputFormat=dialog->currentMimeFilter(); } @@ -437,10 +437,10 @@ bool KEducaBuilder::fileSaveAs() break; } - if ( QFileInfo( newURL.path() ).extension().isEmpty() ) { + if ( TQFileInfo( newURL.path() ).extension().isEmpty() ) { // No more extensions in filters. We need to get it from the mimetype. KMimeType::Ptr mime = KMimeType::mimeType( outputFormat ); - QString extension = mime->property( "X-KDE-NativeExtension" ).toString(); + TQString extension = mime->property( "X-KDE-NativeExtension" ).toString(); kdDebug() << "KEducaBuilder::slotFileSaveAs outputFormat=" << outputFormat << " extension=" << extension << endl; newURL.setPath( newURL.path() + extension ); } @@ -482,21 +482,21 @@ void KEducaBuilder::slotFilePrint() { KPrinter *printer = new KPrinter(); - QString file = _keducaFile->getCurrentURL().fileName(); + TQString file = _keducaFile->getCurrentURL().fileName(); if (file.isEmpty()) file = i18n("Test"); if(printer->setup(this, i18n("Print %1").arg(file))) { - QPaintDeviceMetrics metrics(printer); - QPainter p; + TQPaintDeviceMetrics metrics(printer); + TQPainter p; const int margin=20; int yPos=0; - QString text; + TQString text; p.begin(printer); - p.setFont( QFont(font().family(), 12, QFont::Bold) ); - QFontMetrics fm = p.fontMetrics(); + p.setFont( TQFont(font().family(), 12, TQFont::Bold) ); + TQFontMetrics fm = p.fontMetrics(); _keducaFile->recordFirst(); while(!_keducaFile->recordEOF()) @@ -533,7 +533,7 @@ bool KEducaBuilder::checkSave() _keducaFile->getHeader("level").isEmpty() || _keducaFile->getHeader("language").isEmpty() ) { - if (KMessageBox::warningContinueCancel(this, i18n("Unable to save file.\n\nYou must complete the Document Info\n(Only the description is necessary)"), QString::null, i18n("Complete Document Info...")) + if (KMessageBox::warningContinueCancel(this, i18n("Unable to save file.\n\nYou must complete the Document Info\n(Only the description is necessary)"), TQString::null, i18n("Complete Document Info...")) == KMessageBox::Continue) { if (slotHeader()!=KControlHeader::Accepted) return false; @@ -544,7 +544,7 @@ bool KEducaBuilder::checkSave() if( _listAnswer->count() < 1 ) { if (KMessageBox::warningContinueCancel(this, i18n("Unable to save file.\n\nYou must insert a question."), - QString::null, i18n("Insert Question"))==KMessageBox::Continue) + TQString::null, i18n("Insert Question"))==KMessageBox::Continue) slotAdd(); else return false; @@ -582,7 +582,7 @@ void KEducaBuilder::initGallery(const KURL &urlFile) if( !urlFile.url().isEmpty() ) galleries.putURL( urlFile ); - if( galleries.exec() == QDialog::Accepted ) + if( galleries.exec() == TQDialog::Accepted ) slotFileOpenURL( galleries.getURL() ); } @@ -593,7 +593,7 @@ void KEducaBuilder::slotGallery() } /** Double click in list, edit question */ -void KEducaBuilder::slotEditbyList(QListBoxItem *item) +void KEducaBuilder::slotEditbyList(TQListBoxItem *item) { if( item ) slotEdit(); diff --git a/keduca/keducabuilder/keducabuilder.h b/keduca/keducabuilder/keducabuilder.h index 74c5eb58..c3a736a7 100644 --- a/keduca/keducabuilder/keducabuilder.h +++ b/keduca/keducabuilder/keducabuilder.h @@ -25,8 +25,8 @@ #include <klistbox.h> #include <kaction.h> -#include <qtextview.h> -#include <qsplitter.h> +#include <tqtextview.h> +#include <tqsplitter.h> /**Main control documents * The Editor. This is the new main window of KEduca. @@ -38,7 +38,7 @@ class KEducaBuilder : public KMainWindow { Q_OBJECT public: - KEducaBuilder(QWidget* parent=0, const char *name=0, WFlags f = WType_TopLevel | WDestructiveClose); + KEducaBuilder(TQWidget* parent=0, const char *name=0, WFlags f = WType_TopLevel | WDestructiveClose); ~KEducaBuilder(); /** start a dialog that asks the user what he wants to do to start*/ bool startChooser(); @@ -79,12 +79,12 @@ private: /** List of answers */ KListBox *_listAnswer; /** Preview */ - QTextView *_preview; + TQTextView *_preview; /** Main splitter */ - QSplitter *_split; + TQSplitter *_split; /** I open a file */ bool _isOpenFile; - QString _nativeFormat; + TQString _nativeFormat; public slots: /** Open new file */ @@ -96,7 +96,7 @@ private slots: /** Open new document. */ void slotFileOpen(); /** Item select */ - void slotPreview( QListBoxItem *item ); + void slotPreview( TQListBoxItem *item ); /** Close the window */ bool queryClose(); /** Edit question */ @@ -120,7 +120,7 @@ private slots: /** Init Gallery */ void slotGallery(); /** Double click in list, edit question */ - void slotEditbyList(QListBoxItem *item); + void slotEditbyList(TQListBoxItem *item); }; #endif diff --git a/keduca/keducabuilder/keducaeditorstartdialog.cpp b/keduca/keducabuilder/keducaeditorstartdialog.cpp index 88cf9305..8528b6ba 100644 --- a/keduca/keducabuilder/keducaeditorstartdialog.cpp +++ b/keduca/keducabuilder/keducaeditorstartdialog.cpp @@ -14,8 +14,8 @@ * (at your option) any later version. * * * ***************************************************************************/ -#include <qradiobutton.h> -#include <qbuttongroup.h> +#include <tqradiobutton.h> +#include <tqbuttongroup.h> #include <kdebug.h> #include <kurlrequester.h> @@ -42,17 +42,17 @@ KEducaEditorStartDialog::KEducaEditorStartDialog(KEducaBuilder * parent, const c // setup connections urlRequester->setFilter( "application/x-edu"); - connect( startChoiceBtnGrp, SIGNAL( clicked(int) ), - this, SLOT( slotChoiceChanged(int) ) ); + connect( startChoiceBtnGrp, TQT_SIGNAL( clicked(int) ), + this, TQT_SLOT( slotChoiceChanged(int) ) ); } /** based on code in kaction.cpp */ void KEducaEditorStartDialog::buildRecentFilesList() { - QString key; - QString value; - QString oldGroup; + TQString key; + TQString value; + TQString oldGroup; KConfig *config = KGlobal::config(); oldGroup = config->group(); @@ -62,8 +62,8 @@ void KEducaEditorStartDialog::buildRecentFilesList() // read file list for( unsigned int i = 1 ; i <= _maxRecentDocumentItems ; i++ ) { - key = QString( "File%1" ).arg( i ); - value = config->readEntry( key, QString::null ); + key = TQString( "File%1" ).arg( i ); + value = config->readEntry( key, TQString::null ); if (!value.isNull()) recentDocumentCB->insertURL( KURL(value) ); diff --git a/keduca/keducabuilder/klangcombo.cpp b/keduca/keducabuilder/klangcombo.cpp index ebedd9dd..1d86c09e 100644 --- a/keduca/keducabuilder/klangcombo.cpp +++ b/keduca/keducabuilder/klangcombo.cpp @@ -31,21 +31,21 @@ KLanguageCombo::~KLanguageCombo () { } -KLanguageCombo::KLanguageCombo (QWidget * parent, const char *name) +KLanguageCombo::KLanguageCombo (TQWidget * parent, const char *name) : KTagComboBox(parent, name) { } -void KLanguageCombo::insertLanguage(const QString& path, const QString& name, const QString& sub, const QString &submenu) +void KLanguageCombo::insertLanguage(const TQString& path, const TQString& name, const TQString& sub, const TQString &submenu) { - QString output = name + QString::fromLatin1(" (") + path + QString::fromLatin1(")"); - QPixmap flag(locate("locale", sub + path + QString::fromLatin1("/flag.png"))); - insertItem(QIconSet(flag), output, path, submenu); + TQString output = name + TQString::fromLatin1(" (") + path + TQString::fromLatin1(")"); + TQPixmap flag(locate("locale", sub + path + TQString::fromLatin1("/flag.png"))); + insertItem(TQIconSet(flag), output, path, submenu); } -void KLanguageCombo::changeLanguage(const QString& name, int i) +void KLanguageCombo::changeLanguage(const TQString& name, int i) { if (i < 0 || i >= count()) return; - QString output = name + QString::fromLatin1(" (") + tag(i) + QString::fromLatin1(")"); + TQString output = name + TQString::fromLatin1(" (") + tag(i) + TQString::fromLatin1(")"); changeItem(output, i); } diff --git a/keduca/keducabuilder/klangcombo.h b/keduca/keducabuilder/klangcombo.h index 4c9fb801..2aca5753 100644 --- a/keduca/keducabuilder/klangcombo.h +++ b/keduca/keducabuilder/klangcombo.h @@ -37,11 +37,11 @@ class KLanguageCombo : public KTagComboBox Q_OBJECT public: - KLanguageCombo(QWidget *parent=0, const char *name=0); + KLanguageCombo(TQWidget *parent=0, const char *name=0); ~KLanguageCombo(); - void insertLanguage(const QString& path, const QString& name, const QString& sub = QString::null, const QString &submenu = QString::null); - void changeLanguage(const QString& name, int i); + void insertLanguage(const TQString& path, const TQString& name, const TQString& sub = TQString::null, const TQString &submenu = TQString::null); + void changeLanguage(const TQString& name, int i); }; #endif diff --git a/keduca/keducabuilder/ktagcombobox.cpp b/keduca/keducabuilder/ktagcombobox.cpp index 9b7e969e..6d8951ec 100644 --- a/keduca/keducabuilder/ktagcombobox.cpp +++ b/keduca/keducabuilder/ktagcombobox.cpp @@ -22,8 +22,8 @@ */ #define INCLUDE_MENUITEM_DEF 1 -#include <qpainter.h> -#include <qpopupmenu.h> +#include <tqpainter.h> +#include <tqpopupmenu.h> #include <kdebug.h> @@ -36,23 +36,23 @@ KTagComboBox::~KTagComboBox () delete _tags; } -KTagComboBox::KTagComboBox (QWidget * parent, const char *name) - : QComboBox(parent, name) +KTagComboBox::KTagComboBox (TQWidget * parent, const char *name) + : TQComboBox(parent, name) { - _popup = new QPopupMenu(this); + _popup = new TQPopupMenu(this); _tags = new QStringList; - connect( _popup, SIGNAL(activated(int)), - SLOT(internalActivate(int)) ); - connect( _popup, SIGNAL(highlighted(int)), - SLOT(internalHighlight(int)) ); + connect( _popup, TQT_SIGNAL(activated(int)), + TQT_SLOT(internalActivate(int)) ); + connect( _popup, TQT_SIGNAL(highlighted(int)), + TQT_SLOT(internalHighlight(int)) ); } void KTagComboBox::popupMenu() { - _popup->popup( mapToGlobal( QPoint(0,0) ), _current ); + _popup->popup( mapToGlobal( TQPoint(0,0) ), _current ); } -void KTagComboBox::keyPressEvent( QKeyEvent *e ) +void KTagComboBox::keyPressEvent( TQKeyEvent *e ) { int c; @@ -74,7 +74,7 @@ void KTagComboBox::keyPressEvent( QKeyEvent *e ) emit activated( c ); } -void KTagComboBox::mousePressEvent( QMouseEvent * ) +void KTagComboBox::mousePressEvent( TQMouseEvent * ) { popupMenu(); } @@ -103,14 +103,14 @@ int KTagComboBox::count() const return _tags->count(); } -static inline QPopupMenu *checkInsertIndex(QPopupMenu *popup, const QStringList *tags, const QString &submenu, int *index) +static inline TQPopupMenu *checkInsertIndex(TQPopupMenu *popup, const TQStringList *tags, const TQString &submenu, int *index) { int pos = tags->findIndex(submenu); - QPopupMenu *pi = 0; + TQPopupMenu *pi = 0; if (pos != -1) { - QMenuItem *p = popup->findItem(popup->idAt(pos)); + TQMenuItem *p = popup->findItem(popup->idAt(pos)); pi = p?p->popup():0; } if (!pi) pi = popup; @@ -121,82 +121,82 @@ static inline QPopupMenu *checkInsertIndex(QPopupMenu *popup, const QStringList return pi; } -void KTagComboBox::insertItem(const QIconSet& icon, const QString &text, const QString &tag, const QString &submenu, int index ) +void KTagComboBox::insertItem(const TQIconSet& icon, const TQString &text, const TQString &tag, const TQString &submenu, int index ) { - QPopupMenu *pi = checkInsertIndex(_popup, _tags, submenu, &index); + TQPopupMenu *pi = checkInsertIndex(_popup, _tags, submenu, &index); pi->insertItem(icon, text, count(), index); _tags->append(tag); } -void KTagComboBox::insertItem(const QString &text, const QString &tag, const QString &submenu, int index ) +void KTagComboBox::insertItem(const TQString &text, const TQString &tag, const TQString &submenu, int index ) { - QPopupMenu *pi = checkInsertIndex(_popup, _tags, submenu, &index); + TQPopupMenu *pi = checkInsertIndex(_popup, _tags, submenu, &index); pi->insertItem(text, count(), index); _tags->append(tag); } -void KTagComboBox::insertSeparator(const QString &submenu, int index) +void KTagComboBox::insertSeparator(const TQString &submenu, int index) { - QPopupMenu *pi = checkInsertIndex(_popup, _tags, submenu, &index); + TQPopupMenu *pi = checkInsertIndex(_popup, _tags, submenu, &index); pi->insertSeparator(index); - _tags->append(QString::null); + _tags->append(TQString::null); } -void KTagComboBox::insertSubmenu(const QString &text, const QString &tag, const QString &submenu, int index) +void KTagComboBox::insertSubmenu(const TQString &text, const TQString &tag, const TQString &submenu, int index) { - QPopupMenu *pi = checkInsertIndex(_popup, _tags, submenu, &index); - QPopupMenu *p = new QPopupMenu(pi); + TQPopupMenu *pi = checkInsertIndex(_popup, _tags, submenu, &index); + TQPopupMenu *p = new TQPopupMenu(pi); pi->insertItem(text, p, count(), index); _tags->append(tag); - connect( p, SIGNAL(activated(int)), - SLOT(internalActivate(int)) ); - connect( p, SIGNAL(highlighted(int)), - SLOT(internalHighlight(int)) ); + connect( p, TQT_SIGNAL(activated(int)), + TQT_SLOT(internalActivate(int)) ); + connect( p, TQT_SIGNAL(highlighted(int)), + TQT_SLOT(internalHighlight(int)) ); } -void KTagComboBox::changeItem( const QString &text, int index ) +void KTagComboBox::changeItem( const TQString &text, int index ) { _popup->changeItem( text, index); if (index == _current) repaint(); } -void KTagComboBox::paintEvent( QPaintEvent * ev) +void KTagComboBox::paintEvent( TQPaintEvent * ev) { - QComboBox::paintEvent(ev); + TQComboBox::paintEvent(ev); - QPainter p (this); + TQPainter p (this); // Text - QRect clip(2, 2, width() - 4, height() - 4); + TQRect clip(2, 2, width() - 4, height() - 4); if ( hasFocus()) p.setPen( colorGroup().highlightedText() ); p.drawText(clip, AlignCenter | SingleLine, _popup->text( _current )); // Icon - QIconSet *icon = _popup->iconSet( _current ); + TQIconSet *icon = _popup->iconSet( _current ); if (icon) { - QPixmap pm = icon->pixmap(); + TQPixmap pm = icon->pixmap(); p.drawPixmap( 4, (height()-pm.height())/2, pm ); } } -bool KTagComboBox::containsTag( const QString &str ) const +bool KTagComboBox::containsTag( const TQString &str ) const { return _tags->contains(str) > 0; } -QString KTagComboBox::currentTag() const +TQString KTagComboBox::currentTag() const { return *_tags->at(currentItem()); } -QString KTagComboBox::tag(int i) const +TQString KTagComboBox::tag(int i) const { if (i < 0 || i >= count()) { kdDebug() << "KTagComboBox::tag(), unknown tag " << i << endl; - return QString::null; + return TQString::null; } return *_tags->at(i); } @@ -213,7 +213,7 @@ void KTagComboBox::setCurrentItem(int i) repaint(); } -void KTagComboBox::setCurrentItem(const QString &code) +void KTagComboBox::setCurrentItem(const TQString &code) { int i = _tags->findIndex(code); if (code.isNull()) @@ -222,8 +222,8 @@ void KTagComboBox::setCurrentItem(const QString &code) setCurrentItem(i); } -void KTagComboBox::setFont( const QFont &font ) +void KTagComboBox::setFont( const TQFont &font ) { - QComboBox::setFont( font ); + TQComboBox::setFont( font ); _popup->setFont( font ); } diff --git a/keduca/keducabuilder/ktagcombobox.h b/keduca/keducabuilder/ktagcombobox.h index 099c6561..1644d6a7 100644 --- a/keduca/keducabuilder/ktagcombobox.h +++ b/keduca/keducabuilder/ktagcombobox.h @@ -25,14 +25,14 @@ #ifndef __KTAGCOMBOBOX_H__ #define __KTAGCOMBOBOX_H__ -#include <qcombobox.h> -#include <qiconset.h> +#include <tqcombobox.h> +#include <tqiconset.h> class QPopupMenu; class QStringList; /* * This class should be just like qcombobox, but it should be possible - * to have have a QIconSet for each entry, and each entry should have a tag. + * to have have a TQIconSet for each entry, and each entry should have a tag. * * It has also support for sub menues. */ @@ -41,14 +41,14 @@ class KTagComboBox : public QComboBox Q_OBJECT public: - KTagComboBox(QWidget *parent=0, const char *name=0); + KTagComboBox(TQWidget *parent=0, const char *name=0); ~KTagComboBox(); - void insertItem(const QIconSet& icon, const QString &text, const QString &tag, const QString &submenu = QString::null, int index=-1 ); - void insertItem(const QString &text, const QString &tag, const QString &submenu = QString::null, int index=-1 ); - void insertSeparator(const QString &submenu = QString::null, int index=-1 ); - void insertSubmenu(const QString &text, const QString &tag, const QString &submenu = QString::null, int index=-1); - void changeItem( const QString &text, int index ); + void insertItem(const TQIconSet& icon, const TQString &text, const TQString &tag, const TQString &submenu = TQString::null, int index=-1 ); + void insertItem(const TQString &text, const TQString &tag, const TQString &submenu = TQString::null, int index=-1 ); + void insertSeparator(const TQString &submenu = TQString::null, int index=-1 ); + void insertSubmenu(const TQString &text, const TQString &tag, const TQString &submenu = TQString::null, int index=-1); + void changeItem( const TQString &text, int index ); int count() const; void clear(); @@ -56,19 +56,19 @@ public: /* * Tag of the selected item */ - QString currentTag() const; - QString tag ( int i ) const; - bool containsTag (const QString &str ) const; + TQString currentTag() const; + TQString tag ( int i ) const; + bool containsTag (const TQString &str ) const; /* * Set the current item */ int currentItem() const; void setCurrentItem(int i); - void setCurrentItem(const QString &code); + void setCurrentItem(const TQString &code); // widget stuff - virtual void setFont( const QFont & ); + virtual void setFont( const TQFont & ); signals: void activated( int index ); @@ -79,15 +79,15 @@ private slots: void internalHighlight( int ); protected: - void paintEvent( QPaintEvent * ); - void mousePressEvent( QMouseEvent * ); - void keyPressEvent( QKeyEvent *e ); + void paintEvent( TQPaintEvent * ); + void mousePressEvent( TQMouseEvent * ); + void keyPressEvent( TQKeyEvent *e ); void popupMenu(); private: // work space for the new class - QStringList *_tags; - QPopupMenu *_popup; + TQStringList *_tags; + TQPopupMenu *_popup; int _current; }; diff --git a/keduca/keducabuilder/main.cpp b/keduca/keducabuilder/main.cpp index 93a49cdf..00032f08 100644 --- a/keduca/keducabuilder/main.cpp +++ b/keduca/keducabuilder/main.cpp @@ -20,7 +20,7 @@ #include <kaboutdata.h> #include <kdebug.h> -#include <qfileinfo.h> +#include <tqfileinfo.h> #include "keducabuilder.h" static const char description[] = I18N_NOOP("Form-based tests and exams builder"); @@ -53,7 +53,7 @@ int main(int argc, char *argv[]) keducaEditor->show(); if ( args->count() > 0 ){ - if( QFileInfo( KURL(args->url(0)).url() ).extension() == "edugallery" ) + if( TQFileInfo( KURL(args->url(0)).url() ).extension() == "edugallery" ) keducaEditor->initGallery( args->url(0) ); else keducaEditor->slotFileOpenURL( args->url(0) ); diff --git a/keduca/libkeduca/fileread.cpp b/keduca/libkeduca/fileread.cpp index db8f56cb..7632b6fd 100644 --- a/keduca/libkeduca/fileread.cpp +++ b/keduca/libkeduca/fileread.cpp @@ -25,12 +25,12 @@ #include <kdebug.h> #include <ktempfile.h> -#include <qfileinfo.h> -#include <qpixmap.h> -#include <qbuffer.h> +#include <tqfileinfo.h> +#include <tqpixmap.h> +#include <tqbuffer.h> -FileRead::FileRead( QObject *parent, const char *name ) - :QObject(parent, name), +FileRead::FileRead( TQObject *parent, const char *name ) + :TQObject(parent, name), _changed(false), _tmpfile(0) { @@ -41,7 +41,7 @@ FileRead::~FileRead() } bool FileRead::openFile(const KURL &url) { - QString tmpFile; + TQString tmpFile; bool returnval=false; if( KIO::NetAccess::download( url, tmpFile, 0 ) ) { @@ -58,15 +58,15 @@ bool FileRead::openFile(const KURL &url) { return returnval; } -bool FileRead::loadFile(const QString &filename) +bool FileRead::loadFile(const TQString &filename) { - QDomDocument doc("document.xml"); + TQDomDocument doc("document.xml"); KMimeType::Ptr type = KMimeType::findByFileContent(filename); kdDebug() << "FileRead::loadFile(): MIME-Type is " << type->name() << endl; - QFile file(filename); + TQFile file(filename); if(!file.open(IO_ReadOnly)) { @@ -82,26 +82,26 @@ bool FileRead::loadFile(const QString &filename) doc.setContent(qUncompress(file.readAll())); } - QDomElement docElem = doc.documentElement(); + TQDomElement docElem = doc.documentElement(); if( (doc.doctype().isNull()) || (doc.doctype().name() != "educa") ) { file.close(); return false; } - QDomNode n = docElem.firstChild(); + TQDomNode n = docElem.firstChild(); - QDomNodeList dnList = n.childNodes(); + TQDomNodeList dnList = n.childNodes(); for( unsigned int i = 0; i < dnList.count(); ++i) { // ------------------- INFORMATION BODY ----------------------- - QDomElement element = dnList.item(i).toElement(); + TQDomElement element = dnList.item(i).toElement(); if( element.tagName() == "default" || element.tagName() == "author" ) { if( element.tagName() == "default" ) { _header.insert( "image", element.attribute( "image", "default.png" ) ); } if( element.tagName() == "author" ) { - QDomNodeList AuthordnList = element.childNodes(); + TQDomNodeList AuthordnList = element.childNodes(); for( unsigned int i = 0; i < AuthordnList.count(); ++i) { - QDomElement authorelement = AuthordnList.item(i).toElement(); + TQDomElement authorelement = AuthordnList.item(i).toElement(); _header.insert( authorelement.tagName(), authorelement.text() ); } } @@ -117,17 +117,17 @@ bool FileRead::loadFile(const QString &filename) { insertQuestion(); // --------------------- QUESTION ATTRIBUTE------------------------ - QDomElement elementNODE = dnList.item(i).toElement(); + TQDomElement elementNODE = dnList.item(i).toElement(); setQuestion( QF_TYPE, elementNODE.attribute( "type", "1" ).toInt() ); setQuestion( QF_PICTURE, elementNODE.attribute( "image", "" ) ); setQuestion( QF_TIME, elementNODE.attribute( "time", "0" ).toInt() ); setQuestion( QF_POINTS, elementNODE.attribute( "points", "0" ).toInt() ); - QDomNodeList quList = elementNODE.childNodes(); + TQDomNodeList quList = elementNODE.childNodes(); for( unsigned int x = 0; x < quList.count(); ++x) { // --------------------- QUESTION AND RESPONSES------------------ - QDomElement element = quList.item(x).toElement(); + TQDomElement element = quList.item(x).toElement(); if( element.tagName() == "text" ) setQuestion( QF_TEXT, element.text() ); if( element.tagName() == "true" ) setAnswer( element.text(), true, element.attribute( "points", "0" ).toInt() ); if( element.tagName() == "false" ) setAnswer( element.text(), false,element.attribute( "points", "0" ).toInt() ); @@ -146,7 +146,7 @@ bool FileRead::loadFile(const QString &filename) { insertResult(); // --------------------- QUESTION ATTRIBUTE------------------------ - QDomElement elementNODE = dnList.item(i).toElement(); + TQDomElement elementNODE = dnList.item(i).toElement(); setResult( RS_TEXT, elementNODE.text() ); setResult( RS_PICTURE, elementNODE.attribute( "image", "" ) ); setResult( RS_MIN, elementNODE.attribute( "min", "0" ).toInt() ); @@ -162,7 +162,7 @@ bool FileRead::loadFile(const QString &filename) return true; } -void FileRead::setQuestion( QuestionField field, const QString& text) +void FileRead::setQuestion( QuestionField field, const TQString& text) { // QF_text, QF_picture, QF_type, QF_time, QF_tip, QF_explain switch( field ) @@ -180,7 +180,7 @@ void FileRead::setQuestion( QuestionField field, const QString& text) (*_recordQuestions).explain = text; break; default: - kdDebug()<<"FileRead::setQuestion(QuestionField field, QString text) called for not handled field value "<<field <<endl; + kdDebug()<<"FileRead::setQuestion(QuestionField field, TQString text) called for not handled field value "<<field <<endl; break; } _changed=true; @@ -206,7 +206,7 @@ void FileRead::setQuestion( QuestionField field, int value ) _changed=true; } -void FileRead::setResult( ResultField field, const QString& text) +void FileRead::setResult( ResultField field, const TQString& text) { // RS_text, QF_picture switch( field ) @@ -218,7 +218,7 @@ void FileRead::setResult( ResultField field, const QString& text) (*_recordResults).picture = text; break; default: - kdDebug()<<"FileRead::setResult(ResultField field, QString text) called for not handled field value "<<field <<endl; + kdDebug()<<"FileRead::setResult(ResultField field, TQString text) called for not handled field value "<<field <<endl; break; } _changed=true; @@ -241,7 +241,7 @@ void FileRead::setResult( ResultField field, int value ) _changed=true; } -void FileRead::setAnswer( const QString& text, bool value, int points) +void FileRead::setAnswer( const TQString& text, bool value, int points) { Answers tmpAnswers; @@ -405,7 +405,7 @@ unsigned int FileRead::recordAnswerCount() return (*_recordQuestions).listAnswers.count(); } -QString FileRead::getQuestion( QuestionField field ) +TQString FileRead::getQuestion( QuestionField field ) { // QF_text, QF_picture, QF_type, QF_time, QF_tip, QF_explain switch( field ) @@ -418,10 +418,10 @@ QString FileRead::getQuestion( QuestionField field ) return( (*_recordQuestions).picture ); break; case QF_POINTS: - return QString().setNum( (*_recordQuestions).points ); + return TQString().setNum( (*_recordQuestions).points ); break; case QF_TIME: - return QString().setNum( (*_recordQuestions).time ); + return TQString().setNum( (*_recordQuestions).time ); break; case QF_TIP: return (*_recordQuestions).tip; @@ -455,7 +455,7 @@ int FileRead::getQuestionInt( QuestionField field ) } } -QString FileRead::getAnswer( AnswerField field ) +TQString FileRead::getAnswer( AnswerField field ) { // AField { AF_text, AF_value, AF_picture, AF_point }; switch( field ) @@ -467,7 +467,7 @@ QString FileRead::getAnswer( AnswerField field ) // (*(*_recordQuestions).RecordAnswers).Value ? return i18n("True") : return i18n("False"); // break; case AF_POINT: - return QString().setNum( (*(*_recordQuestions).recordAnswers).points ); + return TQString().setNum( (*(*_recordQuestions).recordAnswers).points ); break; default: kdDebug()<<"FileRead::getAnswer() called for not handled field value "<<field <<endl; @@ -485,7 +485,7 @@ int FileRead::getAnswerPoints() return (*(*_recordQuestions).recordAnswers).points; } -QString FileRead::getResult( ResultField field ) +TQString FileRead::getResult( ResultField field ) { switch( field ) { @@ -496,10 +496,10 @@ QString FileRead::getResult( ResultField field ) return( (*_recordResults).picture ); break; case RS_MIN: - return QString().setNum( (*_recordResults).min ); + return TQString().setNum( (*_recordResults).min ); break; case RS_MAX: - return QString().setNum( (*_recordResults).max ); + return TQString().setNum( (*_recordResults).max ); break; default: kdDebug()<<"FileRead::getResult() called for not handled field value "<<field <<endl; @@ -555,9 +555,9 @@ bool FileRead::recordAnswerBOF() return _fileAnswerBOF; } -QString FileRead::getPicture() +TQString FileRead::getPicture() { - QString picture; + TQString picture; if( !getQuestion(QF_PICTURE).isEmpty() ) picture = getQuestion(QF_PICTURE); @@ -568,7 +568,7 @@ QString FileRead::getPicture() if( _currentURL.isLocalFile() && !KURL(picture).isValid() ) { - if( !QFileInfo(picture).exists() ) + if( !TQFileInfo(picture).exists() ) picture = _currentURL.directory(false,true) + picture; } else if( !_currentURL.isLocalFile() && !KURL(picture).isValid() ) picture = _currentURL.protocol() + "://" + _currentURL.host() + _currentURL.directory(false,true) + picture; @@ -578,16 +578,16 @@ QString FileRead::getPicture() return picture; } -QPixmap FileRead::getPicturePixmap() +TQPixmap FileRead::getPicturePixmap() { KURL picture ( getPicture() ); - QPixmap pict; + TQPixmap pict; if( KIO::NetAccess::download( picture, _tmpfileImage, 0 ) ) { kdDebug()<<"... load successful: "<< _tmpfileImage <<endl; - pict = QPixmap( _tmpfileImage ); + pict = TQPixmap( _tmpfileImage ); KIO::NetAccess::removeTempFile( _tmpfileImage ); } else @@ -670,7 +670,7 @@ bool FileRead::saveFile( const KURL &url, bool copyimages, bool saveCompressed ) if( saveFile(_tmpfile->name(), copyimages, saveCompressed) ) { // upload the file KIO::Job * job = KIO::file_copy( KURL::fromPathOrURL( _tmpfile->name() ), _currentURL, -1, true /*overwrite*/ ); - connect( job, SIGNAL( result( KIO::Job * ) ), this, SLOT( slotUploadFinished (KIO::Job *) ) ); + connect( job, TQT_SIGNAL( result( KIO::Job * ) ), this, TQT_SLOT( slotUploadFinished (KIO::Job *) ) ); return true; } } @@ -679,15 +679,15 @@ bool FileRead::saveFile( const KURL &url, bool copyimages, bool saveCompressed ) return false; } -bool FileRead::saveFile( const QString &filename, bool copyimages, bool saveCompressed ) +bool FileRead::saveFile( const TQString &filename, bool copyimages, bool saveCompressed ) { - QDomDocument doc("document.xml"); - QTextStream stream; - QString line; - QByteArray data; - QBuffer buffer(data); - QFile file(filename); - QStringList copyJOB; + TQDomDocument doc("document.xml"); + TQTextStream stream; + TQString line; + TQByteArray data; + TQBuffer buffer(data); + TQFile file(filename); + TQStringList copyJOB; stream.setDevice(&buffer); @@ -705,13 +705,13 @@ bool FileRead::saveFile( const QString &filename, bool copyimages, bool saveComp } */ - QString head( "<?xml version='1.0' encoding='UTF-8' standalone='yes' ?><!DOCTYPE educa>" ); + TQString head( "<?xml version='1.0' encoding='UTF-8' standalone='yes' ?><!DOCTYPE educa>" ); doc.setContent( head ); - QDomElement Root = doc.createElement("Document"); + TQDomElement Root = doc.createElement("Document"); doc.appendChild( Root ); - QDomElement NodeInfo = doc.createElement("Info"); + TQDomElement NodeInfo = doc.createElement("Info"); Root.appendChild( NodeInfo ); insertXML( doc, NodeInfo, "title", _header["title"] ); @@ -722,12 +722,12 @@ bool FileRead::saveFile( const QString &filename, bool copyimages, bool saveComp if( !(_header["image"]).isEmpty() ) { - QDomElement Nodedefault = doc.createElement("default"); + TQDomElement Nodedefault = doc.createElement("default"); if( copyimages ) { copyJOB.append( _header["image"] ); - Nodedefault.setAttribute( "image", QFileInfo(_header["image"]).fileName() ); + Nodedefault.setAttribute( "image", TQFileInfo(_header["image"]).fileName() ); } else { Nodedefault.setAttribute( "image", _header["image"]); } @@ -736,26 +736,26 @@ bool FileRead::saveFile( const QString &filename, bool copyimages, bool saveComp if( !_header["name"].isEmpty() || !_header["email"].isEmpty() || !_header["www"].isEmpty() ) { - QDomElement Nodeauthor = doc.createElement("author"); + TQDomElement Nodeauthor = doc.createElement("author"); NodeInfo.appendChild( Nodeauthor ); if( !_header["name"].isEmpty() ) insertXML( doc, Nodeauthor, "name", _header["name"] ); if( !_header["email"].isEmpty() ) insertXML( doc, Nodeauthor, "email", _header["email"] ); if( !_header["www"].isEmpty() ) insertXML( doc, Nodeauthor, "www", _header["www"] ); } - QDomElement NodeData = doc.createElement("Data"); + TQDomElement NodeData = doc.createElement("Data"); Root.appendChild( NodeData ); recordFirst(); while ( !recordEOF() ) { - QDomElement question = doc.createElement("question"); + TQDomElement question = doc.createElement("question"); if( !getQuestion( QF_PICTURE ).isEmpty() ) { if( copyimages ) { copyJOB.append( getQuestion( QF_PICTURE ) ); - question.setAttribute("image", QFileInfo( getQuestion( QF_PICTURE ) ).fileName() ); + question.setAttribute("image", TQFileInfo( getQuestion( QF_PICTURE ) ).fileName() ); } else { question.setAttribute("image", getQuestion( QF_PICTURE ) ); } @@ -770,16 +770,16 @@ bool FileRead::saveFile( const QString &filename, bool copyimages, bool saveComp { if( getAnswerValue() ) { - QDomElement domELEMENT = doc.createElement( "true" ); + TQDomElement domELEMENT = doc.createElement( "true" ); if( getAnswerPoints() > 0 ) domELEMENT.setAttribute("points", getAnswerPoints() ); - QDomText DATAelement = doc.createTextNode( getAnswer( AF_TEXT ) ); + TQDomText DATAelement = doc.createTextNode( getAnswer( AF_TEXT ) ); question.appendChild( domELEMENT ); domELEMENT.appendChild( DATAelement ); } else { // insertXML( doc, question, "false", getAnswer( AF_text ) ); - QDomElement domELEMENT = doc.createElement( "false" ); + TQDomElement domELEMENT = doc.createElement( "false" ); if( getAnswerPoints() > 0 ) domELEMENT.setAttribute("points", getAnswerPoints() ); - QDomText DATAelement = doc.createTextNode( getAnswer( AF_TEXT ) ); + TQDomText DATAelement = doc.createTextNode( getAnswer( AF_TEXT ) ); question.appendChild( domELEMENT ); domELEMENT.appendChild( DATAelement ); } @@ -814,7 +814,7 @@ bool FileRead::saveFile( const QString &filename, bool copyimages, bool saveComp } /** Save results */ -bool FileRead::saveResults( const KURL &url, const QString &results ) +bool FileRead::saveResults( const KURL &url, const TQString &results ) { if (url.isValid()) { @@ -847,7 +847,7 @@ bool FileRead::saveResults( const KURL &url, const QString &results ) if( saveResults(_tmpfile->name(), results) ) { // upload the file KIO::Job * job = KIO::file_copy( KURL::fromPathOrURL( _tmpfile->name() ), _currentURL, -1, true /*overwrite*/ ); - connect( job, SIGNAL( result( KIO::Job * ) ), this, SLOT( slotUploadFinished (KIO::Job *) ) ); + connect( job, TQT_SIGNAL( result( KIO::Job * ) ), this, TQT_SLOT( slotUploadFinished (KIO::Job *) ) ); return true; } } @@ -856,11 +856,11 @@ bool FileRead::saveResults( const KURL &url, const QString &results ) return false; } -bool FileRead::saveResults( const QString &filename, const QString &results ) +bool FileRead::saveResults( const TQString &filename, const TQString &results ) { - QTextStream stream; - QFile file(filename); - QStringList copyJOB; + TQTextStream stream; + TQFile file(filename); + TQStringList copyJOB; stream.setDevice(&file); @@ -875,30 +875,30 @@ bool FileRead::saveResults( const QString &filename, const QString &results ) } /** Insert xml format data */ -void FileRead::insertXML( QDomDocument &doc, QDomElement &parent, const QString &tagName, const QString &data) +void FileRead::insertXML( TQDomDocument &doc, TQDomElement &parent, const TQString &tagName, const TQString &data) { - QDomElement domELEMENT = doc.createElement( tagName ); - QDomText DATAelement = doc.createTextNode( data ); + TQDomElement domELEMENT = doc.createElement( tagName ); + TQDomText DATAelement = doc.createTextNode( data ); parent.appendChild( domELEMENT ); domELEMENT.appendChild( DATAelement ); } /** Insert xml data format */ -void FileRead::insertXML( QDomDocument &doc, QDomElement &parent, const QString &data) +void FileRead::insertXML( TQDomDocument &doc, TQDomElement &parent, const TQString &data) { - QDomText DATAelement = doc.createTextNode( data ); + TQDomText DATAelement = doc.createTextNode( data ); parent.appendChild( DATAelement ); } /** Get Header */ -QString FileRead::getHeader(const QString &head) +TQString FileRead::getHeader(const TQString &head) { return _header[head]; } /** Set header data */ -void FileRead::setHeader( const QString field, const QString value) +void FileRead::setHeader( const TQString field, const TQString value) { _changed = _header[field]!=value; diff --git a/keduca/libkeduca/fileread.h b/keduca/libkeduca/fileread.h index 3dc82a0b..679d2cc5 100644 --- a/keduca/libkeduca/fileread.h +++ b/keduca/libkeduca/fileread.h @@ -20,7 +20,7 @@ #include <kio/job.h> -#include <qdom.h> +#include <tqdom.h> // forward declarations class KTempFile; @@ -32,11 +32,11 @@ class QFile; *@author Klas Kalass */ -class FileRead : public QObject { +class FileRead : public TQObject { Q_OBJECT public: - FileRead( QObject *parent=0, const char *name=0 ); + FileRead( TQObject *parent=0, const char *name=0 ); virtual ~FileRead(); enum QuestionField { QF_TEXT, QF_PICTURE, QF_POINTS, QF_TYPE, QF_TIME, QF_TIP, QF_EXPLAIN }; enum AnswerField { AF_TEXT, AF_VALUE, AF_POINT }; @@ -45,15 +45,15 @@ public: /** Open keduca file. This function can open a remote or local url. */ bool openFile( const KURL &url ); /** Set value to questions fields */ - void setQuestion( QuestionField field, const QString& text); + void setQuestion( QuestionField field, const TQString& text); /** Set value to questions fields */ void setQuestion( QuestionField field, int value ); /** Set value to results fields */ - void setResult( ResultField field, const QString& text); + void setResult( ResultField field, const TQString& text); /** Set value to results fields */ void setResult( ResultField field, int value ); /** Insert an answer field */ - void setAnswer( const QString& text, bool value, int points=0); + void setAnswer( const TQString& text, bool value, int points=0); /** Go to the Last Record */ void recordLast(); /** Go to the First record */ @@ -87,17 +87,17 @@ public: /** Record answer count */ unsigned int recordAnswerCount(); /** Get the value of the field question */ - QString getQuestion( QuestionField field ); + TQString getQuestion( QuestionField field ); /** Get the value of the field questions in integer */ int getQuestionInt( QuestionField field ); /** Get Answer field */ - QString getAnswer( AnswerField field ); + TQString getAnswer( AnswerField field ); /** Get answer field */ int getAnswerPoints(); /** Get Answer field */ bool getAnswerValue(); /** Get the value of the field result */ - QString getResult( ResultField field ); + TQString getResult( ResultField field ); /** Get the value of the field result */ int getResultInt( ResultField field ); /** Returns if this record is a begin of file */ @@ -121,15 +121,15 @@ public: /** Save file */ bool saveFile( const KURL &url = KURL(), bool copyimages = false, bool saveCompressed = true ); /** Save results */ - bool saveResults( const KURL &url, const QString &results ); + bool saveResults( const KURL &url, const TQString &results ); /** Get real picture */ - QString getPicture(); + TQString getPicture(); /** Get real picture */ - QPixmap getPicturePixmap(); + TQPixmap getPicturePixmap(); /** Set header data */ - void setHeader( const QString field, const QString value); + void setHeader( const TQString field, const TQString value); /** Get Header */ - QString getHeader(const QString &head); + TQString getHeader(const TQString &head); /** is Multi Answer */ bool isMultiAnswer(); /** is Result */ @@ -153,42 +153,42 @@ private: bool _changed; /** List of General Variables of the header */ - QMap<QString,QString> _header; + TQMap<TQString,TQString> _header; struct Answers { - QString text; + TQString text; bool value; int points; }; struct Results { - QString text; - QString picture; + TQString text; + TQString picture; int min; int max; }; struct Questions { - QString text; + TQString text; int type; - QString picture; + TQString picture; int time; int points; - QString tip; - QString explain; - QValueList<Answers> listAnswers; - QValueListIterator<Answers> recordAnswers; + TQString tip; + TQString explain; + TQValueList<Answers> listAnswers; + TQValueListIterator<Answers> recordAnswers; }; /** List to Data struct */ - QValueList<Questions> _listQuestions; - QValueListIterator<Questions> _recordQuestions; + TQValueList<Questions> _listQuestions; + TQValueListIterator<Questions> _recordQuestions; - QValueList<Results> _listResults; - QValueListIterator<Results> _recordResults; + TQValueList<Results> _listResults; + TQValueListIterator<Results> _recordResults; /** Returns if the database finds End Of File */ bool _fileEOF; @@ -207,7 +207,7 @@ private: /** the temporary file to which the document is saved, NULL if no temporary file is needed */ KTempFile *_tmpfile; /** the temporary image file */ - QString _tmpfileImage; + TQString _tmpfileImage; /** Total Questions */ uint _totalQuestions; /** Total Time */ @@ -218,17 +218,17 @@ private: // Private methods /** Insert xml format data */ - void insertXML( QDomDocument &doc, QDomElement &parent, const QString &tagName, const QString &data); + void insertXML( TQDomDocument &doc, TQDomElement &parent, const TQString &tagName, const TQString &data); /** Insert xml data format */ - void insertXML( QDomDocument &doc, QDomElement &parent, const QString &data); + void insertXML( TQDomDocument &doc, TQDomElement &parent, const TQString &data); protected: /** Open keduca file. This function does the actual work and expects a local filename . */ - bool loadFile( const QString &filename ); + bool loadFile( const TQString &filename ); /** Save KEduca file to the file*/ - bool saveFile( const QString &filename, bool copyimages, bool saveCompressed = true ); + bool saveFile( const TQString &filename, bool copyimages, bool saveCompressed = true ); /** Save Results file to the file */ - bool saveResults( const QString &filename, const QString &results ); + bool saveResults( const TQString &filename, const TQString &results ); protected slots: void slotUploadFinished( KIO::Job * job ); @@ -261,13 +261,13 @@ signals: /** * Emit this if loading is canceled by the user or by an error. **/ - void canceled( const QString &errMsg ); + void canceled( const TQString &errMsg ); /** * Emitted by the part, to set the caption of the window(s) * hosting this part */ - void setWindowCaption( const QString & caption ); + void setWindowCaption( const TQString & caption ); }; diff --git a/keduca/libkeduca/kgallerydialog.cpp b/keduca/libkeduca/kgallerydialog.cpp index 0ab2d126..b1ec43e2 100644 --- a/keduca/libkeduca/kgallerydialog.cpp +++ b/keduca/libkeduca/kgallerydialog.cpp @@ -24,13 +24,13 @@ #include <kmessagebox.h> #include <kio/netaccess.h> -#include <qlineedit.h> -#include <qlistview.h> -#include <qsplitter.h> -#include <qdom.h> -#include <qfileinfo.h> +#include <tqlineedit.h> +#include <tqlistview.h> +#include <tqsplitter.h> +#include <tqdom.h> +#include <tqfileinfo.h> -KGalleryDialog::KGalleryDialog(QWidget *parent, const char *name ) +KGalleryDialog::KGalleryDialog(TQWidget *parent, const char *name ) :KGalleryDialogBase(parent,name) { configRead(); @@ -42,7 +42,7 @@ KGalleryDialog::~KGalleryDialog() /** Open keduca file. This function can open a remote or local url. */ bool KGalleryDialog::openFile(const KURL &url) { - QString tmpFile; + TQString tmpFile; bool returnval=false; if( KIO::NetAccess::download( url, tmpFile, this ) ) { @@ -59,11 +59,11 @@ bool KGalleryDialog::openFile(const KURL &url) { return returnval; } -bool KGalleryDialog::loadFile( const QString &filename ) +bool KGalleryDialog::loadFile( const TQString &filename ) { - QDomDocument doc("document.xml"); + TQDomDocument doc("document.xml"); - QFile file(filename); + TQFile file(filename); if(!file.open(IO_ReadOnly)) { @@ -74,16 +74,16 @@ bool KGalleryDialog::loadFile( const QString &filename ) if( doc.doctype().name() != "educagallery" ) { return false; } - QDomElement docElem = doc.documentElement(); - QDomNode n = docElem.firstChild(); + TQDomElement docElem = doc.documentElement(); + TQDomNode n = docElem.firstChild(); kdDebug()<<"... load attributes: "<< docElem.tagName() <<endl; - QDomNodeList dnList = n.childNodes(); + TQDomNodeList dnList = n.childNodes(); for( unsigned int i = 0; i < dnList.count(); ++i) { - QListViewItem *newItem = new QListViewItem(listDocuments); - QDomElement serversNode = dnList.item(i).toElement(); + TQListViewItem *newItem = new TQListViewItem(listDocuments); + TQDomElement serversNode = dnList.item(i).toElement(); kdDebug()<<"... load attributes: "<< serversNode.text() <<endl; @@ -105,13 +105,13 @@ bool KGalleryDialog::loadFile( const QString &filename ) void KGalleryDialog::configRead() { KConfig *appconfig = KGlobal::config(); - QStringList servers; - QStringList ipservers; - QStringList::Iterator it_ipservers; + TQStringList servers; + TQStringList ipservers; + TQStringList::Iterator it_ipservers; appconfig->setGroup( "kgallerydialog" ); _split->setSizes( appconfig->readIntListEntry("Splitter_size") ); - QSize defaultSize(500,400); + TQSize defaultSize(500,400); resize( appconfig->readSizeEntry("Geometry", &defaultSize ) ); appconfig->setGroup("Galleries Servers"); @@ -125,9 +125,9 @@ void KGalleryDialog::configRead() } it_ipservers=ipservers.begin(); - for ( QStringList::Iterator it_servers = servers.begin(); it_servers != servers.end(); ++it_servers ) + for ( TQStringList::Iterator it_servers = servers.begin(); it_servers != servers.end(); ++it_servers ) { - QListViewItem *newItem = new QListViewItem(listServers); + TQListViewItem *newItem = new TQListViewItem(listServers); newItem->setText(0,*it_servers); newItem->setText(1,*it_ipservers); newItem->setSelected(false); @@ -138,8 +138,8 @@ void KGalleryDialog::configRead() /** Write servers lists */ void KGalleryDialog::configWrite() { - QStringList servers; - QStringList ipservers; + TQStringList servers; + TQStringList ipservers; KConfig *config = KGlobal::config(); config->setGroup( "kgallerydialog" ); @@ -148,7 +148,7 @@ void KGalleryDialog::configWrite() config->sync(); config->setGroup("Galleries Servers"); - QListViewItem *item = listServers->firstChild(); + TQListViewItem *item = listServers->firstChild(); while (item) { servers.append( item->text(0) ); ipservers.append( item->text(1) ); @@ -169,7 +169,7 @@ void KGalleryDialog::slotButtonAdd() return; } - QListViewItem *newItem = new QListViewItem(listServers); + TQListViewItem *newItem = new TQListViewItem(listServers); newItem->setText(0,lineName->text()); newItem->setText(1,lineAddress->text()); newItem->setSelected(false); @@ -185,11 +185,11 @@ void KGalleryDialog::accept() configWrite(); KGalleryDialogBase::accept(); } -// done( QDialog::Accepted ); +// done( TQDialog::Accepted ); } /** Select Server */ -void KGalleryDialog::slotServerSelected( QListViewItem *item ) +void KGalleryDialog::slotServerSelected( TQListViewItem *item ) { if (!item) return; @@ -203,16 +203,16 @@ void KGalleryDialog::slotServerSelected( QListViewItem *item ) /** Get keduca test url */ KURL KGalleryDialog::getURL() { - QListViewItem *item = listDocuments->currentItem(); + TQListViewItem *item = listDocuments->currentItem(); if (!item) return KURL(); - QString urlAddress = item->text(5); + TQString urlAddress = item->text(5); if( _currentURL.isLocalFile() && !KURL(urlAddress).isValid() ) { - if( !QFileInfo(urlAddress).exists() ) + if( !TQFileInfo(urlAddress).exists() ) urlAddress = _currentURL.directory(false,true) + urlAddress; kdDebug()<< "Imagen en local" <<endl; } else if( !_currentURL.isLocalFile() && !KURL(urlAddress).isValid() ) @@ -225,7 +225,7 @@ KURL KGalleryDialog::getURL() /** Add url */ void KGalleryDialog::putURL(const KURL &urlFile) { - QListViewItem *newItem = new QListViewItem(listServers); + TQListViewItem *newItem = new TQListViewItem(listServers); newItem->setText( 1, urlFile.url() ); newItem->setSelected(false); } diff --git a/keduca/libkeduca/kgallerydialog.h b/keduca/libkeduca/kgallerydialog.h index a662bde6..41383091 100644 --- a/keduca/libkeduca/kgallerydialog.h +++ b/keduca/libkeduca/kgallerydialog.h @@ -36,7 +36,7 @@ namespace KIO { class Job; } class KGalleryDialog : public KGalleryDialogBase { Q_OBJECT public: - KGalleryDialog(QWidget *parent=0, const char *name=0); + KGalleryDialog(TQWidget *parent=0, const char *name=0); ~KGalleryDialog(); /** Open keduca file. This function can open a remote or local url. */ bool openFile( const KURL &url ); @@ -50,10 +50,10 @@ protected slots: // Private slots /** Open selected document */ void accept(); /** Select Server */ - void slotServerSelected( QListViewItem *item ); + void slotServerSelected( TQListViewItem *item ); protected: /** Open keduca file. This function does the actual work and expects a local filename . */ - bool loadFile( const QString &filename ); + bool loadFile( const TQString &filename ); private: // Private attributes /** Current url */ KURL _currentURL; |