From 252fce5a2a5384702fbcc1c9987284d7bd2e6943 Mon Sep 17 00:00:00 2001 From: Timothy Pearson Date: Thu, 15 Dec 2011 15:31:01 -0600 Subject: Rename a number of old tq methods that are no longer tq specific --- libkdchart/KDChartObjectFactory.cpp | 72 ++++++++++++++++++------------------- 1 file changed, 36 insertions(+), 36 deletions(-) (limited to 'libkdchart/KDChartObjectFactory.cpp') diff --git a/libkdchart/KDChartObjectFactory.cpp b/libkdchart/KDChartObjectFactory.cpp index b1dac73..a53f84c 100644 --- a/libkdchart/KDChartObjectFactory.cpp +++ b/libkdchart/KDChartObjectFactory.cpp @@ -15,42 +15,42 @@ // PENDING(blackie) Clean up code in this file, so it uses the correct getter methods like getBool. KDChartObjectFactory::KDChartObjectFactory() { - registerClass( TQString::tqfromLatin1( "KDChartWidget" ) ); - registerClass( TQString::tqfromLatin1( "KDChartParams" ), new KDChartParams ); - registerClass( TQString::tqfromLatin1( "KDChartTableData" ) ); - registerClass( TQString::tqfromLatin1( "KDChartAxisParams" ), new KDChartAxisParams ); - registerClass( TQString::tqfromLatin1( "KDChartEnums" ), 0, new KDChartEnums ); - registerClass( TQString::tqfromLatin1( "KDChartTextPiece" ) ); - registerClass( TQString::tqfromLatin1( "KDChartCustomBox" ), new KDChartCustomBox ); - registerClass( TQString::tqfromLatin1( "KDChartPropertySet" ), new KDChartPropertySet ); - registerClass( TQString::tqfromLatin1( "KDFrame" ), TQString(), new KDFrame ); - - registerClass( TQString::tqfromLatin1( "TQt" ), TQString(), new TQtFactory() ); - registerClass( TQString::tqfromLatin1( "TQFont" ), TQString(), new TQFontFactory ); + registerClass( TQString::fromLatin1( "KDChartWidget" ) ); + registerClass( TQString::fromLatin1( "KDChartParams" ), new KDChartParams ); + registerClass( TQString::fromLatin1( "KDChartTableData" ) ); + registerClass( TQString::fromLatin1( "KDChartAxisParams" ), new KDChartAxisParams ); + registerClass( TQString::fromLatin1( "KDChartEnums" ), 0, new KDChartEnums ); + registerClass( TQString::fromLatin1( "KDChartTextPiece" ) ); + registerClass( TQString::fromLatin1( "KDChartCustomBox" ), new KDChartCustomBox ); + registerClass( TQString::fromLatin1( "KDChartPropertySet" ), new KDChartPropertySet ); + registerClass( TQString::fromLatin1( "KDFrame" ), TQString(), new KDFrame ); + + registerClass( TQString::fromLatin1( "TQt" ), TQString(), new TQtFactory() ); + registerClass( TQString::fromLatin1( "TQFont" ), TQString(), new TQFontFactory ); } TQObject* KDChartObjectFactory::create( const TQString& className, const TQSArgumentList& args, TQObject* /*context*/ ) { - if ( className == TQString::tqfromLatin1( "KDChartWidget" ) ) + if ( className == TQString::fromLatin1( "KDChartWidget" ) ) return createKDChartWidget( args ); - if ( className == TQString::tqfromLatin1("KDChartParams") ) + if ( className == TQString::fromLatin1("KDChartParams") ) return new KDChartParams(); - else if ( className == TQString::tqfromLatin1("KDChartTableData") ) + else if ( className == TQString::fromLatin1("KDChartTableData") ) return createKDChartTableData( args ); - else if ( className == TQString::tqfromLatin1("KDChartAxisParams") ) + else if ( className == TQString::fromLatin1("KDChartAxisParams") ) return new KDChartAxisParams(); - else if ( className == TQString::tqfromLatin1( "KDChartTextPiece" ) ) + else if ( className == TQString::fromLatin1( "KDChartTextPiece" ) ) return createKDChartTextPiece( args ); - else if ( className == TQString::tqfromLatin1( "KDChartCustomBox" ) ) + else if ( className == TQString::fromLatin1( "KDChartCustomBox" ) ) return createKDChartCustomBox( args ); - else if ( className == TQString::tqfromLatin1( "KDChartPropertySet" ) ) + else if ( className == TQString::fromLatin1( "KDChartPropertySet" ) ) return createKDChartPropertySet( args ); else @@ -98,7 +98,7 @@ TQObject* KDChartObjectFactory::createKDChartTextPiece( const TQSArgumentList& a TQString str; if ( !getString( args, 1, &str, "KDChartTextPiece" ) ) return 0; - if ( !checkIsTQtVariant( args, 2, TQVariant::Font, TQString::tqfromLatin1( "TQFont" ), "KDChartTextPiece" ) ) return 0; + if ( !checkIsTQtVariant( args, 2, TQVariant::Font, TQString::fromLatin1( "TQFont" ), "KDChartTextPiece" ) ) return 0; TQFont font = args[1].variant().toFont(); return new KDChartTextPiece( str, font ); @@ -145,13 +145,13 @@ TQObject* KDChartObjectFactory::createKDChartCustomBox( const TQSArgumentList& a TQColor color = TQt::black; if ( args.count() >= 9 ) { - if ( !checkIsTQtVariant( args, 9, TQVariant::Color, TQString::tqfromLatin1( "TQColor" ), "KDChartCustomBox" ) ) return 0; + if ( !checkIsTQtVariant( args, 9, TQVariant::Color, TQString::fromLatin1( "TQColor" ), "KDChartCustomBox" ) ) return 0; color = args[8].variant().toColor(); } TQBrush paper = TQt::NoBrush; if ( args.count() >= 10 ) { - if ( !checkIsTQtVariant( args, 10, TQVariant::Brush, TQString::tqfromLatin1( "TQBrush" ), "KDChartCustomBox" ) ) return 0; + if ( !checkIsTQtVariant( args, 10, TQVariant::Brush, TQString::fromLatin1( "TQBrush" ), "KDChartCustomBox" ) ) return 0; paper = args[9].variant().toBrush(); } @@ -235,13 +235,13 @@ TQObject* KDChartObjectFactory::createKDChartCustomBox( const TQSArgumentList& a TQColor color = TQt::black; if ( args.count() >= 8 ) { - if ( !checkIsTQtVariant( args, 8, TQVariant::Color, TQString::tqfromLatin1( "TQColor" ), "KDChartCustomBox" ) ) return 0; + if ( !checkIsTQtVariant( args, 8, TQVariant::Color, TQString::fromLatin1( "TQColor" ), "KDChartCustomBox" ) ) return 0; color = args[7].variant().toColor(); } TQBrush paper = TQt::NoBrush; if ( args.count() >= 9 ) { - if ( !checkIsTQtVariant( args, 9, TQVariant::Brush, TQString::tqfromLatin1( "TQBrush" ), "KDChartCustomBox" ) ) return 0; + if ( !checkIsTQtVariant( args, 9, TQVariant::Brush, TQString::fromLatin1( "TQBrush" ), "KDChartCustomBox" ) ) return 0; paper = args[8].variant().toBrush(); } @@ -318,7 +318,7 @@ TQObject* KDChartObjectFactory::createKDChartPropertySet(const TQSArgumentList& if ( !getNumber( args, 4,&idLineColor, "KDChartPropertySet" ) ) return 0; - if ( !checkIsTQtVariant( args, 5, TQVariant::Color, TQString::tqfromLatin1( "TQColor" ), "KDChartPropertySet" ) ) return 0; + if ( !checkIsTQtVariant( args, 5, TQVariant::Color, TQString::fromLatin1( "TQColor" ), "KDChartPropertySet" ) ) return 0; TQColor lineColor = args[4].variant().toColor(); int idLineStyle; @@ -362,7 +362,7 @@ TQObject* KDChartObjectFactory::createKDChartPropertySet(const TQSArgumentList& int idExtraLinesColor; if ( !getNumber( args, 18,&idExtraLinesColor, "KDChartPropertySet" ) ) return 0; - if ( !checkIsTQtVariant( args, 19, TQVariant::Color, TQString::tqfromLatin1( "TQColor" ), "KDChartPropertySet" ) ) return 0; + if ( !checkIsTQtVariant( args, 19, TQVariant::Color, TQString::fromLatin1( "TQColor" ), "KDChartPropertySet" ) ) return 0; TQColor extraLinesColor = args[18].variant().toColor(); int idExtraLinesStyle; @@ -380,13 +380,13 @@ TQObject* KDChartObjectFactory::createKDChartPropertySet(const TQSArgumentList& int idExtraMarkersSize; if ( !getNumber( args, 24,&idExtraMarkersSize, "KDChartPropertySet" ) ) return 0; - if ( !checkIsTQtVariant( args, 25, TQVariant::Size, TQString::tqfromLatin1( "TQSize" ), "KDChartPropertySet" ) ) return 0; + if ( !checkIsTQtVariant( args, 25, TQVariant::Size, TQString::fromLatin1( "TQSize" ), "KDChartPropertySet" ) ) return 0; TQSize extraMarkersSize = args[24].variant().toSize(); int idExtraMarkersColor; if ( !getNumber( args, 26,&idExtraMarkersColor, "KDChartPropertySet" ) ) return 0; - if ( !checkIsTQtVariant( args, 27, TQVariant::Color, TQString::tqfromLatin1( "TQColor" ), "KDChartPropertySet" ) ) return 0; + if ( !checkIsTQtVariant( args, 27, TQVariant::Color, TQString::fromLatin1( "TQColor" ), "KDChartPropertySet" ) ) return 0; TQColor extraMarkersColor = args[26].variant().toColor(); int idExtraMarkersStyle; @@ -404,7 +404,7 @@ TQObject* KDChartObjectFactory::createKDChartPropertySet(const TQSArgumentList& int idBarColor; if ( !getNumber( args, 32,&idBarColor, "KDChartPropertySet" ) ) return 0; - if ( !checkIsTQtVariant( args, 33, TQVariant::Color, TQString::tqfromLatin1( "TQColor" ), "KDChartPropertySet" ) ) return 0; + if ( !checkIsTQtVariant( args, 33, TQVariant::Color, TQString::fromLatin1( "TQColor" ), "KDChartPropertySet" ) ) return 0; TQColor barColor = args[32].variant().toColor(); KDChartPropertySet* set = new KDChartPropertySet; @@ -438,11 +438,11 @@ bool KDChartObjectFactory::isNumber( const TQVariant& v ) bool KDChartObjectFactory::checkArgCount( const TQString& className, int count, int min, int max ) { if ( count < min ) { - throwError( TQObject::tr( "Too few arguments when creating %1 object." ).tqarg( className ) ); + throwError( TQObject::tr( "Too few arguments when creating %1 object." ).arg( className ) ); return false; } if ( count > max ) { - throwError( TQObject::tr( "Too many arguments when creating %1 object." ).tqarg( className ) ); + throwError( TQObject::tr( "Too many arguments when creating %1 object." ).arg( className ) ); return false; } return true; @@ -453,7 +453,7 @@ bool KDChartObjectFactory::checkArgsIsTQtClass( const TQSArgumentList& args, int { const TQSArgument& arg = args[index-1]; if ( arg.type() != TQSArgument::TQObjectPtr || !arg.qobject()->inherits( expected ) ) { - throwError( TQObject::tr( "Invalid type for argument no %1 to %2, must be a %3" ).tqarg(index).tqarg(constructing).tqarg(expected) ); + throwError( TQObject::tr( "Invalid type for argument no %1 to %2, must be a %3" ).arg(index).arg(constructing).arg(expected) ); return false; } return true; @@ -464,7 +464,7 @@ bool KDChartObjectFactory::getString( const TQSArgumentList& args, int index, TQ { const TQSArgument& arg = args[index-1]; if ( arg.type() != TQSArgument::Variant || arg.variant().type() != TQVariant::String ) { - throwError( TQObject::tr( "Invalid type for argument %1 to %2, must be a string" ).tqarg(index).tqarg(constructing) ); + throwError( TQObject::tr( "Invalid type for argument %1 to %2, must be a string" ).arg(index).arg(constructing) ); return false; } else { @@ -477,7 +477,7 @@ bool KDChartObjectFactory::getNumber( const TQSArgumentList& args, int index, do { const TQSArgument& arg = args[index-1]; if ( arg.type() != TQSArgument::Variant || !isNumber(arg.variant()) ) { - throwError( TQObject::tr( "Invalid type for argument %1 to %2, must be a number" ).tqarg(index).tqarg( constructing ) ); + throwError( TQObject::tr( "Invalid type for argument %1 to %2, must be a number" ).arg(index).arg( constructing ) ); return false; } else { @@ -508,7 +508,7 @@ bool KDChartObjectFactory::getBool( const TQSArgumentList& args, int index, bool { const TQSArgument& arg = args[index-1]; if ( arg.type() != TQSArgument::Variant || arg.variant().type() != TQVariant::Bool ) { - throwError( TQObject::tr( "Invalid type for argument %1 to %2, must be a boolean" ).tqarg(index).tqarg( constructing ) ); + throwError( TQObject::tr( "Invalid type for argument %1 to %2, must be a boolean" ).arg(index).arg( constructing ) ); return false; } else { @@ -521,7 +521,7 @@ bool KDChartObjectFactory::checkIsTQtVariant( const TQSArgumentList& args, int i { const TQSArgument& arg = args[index-1]; if ( arg.type() != TQSArgument::Variant || arg.variant().type() != expected ) { - throwError( TQObject::tr( "Invalid type for argument %1 to %2, must be a %3").tqarg(index).tqarg(constructing).tqarg(variantName) ); + throwError( TQObject::tr( "Invalid type for argument %1 to %2, must be a %3").arg(index).arg(constructing).arg(variantName) ); return false; } else -- cgit v1.2.1