summaryrefslogtreecommitdiffstats
path: root/qtruby/rubylib/designer/rbuic/main.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'qtruby/rubylib/designer/rbuic/main.cpp')
-rw-r--r--qtruby/rubylib/designer/rbuic/main.cpp52
1 files changed, 26 insertions, 26 deletions
diff --git a/qtruby/rubylib/designer/rbuic/main.cpp b/qtruby/rubylib/designer/rbuic/main.cpp
index 4bebf46c..7e2a4f83 100644
--- a/qtruby/rubylib/designer/rbuic/main.cpp
+++ b/qtruby/rubylib/designer/rbuic/main.cpp
@@ -48,7 +48,7 @@
#include <zlib.h>
#define RBUIC_VERSION "0.9"
-void getDBConnections( Uic& uic, TQString& s);
+void getDBConnections( Uic& uic, TTQString& s);
int main( int argc, char * argv[] )
{
@@ -56,7 +56,7 @@ int main( int argc, char * argv[] )
bool execCode = false;
bool subcl = false;
bool imagecollection = false;
- TQStringList images;
+ TTQStringList images;
const char *error = 0;
const char* fileName = 0;
const char* className = 0;
@@ -66,14 +66,14 @@ int main( int argc, char * argv[] )
bool nofwd = false;
bool useKDE = false;
bool fix = false;
- TQApplication app(argc, argv, false);
- TQString uicClass;
+ TTQApplication app(argc, argv, false);
+ TTQString uicClass;
for ( int n = 1; n < argc && error == 0; n++ ) {
- TQCString arg = argv[n];
+ TTQCString arg = argv[n];
if ( arg[0] == '-' ) { // option
- TQCString opt = &arg[1];
+ TTQCString opt = &arg[1];
if ( opt[0] == 'o' ) { // output redirection
if ( opt[1] == '\0' ) {
if ( !(n < argc-1) ) {
@@ -132,7 +132,7 @@ int main( int argc, char * argv[] )
error = "Missing indent";
break;
}
- tabstop = TQCString(argv[++n]).toUInt(&ok);
+ tabstop = TTQCString(argv[++n]).toUInt(&ok);
} else
tabstop = opt.mid(1).toUInt(&ok);
@@ -174,7 +174,7 @@ int main( int argc, char * argv[] )
"\t-o file\t\tWrite output to file rather than stdout\n"
"\t-p indent\tSet the indent in spaces (0 to use a tab)\n"
"\t-nofwd\t\tOmit imports of custom widgets\n"
- "\t-kde\t\tUse kde widgets, require 'Korundum' extension\n"
+ "\t-kde\t\tUse kde widgets, retquire 'Korundum' extension\n"
"\t-tr func\tUse func(...) rather than trUtf8(...) for i18n\n"
"\t-x\t\tGenerate extra code to test the class\n"
"\t-version\tDisplay version of rbuic\n"
@@ -185,7 +185,7 @@ int main( int argc, char * argv[] )
Uic::setIndent(indent);
- TQFile fileOut;
+ TTQFile fileOut;
if ( outputFile ) {
fileOut.setName( outputFile );
if (!fileOut.open( IO_WriteOnly ) )
@@ -193,25 +193,25 @@ int main( int argc, char * argv[] )
} else {
fileOut.open( IO_WriteOnly, stdout );
}
- TQTextStream out( &fileOut );
+ TTQTextStream out( &fileOut );
if ( imagecollection ) {
- out.setEncoding( TQTextStream::Latin1 );
+ out.setEncoding( TTQTextStream::Latin1 );
Uic::embed( out, projectName, images );
return 0;
}
- out.setEncoding( TQTextStream::UnicodeUTF8 );
- TQFile file( fileName );
+ out.setEncoding( TTQTextStream::UnicodeUTF8 );
+ TTQFile file( fileName );
if ( !file.open( IO_ReadOnly ) )
qFatal( "rbuic: Could not open file '%s' ", fileName );
- TQDomDocument doc;
- TQString errMsg;
+ TTQDomDocument doc;
+ TTQString errMsg;
int errLine;
if ( !doc.setContent( &file, &errMsg, &errLine ) )
- qFatal( TQString("rbuic: Failed to parse %s: ") + errMsg + TQString (" in line %d\n"), fileName, errLine );
+ qFatal( TTQString("rbuic: Failed to parse %s: ") + errMsg + TTQString (" in line %d\n"), fileName, errLine );
DomTool::fixDocument( doc );
@@ -223,7 +223,7 @@ int main( int argc, char * argv[] )
if ( !subcl ) {
out << "# Form implementation generated from reading ui file '" << fileName << "'" << endl;
out << "#" << endl;
- out << "# Created: " << TQDateTime::currentDateTime().toString() << endl;
+ out << "# Created: " << TTQDateTime::currentDateTime().toString() << endl;
out << "# by: The QtRuby User Interface Compiler (rbuic)" << endl;
out << "#" << endl;
out << "# WARNING! All changes made in this file will be lost!" << endl;
@@ -242,12 +242,12 @@ int main( int argc, char * argv[] )
out << indent << "KDE::CmdLineArgs.init(ARGV, about)" << endl;
out << indent << "a = KDE::Application.new" << endl;
} else {
- out << indent << "a = Qt::Application.new(ARGV)" << endl;
+ out << indent << "a = TQt::Application.new(ARGV)" << endl;
}
- TQString s;
+ TTQString s;
getDBConnections( uic, s);
out << s;
- out << indent << "w = " << (subcl? TQString::fromLatin1(className) : uicClass) << ".new" << endl;
+ out << indent << "w = " << (subcl? TTQString::fromLatin1(className) : uicClass) << ".new" << endl;
out << indent << "a.mainWidget = w" << endl;
out << indent << "w.show" << endl;
out << indent << "a.exec" << endl;
@@ -258,20 +258,20 @@ int main( int argc, char * argv[] )
return 0;
}
-void getDBConnections( Uic& uic, TQString& s)
+void getDBConnections( Uic& uic, TTQString& s)
{
int num = 0;
- for ( TQStringList::Iterator it = uic.dbConnections.begin(); it != uic.dbConnections.end(); ++it ) {
+ for ( TTQStringList::Iterator it = uic.dbConnections.begin(); it != uic.dbConnections.end(); ++it ) {
if ( !(*it).isEmpty()) {
- TQString inc = (num ? TQString::number(num+1) : TQString::null);
+ TTQString inc = (num ? TTQString::number(num+1) : TTQString::null);
s += "\n # Connection to database " + (*it) + "\n\n";
- s += " DRIVER" + inc + " =\t\t'QMYSQL3'" + (inc?"":" # appropriate driver") + "\n";
+ s += " DRIVER" + inc + " =\t\t'TQMYSQL3'" + (inc?"":" # appropriate driver") + "\n";
s += " DATABASE" + inc + " =\t\t'foo'" + (inc?"":" # name of your database") + "\n";
s += " USER" + inc + "=\t\t'john'" + (inc?"":" # username") + "\n";
s += " PASSWORD" + inc + "=\t\t'ZxjGG34s'" + (inc?"":" # password for USER") + "\n";
s += " HOST" + inc + "=\t\t'localhost'" + (inc?"":" # host on which the database is running") + "\n";
s += "\n";
- s += " $db" + inc + " = Qt::SqlDatabase.addDatabase( DRIVER" + inc;
+ s += " $db" + inc + " = TQt::SqlDatabase.addDatabase( DRIVER" + inc;
if (inc)
s+= ", '" + (*it) + "'";
s += " )\n";
@@ -281,7 +281,7 @@ void getDBConnections( Uic& uic, TQString& s)
s += " $db" + inc + ".hostName = HOST" + inc + "\n";
s += "\n";
s += " if !$db" + inc + ".open\n";
- s += " Qt::MessageBox.information( nil, 'Unable to open database',\n";
+ s += " TQt::MessageBox.information( nil, 'Unable to open database',\n";
s += " $db" + inc + ".lastError().databaseText() + \"\\n\")\n";
s += " exit 1\n";
s += " end\n";