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 /kig/modes | |
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 'kig/modes')
-rw-r--r-- | kig/modes/base_mode.cc | 24 | ||||
-rw-r--r-- | kig/modes/base_mode.h | 32 | ||||
-rw-r--r-- | kig/modes/construct_mode.cc | 62 | ||||
-rw-r--r-- | kig/modes/construct_mode.h | 38 | ||||
-rw-r--r-- | kig/modes/dragrectmode.cc | 44 | ||||
-rw-r--r-- | kig/modes/dragrectmode.h | 40 | ||||
-rw-r--r-- | kig/modes/edittype.cc | 14 | ||||
-rw-r--r-- | kig/modes/edittype.h | 14 | ||||
-rw-r--r-- | kig/modes/label.cc | 58 | ||||
-rw-r--r-- | kig/modes/label.h | 14 | ||||
-rw-r--r-- | kig/modes/linkslabel.cpp | 48 | ||||
-rw-r--r-- | kig/modes/linkslabel.h | 10 | ||||
-rw-r--r-- | kig/modes/macro.cc | 14 | ||||
-rw-r--r-- | kig/modes/macro.h | 14 | ||||
-rw-r--r-- | kig/modes/macrowizard.cc | 16 | ||||
-rw-r--r-- | kig/modes/macrowizard.h | 4 | ||||
-rw-r--r-- | kig/modes/mode.cc | 20 | ||||
-rw-r--r-- | kig/modes/mode.h | 22 | ||||
-rw-r--r-- | kig/modes/moving.cc | 10 | ||||
-rw-r--r-- | kig/modes/moving.h | 6 | ||||
-rw-r--r-- | kig/modes/normal.cc | 18 | ||||
-rw-r--r-- | kig/modes/normal.h | 14 | ||||
-rw-r--r-- | kig/modes/popup.cc | 168 | ||||
-rw-r--r-- | kig/modes/popup.h | 20 | ||||
-rw-r--r-- | kig/modes/textlabelwizard.cc | 22 | ||||
-rw-r--r-- | kig/modes/textlabelwizard.h | 2 | ||||
-rw-r--r-- | kig/modes/typesdialog.cpp | 76 | ||||
-rw-r--r-- | kig/modes/typesdialog.h | 12 |
28 files changed, 418 insertions, 418 deletions
diff --git a/kig/modes/base_mode.cc b/kig/modes/base_mode.cc index 9e92274a..d968566b 100644 --- a/kig/modes/base_mode.cc +++ b/kig/modes/base_mode.cc @@ -23,7 +23,7 @@ #include "../kig/kig_part.h" #include "../kig/kig_document.h" -#include <qevent.h> +#include <tqevent.h> #include <kcursor.h> BaseMode::BaseMode( KigPart& d ) @@ -35,7 +35,7 @@ BaseMode::~BaseMode() { } -void BaseMode::leftClicked( QMouseEvent* e, KigWidget* v ) +void BaseMode::leftClicked( TQMouseEvent* e, KigWidget* v ) { // touch screens don't send a mouseMoved event before a click event, // apparently, so we simulate it. @@ -64,7 +64,7 @@ void BaseMode::leftClicked( QMouseEvent* e, KigWidget* v ) }; } -void BaseMode::leftMouseMoved( QMouseEvent* e, KigWidget* w ) +void BaseMode::leftMouseMoved( TQMouseEvent* e, KigWidget* w ) { if( !moco.empty() && ( mplc - e->pos() ).manhattanLength() > 3 ) dragObject( moco, mplc, *w, @@ -72,7 +72,7 @@ void BaseMode::leftMouseMoved( QMouseEvent* e, KigWidget* w ) ); } -void BaseMode::leftReleased( QMouseEvent* e, KigWidget* v ) +void BaseMode::leftReleased( TQMouseEvent* e, KigWidget* v ) { if( (mplc - e->pos()).manhattanLength() > 4 ) return; @@ -93,7 +93,7 @@ void BaseMode::leftReleased( QMouseEvent* e, KigWidget* v ) leftClickedObject( o, e->pos(), *v, keyCtrl ); } -void BaseMode::midClicked( QMouseEvent* e, KigWidget* v ) +void BaseMode::midClicked( TQMouseEvent* e, KigWidget* v ) { // get rid of text still showing... v->updateCurPix(); @@ -103,14 +103,14 @@ void BaseMode::midClicked( QMouseEvent* e, KigWidget* v ) moco = mdoc.document().whatAmIOn( v->fromScreen( e->pos() ), *v ); } -void BaseMode::midReleased( QMouseEvent* e, KigWidget* v ) +void BaseMode::midReleased( TQMouseEvent* e, KigWidget* v ) { if( (e->pos() - mplc).manhattanLength() > 4 ) return; midClicked( mplc, *v ); } -void BaseMode::rightClicked( QMouseEvent* e, KigWidget* w ) +void BaseMode::rightClicked( TQMouseEvent* e, KigWidget* w ) { // get rid of text still showing... w->updateCurPix(); @@ -124,22 +124,22 @@ void BaseMode::rightClicked( QMouseEvent* e, KigWidget* w ) rightClicked( moco, mplc, *w ); } -void BaseMode::mouseMoved( QMouseEvent* e, KigWidget* w ) +void BaseMode::mouseMoved( TQMouseEvent* e, KigWidget* w ) { std::vector<ObjectHolder*> os = mdoc.document().whatAmIOn( w->fromScreen( e->pos() ), *w ); mouseMoved( os, e->pos(), *w, e->state() & Qt::ShiftButton ); } -void BaseMode::dragRect( const QPoint&, KigWidget& ) +void BaseMode::dragRect( const TQPoint&, KigWidget& ) { } -void BaseMode::leftClickedObject( ObjectHolder*, const QPoint&, +void BaseMode::leftClickedObject( ObjectHolder*, const TQPoint&, KigWidget&, bool ) { } -void BaseMode::dragObject( const std::vector<ObjectHolder*>&, const QPoint&, +void BaseMode::dragObject( const std::vector<ObjectHolder*>&, const TQPoint&, KigWidget&, bool ) { } @@ -154,7 +154,7 @@ std::vector<ObjectHolder*> BaseMode::oco() return moco; } -QPoint BaseMode::pointLocation() +TQPoint BaseMode::pointLocation() { return mplc; } diff --git a/kig/modes/base_mode.h b/kig/modes/base_mode.h index 2f89996f..cb029abf 100644 --- a/kig/modes/base_mode.h +++ b/kig/modes/base_mode.h @@ -20,7 +20,7 @@ #include "mode.h" -#include <qpoint.h> +#include <tqpoint.h> #include <vector> class KigWidget; @@ -30,31 +30,31 @@ class ObjectHolder; class BaseMode : public KigMode { - QPoint mplc; + TQPoint mplc; std::vector<ObjectHolder*> moco; - void leftClicked( QMouseEvent* e, KigWidget* v ); - void leftMouseMoved( QMouseEvent*, KigWidget* ); - void leftReleased( QMouseEvent* e, KigWidget* v ); - void midClicked( QMouseEvent* e, KigWidget* v ); - void midReleased( QMouseEvent* e, KigWidget* v ); - void rightClicked( QMouseEvent*, KigWidget* ); - void mouseMoved( QMouseEvent* e, KigWidget* v ); + void leftClicked( TQMouseEvent* e, KigWidget* v ); + void leftMouseMoved( TQMouseEvent*, KigWidget* ); + void leftReleased( TQMouseEvent* e, KigWidget* v ); + void midClicked( TQMouseEvent* e, KigWidget* v ); + void midReleased( TQMouseEvent* e, KigWidget* v ); + void rightClicked( TQMouseEvent*, KigWidget* ); + void mouseMoved( TQMouseEvent* e, KigWidget* v ); protected: void enableActions(); std::vector<ObjectHolder*> oco(); - QPoint pointLocation(); + TQPoint pointLocation(); protected: - virtual void dragRect( const QPoint& p, KigWidget& w ); - virtual void dragObject( const std::vector<ObjectHolder*>& os, const QPoint& pointClickedOn, KigWidget& w, bool ctrlOrShiftDown ); - virtual void leftClickedObject( ObjectHolder* o, const QPoint& p, + virtual void dragRect( const TQPoint& p, KigWidget& w ); + virtual void dragObject( const std::vector<ObjectHolder*>& os, const TQPoint& pointClickedOn, KigWidget& w, bool ctrlOrShiftDown ); + virtual void leftClickedObject( ObjectHolder* o, const TQPoint& p, KigWidget& w, bool ctrlOrShiftDown ) = 0; - virtual void midClicked( const QPoint& p, KigWidget& w ) = 0; - virtual void rightClicked( const std::vector<ObjectHolder*>& oco, const QPoint& p, KigWidget& w ) = 0; - virtual void mouseMoved( const std::vector<ObjectHolder*>& os, const QPoint& p, KigWidget& w, bool shiftpressed ) = 0; + virtual void midClicked( const TQPoint& p, KigWidget& w ) = 0; + virtual void rightClicked( const std::vector<ObjectHolder*>& oco, const TQPoint& p, KigWidget& w ) = 0; + virtual void mouseMoved( const std::vector<ObjectHolder*>& os, const TQPoint& p, KigWidget& w, bool shiftpressed ) = 0; protected: BaseMode( KigPart& ); diff --git a/kig/modes/construct_mode.cc b/kig/modes/construct_mode.cc index 9618aded..b535ee5c 100644 --- a/kig/modes/construct_mode.cc +++ b/kig/modes/construct_mode.cc @@ -63,7 +63,7 @@ BaseConstructMode::~BaseConstructMode() // delete mcursorholder; } -void BaseConstructMode::leftReleased( QMouseEvent* e, KigWidget* v ) +void BaseConstructMode::leftReleased( TQMouseEvent* e, KigWidget* v ) { if( (pointLocation() - e->pos()).manhattanLength() > 4 ) return; @@ -101,7 +101,7 @@ void BaseConstructMode::leftReleased( QMouseEvent* e, KigWidget* v ) } void BaseConstructMode::leftClickedObject( - ObjectHolder* o, const QPoint& p, KigWidget& w, bool ) + ObjectHolder* o, const TQPoint& p, KigWidget& w, bool ) { std::vector<ObjectHolder*>::iterator it = std::find( mparents.begin(), mparents.end(), o ); std::vector<ObjectCalcer*> nargs = getCalcers( mparents ); @@ -155,7 +155,7 @@ void BaseConstructMode::leftClickedObject( } } -void BaseConstructMode::midClicked( const QPoint& p, KigWidget& w ) +void BaseConstructMode::midClicked( const TQPoint& p, KigWidget& w ) { std::vector<ObjectCalcer*> args = getCalcers( mparents ); args.push_back( mpt.get() ); @@ -171,12 +171,12 @@ void BaseConstructMode::midClicked( const QPoint& p, KigWidget& w ) } } -void BaseConstructMode::rightClicked( const std::vector<ObjectHolder*>&, const QPoint&, KigWidget& ) +void BaseConstructMode::rightClicked( const std::vector<ObjectHolder*>&, const TQPoint&, KigWidget& ) { // TODO ? } -void BaseConstructMode::mouseMoved( const std::vector<ObjectHolder*>& os, const QPoint& p, +void BaseConstructMode::mouseMoved( const std::vector<ObjectHolder*>& os, const TQPoint& p, KigWidget& w, bool shiftpressed ) { mdoc.emitStatusBarText( selectStatement( getCalcers( mparents ), w ) ); @@ -259,10 +259,10 @@ void BaseConstructMode::mouseMoved( const std::vector<ObjectHolder*>& os, const } if ( !text && ( goodargs.size() > 1 ) ) { - QString strwhich = i18n( "Which object?" ); + TQString strwhich = i18n( "Which object?" ); mdoc.emitStatusBarText( strwhich ); - QPoint textloc = p; + TQPoint textloc = p; textloc.setX( textloc.x() + 15 ); pter.drawTextStd( textloc, strwhich ); @@ -303,21 +303,21 @@ PointConstructMode::~PointConstructMode() } void PointConstructMode::leftClickedObject( - ObjectHolder*, const QPoint&, KigWidget& w, bool ) + ObjectHolder*, const TQPoint&, KigWidget& w, bool ) { mdoc.addObject( new ObjectHolder( mpt.get() ) ); w.redrawScreen( std::vector<ObjectHolder*>() ); - mdoc.emitStatusBarText( QString::null ); + mdoc.emitStatusBarText( TQString::null ); mdoc.doneMode( this ); } -void PointConstructMode::midClicked( const QPoint& p, KigWidget& w ) +void PointConstructMode::midClicked( const TQPoint& p, KigWidget& w ) { leftClickedObject( 0, p, w, true ); } -void PointConstructMode::rightClicked( const std::vector<ObjectHolder*>&, const QPoint&, +void PointConstructMode::rightClicked( const std::vector<ObjectHolder*>&, const TQPoint&, KigWidget& ) { // TODO ? @@ -325,7 +325,7 @@ void PointConstructMode::rightClicked( const std::vector<ObjectHolder*>&, const void PointConstructMode::mouseMoved( const std::vector<ObjectHolder*>&, - const QPoint& p, + const TQPoint& p, KigWidget& w, bool shiftpressed ) { @@ -379,15 +379,15 @@ void BaseConstructMode::selectObjects( const std::vector<ObjectHolder*>& os, Kig }; } -void ConstructMode::handlePrelim( const std::vector<ObjectCalcer*>& args, const QPoint& p, KigPainter& pter, KigWidget& w ) +void ConstructMode::handlePrelim( const std::vector<ObjectCalcer*>& args, const TQPoint& p, KigPainter& pter, KigWidget& w ) { // set the text next to the arrow cursor like in modes/normal.cc - QPoint textloc = p; + TQPoint textloc = p; textloc.setX( textloc.x() + 15 ); mctor->handlePrelim( pter, args, mdoc.document(), w ); - QString o = mctor->useText( *args.back(), args, mdoc.document(), w ); + TQString o = mctor->useText( *args.back(), args, mdoc.document(), w ); pter.drawTextStd( textloc, o ); } @@ -419,15 +419,15 @@ ConstructMode::~ConstructMode() // does a test result have a frame by default ? static const bool test_has_frame_dflt = true; -void TestConstructMode::handlePrelim( const std::vector<ObjectCalcer*>& os, const QPoint& p, KigPainter& pter, KigWidget& w ) +void TestConstructMode::handlePrelim( const std::vector<ObjectCalcer*>& os, const TQPoint& p, KigPainter& pter, KigWidget& w ) { Args args; std::transform( os.begin(), os.end(), std::back_inserter( args ), std::mem_fun( &ObjectCalcer::imp ) ); // usetext - QString usetext = i18n( mtype->argsParser().usetext( args.back(), args ).c_str() ); - QPoint textloc = p; + TQString usetext = i18n( mtype->argsParser().usetext( args.back(), args ).c_str() ); + TQPoint textloc = p; textloc.setX( textloc.x() + 15 ); pter.drawTextStd( textloc, usetext ); @@ -435,8 +435,8 @@ void TestConstructMode::handlePrelim( const std::vector<ObjectCalcer*>& os, cons ObjectImp* data = mtype->calc( args, mdoc.document() ); if ( ! data->valid() ) return; assert( data->inherits( TestResultImp::stype() ) ); - QString outputtext = static_cast<TestResultImp*>( data )->data(); - TextImp ti( outputtext, w.fromScreen( p + QPoint( - 40, 30 ) ), test_has_frame_dflt ); + TQString outputtext = static_cast<TestResultImp*>( data )->data(); + TextImp ti( outputtext, w.fromScreen( p + TQPoint( - 40, 30 ) ), test_has_frame_dflt ); ti.draw( pter ); delete data; @@ -475,17 +475,17 @@ void TestConstructMode::handleArgs( const std::vector<ObjectCalcer*>& args, KigW mdoc.emitStatusBarText( i18n( "Now select the location for the result label." ) ); } -void TestConstructMode::leftClickedObject( ObjectHolder* o, const QPoint& p, +void TestConstructMode::leftClickedObject( ObjectHolder* o, const TQPoint& p, KigWidget& w, bool ctrlOrShiftDown ) { if ( mresult ) { - QPoint qloc = p + QPoint( -40, 0 ); + TQPoint qloc = p + TQPoint( -40, 0 ); Coordinate loc = w.fromScreen( qloc ); std::vector<ObjectCalcer*> parents; parents.push_back( new ObjectConstCalcer( new IntImp( test_has_frame_dflt ) ) ); parents.push_back( new ObjectConstCalcer( new PointImp( loc ) ) ); - parents.push_back( new ObjectConstCalcer( new StringImp( QString::fromLatin1( "%1" ) ) ) ); + parents.push_back( new ObjectConstCalcer( new StringImp( TQString::fromLatin1( "%1" ) ) ) ); assert( mresult->imp()->inherits( TestResultImp::stype() ) ); parents.push_back( new ObjectPropertyCalcer( @@ -497,7 +497,7 @@ void TestConstructMode::leftClickedObject( ObjectHolder* o, const QPoint& p, mdoc.addObject( new ObjectHolder( ret ) ); w.unsetCursor(); - mdoc.emitStatusBarText( QString::null ); + mdoc.emitStatusBarText( TQString::null ); finish(); } @@ -505,7 +505,7 @@ void TestConstructMode::leftClickedObject( ObjectHolder* o, const QPoint& p, BaseConstructMode::leftClickedObject( o, p, w, ctrlOrShiftDown ); } -void TestConstructMode::midClicked( const QPoint& p, KigWidget& w ) +void TestConstructMode::midClicked( const TQPoint& p, KigWidget& w ) { if ( mresult ) { // nothing to be done here, really @@ -514,7 +514,7 @@ void TestConstructMode::midClicked( const QPoint& p, KigWidget& w ) BaseConstructMode::midClicked( p, w ); } -void TestConstructMode::rightClicked( const std::vector<ObjectHolder*>& oco, const QPoint& p, KigWidget& w ) +void TestConstructMode::rightClicked( const std::vector<ObjectHolder*>& oco, const TQPoint& p, KigWidget& w ) { if ( mresult ) { // nothing to be done here, really @@ -523,7 +523,7 @@ void TestConstructMode::rightClicked( const std::vector<ObjectHolder*>& oco, con BaseConstructMode::rightClicked( oco, p, w ); } -void TestConstructMode::mouseMoved( const std::vector<ObjectHolder*>& os, const QPoint& p, KigWidget& w, bool shiftPressed ) +void TestConstructMode::mouseMoved( const std::vector<ObjectHolder*>& os, const TQPoint& p, KigWidget& w, bool shiftPressed ) { if ( mresult ) { w.setCursor( KCursor::blankCursor() ); @@ -531,7 +531,7 @@ void TestConstructMode::mouseMoved( const std::vector<ObjectHolder*>& os, const w.updateCurPix(); KigPainter pter( w.screenInfo(), &w.curPix, mdoc.document() ); - QPoint qloc = p + QPoint( -40, 0 ); + TQPoint qloc = p + TQPoint( -40, 0 ); Coordinate loc = w.fromScreen( qloc ); assert( dynamic_cast<const TestResultImp*>( mresult->imp() ) ); TextImp ti( static_cast<const TestResultImp*>( mresult->imp() )->data(), loc, test_has_frame_dflt ); @@ -545,19 +545,19 @@ void TestConstructMode::mouseMoved( const std::vector<ObjectHolder*>& os, const BaseConstructMode::mouseMoved( os, p, w, shiftPressed ); } -QString ConstructMode::selectStatement( const std::vector<ObjectCalcer*>& args, const KigWidget& w ) +TQString ConstructMode::selectStatement( const std::vector<ObjectCalcer*>& args, const KigWidget& w ) { return mctor->selectStatement( args, mdoc.document(), w ); } -QString TestConstructMode::selectStatement( const std::vector<ObjectCalcer*>& sel, const KigWidget& ) +TQString TestConstructMode::selectStatement( const std::vector<ObjectCalcer*>& sel, const KigWidget& ) { using namespace std; Args args; transform( sel.begin(), sel.end(), back_inserter( args ), mem_fun( &ObjectCalcer::imp ) ); std::string ret = mtype->argsParser().selectStatement( args ); - if ( ret.empty() ) return QString::null; + if ( ret.empty() ) return TQString::null; return i18n( ret.c_str() ); } diff --git a/kig/modes/construct_mode.h b/kig/modes/construct_mode.h index fa1be86e..be937723 100644 --- a/kig/modes/construct_mode.h +++ b/kig/modes/construct_mode.h @@ -38,11 +38,11 @@ public: PointConstructMode( KigPart& d ); ~PointConstructMode(); protected: - void leftClickedObject( ObjectHolder* o, const QPoint& p, + void leftClickedObject( ObjectHolder* o, const TQPoint& p, KigWidget& w, bool ctrlOrShiftDown ); - void midClicked( const QPoint& p, KigWidget& w ); - void rightClicked( const std::vector<ObjectHolder*>& oco, const QPoint& p, KigWidget& w ); - void mouseMoved( const std::vector<ObjectHolder*>& os, const QPoint& p, KigWidget& w, bool shiftpressed ); + void midClicked( const TQPoint& p, KigWidget& w ); + void rightClicked( const std::vector<ObjectHolder*>& oco, const TQPoint& p, KigWidget& w ); + void mouseMoved( const std::vector<ObjectHolder*>& os, const TQPoint& p, KigWidget& w, bool shiftpressed ); void enableActions(); void cancelConstruction(); @@ -73,7 +73,7 @@ class BaseConstructMode // ObjectHolder* mcursorholder; std::vector<ObjectHolder*> mparents; - void leftReleased( QMouseEvent* e, KigWidget* v ); + void leftReleased( TQMouseEvent* e, KigWidget* v ); public: void selectObject( ObjectHolder* o, KigWidget& w ); @@ -82,19 +82,19 @@ public: protected: BaseConstructMode( KigPart& d ); protected: - void leftClickedObject( ObjectHolder* o, const QPoint& p, + void leftClickedObject( ObjectHolder* o, const TQPoint& p, KigWidget& w, bool ctrlOrShiftDown ); - void midClicked( const QPoint& p, KigWidget& w ); - void rightClicked( const std::vector<ObjectHolder*>& oco, const QPoint& p, KigWidget& w ); - void mouseMoved( const std::vector<ObjectHolder*>& os, const QPoint& p, KigWidget& w, bool shiftpressed ); + void midClicked( const TQPoint& p, KigWidget& w ); + void rightClicked( const std::vector<ObjectHolder*>& oco, const TQPoint& p, KigWidget& w ); + void mouseMoved( const std::vector<ObjectHolder*>& os, const TQPoint& p, KigWidget& w, bool shiftpressed ); void enableActions(); void cancelConstruction(); void finish(); protected: - virtual void handlePrelim( const std::vector<ObjectCalcer*>& os, const QPoint& p, KigPainter&, KigWidget& w ) = 0; - virtual QString selectStatement( const std::vector<ObjectCalcer*>& args, const KigWidget& w ) = 0; + virtual void handlePrelim( const std::vector<ObjectCalcer*>& os, const TQPoint& p, KigPainter&, KigWidget& w ) = 0; + virtual TQString selectStatement( const std::vector<ObjectCalcer*>& args, const KigWidget& w ) = 0; virtual int isAlreadySelectedOK( const std::vector<ObjectCalcer*>&, const int& ) = 0; virtual int wantArgs( const std::vector<ObjectCalcer*>&, KigDocument& d, KigWidget& w ) = 0; virtual void handleArgs( const std::vector<ObjectCalcer*>& args, KigWidget& w ) = 0; @@ -110,8 +110,8 @@ public: ConstructMode( KigPart& d, const ObjectConstructor* ctor ); ~ConstructMode(); - void handlePrelim( const std::vector<ObjectCalcer*>& os, const QPoint& p, KigPainter&, KigWidget& w ); - QString selectStatement( const std::vector<ObjectCalcer*>& args, const KigWidget& w ); + void handlePrelim( const std::vector<ObjectCalcer*>& os, const TQPoint& p, KigPainter&, KigWidget& w ); + TQString selectStatement( const std::vector<ObjectCalcer*>& args, const KigWidget& w ); int isAlreadySelectedOK( const std::vector<ObjectCalcer*>&, const int& ); int wantArgs( const std::vector<ObjectCalcer*>&, KigDocument& d, KigWidget& w ); void handleArgs( const std::vector<ObjectCalcer*>& args, KigWidget& w ); @@ -138,17 +138,17 @@ public: TestConstructMode( KigPart& d, const ArgsParserObjectType* type ); ~TestConstructMode(); - void handlePrelim( const std::vector<ObjectCalcer*>& os, const QPoint& p, KigPainter&, KigWidget& w ); - QString selectStatement( const std::vector<ObjectCalcer*>& args, const KigWidget& w ); + void handlePrelim( const std::vector<ObjectCalcer*>& os, const TQPoint& p, KigPainter&, KigWidget& w ); + TQString selectStatement( const std::vector<ObjectCalcer*>& args, const KigWidget& w ); int isAlreadySelectedOK( const std::vector<ObjectCalcer*>&, const int& ); int wantArgs( const std::vector<ObjectCalcer*>&, KigDocument& d, KigWidget& w ); void handleArgs( const std::vector<ObjectCalcer*>& args, KigWidget& w ); - void leftClickedObject( ObjectHolder* o, const QPoint& p, + void leftClickedObject( ObjectHolder* o, const TQPoint& p, KigWidget& w, bool ctrlOrShiftDown ); - void midClicked( const QPoint& p, KigWidget& w ); - void rightClicked( const std::vector<ObjectHolder*>& oco, const QPoint& p, KigWidget& w ); - void mouseMoved( const std::vector<ObjectHolder*>& os, const QPoint& p, KigWidget& w, bool shiftpressed ); + void midClicked( const TQPoint& p, KigWidget& w ); + void rightClicked( const std::vector<ObjectHolder*>& oco, const TQPoint& p, KigWidget& w ); + void mouseMoved( const std::vector<ObjectHolder*>& os, const TQPoint& p, KigWidget& w, bool shiftpressed ); }; #endif diff --git a/kig/modes/dragrectmode.cc b/kig/modes/dragrectmode.cc index a3c8c033..3a827009 100644 --- a/kig/modes/dragrectmode.cc +++ b/kig/modes/dragrectmode.cc @@ -22,11 +22,11 @@ #include "../kig/kig_view.h" #include "../misc/kigpainter.h" -#include <qevent.h> -#include <qglobal.h> +#include <tqevent.h> +#include <tqglobal.h> #include <kaction.h> -DragRectMode::DragRectMode( const QPoint& start, KigPart& d, KigWidget& w ) +DragRectMode::DragRectMode( const TQPoint& start, KigPart& d, KigWidget& w ) : KigMode( d ), mstart( start ), mnc( true ), mstartselected( true ), mcancelled( false ) { @@ -41,25 +41,25 @@ DragRectMode::DragRectMode( KigPart& d, KigWidget& w ) w.updateWidget(); } -void DragRectMode::moved( const QPoint& p, KigWidget& w ) +void DragRectMode::moved( const TQPoint& p, KigWidget& w ) { // update the rect... w.updateCurPix(); - std::vector<QRect> overlay; + std::vector<TQRect> overlay; if ( mstartselected ) { KigPainter pt( w.screenInfo(), &w.curPix, mdoc.document() ); - pt.drawFilledRect( QRect( p, mstart ) ); + pt.drawFilledRect( TQRect( p, mstart ) ); overlay = pt.overlay(); }; w.updateWidget( overlay ); } -void DragRectMode::released( const QPoint& p, KigWidget& w, bool nc ) +void DragRectMode::released( const TQPoint& p, KigWidget& w, bool nc ) { if ( mstartselected ) { - mrect = w.fromScreen( QRect( mstart, p ) ); + mrect = w.fromScreen( TQRect( mstart, p ) ); mret = mdoc.document().whatIsInHere( mrect, w ); mnc = nc; @@ -84,12 +84,12 @@ bool DragRectMode::needClear() const return mnc; } -void DragRectMode::moved( QMouseEvent* e, KigWidget& w ) +void DragRectMode::moved( TQMouseEvent* e, KigWidget& w ) { moved( e->pos(), w ); } -void DragRectMode::released( QMouseEvent* e, KigWidget& w ) +void DragRectMode::released( TQMouseEvent* e, KigWidget& w ) { released( e->pos(), w, ! ( e->state() & ( ControlButton | ShiftButton ) ) ); } @@ -98,37 +98,37 @@ DragRectMode::~DragRectMode() { } -void DragRectMode::mouseMoved( QMouseEvent* e, KigWidget* w ) +void DragRectMode::mouseMoved( TQMouseEvent* e, KigWidget* w ) { moved( e, *w ); } -void DragRectMode::leftMouseMoved( QMouseEvent* e, KigWidget* w ) +void DragRectMode::leftMouseMoved( TQMouseEvent* e, KigWidget* w ) { moved( e, *w ); } -void DragRectMode::midMouseMoved( QMouseEvent* e, KigWidget* w ) +void DragRectMode::midMouseMoved( TQMouseEvent* e, KigWidget* w ) { moved( e, *w ); } -void DragRectMode::rightMouseMoved( QMouseEvent* e, KigWidget* w ) +void DragRectMode::rightMouseMoved( TQMouseEvent* e, KigWidget* w ) { moved( e, *w ); } -void DragRectMode::leftReleased( QMouseEvent* e, KigWidget* w ) +void DragRectMode::leftReleased( TQMouseEvent* e, KigWidget* w ) { released( e, *w ); } -void DragRectMode::midReleased( QMouseEvent* e, KigWidget* w ) +void DragRectMode::midReleased( TQMouseEvent* e, KigWidget* w ) { released( e, *w ); } -void DragRectMode::rightReleased( QMouseEvent* e, KigWidget* w ) +void DragRectMode::rightReleased( TQMouseEvent* e, KigWidget* w ) { released( e, *w ); } @@ -138,27 +138,27 @@ Rect DragRectMode::rect() const return mrect; } -void DragRectMode::clicked( const QMouseEvent* e, KigWidget& w ) +void DragRectMode::clicked( const TQMouseEvent* e, KigWidget& w ) { clicked( e->pos(), w ); } -void DragRectMode::leftClicked( QMouseEvent* e, KigWidget* w ) +void DragRectMode::leftClicked( TQMouseEvent* e, KigWidget* w ) { clicked( e, *w ); } -void DragRectMode::midClicked( QMouseEvent* e, KigWidget* w ) +void DragRectMode::midClicked( TQMouseEvent* e, KigWidget* w ) { clicked( e, *w ); } -void DragRectMode::rightClicked( QMouseEvent* e, KigWidget* w ) +void DragRectMode::rightClicked( TQMouseEvent* e, KigWidget* w ) { clicked( e, *w ); } -void DragRectMode::clicked( const QPoint& p, KigWidget& ) +void DragRectMode::clicked( const TQPoint& p, KigWidget& ) { if ( !mstartselected ) { diff --git a/kig/modes/dragrectmode.h b/kig/modes/dragrectmode.h index 29f92139..d0348f31 100644 --- a/kig/modes/dragrectmode.h +++ b/kig/modes/dragrectmode.h @@ -23,7 +23,7 @@ #include "../misc/rect.h" -#include <qpoint.h> +#include <tqpoint.h> #include <vector> class ObjectHolder; @@ -40,37 +40,37 @@ class ObjectHolder; class DragRectMode : public KigMode { - QPoint mstart; + TQPoint mstart; std::vector<ObjectHolder*> mret; Rect mrect; bool mnc; bool mstartselected; bool mcancelled; private: - void clicked( const QPoint& p, KigWidget& w ); - void clicked( const QMouseEvent* e, KigWidget& w ); - void released( const QPoint& p, KigWidget& w, bool nc ); - void released( QMouseEvent* e, KigWidget& w ); - void moved( const QPoint& p, KigWidget& w ); - void moved( QMouseEvent*, KigWidget& w ); - - void leftClicked( QMouseEvent*, KigWidget* ); - void leftMouseMoved( QMouseEvent*, KigWidget* ); - void leftReleased( QMouseEvent*, KigWidget* ); - void midClicked( QMouseEvent*, KigWidget* ); - void midMouseMoved( QMouseEvent*, KigWidget* ); - void midReleased( QMouseEvent*, KigWidget* ); - void rightClicked( QMouseEvent*, KigWidget* ); - void rightMouseMoved( QMouseEvent*, KigWidget* ); - void rightReleased( QMouseEvent*, KigWidget* ); - void mouseMoved( QMouseEvent*, KigWidget* ); + void clicked( const TQPoint& p, KigWidget& w ); + void clicked( const TQMouseEvent* e, KigWidget& w ); + void released( const TQPoint& p, KigWidget& w, bool nc ); + void released( TQMouseEvent* e, KigWidget& w ); + void moved( const TQPoint& p, KigWidget& w ); + void moved( TQMouseEvent*, KigWidget& w ); + + void leftClicked( TQMouseEvent*, KigWidget* ); + void leftMouseMoved( TQMouseEvent*, KigWidget* ); + void leftReleased( TQMouseEvent*, KigWidget* ); + void midClicked( TQMouseEvent*, KigWidget* ); + void midMouseMoved( TQMouseEvent*, KigWidget* ); + void midReleased( TQMouseEvent*, KigWidget* ); + void rightClicked( TQMouseEvent*, KigWidget* ); + void rightMouseMoved( TQMouseEvent*, KigWidget* ); + void rightReleased( TQMouseEvent*, KigWidget* ); + void mouseMoved( TQMouseEvent*, KigWidget* ); void cancelConstruction(); void enableActions(); public: - DragRectMode( const QPoint& start, KigPart& d, KigWidget& w ); + DragRectMode( const TQPoint& start, KigPart& d, KigWidget& w ); DragRectMode( KigPart& d, KigWidget& w ); ~DragRectMode(); diff --git a/kig/modes/edittype.cc b/kig/modes/edittype.cc index 8c6b538f..f4ed323e 100644 --- a/kig/modes/edittype.cc +++ b/kig/modes/edittype.cc @@ -31,7 +31,7 @@ #include <kpushbutton.h> #include <kstdguiitem.h> -EditType::EditType( QWidget* parent, QString name, QString desc, QString icon ) +EditType::EditType( TQWidget* parent, TQString name, TQString desc, TQString icon ) : EditTypeBase( parent, "edittype", true ), mname( name ), mdesc( desc ), micon( icon ) { // improving GUI look'n'feel... @@ -50,13 +50,13 @@ EditType::~EditType() void EditType::helpSlot() { - kapp->invokeHelp( QString::fromLatin1( "working-with-types" ), - QString::fromLatin1( "kig" ) ); + kapp->invokeHelp( TQString::fromLatin1( "working-with-types" ), + TQString::fromLatin1( "kig" ) ); } void EditType::okSlot() { - QString tmp = editName->text(); + TQString tmp = editName->text(); if ( tmp.isEmpty() ) { KMessageBox::information( this, i18n( "The name of the macro can not be empty." ) ); @@ -91,17 +91,17 @@ void EditType::cancelSlot() done( 0 ); } -const QString EditType::name() const +const TQString EditType::name() const { return mname; } -const QString EditType::description() const +const TQString EditType::description() const { return mdesc; } -const QString EditType::icon() const +const TQString EditType::icon() const { return micon; } diff --git a/kig/modes/edittype.h b/kig/modes/edittype.h index c6530df5..c6f40783 100644 --- a/kig/modes/edittype.h +++ b/kig/modes/edittype.h @@ -29,15 +29,15 @@ class EditType : public EditTypeBase { Q_OBJECT - QString mname; - QString mdesc; - QString micon; + TQString mname; + TQString mdesc; + TQString micon; public: - EditType( QWidget* parent, QString name = QString::null, QString desc = QString::null, QString icon = QString::null ); + EditType( TQWidget* parent, TQString name = TQString::null, TQString desc = TQString::null, TQString icon = TQString::null ); ~EditType(); - const QString name() const; - const QString description() const; - const QString icon() const; + const TQString name() const; + const TQString description() const; + const TQString icon() const; public slots: void helpSlot(); diff --git a/kig/modes/label.cc b/kig/modes/label.cc index cd726918..578e15dd 100644 --- a/kig/modes/label.cc +++ b/kig/modes/label.cc @@ -38,12 +38,12 @@ #include <kmessagebox.h> #include <kaction.h> #include <klocale.h> -#include <qtextedit.h> +#include <tqtextedit.h> #include <kdebug.h> #include <kiconloader.h> -#include <qregexp.h> -#include <qpopupmenu.h> -#include <qcheckbox.h> +#include <tqregexp.h> +#include <tqpopupmenu.h> +#include <tqcheckbox.h> #include <algorithm> #include <functional> @@ -52,14 +52,14 @@ class TextLabelModeBase::Private { public: // point last clicked.. - QPoint plc; + TQPoint plc; // the currently selected coordinate Coordinate mcoord; // the possible parent object that defines the location of the label.. ObjectCalcer* locationparent; // the text is only kept in the text input widget, not here - // QString mtext; + // TQString mtext; // the property objects we'll be using as args, we keep a reference // to them in the args object, and keep a pointer to them ( or 0 ) @@ -96,7 +96,7 @@ TextLabelModeBase::TextLabelModeBase( KigPart& doc ) d->wiz = new TextLabelWizard( doc.widget(), this ); } -void TextLabelModeBase::leftClicked( QMouseEvent* e, KigWidget* ) +void TextLabelModeBase::leftClicked( TQMouseEvent* e, KigWidget* ) { d->plc = e->pos(); switch( d->mwawd ) @@ -111,7 +111,7 @@ void TextLabelModeBase::leftClicked( QMouseEvent* e, KigWidget* ) }; } -void TextLabelModeBase::leftReleased( QMouseEvent* e, KigWidget* v ) +void TextLabelModeBase::leftReleased( TQMouseEvent* e, KigWidget* v ) { switch( d->mwawd ) { @@ -132,19 +132,19 @@ void TextLabelModeBase::leftReleased( QMouseEvent* e, KigWidget* v ) std::vector<ObjectHolder*> os = mdoc.document().whatAmIOn( v->fromScreen( d->plc ), *v ); if ( os.empty() ) break; ObjectHolder* o = os[0]; - QPopupMenu* p = new QPopupMenu( v, "text_label_select_arg_popup" ); + TQPopupMenu* p = new TQPopupMenu( v, "text_label_select_arg_popup" ); p->insertItem( i18n( "Name" ), 0 ); QCStringList l = o->imp()->properties(); assert( l.size() == o->imp()->numberOfProperties() ); for ( int i = 0; static_cast<uint>( i ) < l.size(); ++i ) { - QString s = i18n( l[i] ); + TQString s = i18n( l[i] ); const char* iconfile = o->imp()->iconForProperty( i ); int t; if ( iconfile && *iconfile ) { - QPixmap pix = mdoc.instance()->iconLoader()->loadIcon( iconfile, KIcon::User ); - t = p->insertItem( QIconSet( pix ), s, i + 1 ); + TQPixmap pix = mdoc.instance()->iconLoader()->loadIcon( iconfile, KIcon::User ); + t = p->insertItem( TQIconSet( pix ), s, i + 1 ); } else { @@ -200,7 +200,7 @@ void TextLabelModeBase::enableActions() mdoc.aCancelConstruction->setEnabled( true ); } -void TextLabelModeBase::mouseMoved( QMouseEvent* e, KigWidget* w ) +void TextLabelModeBase::mouseMoved( TQMouseEvent* e, KigWidget* w ) { if ( d->mwawd == ReallySelectingArgs ) { @@ -228,13 +228,13 @@ void TextLabelModeBase::mouseMoved( QMouseEvent* e, KigWidget* w ) if ( attachable ) { w->setCursor( KCursor::handCursor() ); - QString s = d->locationparent->imp()->type()->attachToThisStatement(); + TQString s = d->locationparent->imp()->type()->attachToThisStatement(); mdoc.emitStatusBarText( s ); KigPainter p( w->screenInfo(), &w->curPix, mdoc.document() ); // set the text next to the arrow cursor - QPoint point = e->pos(); + TQPoint point = e->pos(); point.setX(point.x()+15); p.drawTextStd( point, s ); @@ -263,10 +263,10 @@ void TextLabelModeBase::cancelPressed() cancelConstruction(); } -static uint percentCount( const QString& s ) +static uint percentCount( const TQString& s ) { -// QRegExp re( QString::fromUtf8( "%[0-9]" ) ); - QRegExp re( QString::fromUtf8( "%[\\d]+" ) ); +// TQRegExp re( TQString::fromUtf8( "%[0-9]" ) ); + TQRegExp re( TQString::fromUtf8( "%[\\d]+" ) ); int offset = 0; uint percentcount = 0; while ( ( offset = re.search( s, offset ) ) != -1 ) @@ -280,7 +280,7 @@ static uint percentCount( const QString& s ) void TextLabelModeBase::finishPressed() { bool needframe = d->wiz->needFrameCheckBox->isChecked(); - QString s = d->wiz->labelTextInput->text(); + TQString s = d->wiz->labelTextInput->text(); assert( percentCount( s ) == d->args.size() ); if ( d->wiz->currentPage() == d->wiz->enter_text_page ) @@ -303,7 +303,7 @@ void TextLabelModeBase::finishPressed() void TextLabelModeBase::updateWiz() { - QString s = d->wiz->labelTextInput->text(); + TQString s = d->wiz->labelTextInput->text(); uint percentcount = percentCount( s ); if ( d->lpc > percentcount ) { @@ -344,9 +344,9 @@ void TextLabelModeBase::labelTextChanged() void TextLabelModeBase::updateLinksLabel() { LinksLabel::LinksLabelEditBuf buf = d->wiz->myCustomWidget1->startEdit(); - QString s = d->wiz->labelTextInput->text(); -// QRegExp re( "%[0-9]" ); - QRegExp re( "%[\\d]+" ); + TQString s = d->wiz->labelTextInput->text(); +// TQRegExp re( "%[0-9]" ); + TQRegExp re( "%[\\d]+" ); int prevpos = 0; int pos = 0; uint count = 0; @@ -361,12 +361,12 @@ void TextLabelModeBase::updateLinksLabel() // "link"... assert( prevpos < pos ); // fetch the text part... - QString subs = s.mid( prevpos, pos - prevpos ); + TQString subs = s.mid( prevpos, pos - prevpos ); // and add it... d->wiz->myCustomWidget1->addText( subs, buf ); }; // we always need a link part... - QString linktext( "%1" ); + TQString linktext( "%1" ); assert( count < d->args.size() ); if ( d->args[count] ) { @@ -428,7 +428,7 @@ void TextLabelModeBase::setCoordinate( const Coordinate& coord ) }; } -void TextLabelModeBase::setText( const QString& s ) +void TextLabelModeBase::setText( const TQString& s ) { d->wiz->labelTextInput->setText( s ); } @@ -450,7 +450,7 @@ TextLabelConstructionMode::~TextLabelConstructionMode() } void TextLabelConstructionMode::finish( - const Coordinate& coord, const QString& s, + const Coordinate& coord, const TQString& s, const argvect& props, bool needframe, ObjectCalcer* locationparent ) { @@ -483,7 +483,7 @@ TextLabelRedefineMode::TextLabelRedefineMode( KigPart& d, ObjectTypeCalcer* labe bool frame = static_cast<const IntImp*>( firstthree[0]->imp() )->data() != 0; Coordinate coord = static_cast<const PointImp*>( firstthree[1]->imp() )->coordinate(); - QString text = static_cast<const StringImp*>( firstthree[2]->imp() )->data(); + TQString text = static_cast<const StringImp*>( firstthree[2]->imp() )->data(); // don't set it, let the user redefine it.. // setCoordinate( coord ); @@ -505,7 +505,7 @@ TextLabelRedefineMode::~TextLabelRedefineMode() } void TextLabelRedefineMode::finish( - const Coordinate& coord, const QString& s, + const Coordinate& coord, const TQString& s, const argvect& props, bool needframe, ObjectCalcer* locationparent ) { diff --git a/kig/modes/label.h b/kig/modes/label.h index 4a3d09f7..1bb82f9a 100644 --- a/kig/modes/label.h +++ b/kig/modes/label.h @@ -61,7 +61,7 @@ protected: ~TextLabelModeBase(); void setCoordinate( const Coordinate& coord ); - void setText( const QString& s ); + void setText( const TQString& s ); void setLocationParent( ObjectCalcer* o ); /** * objects you pass here, should be newly created property objects, @@ -70,16 +70,16 @@ protected: void setPropertyObjects( const argvect& props ); void setFrame( bool f ); - virtual void finish( const Coordinate& c, const QString& s, + virtual void finish( const Coordinate& c, const TQString& s, const argvect& props, bool needframe, ObjectCalcer* locationparent ) = 0; private: // the KigMode interface.. - void leftClicked( QMouseEvent*, KigWidget* ); - void leftReleased( QMouseEvent*, KigWidget* ); + void leftClicked( TQMouseEvent*, KigWidget* ); + void leftReleased( TQMouseEvent*, KigWidget* ); - void mouseMoved( QMouseEvent*, KigWidget* ); + void mouseMoved( TQMouseEvent*, KigWidget* ); void enableActions(); @@ -109,7 +109,7 @@ public: TextLabelConstructionMode( KigPart& d ); ~TextLabelConstructionMode(); - void finish( const Coordinate& coord, const QString& s, + void finish( const Coordinate& coord, const TQString& s, const argvect& props, bool needframe, ObjectCalcer* locationparent ); }; @@ -118,7 +118,7 @@ class TextLabelRedefineMode : public TextLabelModeBase { ObjectTypeCalcer* mlabel; - void finish( const Coordinate& coord, const QString& s, + void finish( const Coordinate& coord, const TQString& s, const argvect& props, bool needframe, ObjectCalcer* locationparent ); public: diff --git a/kig/modes/linkslabel.cpp b/kig/modes/linkslabel.cpp index 572c0bf8..96a73a8f 100644 --- a/kig/modes/linkslabel.cpp +++ b/kig/modes/linkslabel.cpp @@ -19,9 +19,9 @@ #include "linkslabel.h" #include "linkslabel.moc" -#include <qlabel.h> +#include <tqlabel.h> #include <kurllabel.h> -#include <qlayout.h> +#include <tqlayout.h> #include <vector> #include <algorithm> @@ -33,27 +33,27 @@ using namespace std; class LinksLabel::Private { public: - QHBoxLayout* layout; - std::vector<QLabel*> labels; + TQHBoxLayout* layout; + std::vector<TQLabel*> labels; std::vector<KURLLabel*> urllabels; }; -LinksLabel::LinksLabel( QWidget* parent, const char* name ) - : QWidget( parent, name ) +LinksLabel::LinksLabel( TQWidget* parent, const char* name ) + : TQWidget( parent, name ) { p = new Private; - p->layout = new QHBoxLayout( this ); + p->layout = new TQHBoxLayout( this ); - QLabel* l = new QLabel( QString::fromUtf8( "Dit is een " ), this ); + TQLabel* l = new TQLabel( TQString::fromUtf8( "Dit is een " ), this ); p->labels.push_back( l ); p->layout->addWidget( l ); - KURLLabel* u = new KURLLabel( QString::fromUtf8( "http://www.kde.org/" ), - QString::fromUtf8( "url"), this ); + KURLLabel* u = new KURLLabel( TQString::fromUtf8( "http://www.kde.org/" ), + TQString::fromUtf8( "url"), this ); p->urllabels.push_back( u ); p->layout->addWidget( u ); - l = new QLabel( QString::fromUtf8( " !" ), this ); + l = new TQLabel( TQString::fromUtf8( " !" ), this ); p->labels.push_back( l ); p->layout->addWidget(l ); @@ -67,7 +67,7 @@ LinksLabel::~LinksLabel() void LinksLabel::urlClicked() { - const QObject* o = sender(); + const TQObject* o = sender(); std::vector<KURLLabel*>::iterator i = std::find( p->urllabels.begin(), p->urllabels.end(), static_cast<const KURLLabel*>( o ) ); assert( i != p->urllabels.end() ); emit linkClicked( i - p->urllabels.begin() ); @@ -78,18 +78,18 @@ LinksLabel::LinksLabelEditBuf LinksLabel::startEdit() return LinksLabelEditBuf(); } -void LinksLabel::addText( const QString& s, LinksLabelEditBuf& buf ) +void LinksLabel::addText( const TQString& s, LinksLabelEditBuf& buf ) { - buf.data.push_back( std::pair<bool, QString>( false, s ) ); + buf.data.push_back( std::pair<bool, TQString>( false, s ) ); } -void LinksLabel::addLink( const QString& s, LinksLabelEditBuf& buf ) +void LinksLabel::addLink( const TQString& s, LinksLabelEditBuf& buf ) { - buf.data.push_back( std::pair<bool, QString>( true, s ) ); + buf.data.push_back( std::pair<bool, TQString>( true, s ) ); } namespace { - void deleteObj( QObject* o ) { delete o; } + void deleteObj( TQObject* o ) { delete o; } } void LinksLabel::applyEdit( LinksLabelEditBuf& buf ) @@ -100,7 +100,7 @@ void LinksLabel::applyEdit( LinksLabelEditBuf& buf ) p->labels.clear(); delete p->layout; - p->layout = new QHBoxLayout( this ); + p->layout = new TQHBoxLayout( this ); for ( LinksLabelEditBuf::vec::iterator i = buf.data.begin(); i != buf.data.end(); ++i ) { @@ -108,27 +108,27 @@ void LinksLabel::applyEdit( LinksLabelEditBuf& buf ) { // we need a KURLLabel... // the url is an unused stub... - KURLLabel* l = new KURLLabel( QString::fromUtf8( "http://edu.kde.org/kig" ), + KURLLabel* l = new KURLLabel( TQString::fromUtf8( "http://edu.kde.org/kig" ), i->second, this ); p->urllabels.push_back( l ); p->layout->addWidget( l ); - connect( l, SIGNAL( leftClickedURL() ), SLOT( urlClicked() ) ); + connect( l, TQT_SIGNAL( leftClickedURL() ), TQT_SLOT( urlClicked() ) ); } else { // we need a normal label... - QLabel* l = new QLabel( i->second, this ); + TQLabel* l = new TQLabel( i->second, this ); p->labels.push_back( l ); p->layout->addWidget( l ); }; }; - QSpacerItem* spacer = new QSpacerItem( 40, 20, QSizePolicy::Expanding, QSizePolicy::Minimum ); + TQSpacerItem* spacer = new TQSpacerItem( 40, 20, TQSizePolicy::Expanding, TQSizePolicy::Minimum ); p->layout->addItem( spacer ); p->layout->activate(); - std::for_each( p->urllabels.begin(), p->urllabels.end(), mem_fun( &QWidget::show ) ); - std::for_each( p->labels.begin(), p->labels.end(), mem_fun( &QWidget::show ) ); + std::for_each( p->urllabels.begin(), p->urllabels.end(), mem_fun( &TQWidget::show ) ); + std::for_each( p->labels.begin(), p->labels.end(), mem_fun( &TQWidget::show ) ); } diff --git a/kig/modes/linkslabel.h b/kig/modes/linkslabel.h index ba64dbc2..89d1c76e 100644 --- a/kig/modes/linkslabel.h +++ b/kig/modes/linkslabel.h @@ -18,7 +18,7 @@ #ifndef KIG_lINKS_LABEL_H #define KIG_lINKS_LABEL_H -#include <qwidget.h> +#include <tqwidget.h> #include <vector> #include <utility> @@ -32,7 +32,7 @@ class LinksLabel : public QWidget Q_OBJECT public: - LinksLabel( QWidget* parent = 0, const char* name = 0 ); + LinksLabel( TQWidget* parent = 0, const char* name = 0 ); ~LinksLabel(); class LinksLabelEditBuf @@ -43,7 +43,7 @@ public: private: // declare these private so only LinksLabel can use them... LinksLabelEditBuf() {} - typedef std::vector<std::pair<bool,QString> > vec; + typedef std::vector<std::pair<bool,TQString> > vec; vec data; }; @@ -55,11 +55,11 @@ public: /** * add a piece of normal text.. */ - void addText( const QString& s, LinksLabelEditBuf& buf ); + void addText( const TQString& s, LinksLabelEditBuf& buf ); /** * add a link... */ - void addLink( const QString& s, LinksLabelEditBuf& buf ); + void addLink( const TQString& s, LinksLabelEditBuf& buf ); /** * apply the changes... This clears the current contents and adds * the new data... diff --git a/kig/modes/macro.cc b/kig/modes/macro.cc index 879466dc..bc6f5dc5 100644 --- a/kig/modes/macro.cc +++ b/kig/modes/macro.cc @@ -161,7 +161,7 @@ void DefineMacroMode::macroNameChanged() ); } -void DefineMacroMode::dragRect( const QPoint& p, KigWidget& w ) +void DefineMacroMode::dragRect( const TQPoint& p, KigWidget& w ) { if ( mwizard->currentPage() == mwizard->mpname ) return; std::vector<ObjectHolder*>* objs = mwizard->currentPage() == mwizard->mpgiven ? &mgiven : &mfinal; @@ -186,7 +186,7 @@ void DefineMacroMode::dragRect( const QPoint& p, KigWidget& w ) updateNexts(); } -void DefineMacroMode::leftClickedObject( ObjectHolder* o, const QPoint&, +void DefineMacroMode::leftClickedObject( ObjectHolder* o, const TQPoint&, KigWidget& w, bool ) { if ( mwizard->currentPage() == mwizard->mpname ) return; @@ -204,7 +204,7 @@ void DefineMacroMode::leftClickedObject( ObjectHolder* o, const QPoint&, updateNexts(); } -void DefineMacroMode::mouseMoved( const std::vector<ObjectHolder*>& os, const QPoint& pt, KigWidget& w, bool ) +void DefineMacroMode::mouseMoved( const std::vector<ObjectHolder*>& os, const TQPoint& pt, KigWidget& w, bool ) { w.updateCurPix(); @@ -220,14 +220,14 @@ void DefineMacroMode::mouseMoved( const std::vector<ObjectHolder*>& os, const QP // and set statusbar text w.setCursor( KCursor::handCursor() ); - QString selectstat = os.front()->selectStatement(); + TQString selectstat = os.front()->selectStatement(); // statusbar text mdoc.emitStatusBarText( selectstat ); KigPainter p( w.screenInfo(), &w.curPix, mdoc.document() ); // set the text next to the arrow cursor - QPoint point = pt; + TQPoint point = pt; point.setX(point.x()+15); p.drawTextStd( point, selectstat ); @@ -235,11 +235,11 @@ void DefineMacroMode::mouseMoved( const std::vector<ObjectHolder*>& os, const QP } } -void DefineMacroMode::rightClicked( const std::vector<ObjectHolder*>&, const QPoint&, KigWidget& ) +void DefineMacroMode::rightClicked( const std::vector<ObjectHolder*>&, const TQPoint&, KigWidget& ) { } -void DefineMacroMode::midClicked( const QPoint&, KigWidget& ) +void DefineMacroMode::midClicked( const TQPoint&, KigWidget& ) { } diff --git a/kig/modes/macro.h b/kig/modes/macro.h index 4bf8c43e..8725f0c8 100644 --- a/kig/modes/macro.h +++ b/kig/modes/macro.h @@ -20,7 +20,7 @@ #include "base_mode.h" -#include <qobject.h> +#include <tqobject.h> class MacroWizard; @@ -31,12 +31,12 @@ public: DefineMacroMode( KigPart& ); ~DefineMacroMode(); - void dragRect( const QPoint& p, KigWidget& w ); - void leftClickedObject( ObjectHolder* o, const QPoint& p, + void dragRect( const TQPoint& p, KigWidget& w ); + void leftClickedObject( ObjectHolder* o, const TQPoint& p, KigWidget& w, bool ctrlOrShiftDown ); - void rightClicked( const std::vector<ObjectHolder*>& oco, const QPoint& p, KigWidget& w ); - void midClicked( const QPoint& p, KigWidget& w ); - void mouseMoved( const std::vector<ObjectHolder*>& os, const QPoint& p, KigWidget& w, bool shiftpressed ); + void rightClicked( const std::vector<ObjectHolder*>& oco, const TQPoint& p, KigWidget& w ); + void midClicked( const TQPoint& p, KigWidget& w ); + void mouseMoved( const std::vector<ObjectHolder*>& os, const TQPoint& p, KigWidget& w, bool shiftpressed ); // called by MacroWizard class void givenPageEntered(); @@ -57,7 +57,7 @@ protected: */ void abandonMacro(); - QPoint plc; + TQPoint plc; MacroWizard* mwizard; // we can't use a set for this because the order is important diff --git a/kig/modes/macrowizard.cc b/kig/modes/macrowizard.cc index e6315caf..662e3a0d 100644 --- a/kig/modes/macrowizard.cc +++ b/kig/modes/macrowizard.cc @@ -24,13 +24,13 @@ #include <klineedit.h> #include <kapplication.h> -MacroWizard::MacroWizard( QWidget* parent, DefineMacroMode* m ) +MacroWizard::MacroWizard( TQWidget* parent, DefineMacroMode* m ) : MacroWizardBase( parent, "Define Macro Wizard", false ), mmode( m ) { - connect( KLineEdit2, SIGNAL( textChanged( const QString& ) ), - this, SLOT( nameTextChanged( const QString& ) ) ); - connect( this, SIGNAL( helpClicked() ), this, - SLOT( slotHelpClicked() ) ); + connect( KLineEdit2, TQT_SIGNAL( textChanged( const TQString& ) ), + this, TQT_SLOT( nameTextChanged( const TQString& ) ) ); + connect( this, TQT_SIGNAL( helpClicked() ), this, + TQT_SLOT( slotHelpClicked() ) ); } MacroWizard::~MacroWizard() @@ -73,7 +73,7 @@ void MacroWizard::reject() mmode->cancelPressed(); } -void MacroWizard::nameTextChanged( const QString& ) +void MacroWizard::nameTextChanged( const TQString& ) { mmode->macroNameChanged(); } @@ -85,6 +85,6 @@ void MacroWizard::accept() void MacroWizard::slotHelpClicked() { - kapp->invokeHelp( QString::fromLatin1( "defining-macros"), - QString::fromLatin1( "kig" ) ); + kapp->invokeHelp( TQString::fromLatin1( "defining-macros"), + TQString::fromLatin1( "kig" ) ); } diff --git a/kig/modes/macrowizard.h b/kig/modes/macrowizard.h index dfce8b06..96318ec9 100644 --- a/kig/modes/macrowizard.h +++ b/kig/modes/macrowizard.h @@ -26,7 +26,7 @@ class MacroWizard : public MacroWizardBase { Q_OBJECT public: - MacroWizard( QWidget* parent, DefineMacroMode* m ); + MacroWizard( TQWidget* parent, DefineMacroMode* m ); ~MacroWizard(); void back(); @@ -34,7 +34,7 @@ public: void reject(); void accept(); private slots: - void nameTextChanged( const QString& ); + void nameTextChanged( const TQString& ); void slotHelpClicked(); private: DefineMacroMode* mmode; diff --git a/kig/modes/mode.cc b/kig/modes/mode.cc index 9d95b64d..76edc4f1 100644 --- a/kig/modes/mode.cc +++ b/kig/modes/mode.cc @@ -48,46 +48,46 @@ KigMode::KigMode( KigPart& d ) { } -void KigMode::leftClicked( QMouseEvent*, KigWidget* ) +void KigMode::leftClicked( TQMouseEvent*, KigWidget* ) { } -void KigMode::leftMouseMoved( QMouseEvent*, KigWidget* ) +void KigMode::leftMouseMoved( TQMouseEvent*, KigWidget* ) { } -void KigMode::leftReleased( QMouseEvent*, KigWidget* ) +void KigMode::leftReleased( TQMouseEvent*, KigWidget* ) { /* insist disabling the undo button to avoid crashes */ mdoc.action( "edit_undo" )->setEnabled( false ); mdoc.action( "edit_redo" )->setEnabled( false ); } -void KigMode::midClicked( QMouseEvent*, KigWidget* ) +void KigMode::midClicked( TQMouseEvent*, KigWidget* ) { } -void KigMode::midMouseMoved( QMouseEvent*, KigWidget* ) +void KigMode::midMouseMoved( TQMouseEvent*, KigWidget* ) { } -void KigMode::midReleased( QMouseEvent*, KigWidget* ) +void KigMode::midReleased( TQMouseEvent*, KigWidget* ) { } -void KigMode::rightClicked( QMouseEvent*, KigWidget* ) +void KigMode::rightClicked( TQMouseEvent*, KigWidget* ) { } -void KigMode::rightMouseMoved( QMouseEvent*, KigWidget* ) +void KigMode::rightMouseMoved( TQMouseEvent*, KigWidget* ) { } -void KigMode::rightReleased( QMouseEvent*, KigWidget* ) +void KigMode::rightReleased( TQMouseEvent*, KigWidget* ) { } -void KigMode::mouseMoved( QMouseEvent*, KigWidget* ) +void KigMode::mouseMoved( TQMouseEvent*, KigWidget* ) { } diff --git a/kig/modes/mode.h b/kig/modes/mode.h index 6f476072..9dede83b 100644 --- a/kig/modes/mode.h +++ b/kig/modes/mode.h @@ -21,7 +21,7 @@ #ifndef KIG_PART_MODE_H #define KIG_PART_MODE_H -#include <qnamespace.h> +#include <tqnamespace.h> class KigDocument; class KigPart; @@ -41,23 +41,23 @@ public: virtual StdConstructionMode* toStdConstructionMode(); - virtual void leftClicked( QMouseEvent*, KigWidget* ); + virtual void leftClicked( TQMouseEvent*, KigWidget* ); /** * this means: mouse moved with left mouse button down (in case that * wasn't clear...) */ - virtual void leftMouseMoved( QMouseEvent*, KigWidget* ); - virtual void leftReleased( QMouseEvent*, KigWidget* ); - virtual void midClicked( QMouseEvent*, KigWidget* ); - virtual void midMouseMoved( QMouseEvent*, KigWidget* ); - virtual void midReleased( QMouseEvent*, KigWidget* ); - virtual void rightClicked( QMouseEvent*, KigWidget* ); - virtual void rightMouseMoved( QMouseEvent*, KigWidget* ); - virtual void rightReleased( QMouseEvent*, KigWidget* ); + virtual void leftMouseMoved( TQMouseEvent*, KigWidget* ); + virtual void leftReleased( TQMouseEvent*, KigWidget* ); + virtual void midClicked( TQMouseEvent*, KigWidget* ); + virtual void midMouseMoved( TQMouseEvent*, KigWidget* ); + virtual void midReleased( TQMouseEvent*, KigWidget* ); + virtual void rightClicked( TQMouseEvent*, KigWidget* ); + virtual void rightMouseMoved( TQMouseEvent*, KigWidget* ); + virtual void rightReleased( TQMouseEvent*, KigWidget* ); /** * mouse moved without any buttons down... */ - virtual void mouseMoved( QMouseEvent*, KigWidget* ); + virtual void mouseMoved( TQMouseEvent*, KigWidget* ); /** * actions: we enable the actions we want when our mode is made diff --git a/kig/modes/moving.cc b/kig/modes/moving.cc index e628a7ce..533b15d4 100644 --- a/kig/modes/moving.cc +++ b/kig/modes/moving.cc @@ -29,7 +29,7 @@ #include "../misc/calcpaths.h" #include "../misc/coordinate_system.h" -#include <qevent.h> +#include <tqevent.h> #include <functional> #include <algorithm> @@ -65,7 +65,7 @@ void MovingModeBase::initScreen( const std::vector<ObjectCalcer*>& in ) p2.drawObjects( drawableset.begin(), drawableset.end(), true ); } -void MovingModeBase::leftReleased( QMouseEvent*, KigWidget* v ) +void MovingModeBase::leftReleased( TQMouseEvent*, KigWidget* v ) { // clean up after ourselves: for ( std::vector<ObjectCalcer*>::iterator i = mcalcable.begin(); @@ -81,7 +81,7 @@ void MovingModeBase::leftReleased( QMouseEvent*, KigWidget* v ) mdoc.doneMode( this ); } -void MovingModeBase::mouseMoved( QMouseEvent* e, KigWidget* v ) +void MovingModeBase::mouseMoved( TQMouseEvent* e, KigWidget* v ) { v->updateCurPix(); Coordinate c = v->fromScreen( e->pos() ); @@ -152,7 +152,7 @@ MovingMode::MovingMode( const std::vector<ObjectHolder*>& os, const Coordinate& void MovingMode::stopMove() { - QString text = d->emo.size() == 1 ? + TQString text = d->emo.size() == 1 ? d->emo[0]->imp()->type()->moveAStatement() : i18n( "Move %1 Objects" ).arg( d->emo.size() ); KigCommand* mc = new KigCommand( mdoc, text ); @@ -208,7 +208,7 @@ MovingModeBase::~MovingModeBase() { } -void MovingModeBase::leftMouseMoved( QMouseEvent* e, KigWidget* v ) +void MovingModeBase::leftMouseMoved( TQMouseEvent* e, KigWidget* v ) { mouseMoved( e, v ); } diff --git a/kig/modes/moving.h b/kig/modes/moving.h index 32828db3..7c27aa4e 100644 --- a/kig/modes/moving.h +++ b/kig/modes/moving.h @@ -66,9 +66,9 @@ protected: virtual void moveTo( const Coordinate& o, bool snaptogrid ) = 0; public: - void leftReleased( QMouseEvent*, KigWidget* ); - void leftMouseMoved( QMouseEvent*, KigWidget* ); - void mouseMoved( QMouseEvent*, KigWidget* ); + void leftReleased( TQMouseEvent*, KigWidget* ); + void leftMouseMoved( TQMouseEvent*, KigWidget* ); + void mouseMoved( TQMouseEvent*, KigWidget* ); }; class MovingMode diff --git a/kig/modes/normal.cc b/kig/modes/normal.cc index ecf5f5c1..1fa45d00 100644 --- a/kig/modes/normal.cc +++ b/kig/modes/normal.cc @@ -128,7 +128,7 @@ NormalMode::~NormalMode() { } -void NormalMode::dragRect( const QPoint& p, KigWidget& w ) +void NormalMode::dragRect( const TQPoint& p, KigWidget& w ) { DragRectMode d( p, mdoc, w ); mdoc.runMode( &d ); @@ -153,7 +153,7 @@ void NormalMode::dragRect( const QPoint& p, KigWidget& w ) w.updateWidget(); } -void NormalMode::dragObject( const std::vector<ObjectHolder*>& oco, const QPoint& pco, +void NormalMode::dragObject( const std::vector<ObjectHolder*>& oco, const TQPoint& pco, KigWidget& w, bool ctrlOrShiftDown ) { // first determine what to move... @@ -171,7 +171,7 @@ void NormalMode::dragObject( const std::vector<ObjectHolder*>& oco, const QPoint mdoc.runMode( &m ); } -void NormalMode::leftClickedObject( ObjectHolder* o, const QPoint&, +void NormalMode::leftClickedObject( ObjectHolder* o, const TQPoint&, KigWidget& w, bool ctrlOrShiftDown ) { KigPainter pter( w.screenInfo(), &w.stillPix, mdoc.document() ); @@ -202,7 +202,7 @@ void NormalMode::leftClickedObject( ObjectHolder* o, const QPoint&, w.updateWidget(); } -void NormalMode::midClicked( const QPoint& p, KigWidget& w ) +void NormalMode::midClicked( const TQPoint& p, KigWidget& w ) { ObjectHolder* pto = ObjectFactory::instance()->sensiblePoint( w.fromScreen( p ), mdoc.document(), w ); pto->calc( mdoc.document() ); @@ -215,11 +215,11 @@ void NormalMode::midClicked( const QPoint& p, KigWidget& w ) } void NormalMode::rightClicked( const std::vector<ObjectHolder*>& os, - const QPoint& plc, + const TQPoint& plc, KigWidget& w ) { // saving the current cursor position - QPoint pt = QCursor::pos(); + TQPoint pt = TQCursor::pos(); if( !os.empty() ) { ObjectHolder* o = 0; @@ -246,7 +246,7 @@ void NormalMode::rightClicked( const std::vector<ObjectHolder*>& os, } void NormalMode::mouseMoved( const std::vector<ObjectHolder*>& os, - const QPoint& plc, + const TQPoint& plc, KigWidget& w, bool ) { @@ -265,14 +265,14 @@ void NormalMode::mouseMoved( const std::vector<ObjectHolder*>& os, w.setCursor( KCursor::handCursor() ); int id = ObjectChooserPopup::getObjectFromList( plc, &w, os, false ); - QString stat = id == 0 ? os.front()->selectStatement() : i18n( "Which object?" ); + TQString stat = id == 0 ? os.front()->selectStatement() : i18n( "Which object?" ); // statusbar text mdoc.emitStatusBarText( stat ); KigPainter p( w.screenInfo(), &w.curPix, mdoc.document() ); // set the text next to the arrow cursor - QPoint point = plc; + TQPoint point = plc; point.setX(point.x()+15); p.drawTextStd( point, stat ); diff --git a/kig/modes/normal.h b/kig/modes/normal.h index dd51c854..314b7e20 100644 --- a/kig/modes/normal.h +++ b/kig/modes/normal.h @@ -20,7 +20,7 @@ #include "base_mode.h" -#include <qpoint.h> +#include <tqpoint.h> #include <set> class NormalMode @@ -30,14 +30,14 @@ public: NormalMode( KigPart& ); ~NormalMode(); protected: - void dragRect( const QPoint& p, KigWidget& w ); - void dragObject( const std::vector<ObjectHolder*>& os, const QPoint& pointClickedOn, + void dragRect( const TQPoint& p, KigWidget& w ); + void dragObject( const std::vector<ObjectHolder*>& os, const TQPoint& pointClickedOn, KigWidget& w, bool ctrlOrShiftDown ); - void leftClickedObject( ObjectHolder* o, const QPoint& p, + void leftClickedObject( ObjectHolder* o, const TQPoint& p, KigWidget& w, bool ctrlOrShiftDown ); - void midClicked( const QPoint& p, KigWidget& w ); - void rightClicked( const std::vector<ObjectHolder*>& os, const QPoint& p, KigWidget& w ); - void mouseMoved( const std::vector<ObjectHolder*>& os, const QPoint& p, KigWidget& w, + void midClicked( const TQPoint& p, KigWidget& w ); + void rightClicked( const std::vector<ObjectHolder*>& os, const TQPoint& p, KigWidget& w ); + void mouseMoved( const std::vector<ObjectHolder*>& os, const TQPoint& p, KigWidget& w, bool shiftpressed ); void selectAll(); void deselectAll(); diff --git a/kig/modes/popup.cc b/kig/modes/popup.cc index b71d9896..489b4985 100644 --- a/kig/modes/popup.cc +++ b/kig/modes/popup.cc @@ -46,11 +46,11 @@ #include <algorithm> #include <functional> -#include <qcursor.h> -#include <qdialog.h> -#include <qpen.h> -#include <qregexp.h> -#include <qvalidator.h> +#include <tqcursor.h> +#include <tqdialog.h> +#include <tqpen.h> +#include <tqregexp.h> +#include <tqvalidator.h> #include <kaction.h> #include <kcolordialog.h> @@ -184,21 +184,21 @@ NormalModePopupObjects::NormalModePopupObjects( KigPart& part, KigWidget& view, NormalMode& mode, const std::vector<ObjectHolder*>& objs, - const QPoint& plc ) + const TQPoint& plc ) : KPopupMenu( &view ), mplc( plc ), mpart( part ), mview( view ), mobjs( objs ), mmode( mode ), monlylabels( false ) { bool empty = objs.empty(); bool single = objs.size() == 1; - connect( this, SIGNAL( activated( int ) ), this, SLOT( toplevelMenuSlot( int ) ) ); + connect( this, TQT_SIGNAL( activated( int ) ), this, TQT_SLOT( toplevelMenuSlot( int ) ) ); - QString title; + TQString title; if ( empty ) title = i18n( "Kig Document" ); else if ( single ) { if ( !objs[0]->name().isNull() ) - title = QString::fromLatin1( "%1 %2" ).arg( objs[0]->imp()->type()->translatedName() ).arg( objs[0]->name() ); + title = TQString::fromLatin1( "%1 %2" ).arg( objs[0]->imp()->type()->translatedName() ).arg( objs[0]->name() ); else title = objs[0]->imp()->type()->translatedName(); } @@ -244,26 +244,26 @@ NormalModePopupObjects::NormalModePopupObjects( KigPart& part, #endif for ( uint i = 0; i < NumberOfMenus; ++i ) - mmenus[i] = new QPopupMenu( this ); - - connect( mmenus[TransformMenu], SIGNAL( activated( int ) ), - this, SLOT( transformMenuSlot( int ) ) ); - connect( mmenus[TestMenu], SIGNAL( activated( int ) ), - this, SLOT( testMenuSlot( int ) ) ); - connect( mmenus[ConstructMenu], SIGNAL( activated( int ) ), - this, SLOT( constructMenuSlot( int ) ) ); - connect( mmenus[StartMenu], SIGNAL( activated( int ) ), - this, SLOT( startMenuSlot( int ) ) ); - connect( mmenus[ShowMenu], SIGNAL( activated( int ) ), - this, SLOT( showMenuSlot( int ) ) ); - connect( mmenus[SetColorMenu], SIGNAL( activated( int ) ), - this, SLOT( setColorMenuSlot( int ) ) ); - connect( mmenus[SetSizeMenu], SIGNAL( activated( int ) ), - this, SLOT( setSizeMenuSlot( int ) ) ); - connect( mmenus[SetStyleMenu], SIGNAL( activated( int ) ), - this, SLOT( setStyleMenuSlot( int ) ) ); - connect( mmenus[SetCoordinateSystemMenu], SIGNAL( activated( int ) ), - this, SLOT( setCoordinateSystemMenuSlot( int ) ) ); + mmenus[i] = new TQPopupMenu( this ); + + connect( mmenus[TransformMenu], TQT_SIGNAL( activated( int ) ), + this, TQT_SLOT( transformMenuSlot( int ) ) ); + connect( mmenus[TestMenu], TQT_SIGNAL( activated( int ) ), + this, TQT_SLOT( testMenuSlot( int ) ) ); + connect( mmenus[ConstructMenu], TQT_SIGNAL( activated( int ) ), + this, TQT_SLOT( constructMenuSlot( int ) ) ); + connect( mmenus[StartMenu], TQT_SIGNAL( activated( int ) ), + this, TQT_SLOT( startMenuSlot( int ) ) ); + connect( mmenus[ShowMenu], TQT_SIGNAL( activated( int ) ), + this, TQT_SLOT( showMenuSlot( int ) ) ); + connect( mmenus[SetColorMenu], TQT_SIGNAL( activated( int ) ), + this, TQT_SLOT( setColorMenuSlot( int ) ) ); + connect( mmenus[SetSizeMenu], TQT_SIGNAL( activated( int ) ), + this, TQT_SLOT( setSizeMenuSlot( int ) ) ); + connect( mmenus[SetStyleMenu], TQT_SIGNAL( activated( int ) ), + this, TQT_SLOT( setStyleMenuSlot( int ) ) ); + connect( mmenus[SetCoordinateSystemMenu], TQT_SIGNAL( activated( int ) ), + this, TQT_SLOT( setCoordinateSystemMenuSlot( int ) ) ); for ( int i = 0; i <= NumberOfMenus; ++i ) { @@ -271,7 +271,7 @@ NormalModePopupObjects::NormalModePopupObjects( KigPart& part, for ( uint j = 0; j < mproviders.size(); ++j ) mproviders[j]->fillUpMenu( *this, i, nextfree ); }; - static const QString menunames[NumberOfMenus] = + static const TQString menunames[NumberOfMenus] = { i18n( "&Transform" ), i18n( "T&est" ), @@ -281,22 +281,22 @@ NormalModePopupObjects::NormalModePopupObjects( KigPart& part, i18n( "Set Co&lor" ), i18n( "Set &Pen Width" ), i18n( "Set St&yle" ), - QString::null, + TQString::null, i18n( "Set Coordinate S&ystem" ) }; - static const QString menuicons[NumberOfMenus] = + static const TQString menuicons[NumberOfMenus] = { "centralsymmetry", "test", - QString::null, + TQString::null, "launch", "kig_text", "color_fill", // "colorize", "sizer", "paintbrush", - QString::null, - QString::null + TQString::null, + TQString::null }; int index = 1; for ( int i = 0; i < NumberOfMenus; ++i ) @@ -307,8 +307,8 @@ NormalModePopupObjects::NormalModePopupObjects( KigPart& part, else { KIconLoader* l = part.instance()->iconLoader(); - QPixmap icon = l->loadIcon( menuicons[i], KIcon::Small, 22, KIcon::DefaultState, 0L, true ); - insertItem( QIconSet( icon ), menunames[i], mmenus[i], i, index++ ); + TQPixmap icon = l->loadIcon( menuicons[i], KIcon::Small, 22, KIcon::DefaultState, 0L, true ); + insertItem( TQIconSet( icon ), menunames[i], mmenus[i], i, index++ ); } }; } @@ -358,7 +358,7 @@ NormalModePopupObjects::~NormalModePopupObjects() delete_all ( mproviders.begin(), mproviders.end() ); } -static const QColor* colors[] = +static const TQColor* colors[] = { &Qt::blue, &Qt::black, @@ -369,7 +369,7 @@ static const QColor* colors[] = &Qt::yellow, &Qt::darkRed }; -static const int numberofcolors = sizeof( colors ) / sizeof( QColor* ); +static const int numberofcolors = sizeof( colors ) / sizeof( TQColor* ); void BuiltinObjectActionsProvider::fillUpMenu( NormalModePopupObjects& popup, int menu, int& nextfree ) { @@ -397,15 +397,15 @@ void BuiltinObjectActionsProvider::fillUpMenu( NormalModePopupObjects& popup, in popup.addAction( menu, i18n( "&Show" ), nextfree+1 ); } nextfree += 2; - QPixmap p = l->loadIcon( "move", KIcon::Toolbar ); + TQPixmap p = l->loadIcon( "move", KIcon::Toolbar ); popup.addAction( menu, p, i18n( "&Move" ), nextfree++ ); p = l->loadIcon( "editdelete", KIcon::Toolbar ); popup.addAction( menu, p, i18n( "&Delete" ), nextfree++ ); } else if ( menu == NormalModePopupObjects::SetColorMenu ) { - QPixmap p( 50, 20 ); - for( const QColor** c = colors; c < colors + numberofcolors; ++c ) + TQPixmap p( 50, 20 ); + for( const TQColor** c = colors; c < colors + numberofcolors; ++c ) { p.fill( **c ); popup.addAction( menu, p, nextfree++ ); @@ -417,7 +417,7 @@ void BuiltinObjectActionsProvider::fillUpMenu( NormalModePopupObjects& popup, in bool point = true; bool samecolor = true; std::vector<ObjectHolder*> os = popup.objects(); - QColor color = os.front()->drawer()->color(); + TQColor color = os.front()->drawer()->color(); for ( std::vector<ObjectHolder*>::const_iterator i = os.begin(); i != os.end(); ++i ) { if ( ! (*i)->imp()->inherits( PointImp::stype() ) ) @@ -425,23 +425,23 @@ void BuiltinObjectActionsProvider::fillUpMenu( NormalModePopupObjects& popup, in if ( (*i)->drawer()->color() != color ) samecolor = false; }; if ( ! samecolor ) color = Qt::blue; - QPixmap p( point ? 20 : 50, 20 ); + TQPixmap p( point ? 20 : 50, 20 ); for ( int i = 1; i < 8; ++i ) { p.fill( popup.eraseColor() ); - QPainter ptr( &p ); - ptr.setPen( QPen( color, 1 ) ); - ptr.setBrush( QBrush( color, Qt::SolidPattern ) ); + TQPainter ptr( &p ); + ptr.setPen( TQPen( color, 1 ) ); + ptr.setBrush( TQBrush( color, Qt::SolidPattern ) ); if ( point ) { int size = 2*i; - QRect r( ( 20 - size ) / 2, ( 20 - size ) / 2, size, size ); + TQRect r( ( 20 - size ) / 2, ( 20 - size ) / 2, size, size ); ptr.drawEllipse( r ); } else { - ptr.setPen( QPen( color, -1 + 2*i ) ); - ptr.drawLine( QPoint( 0, 10 ), QPoint( 50, 10 ) ); + ptr.setPen( TQPen( color, -1 + 2*i ) ); + ptr.drawLine( TQPoint( 0, 10 ), TQPoint( 50, 10 ) ); }; ptr.end(); popup.addAction( menu, p, nextfree++ ); @@ -453,7 +453,7 @@ void BuiltinObjectActionsProvider::fillUpMenu( NormalModePopupObjects& popup, in int npoints = 0; int nothers = 0; std::vector<ObjectHolder*> os = popup.objects(); - QColor color = os.front()->drawer()->color(); + TQColor color = os.front()->drawer()->color(); for ( std::vector<ObjectHolder*>::const_iterator i = os.begin(); i != os.end(); ++i ) { if ( (*i)->imp()->inherits( PointImp::stype() ) ) @@ -467,7 +467,7 @@ void BuiltinObjectActionsProvider::fillUpMenu( NormalModePopupObjects& popup, in if ( point ) for ( int i = 0; i < 5; ++i ) { - QPixmap p( 20, 20 ); + TQPixmap p( 20, 20 ); p.fill( popup.eraseColor() ); ScreenInfo si( Rect( -1, -1, 2, 2 ), p.rect() ); KigPainter ptr( si, &p, popup.part().document(), false ); @@ -481,7 +481,7 @@ void BuiltinObjectActionsProvider::fillUpMenu( NormalModePopupObjects& popup, in Qt::PenStyle penstyles[] = {Qt::SolidLine, Qt::DashLine, Qt::DashDotLine, Qt::DashDotDotLine, Qt::DotLine}; for ( int i = 0; i < (int) ( sizeof( penstyles ) / sizeof( Qt::PenStyle ) ); ++i ) { - QPixmap p( 50, 20 ); + TQPixmap p( 50, 20 ); p.fill( popup.eraseColor() ); ScreenInfo si( Rect( -2.5, -1, 5, 2 ), p.rect() ); KigPainter ptr( si, &p, popup.part().document(), false ); @@ -518,7 +518,7 @@ static void addNameLabel( ObjectCalcer* object, ObjectCalcer* namecalcer, const object->imp()->inherits( CurveImp::stype() ) ) attachto = object; ObjectHolder* label = ObjectFactory::instance()->attachedLabel( - QString::fromLatin1( "%1" ), attachto, loc, namelabelneedsframe, args, doc.document() ); + TQString::fromLatin1( "%1" ), attachto, loc, namelabelneedsframe, args, doc.document() ); doc.addObject( label ); } @@ -534,12 +534,12 @@ bool NameObjectActionsProvider::executeAction( return false; } assert( os.size() == 1 ); - QString name = os[0]->name(); + TQString name = os[0]->name(); bool ok; - QRegExp re( ".*" ); - QRegExpValidator* rev = new QRegExpValidator( re, &doc ); - QString caption = i18n( "Set Object Name" ); - QString label = i18n( "Set Name of this Object:" ); + TQRegExp re( ".*" ); + TQRegExpValidator* rev = new TQRegExpValidator( re, &doc ); + TQString caption = i18n( "Set Object Name" ); + TQString label = i18n( "Set Name of this Object:" ); #if KDE_IS_VERSION( 3, 1, 90 ) name = KInputDialog::getText( caption, label, name, &ok, &w, 0, rev ); #else @@ -567,7 +567,7 @@ bool NameObjectActionsProvider::executeAction( // if we just added the name, we add a label to show it to the user. if ( justadded ) addNameLabel( os[0]->calcer(), namecalcer, -// w.fromScreen( w.mapFromGlobal( popup.mapToGlobal( QPoint( 5, 0 ) ) ) ), +// w.fromScreen( w.mapFromGlobal( popup.mapToGlobal( TQPoint( 5, 0 ) ) ) ), w.fromScreen( popup.plc() ), doc ); } @@ -589,7 +589,7 @@ bool NameObjectActionsProvider::executeAction( namecalcer = c; } addNameLabel( os[0]->calcer(), namecalcer, -// w.fromScreen( w.mapFromGlobal( popup.mapToGlobal( QPoint( 5, 0 ) ) ) ), doc ); +// w.fromScreen( w.mapFromGlobal( popup.mapToGlobal( TQPoint( 5, 0 ) ) ) ), doc ); w.fromScreen( popup.plc() ), doc ); return true; } @@ -623,8 +623,8 @@ bool BuiltinObjectActionsProvider::executeAction( case 2: { // move - QCursor::setPos( popup.mapToGlobal( QPoint( 0, 0 ) ) ); - QPoint p = w.mapFromGlobal( QCursor::pos() ); + TQCursor::setPos( popup.mapToGlobal( TQPoint( 0, 0 ) ) ); + TQPoint p = w.mapFromGlobal( TQCursor::pos() ); Coordinate c = w.fromScreen( p ); MovingMode m( os, c, w, doc ); doc.runMode( &m ); @@ -648,7 +648,7 @@ bool BuiltinObjectActionsProvider::executeAction( id -= numberofcolors + 1; return false; }; - QColor color; + TQColor color; if ( id < numberofcolors ) color = *colors[id]; else @@ -753,10 +753,10 @@ void ObjectConstructorActionsProvider::fillUpMenu( NormalModePopupObjects& popup }; if ( add ) { - QCString iconfile = (*i)->iconFileName(); + TQCString iconfile = (*i)->iconFileName(); if ( !iconfile.isEmpty() && !iconfile.isNull() ) { - QPixmap icon = popup.part().instance()->iconLoader()->loadIcon( iconfile, KIcon::Toolbar, 22, KIcon::DefaultState, 0L, true ); + TQPixmap icon = popup.part().instance()->iconLoader()->loadIcon( iconfile, KIcon::Toolbar, 22, KIcon::DefaultState, 0L, true ); popup.addAction( menu, icon, (*i)->descriptiveName(), nextfree++ ); } else @@ -794,9 +794,9 @@ bool ObjectConstructorActionsProvider::executeAction( return true; } -void NormalModePopupObjects::addAction( int menu, const QPixmap& pix, int id ) +void NormalModePopupObjects::addAction( int menu, const TQPixmap& pix, int id ) { - QPopupMenu* m = 0; + TQPopupMenu* m = 0; if ( menu == ToplevelMenu ) m = this; else m = mmenus[menu]; int ret = m->insertItem( pix, id ); @@ -825,20 +825,20 @@ void NormalModePopupObjects::setCoordinateSystemMenuSlot( int i ) activateAction( SetCoordinateSystemMenu, i ); } -void NormalModePopupObjects::addAction( int menu, const QPixmap& icon, const QString& name, int id ) +void NormalModePopupObjects::addAction( int menu, const TQPixmap& icon, const TQString& name, int id ) { - QPopupMenu* m = 0; + TQPopupMenu* m = 0; if ( menu == ToplevelMenu ) m = this; else m = mmenus[menu]; - int ret = m->insertItem( QIconSet( icon ), name, id ); + int ret = m->insertItem( TQIconSet( icon ), name, id ); assert( ret == id ); // pretend to use this var.. (void)ret; } -void NormalModePopupObjects::addAction( int menu, const QString& name, int id ) +void NormalModePopupObjects::addAction( int menu, const TQString& name, int id ) { - QPopupMenu* m = 0; + TQPopupMenu* m = 0; if ( menu == ToplevelMenu ) m = this; else m = mmenus[menu]; int ret = m->insertItem( name, id ); @@ -881,7 +881,7 @@ void PropertiesActionsProvider::fillUpMenu( NormalModePopupObjects& popup, { if ( iconfile && *iconfile ) { - QPixmap pix = popup.part().instance()->iconLoader()->loadIcon( iconfile, KIcon::Toolbar, 22, KIcon::DefaultState, 0L, true ); + TQPixmap pix = popup.part().instance()->iconLoader()->loadIcon( iconfile, KIcon::Toolbar, 22, KIcon::DefaultState, 0L, true ); popup.addAction( menu, pix, i18n( o->imp()->properties()[i] ), nextfree++ ); } else @@ -917,14 +917,14 @@ bool PropertiesActionsProvider::executeAction( args.back()->calc( doc.document() ); // TODO: recover the cursor position somehow... the following does not work // in general... -// Coordinate c = w.fromScreen( w.mapFromGlobal( popup.mapToGlobal( QPoint( 5, 0 ) ) ) ); +// Coordinate c = w.fromScreen( w.mapFromGlobal( popup.mapToGlobal( TQPoint( 5, 0 ) ) ) ); // mp: it seems that we have no idea where to position the label, // btw what's the meaning of (5,0)? let the // attach method decide what to do... (passing an invalidCoord) // /////// Coordinate c = Coordinate::invalidCoord(); Coordinate c = w.fromScreen( popup.plc() ); ObjectHolder* label = ObjectFactory::instance()->attachedLabel( - QString::fromLatin1( "%1" ), parent->calcer(), c, + TQString::fromLatin1( "%1" ), parent->calcer(), c, false, args, doc.document() ); doc.addObject( label ); } @@ -948,7 +948,7 @@ void ObjectTypeActionsProvider::fillUpMenu( if ( ! c ) return; const ObjectType* t = c->type(); - QStringList l = t->specialActions(); + TQStringList l = t->specialActions(); mnoa = l.count(); for ( int i = 0; i < mnoa; ++i ) popup.addAction( menu, l[i], nextfree++ ); @@ -986,7 +986,7 @@ void BuiltinDocumentActionsProvider::fillUpMenu( NormalModePopupObjects& popup, else if ( menu == NormalModePopupObjects::SetCoordinateSystemMenu ) { int idoffset = nextfree; - QStringList l = CoordinateSystemFactory::names(); + TQStringList l = CoordinateSystemFactory::names(); mnumberofcoordsystems = l.count(); for ( uint i = 0; i < l.count(); ++i ) popup.addAction( menu, l[i], nextfree++ ); @@ -1053,7 +1053,7 @@ void ScriptActionsProvider::fillUpMenu( NormalModePopupObjects& popup, int menu, if ( menu == NormalModePopupObjects::StartMenu ) { KIconLoader* l = popup.part().instance()->iconLoader(); - QPixmap p = l->loadIcon( ScriptType::icon( ScriptType::Python ), KIcon::Toolbar, 22, KIcon::DefaultState, 0L, true ); + TQPixmap p = l->loadIcon( ScriptType::icon( ScriptType::Python ), KIcon::Toolbar, 22, KIcon::DefaultState, 0L, true ); popup.addAction( menu, p, i18n( "Python Script" ), nextfree++ ); mns++; } @@ -1115,7 +1115,7 @@ bool ScriptActionsProvider::executeAction( } #endif -int ObjectChooserPopup::getObjectFromList( const QPoint& p, KigWidget* w, +int ObjectChooserPopup::getObjectFromList( const TQPoint& p, KigWidget* w, const std::vector<ObjectHolder*>& objs, bool givepopup ) { @@ -1153,7 +1153,7 @@ int ObjectChooserPopup::getObjectFromList( const QPoint& p, KigWidget* w, if ( givepopup ) { ObjectChooserPopup* ppp = new ObjectChooserPopup( p, *w, objs ); - ppp->exec( QCursor::pos() ); + ppp->exec( TQCursor::pos() ); id = ppp->mselected; @@ -1175,19 +1175,19 @@ int ObjectChooserPopup::getObjectFromList( const QPoint& p, KigWidget* w, return id; } -ObjectChooserPopup::ObjectChooserPopup( const QPoint& p, KigWidget& view, +ObjectChooserPopup::ObjectChooserPopup( const TQPoint& p, KigWidget& view, const std::vector<ObjectHolder*>& objs ) : KPopupMenu(), mplc( p ), mview( view ), mobjs( objs ), mselected( -1 ) { for ( uint i = 0; i < mobjs.size(); i++ ) { insertItem( !mobjs[i]->name().isEmpty() - ? QString::fromLatin1( "%1 %2" ).arg( mobjs[i]->imp()->type()->translatedName() ).arg( mobjs[i]->name() ) + ? TQString::fromLatin1( "%1 %2" ).arg( mobjs[i]->imp()->type()->translatedName() ).arg( mobjs[i]->name() ) : mobjs[i]->imp()->type()->translatedName(), i ); } - connect( this, SIGNAL( activated( int ) ), this, SLOT( actionActivatedSlot( int ) ) ); + connect( this, TQT_SIGNAL( activated( int ) ), this, TQT_SLOT( actionActivatedSlot( int ) ) ); } ObjectChooserPopup::~ObjectChooserPopup() diff --git a/kig/modes/popup.h b/kig/modes/popup.h index 405bcee6..76574b74 100644 --- a/kig/modes/popup.h +++ b/kig/modes/popup.h @@ -51,7 +51,7 @@ class NormalModePopupObjects public: NormalModePopupObjects( KigPart& part, KigWidget& view, NormalMode& mode, - const std::vector<ObjectHolder*>& objs, const QPoint& p ); + const std::vector<ObjectHolder*>& objs, const TQPoint& p ); ~NormalModePopupObjects(); // the different "menu's", the toplevel is considered as just @@ -61,9 +61,9 @@ public: SetCoordinateSystemMenu, NumberOfMenus }; // used by the PopupActionProvider's to add actions to us.. - void addAction( int menu, const QString& name, int id ); - void addAction( int menu, const QPixmap& icon, const QString& name, int id ); - void addAction( int menu, const QPixmap& pix, int id ); + void addAction( int menu, const TQString& name, int id ); + void addAction( int menu, const TQPixmap& icon, const TQString& name, int id ); + void addAction( int menu, const TQPixmap& pix, int id ); /** * set the checked state of the \p n 'th item in \p menu to \p checked .. @@ -73,7 +73,7 @@ public: std::vector<ObjectHolder*> objects() const { return mobjs; } KigPart& part() { return mpart; } KigWidget& widget() { return mview; } - QPoint plc() { return mplc; } + TQPoint plc() { return mplc; } bool onlyLabels() const { return monlylabels; } @@ -93,7 +93,7 @@ private slots: void setCoordinateSystemMenuSlot( int ); protected: - QPoint mplc; + TQPoint mplc; KigPart& mpart; KigWidget& mview; std::vector<ObjectHolder*> mobjs; @@ -101,7 +101,7 @@ protected: std::vector<PopupActionProvider*> mproviders; - QPopupMenu* mmenus[NumberOfMenus]; + TQPopupMenu* mmenus[NumberOfMenus]; private: bool monlylabels; @@ -130,12 +130,12 @@ public: * \return the index of the chosen element ( starting from 0 ), or -1 * if none was selected. */ - static int getObjectFromList( const QPoint& p, KigWidget* w, + static int getObjectFromList( const TQPoint& p, KigWidget* w, const std::vector<ObjectHolder*>& objs, bool givepopup = true ); protected: - ObjectChooserPopup( const QPoint& p, KigWidget& view, + ObjectChooserPopup( const TQPoint& p, KigWidget& view, const std::vector<ObjectHolder*>& objs ); ~ObjectChooserPopup(); @@ -143,7 +143,7 @@ protected slots: void actionActivatedSlot( int ); protected: - QPoint mplc; + TQPoint mplc; KigWidget& mview; std::vector<ObjectHolder*> mobjs; diff --git a/kig/modes/textlabelwizard.cc b/kig/modes/textlabelwizard.cc index 803ca819..d562bbf3 100644 --- a/kig/modes/textlabelwizard.cc +++ b/kig/modes/textlabelwizard.cc @@ -21,20 +21,20 @@ #include "label.h" #include "linkslabel.h" -#include <qtextedit.h> +#include <tqtextedit.h> #include <kapplication.h> -#include <qlayout.h> +#include <tqlayout.h> -TextLabelWizard::TextLabelWizard( QWidget* parent, TextLabelModeBase* mode ) +TextLabelWizard::TextLabelWizard( TQWidget* parent, TextLabelModeBase* mode ) : TextLabelWizardBase( parent, "TextLabelWizard", false ), mmode( mode ) { - connect( labelTextInput, SIGNAL( textChanged() ), - SLOT( textChanged() ) ); - connect( myCustomWidget1, SIGNAL( linkClicked( int ) ), - SLOT( linkClicked( int ) ) ); - connect( this, SIGNAL( helpClicked() ), - this, SLOT( slotHelpClicked() ) ); + connect( labelTextInput, TQT_SIGNAL( textChanged() ), + TQT_SLOT( textChanged() ) ); + connect( myCustomWidget1, TQT_SIGNAL( linkClicked( int ) ), + TQT_SLOT( linkClicked( int ) ) ); + connect( this, TQT_SIGNAL( helpClicked() ), + this, TQT_SLOT( slotHelpClicked() ) ); labelTextInput->setFocus(); } @@ -89,7 +89,7 @@ void TextLabelWizard::relayoutArgsPage() void TextLabelWizard::slotHelpClicked() { - kapp->invokeHelp( QString::fromLatin1( "text-labels" ), - QString::fromLatin1( "kig" ) ); + kapp->invokeHelp( TQString::fromLatin1( "text-labels" ), + TQString::fromLatin1( "kig" ) ); } diff --git a/kig/modes/textlabelwizard.h b/kig/modes/textlabelwizard.h index 787e0803..bd51c1e0 100644 --- a/kig/modes/textlabelwizard.h +++ b/kig/modes/textlabelwizard.h @@ -26,7 +26,7 @@ class TextLabelWizard : public TextLabelWizardBase { Q_OBJECT public: - TextLabelWizard( QWidget* parent, TextLabelModeBase* mode ); + TextLabelWizard( TQWidget* parent, TextLabelModeBase* mode ); ~TextLabelWizard(); void back(); diff --git a/kig/modes/typesdialog.cpp b/kig/modes/typesdialog.cpp index 67621c20..e14ceee8 100644 --- a/kig/modes/typesdialog.cpp +++ b/kig/modes/typesdialog.cpp @@ -35,10 +35,10 @@ #include <kpushbutton.h> #include <kstdguiitem.h> -#include <qfile.h> -#include <qpixmap.h> -#include <qstringlist.h> -#include <qtextstream.h> +#include <tqfile.h> +#include <tqpixmap.h> +#include <tqstringlist.h> +#include <tqtextstream.h> #include <algorithm> #include <vector> @@ -53,12 +53,12 @@ public: }; MacroListElement::MacroListElement( KListView* lv, Macro* m ) - : QListViewItem( lv, QString::null, m->action->descriptiveName(), m->action->description() ), + : TQListViewItem( lv, TQString::null, m->action->descriptiveName(), m->action->description() ), macro( m ) { } -TypesDialog::TypesDialog( QWidget* parent, KigPart& part ) +TypesDialog::TypesDialog( TQWidget* parent, KigPart& part ) : TypesDialogBase( parent, "types_dialog", true ), mpart( part ) { // improving GUI look'n'feel... @@ -66,10 +66,10 @@ TypesDialog::TypesDialog( QWidget* parent, KigPart& part ) buttonOk->setGuiItem( KStdGuiItem::ok() ); buttonCancel->setGuiItem( KStdGuiItem::cancel() ); il = part.instance()->iconLoader(); - buttonEdit->setIconSet( QIconSet( il->loadIcon( "edit", KIcon::Small ) ) ); - buttonRemove->setIconSet( QIconSet( il->loadIcon( "editdelete", KIcon::Small ) ) ); - buttonExport->setIconSet( QIconSet( il->loadIcon( "fileexport", KIcon::Small ) ) ); - buttonImport->setIconSet( QIconSet( il->loadIcon( "fileimport", KIcon::Small ) ) ); + buttonEdit->setIconSet( TQIconSet( il->loadIcon( "edit", KIcon::Small ) ) ); + buttonRemove->setIconSet( TQIconSet( il->loadIcon( "editdelete", KIcon::Small ) ) ); + buttonExport->setIconSet( TQIconSet( il->loadIcon( "fileexport", KIcon::Small ) ) ); + buttonImport->setIconSet( TQIconSet( il->loadIcon( "fileimport", KIcon::Small ) ) ); typeList->setColumnWidth( 0, 22 ); typeList->setColumnWidth( 1, 140 ); @@ -78,23 +78,23 @@ TypesDialog::TypesDialog( QWidget* parent, KigPart& part ) // loading macros... loadAllMacros(); - popup = new QPopupMenu( this ); - popup->insertItem( SmallIcon( "edit" ), i18n( "&Edit..." ), this, SLOT( editType() ) ); - popup->insertItem( SmallIcon( "editdelete" ), i18n( "&Delete" ), this, SLOT( deleteType() ) ); + popup = new TQPopupMenu( this ); + popup->insertItem( SmallIcon( "edit" ), i18n( "&Edit..." ), this, TQT_SLOT( editType() ) ); + popup->insertItem( SmallIcon( "editdelete" ), i18n( "&Delete" ), this, TQT_SLOT( deleteType() ) ); popup->insertSeparator(); - popup->insertItem( SmallIcon( "fileexport" ), i18n( "E&xport..." ), this, SLOT( exportType() ) ); + popup->insertItem( SmallIcon( "fileexport" ), i18n( "E&xport..." ), this, TQT_SLOT( exportType() ) ); // saving types part.saveTypes(); } -QListViewItem* TypesDialog::newListItem( Macro* m ) +TQListViewItem* TypesDialog::newListItem( Macro* m ) { MacroListElement* e = new MacroListElement( typeList, m ); - QCString ifn = m->action->iconFileName(); + TQCString ifn = m->action->iconFileName(); if ( !ifn.isNull() ) { - QPixmap p = il->loadIcon( ifn, KIcon::Small ); + TQPixmap p = il->loadIcon( ifn, KIcon::Small ); e->setPixmap( 0, p ); } return e; @@ -106,8 +106,8 @@ TypesDialog::~TypesDialog() void TypesDialog::helpSlot() { - kapp->invokeHelp( QString::fromLatin1( "working-with-types" ), - QString::fromLatin1( "kig" ) ); + kapp->invokeHelp( TQString::fromLatin1( "working-with-types" ), + TQString::fromLatin1( "kig" ) ); } void TypesDialog::okSlot() @@ -120,9 +120,9 @@ void TypesDialog::okSlot() void TypesDialog::deleteType() { - std::vector<QListViewItem*> items; + std::vector<TQListViewItem*> items; std::vector<Macro*> selectedTypes; - QListViewItemIterator it( typeList ); + TQListViewItemIterator it( typeList ); while ( it.current() ) { if ( ( it.current() )->isSelected() ) { @@ -132,7 +132,7 @@ void TypesDialog::deleteType() ++it; } if (selectedTypes.empty()) return; - QStringList types; + TQStringList types; for ( std::vector<Macro*>::iterator j = selectedTypes.begin(); j != selectedTypes.end(); ++j ) types << ( *j )->action->descriptiveName(); @@ -142,7 +142,7 @@ void TypesDialog::deleteType() types, i18n("Are You Sure?"), KStdGuiItem::cont(), "deleteTypeWarning") == KMessageBox::Cancel ) return; - for ( std::vector<QListViewItem*>::iterator i = items.begin(); i != items.end(); ++i) + for ( std::vector<TQListViewItem*>::iterator i = items.begin(); i != items.end(); ++i) { int appel = typeList->itemIndex(*i); assert (appel != -1); @@ -156,7 +156,7 @@ void TypesDialog::deleteType() void TypesDialog::exportType() { std::vector<Macro*> types; - QListViewItemIterator it( typeList ); + TQListViewItemIterator it( typeList ); while ( it.current() ) { if ( ( it.current() )->isSelected() ) { @@ -165,10 +165,10 @@ void TypesDialog::exportType() ++it; } if (types.empty()) return; - QString file_name = KFileDialog::getSaveFileName(":macro", i18n("*.kigt|Kig Types Files\n*|All Files"), this, i18n( "Export Types" ) ); + TQString file_name = KFileDialog::getSaveFileName(":macro", i18n("*.kigt|Kig Types Files\n*|All Files"), this, i18n( "Export Types" ) ); if ( file_name.isNull() ) return; - QFile fi( file_name ); + TQFile fi( file_name ); if ( fi.exists() ) if ( KMessageBox::warningContinueCancel( this, i18n( "The file \"%1\" already exists. " "Do you wish to overwrite it?" ).arg( fi.name() ), @@ -179,12 +179,12 @@ void TypesDialog::exportType() void TypesDialog::importTypes() { - QStringList file_names = + TQStringList file_names = KFileDialog::getOpenFileNames(":importTypes", i18n("*.kigt|Kig Types Files\n*|All Files"), this, i18n( "Import Types" )); std::vector<Macro*> macros; - for ( QStringList::Iterator i = file_names.begin(); + for ( TQStringList::Iterator i = file_names.begin(); i != file_names.end(); ++i) { std::vector<Macro*> nmacros; @@ -199,9 +199,9 @@ void TypesDialog::importTypes() typeList->insertItem( newListItem( macros[i] ) ); } -QString TypesDialog::fetchIconFromListItem( QListViewItem* i ) +TQString TypesDialog::fetchIconFromListItem( TQListViewItem* i ) { - QListViewItemIterator it( typeList ); + TQListViewItemIterator it( typeList ); Macro* ai = static_cast<MacroListElement*>( i )->getMacro(); while ( it.current() ) { if ( ( it.current() )->isSelected() ) @@ -219,8 +219,8 @@ QString TypesDialog::fetchIconFromListItem( QListViewItem* i ) void TypesDialog::editType() { - std::vector<QListViewItem*> items; - QListViewItemIterator it( typeList ); + std::vector<TQListViewItem*> items; + TQListViewItemIterator it( typeList ); while ( it.current() ) { if ( ( it.current() )->isSelected() ) items.push_back( it.current() ); @@ -237,19 +237,19 @@ void TypesDialog::editType() i18n( "More Than One Type Selected" ) ); return; } - QListViewItem* i = items[0]; + TQListViewItem* i = items[0]; EditType* d = new EditType( this, i->text( 1 ), i->text( 2 ), fetchIconFromListItem( i ) ); if ( d->exec() ) { - QString newname = d->name(); - QString newdesc = d->description(); - QString newicon = d->icon(); + TQString newname = d->name(); + TQString newdesc = d->description(); + TQString newicon = d->icon(); Macro* oldmacro = static_cast<MacroListElement*>( i )->getMacro(); // mpart.unplugActionLists(); oldmacro->ctor->setName( newname ); oldmacro->ctor->setDescription( newdesc ); - QCString ncicon( newicon.utf8() ); + TQCString ncicon( newicon.utf8() ); oldmacro->ctor->setIcon( ncicon ); // mpart.plugActionLists(); @@ -260,7 +260,7 @@ void TypesDialog::editType() delete d; } -void TypesDialog::contextMenuRequested( QListViewItem*, const QPoint& p, int ) +void TypesDialog::contextMenuRequested( TQListViewItem*, const TQPoint& p, int ) { popup->exec( p ); } diff --git a/kig/modes/typesdialog.h b/kig/modes/typesdialog.h index 6f0e4702..2e914bcd 100644 --- a/kig/modes/typesdialog.h +++ b/kig/modes/typesdialog.h @@ -25,7 +25,7 @@ #include "../misc/lists.h" -#include <qpopupmenu.h> +#include <tqpopupmenu.h> #include <klistview.h> #include <kiconloader.h> @@ -43,9 +43,9 @@ class TypesDialog : public TypesDialogBase // necessary because some MacroList functions need it.. KigPart& mpart; const KIconLoader* il; - QPopupMenu* popup; + TQPopupMenu* popup; public: - TypesDialog( QWidget* parent, KigPart& ); + TypesDialog( TQWidget* parent, KigPart& ); ~TypesDialog(); public slots: @@ -58,11 +58,11 @@ protected slots: void exportType(); void importTypes(); void editType(); - void contextMenuRequested( QListViewItem* i, const QPoint& p, int c ); + void contextMenuRequested( TQListViewItem* i, const TQPoint& p, int c ); private: - QListViewItem* newListItem( Macro* m ); - QString fetchIconFromListItem( QListViewItem* i ); + TQListViewItem* newListItem( Macro* m ); + TQString fetchIconFromListItem( TQListViewItem* i ); void loadAllMacros(); typedef MacroList::vectype vec; }; |