diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-06-11 04:44:41 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-06-11 04:44:41 +0000 |
commit | a374efce3a207b39514be3c52264091400ce297e (patch) | |
tree | 77bdf654b55826d4f59b53a5621310206bcaead1 /keduca/keducabuilder/keducabuilder.cpp | |
parent | f81a494f3957d5cf38c787973415597941934727 (diff) | |
download | tdeedu-a374efce3a207b39514be3c52264091400ce297e.tar.gz tdeedu-a374efce3a207b39514be3c52264091400ce297e.zip |
TQt4 port kdeedu
This enables compilation under both Qt3 and Qt4
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdeedu@1236073 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'keduca/keducabuilder/keducabuilder.cpp')
-rw-r--r-- | keduca/keducabuilder/keducabuilder.cpp | 86 |
1 files changed, 43 insertions, 43 deletions
diff --git a/keduca/keducabuilder/keducabuilder.cpp b/keduca/keducabuilder/keducabuilder.cpp index fa7da986..93dbb334 100644 --- a/keduca/keducabuilder/keducabuilder.cpp +++ b/keduca/keducabuilder/keducabuilder.cpp @@ -60,8 +60,8 @@ static const char* const keducabuilder_data[] = { ".#############.", "..............."}; -KEducaBuilder::KEducaBuilder(TQWidget* parent, const char *name, WFlags f ) - : KMainWindow(parent,name,f), +KEducaBuilder::KEducaBuilder(TQWidget* tqparent, const char *name, WFlags f ) + : KMainWindow(tqparent,name,f), _nativeFormat("application/x-edu") { _keducaFile = new FileRead(); @@ -88,12 +88,12 @@ void KEducaBuilder::init() form2Layout->setMargin( 0 ); _split = new TQSplitter( mainView ); - _split->setOrientation( TQSplitter::Vertical ); + _split->setOrientation( Qt::Vertical ); _listAnswer = new KListBox( _split, "_listAnswer" ); - _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 *) ) ); + _listAnswer->tqsetSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)7, (TQSizePolicy::SizeType)7, _listAnswer->sizePolicy().hasHeightForWidth() ) ); + connect( _listAnswer, TQT_SIGNAL( highlighted(TQListBoxItem *) ), TQT_TQOBJECT(this), TQT_SLOT( slotPreview(TQListBoxItem *) ) ); + connect( _listAnswer, TQT_SIGNAL( doubleClicked(TQListBoxItem *) ), TQT_TQOBJECT(this), TQT_SLOT( slotEditbyList(TQListBoxItem *) ) ); _preview = new TQTextView( _split, "_preview" ); _preview->setFrameShape( TQTextView::NoFrame ); @@ -103,7 +103,7 @@ void KEducaBuilder::init() setCentralWidget( mainView ); if (!initialGeometrySet()) - resize( TQSize(500, 400).expandedTo(minimumSizeHint())); + resize( TQSize(500, 400).expandedTo(tqminimumSizeHint())); 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, 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"); + KStdAction::openNew(TQT_TQOBJECT(this), TQT_SLOT( slotFileOpenNew() ), actionCollection()); + KStdAction::open (TQT_TQOBJECT(this), TQT_SLOT( slotFileOpen() ), actionCollection()); + (void)new KAction(i18n("Open &Gallery..."), 0, 0, TQT_TQOBJECT(this), TQT_SLOT( slotGallery() ), actionCollection(), "open_gallery"); + _recentFiles = KStdAction::openRecent(TQT_TQOBJECT(this), TQT_SLOT ( slotFileOpenURL(const KURL &)), actionCollection()); + KStdAction::save (TQT_TQOBJECT(this), TQT_SLOT( slotFileSave() ), actionCollection()); + KStdAction::saveAs (TQT_TQOBJECT(this), TQT_SLOT( slotFileSaveAs() ), actionCollection()); + KStdAction::print (TQT_TQOBJECT(this), TQT_SLOT( slotFilePrint() ), actionCollection()); + (void)new KAction(i18n("Document Info"), "info", 0, TQT_TQOBJECT(this), TQT_SLOT( slotHeader() ), actionCollection(), "info_doc"); + KStdAction::quit(TQT_TQOBJECT(this), TQT_SLOT( close() ), actionCollection()); + + (void)new KAction(i18n("&Add..."), "addquestion", 0, TQT_TQOBJECT(this), TQT_SLOT( slotAdd() ), actionCollection(), "question_add"); + (void)new KAction(i18n("&Edit..."), "editquestion", 0, TQT_TQOBJECT(this), TQT_SLOT( slotEdit() ), actionCollection(), "question_edit"); + (void)new KAction(i18n("&Remove"), "delquestion", 0, TQT_TQOBJECT(this), TQT_SLOT( slotRemove() ), actionCollection(), "question_remove"); + (void)new KAction(i18n("&Up"), "up", 0, TQT_TQOBJECT(this), TQT_SLOT( slotUp() ), actionCollection(), "question_up"); + (void)new KAction(i18n("&Down"), "down", 0, TQT_TQOBJECT(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( TQString::null, _nativeFormat, this, i18n("Open Educa File") ); + KURL url = KFileDialog::getOpenURL( TQString(), _nativeFormat, this, i18n("Open Educa File") ); if( !url.isEmpty() ) slotFileOpenURL( url ); @@ -171,7 +171,7 @@ void KEducaBuilder::slotFileOpenURL( const KURL &url ) _keducaFile->recordFirst(); while( !_keducaFile->recordEOF() ) { - _listAnswer->insertItem( image0, _keducaFile->getQuestion( FileRead::QF_TEXT ) ); + _listAnswer->insertItem( image0, _keducaFile->getQuestion( FileRead::TQF_TEXT ) ); _keducaFile->recordNext(); } } @@ -199,7 +199,7 @@ void KEducaBuilder::slotPreview( TQListBoxItem *item ) tmpListanswer += "<TR>"; tmpListanswer += "<TD WIDTH=3% BGCOLOR="; _keducaFile->getAnswerValue() ? tmpListanswer += "#006b6b>" : tmpListanswer += "#b84747>"; - if( _keducaFile->getQuestionInt( FileRead::QF_TYPE ) == 3 ) + if( _keducaFile->getQuestionInt( FileRead::TQF_TYPE ) == 3 ) { tmpListanswer += "<FONT COLOR=#ffffff><b>" + _keducaFile->getAnswer( FileRead::AF_POINT ) @@ -214,40 +214,40 @@ void KEducaBuilder::slotPreview( TQListBoxItem *item ) }; tmpListanswer += "</TABLE>"; - if( !_keducaFile->getQuestion( FileRead::QF_PICTURE ).isEmpty() ) + if( !_keducaFile->getQuestion( FileRead::TQF_PICTURE ).isEmpty() ) { tmpListanswer += "<table><tr><td><img src="; tmpListanswer += _keducaFile->getPicture(); tmpListanswer += "></td>"; tmpListanswer += "<td align=right><b>" + i18n("Question Image") + "</b><hr>"; - tmpListanswer += _keducaFile->getQuestion( FileRead::QF_PICTURE ) + "</td></tr></table>"; + tmpListanswer += _keducaFile->getQuestion( FileRead::TQF_PICTURE ) + "</td></tr></table>"; }; - if( _keducaFile->getQuestionInt( FileRead::QF_POINTS ) > 0 ) + if( _keducaFile->getQuestionInt( FileRead::TQF_POINTS ) > 0 ) { tmpListanswer += "<p><b>" + i18n("Question point") + ":</b> "; - tmpListanswer += _keducaFile->getQuestion( FileRead::QF_POINTS ); + tmpListanswer += _keducaFile->getQuestion( FileRead::TQF_POINTS ); } - if( _keducaFile->getQuestionInt( FileRead::QF_TIME ) > 0 ) + if( _keducaFile->getQuestionInt( FileRead::TQF_TIME ) > 0 ) { tmpListanswer += "<p><b>"+i18n("Time")+":</b> "; - tmpListanswer += _keducaFile->getQuestion( FileRead::QF_TIME ); + tmpListanswer += _keducaFile->getQuestion( FileRead::TQF_TIME ); tmpListanswer += i18n(" seconds</p>"); } - if( !_keducaFile->getQuestion( FileRead::QF_TIP ).isEmpty() ) + if( !_keducaFile->getQuestion( FileRead::TQF_TIP ).isEmpty() ) { tmpListanswer += "<p><b>" + i18n("Tip") +":</b> "; - tmpListanswer += _keducaFile->getQuestion( FileRead::QF_TIP ); + tmpListanswer += _keducaFile->getQuestion( FileRead::TQF_TIP ); tmpListanswer += "</p>"; } - if( !_keducaFile->getQuestion( FileRead::QF_EXPLAIN ).isEmpty() ) + if( !_keducaFile->getQuestion( FileRead::TQF_EXPLAIN ).isEmpty() ) { tmpListanswer += "<p><b>" + i18n("Explain") + ":</b>" - + _keducaFile->getQuestion( FileRead::QF_EXPLAIN ) + + _keducaFile->getQuestion( FileRead::TQF_EXPLAIN ) + "</p>"; } @@ -284,7 +284,7 @@ bool KEducaBuilder::currentFileMayBeReplaced() int res = KMessageBox::warningYesNoCancel( widget(), // ask the user to save i18n( "The document \"%1\" has been modified.\n" - "Do you want to save it?" ).arg( _keducaFile->getCurrentURL().fileName() ), + "Do you want to save it?" ).tqarg( _keducaFile->getCurrentURL().fileName() ), i18n( "Save Document?" ), KStdGuiItem::save(), KStdGuiItem::discard() ); switch (res) { @@ -324,7 +324,7 @@ void KEducaBuilder::slotAdd() edit.init( _keducaFile, false ); if( !edit.exec() ) return; - _listAnswer->insertItem( image0, _keducaFile->getQuestion( FileRead::QF_TEXT ) ); + _listAnswer->insertItem( image0, _keducaFile->getQuestion( FileRead::TQF_TEXT ) ); _listAnswer->setCurrentItem( _listAnswer->count()-1 ); slotPreview( _listAnswer->item(_listAnswer->currentItem()) ); } @@ -340,7 +340,7 @@ void KEducaBuilder::slotEdit() edit.init( _keducaFile, true ); if( edit.exec() ) { - _listAnswer->changeItem( image0, _keducaFile->getQuestion( FileRead::QF_TEXT ), _listAnswer->currentItem() ); + _listAnswer->changeItem( image0, _keducaFile->getQuestion( FileRead::TQF_TEXT ), _listAnswer->currentItem() ); slotPreview( _listAnswer->item(_listAnswer->currentItem()) ); } } @@ -409,7 +409,7 @@ bool KEducaBuilder::fileSaveAs() TQCheckBox *saveCompressedCheckBox = new TQCheckBox( i18n( "Compress the file" ), 0 ); saveCompressedCheckBox->setChecked( true ); - KFileDialog *dialog=new KFileDialog(TQString::null, TQString::null, this, "file dialog", true, saveCompressedCheckBox); + KFileDialog *dialog=new KFileDialog(TQString(), TQString(), this, "file dialog", true, saveCompressedCheckBox); dialog->setCaption( i18n("Save Document As") ); dialog->setKeepLocation( true ); dialog->setOperationMode( KFileDialog::Saving ); @@ -485,7 +485,7 @@ void KEducaBuilder::slotFilePrint() TQString file = _keducaFile->getCurrentURL().fileName(); if (file.isEmpty()) file = i18n("Test"); - if(printer->setup(this, i18n("Print %1").arg(file))) + if(printer->setup(this, i18n("Print %1").tqarg(file))) { TQPaintDeviceMetrics metrics(printer); TQPainter p; @@ -502,7 +502,7 @@ void KEducaBuilder::slotFilePrint() while(!_keducaFile->recordEOF()) { p.drawText( 10, yPos+margin, metrics.width(), fm.lineSpacing(), - ExpandTabs | DontClip, _keducaFile->getQuestion(FileRead::QF_TEXT) ); + ExpandTabs | DontClip, _keducaFile->getQuestion(FileRead::TQF_TEXT) ); yPos += fm.lineSpacing(); p.drawLine(10, yPos+margin, metrics.width(), yPos+margin); @@ -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)"), TQString::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(), 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."), - TQString::null, i18n("Insert Question"))==KMessageBox::Continue) + TQString(), i18n("Insert Question"))==KMessageBox::Continue) slotAdd(); else return false; |