From a374efce3a207b39514be3c52264091400ce297e Mon Sep 17 00:00:00 2001 From: tpearson Date: Sat, 11 Jun 2011 04:44:41 +0000 Subject: 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 --- kig/scripting/newscriptwizard.cc | 18 +++++++++--------- kig/scripting/newscriptwizard.h | 3 ++- kig/scripting/newscriptwizardbase.ui | 18 +++++++++--------- kig/scripting/python_type.cc | 22 +++++++++++----------- kig/scripting/python_type.h | 12 ++++++------ kig/scripting/script-common.cc | 4 ++-- kig/scripting/script_mode.cc | 16 ++++++++-------- 7 files changed, 47 insertions(+), 46 deletions(-) (limited to 'kig/scripting') diff --git a/kig/scripting/newscriptwizard.cc b/kig/scripting/newscriptwizard.cc index de959ce2..cc3e1771 100644 --- a/kig/scripting/newscriptwizard.cc +++ b/kig/scripting/newscriptwizard.cc @@ -56,8 +56,8 @@ NewScriptWizard::~NewScriptWizard() } } -NewScriptWizard::NewScriptWizard( TQWidget* parent, ScriptModeBase* mode ) - : NewScriptWizardBase( parent, "New Script Wizard" ), +NewScriptWizard::NewScriptWizard( TQWidget* tqparent, ScriptModeBase* mode ) + : NewScriptWizardBase( tqparent, "New Script Wizard" ), mmode( mode ) { document = KTextEditor::EditorChooser::createDocument( 0, "KTextEditor::Document" ); @@ -97,11 +97,11 @@ NewScriptWizard::NewScriptWizard( TQWidget* parent, ScriptModeBase* mode ) KPopupMenu* pm = new KPopupMenu( editor ); // creating the actions for the code editor... KActionCollection* ac = new KActionCollection( editor ); - KAction* undoAction = KStdAction::undo( this, TQT_SLOT( slotUndo() ), ac ); - KAction* redoAction = KStdAction::redo( this, TQT_SLOT( slotRedo() ), ac ); - KAction* cutAction = KStdAction::cut( this, TQT_SLOT( slotCut() ), ac ); - KAction* copyAction = KStdAction::copy( this, TQT_SLOT( slotCopy() ), ac ); - KAction* pasteAction = KStdAction::paste( this, TQT_SLOT( slotPaste() ), ac ); + KAction* undoAction = KStdAction::undo( TQT_TQOBJECT(this), TQT_SLOT( slotUndo() ), ac ); + KAction* redoAction = KStdAction::redo( TQT_TQOBJECT(this), TQT_SLOT( slotRedo() ), ac ); + KAction* cutAction = KStdAction::cut( TQT_TQOBJECT(this), TQT_SLOT( slotCut() ), ac ); + KAction* copyAction = KStdAction::copy( TQT_TQOBJECT(this), TQT_SLOT( slotCopy() ), ac ); + KAction* pasteAction = KStdAction::paste( TQT_TQOBJECT(this), TQT_SLOT( slotPaste() ), ac ); // ... and plugging them into the popup menu (to build it, of course :) ) undoAction->plug( pm ); redoAction->plug( pm ); @@ -159,8 +159,8 @@ void NewScriptWizard::accept() void NewScriptWizard::slotHelpClicked() { - kapp->invokeHelp( TQString::fromLatin1( "scripting" ), - TQString::fromLatin1( "kig" ) ); + kapp->invokeHelp( TQString::tqfromLatin1( "scripting" ), + TQString::tqfromLatin1( "kig" ) ); } void NewScriptWizard::setText( const TQString& text ) diff --git a/kig/scripting/newscriptwizard.h b/kig/scripting/newscriptwizard.h index d1831b96..403236ee 100644 --- a/kig/scripting/newscriptwizard.h +++ b/kig/scripting/newscriptwizard.h @@ -35,9 +35,10 @@ class NewScriptWizard : public NewScriptWizardBase { Q_OBJECT + TQ_OBJECT ScriptModeBase* mmode; public: - NewScriptWizard( TQWidget* parent, ScriptModeBase* mode ); + NewScriptWizard( TQWidget* tqparent, ScriptModeBase* mode ); ~NewScriptWizard(); void back(); diff --git a/kig/scripting/newscriptwizardbase.ui b/kig/scripting/newscriptwizardbase.ui index 30117961..b71565d0 100644 --- a/kig/scripting/newscriptwizardbase.ui +++ b/kig/scripting/newscriptwizardbase.ui @@ -1,10 +1,10 @@ NewScriptWizardBase - + NewScriptWizardBase - + 0 0 @@ -15,7 +15,7 @@ New Script - + mpargs @@ -26,7 +26,7 @@ unnamed - + textLabel1 @@ -34,13 +34,13 @@ Select the argument objects ( if any ) in the Kig window and press "Next". - + AlignCenter - + mpcode @@ -51,7 +51,7 @@ in the Kig window and press "Next". unnamed - + gridLayout @@ -59,7 +59,7 @@ in the Kig window and press "Next". unnamed - + labelFillCode @@ -74,7 +74,7 @@ in the Kig window and press "Next". - + ktextedit.h diff --git a/kig/scripting/python_type.cc b/kig/scripting/python_type.cc index cc5a00ea..0b73cda4 100644 --- a/kig/scripting/python_type.cc +++ b/kig/scripting/python_type.cc @@ -108,12 +108,12 @@ const ObjectImpType* PythonCompileType::resultId() const return PythonCompiledScriptImp::stype(); } -ObjectImp* PythonCompileType::calc( const Args& parents, const KigDocument& ) const +ObjectImp* PythonCompileType::calc( const Args& tqparents, const KigDocument& ) const { - assert( parents.size() == 1 ); - if ( !parents[0]->inherits( StringImp::stype() ) ) return new InvalidImp; + assert( tqparents.size() == 1 ); + if ( !tqparents[0]->inherits( StringImp::stype() ) ) return new InvalidImp; - const StringImp* si = static_cast( parents[0] ); + const StringImp* si = static_cast( tqparents[0] ); TQString s = si->data(); CompiledPythonScript cs = PythonScripter::instance()->compile( s.latin1() ); @@ -141,20 +141,20 @@ const PythonExecuteType* PythonExecuteType::instance() return &t; } -ObjectImp* PythonExecuteType::calc( const Args& parents, const KigDocument& d ) const +ObjectImp* PythonExecuteType::calc( const Args& tqparents, const KigDocument& d ) const { - assert( parents.size() >= 1 ); - if( !parents[0]->inherits( PythonCompiledScriptImp::stype() ) ) return new InvalidImp; + assert( tqparents.size() >= 1 ); + if( !tqparents[0]->inherits( PythonCompiledScriptImp::stype() ) ) return new InvalidImp; - CompiledPythonScript& script = static_cast( parents[0] )->data(); + CompiledPythonScript& script = static_cast( tqparents[0] )->data(); - Args args( parents.begin() + 1, parents.end() ); + Args args( tqparents.begin() + 1, tqparents.end() ); return script.calc( args, d ); } -const ObjectImpType* PythonExecuteType::impRequirement( const ObjectImp* o, const Args& parents ) const +const ObjectImpType* PythonExecuteType::impRequirement( const ObjectImp* o, const Args& tqparents ) const { - if ( o == parents[0] ) return PythonCompiledScriptImp::stype(); + if ( o == tqparents[0] ) return PythonCompiledScriptImp::stype(); else return ObjectImp::stype(); } diff --git a/kig/scripting/python_type.h b/kig/scripting/python_type.h index db623ab6..871cfc17 100644 --- a/kig/scripting/python_type.h +++ b/kig/scripting/python_type.h @@ -28,10 +28,10 @@ class PythonCompileType public: static const PythonCompileType* instance(); - ObjectImp* calc( const Args& parents, const KigDocument& d ) const; + ObjectImp* calc( const Args& tqparents, const KigDocument& d ) const; - const ObjectImpType* impRequirement( const ObjectImp* o, const Args& parents ) const; - bool isDefinedOnOrThrough( const ObjectImp* o, const Args& parents ) const; + const ObjectImpType* impRequirement( const ObjectImp* o, const Args& tqparents ) const; + bool isDefinedOnOrThrough( const ObjectImp* o, const Args& tqparents ) const; const ObjectImpType* resultId() const; std::vector sortArgs( const std::vector& args ) const; @@ -46,10 +46,10 @@ class PythonExecuteType public: static const PythonExecuteType* instance(); - ObjectImp* calc( const Args& parents, const KigDocument& d ) const; + ObjectImp* calc( const Args& tqparents, const KigDocument& d ) const; - const ObjectImpType* impRequirement( const ObjectImp* o, const Args& parents ) const; - bool isDefinedOnOrThrough( const ObjectImp* o, const Args& parents ) const; + const ObjectImpType* impRequirement( const ObjectImp* o, const Args& tqparents ) const; + bool isDefinedOnOrThrough( const ObjectImp* o, const Args& tqparents ) const; const ObjectImpType* resultId() const; std::vector sortArgs( const std::vector& args ) const; diff --git a/kig/scripting/script-common.cc b/kig/scripting/script-common.cc index 2eb2da81..1f5d8c4a 100644 --- a/kig/scripting/script-common.cc +++ b/kig/scripting/script-common.cc @@ -44,7 +44,7 @@ TQString ScriptType::templateCode( ScriptType::Type type, std::listname(); - tempcode += n.isEmpty() ? temparg.arg( id ) : n; + tempcode += n.isEmpty() ? temparg.tqarg( id ) : n; id++; }; tempcode += diff --git a/kig/scripting/script_mode.cc b/kig/scripting/script_mode.cc index adbcc857..2c6f4d80 100644 --- a/kig/scripting/script_mode.cc +++ b/kig/scripting/script_mode.cc @@ -45,7 +45,7 @@ void ScriptModeBase::dragRect( const TQPoint& p, KigWidget& w ) mdoc.runMode( &dm ); std::vector ret = dm.ret(); - KigPainter pter( w.screenInfo(), &w.stillPix, mdoc.document() ); + KigPainter pter( w.screenInfo(), TQT_TQPAINTDEVICE(&w.stillPix), mdoc.document() ); if ( dm.needClear() ) { std::vector tmp( margs.begin(), margs.begin() ); @@ -67,7 +67,7 @@ void ScriptModeBase::leftClickedObject( ObjectHolder* o, const TQPoint&, if ( mwawd != SelectingArgs ) return; - KigPainter pter( w.screenInfo(), &w.stillPix, mdoc.document() ); + KigPainter pter( w.screenInfo(), TQT_TQPAINTDEVICE(&w.stillPix), mdoc.document() ); if ( (dup_o = std::find( margs.begin(), margs.end(), o )) != margs.end() ) { @@ -105,7 +105,7 @@ void ScriptModeBase::mouseMoved( const std::vector& os, // statusbar text mdoc.emitStatusBarText( selectstat ); - KigPainter p( w.screenInfo(), &w.curPix, mdoc.document() ); + KigPainter p( w.screenInfo(), TQT_TQPAINTDEVICE(&w.curPix), mdoc.document() ); // set the text next to the arrow cursor TQPoint point = pt; @@ -204,7 +204,7 @@ bool ScriptCreationMode::queryFinish() KMessageBox::detailedSorry( mwizard, i18n( "The Python interpreter caught an error during the execution of your " "script. Please fix the script and click the Finish button again." ), - i18n( "The Python Interpreter generated the following error output:\n%1").arg( errtrace ) ); + i18n( "The Python Interpreter generated the following error output:\n%1").tqarg( errtrace.data() ) ); } else { @@ -246,7 +246,7 @@ void ScriptModeBase::setScriptType( ScriptType::Type type ) void ScriptModeBase::addArgs( const std::vector& obj, KigWidget& w ) { - KigPainter pter( w.screenInfo(), &w.stillPix, mdoc.document() ); + KigPainter pter( w.screenInfo(), TQT_TQPAINTDEVICE(&w.stillPix), mdoc.document() ); std::copy( obj.begin(), obj.end(), std::inserter( margs, margs.begin() ) ); pter.drawObjects( obj, true ); @@ -275,10 +275,10 @@ ScriptEditMode::ScriptEditMode( ObjectTypeCalcer* exec_calc, KigPart& doc ) { mwawd = EnteringCode; - mexecargs = mexecuted->parents(); + mexecargs = mexecuted->tqparents(); assert( mexecargs.size() >= 1 ); - mcompiledargs = mexecargs[0]->parents(); + mcompiledargs = mexecargs[0]->tqparents(); assert( mcompiledargs.size() == 1 ); const ObjectImp* imp = static_cast( mcompiledargs[0] )->imp(); @@ -322,7 +322,7 @@ bool ScriptEditMode::queryFinish() KMessageBox::detailedSorry( mpart.widget(), i18n( "The Python interpreter caught an error during the execution of your " "script. Please fix the script." ), - i18n( "The Python Interpreter generated the following error output:\n%1").arg( errtrace ) ); + i18n( "The Python Interpreter generated the following error output:\n%1").tqarg( errtrace.data() ) ); } else { -- cgit v1.2.1