diff options
author | Timothy Pearson <kb9vqf@pearsoncomputing.net> | 2011-11-29 01:11:08 -0600 |
---|---|---|
committer | Timothy Pearson <kb9vqf@pearsoncomputing.net> | 2011-11-29 01:11:08 -0600 |
commit | 8a055d66f43592c257cece2eb8cc021808062917 (patch) | |
tree | d0922f201bd5d24b62a33160d1d9baf9e89f9a70 /pyuic3/main.cpp | |
parent | b388516ca2691303a076a0764fd40bf7116fe43d (diff) | |
download | pytqt-8a055d66f43592c257cece2eb8cc021808062917.tar.gz pytqt-8a055d66f43592c257cece2eb8cc021808062917.zip |
Initial TQt conversion
Diffstat (limited to 'pyuic3/main.cpp')
-rw-r--r-- | pyuic3/main.cpp | 50 |
1 files changed, 25 insertions, 25 deletions
diff --git a/pyuic3/main.cpp b/pyuic3/main.cpp index 265a536..2cd8e5b 100644 --- a/pyuic3/main.cpp +++ b/pyuic3/main.cpp @@ -2,7 +2,7 @@ ** Copyright (C) 2000 Trolltech AS. All rights reserved. ** Copyright (c) 2001 Phil Thompson <phil@river-bank.demon.co.uk> ** -** This file is part of Qt Designer. +** This file is part of TQt Designer. ** ** This file may be distributed and/or modified under the terms of the ** GNU General Public License version 2 as published by the Free Software @@ -39,20 +39,20 @@ int main( int argc, char * argv[] ) bool testCode = FALSE, execCode = FALSE; bool subcl = FALSE; bool imagecollection = FALSE; - QStringList images; + TQStringList images; const char *error = 0; const char* fileName = 0; - QCString outputFile; + TQCString outputFile; const char* projectName = 0; const char* trmacro = 0; bool fix = FALSE; - QApplication app(argc, argv, FALSE); - QString className, uicClass; + TQApplication app(argc, argv, FALSE); + TQString className, uicClass; for ( int n = 1; n < argc && error == 0; n++ ) { - QCString arg = argv[n]; + TQCString arg = argv[n]; if ( arg[0] == '-' ) { // option - QCString opt = &arg[1]; + TQCString opt = &arg[1]; if ( opt[0] == 'o' ) { // output redirection if ( opt[1] == '\0' ) { if ( !(n < argc-1) ) { @@ -91,7 +91,7 @@ int main( int argc, char * argv[] ) } } else if ( opt == "version" ) { fprintf( stderr, - "Python User Interface Compiler %s for Qt version %s\n", + "Python User Interface Compiler %s for TQt version %s\n", PYQT_VERSION, QT_VERSION_STR ); return 1; } else if ( opt == "help" ) { @@ -107,7 +107,7 @@ int main( int argc, char * argv[] ) error = "Missing Python indent"; break; } - tabstop = QCString(argv[++n]).toUInt(&ok); + tabstop = TQCString(argv[++n]).toUInt(&ok); } else tabstop = opt.mid(1).toUInt(&ok); @@ -133,7 +133,7 @@ int main( int argc, char * argv[] ) } if ( argc < 2 || error || (!fileName && !imagecollection ) ) { - fprintf( stderr, "PyQt user interface compiler.\n" ); + fprintf( stderr, "PyTQt user interface compiler.\n" ); if ( error ) fprintf( stderr, "pyuic: %s\n", error ); @@ -150,7 +150,7 @@ int main( int argc, char * argv[] ) "Options:\n" "\t-o file\t\tWrite output to file rather than stdout\n" "\t-p indent\tSet the Python indent in spaces (0 to use a tab)\n" - "\t-tr func\tUse func() rather than QApplication.translate() for i18n\n" + "\t-tr func\tUse func() rather than TQApplication.translate() for i18n\n" "\t-x\t\tGenerate extra code to test and display the class\n" "\t-test\t\tGenerate extra code to test but not display the class\n" "\t-version\tDisplay version of pyuic\n" @@ -161,7 +161,7 @@ int main( int argc, char * argv[] ) Uic::setIndent(indent); - QFile fileOut; + TQFile fileOut; if ( !outputFile.isEmpty() ) { fileOut.setName( outputFile ); if (!fileOut.open( IO_WriteOnly ) ) @@ -169,30 +169,30 @@ int main( int argc, char * argv[] ) } else { fileOut.open( IO_WriteOnly, stdout ); } - QTextStream out( &fileOut ); + TQTextStream out( &fileOut ); if ( imagecollection ) { - out.setEncoding( QTextStream::Latin1 ); + out.setEncoding( TQTextStream::Latin1 ); out << "# -*- coding: latin-1 -*-\n\n"; Uic::embed( out, projectName, images ); return 0; } - out.setEncoding( QTextStream::UnicodeUTF8 ); - QFile file( fileName ); + out.setEncoding( TQTextStream::UnicodeUTF8 ); + TQFile file( fileName ); if ( !file.open( IO_ReadOnly ) ) qFatal( "pyuic: Could not open file '%s' ", fileName ); - QDomDocument doc; - QString errMsg; + TQDomDocument doc; + TQString errMsg; int errLine; if ( !doc.setContent( &file, &errMsg, &errLine ) ) - qFatal( QString("pyuic: Failed to parse %s: ") + errMsg + QString (" in line %d\n"), fileName, errLine ); + qFatal( TQString("pyuic: Failed to parse %s: ") + errMsg + TQString (" in line %d\n"), fileName, errLine ); - QDomElement e = doc.firstChild().toElement(); + TQDomElement e = doc.firstChild().toElement(); if ( e.hasAttribute("version") && e.attribute("version").toDouble() > 3.3 ) { - qWarning( QString("pyuic: File generated with too recent version of Qt Designer (%s vs. %s)"), + qWarning( TQString("pyuic: File generated with too recent version of TQt Designer (%s vs. %s)"), e.attribute("version").latin1(), QT_VERSION_STR ); return 1; } @@ -209,8 +209,8 @@ int main( int argc, char * argv[] ) if ( !subcl ) { out << "# Form implementation generated from reading ui file '" << fileName << "'" << endl; out << "#" << endl; - out << "# Created: " << QDateTime::currentDateTime().toString() << endl; - out << "# by: The PyQt User Interface Compiler (pyuic) " << PYQT_VERSION << endl; + out << "# Created: " << TQDateTime::currentDateTime().toString() << endl; + out << "# by: The PyTQt User Interface Compiler (pyuic) " << PYQT_VERSION << endl; out << "#" << endl; out << "# WARNING! All changes made in this file will be lost!" << endl; out << endl; @@ -228,8 +228,8 @@ int main( int argc, char * argv[] ) out << endl; out << indent << "if __name__ == \"__main__\":" << endl; ++indent; - out << indent << "a = QApplication(sys.argv)" << endl; - out << indent << "QObject.connect(a,SIGNAL(\"lastWindowClosed()\"),a,SLOT(\"quit()\"))" << endl; + out << indent << "a = TQApplication(sys.argv)" << endl; + out << indent << "TQObject.connect(a,SIGNAL(\"lastWindowClosed()\"),a,SLOT(\"quit()\"))" << endl; out << indent << "w = " << (subcl ? className : uicClass) << "()" << endl; out << indent << "a.setMainWidget(w)" << endl; |