summaryrefslogtreecommitdiffstats
path: root/python/pyqt/pyuic3/embed.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'python/pyqt/pyuic3/embed.cpp')
-rw-r--r--python/pyqt/pyuic3/embed.cpp64
1 files changed, 32 insertions, 32 deletions
diff --git a/python/pyqt/pyuic3/embed.cpp b/python/pyqt/pyuic3/embed.cpp
index 04f6494c..da1c1d5c 100644
--- a/python/pyqt/pyuic3/embed.cpp
+++ b/python/pyqt/pyuic3/embed.cpp
@@ -21,11 +21,11 @@
**********************************************************************/
#include "uic.h"
-#include <qfile.h>
-#include <qimage.h>
-#include <qstringlist.h>
-#include <qdatetime.h>
-#include <qfileinfo.h>
+#include <tqfile.h>
+#include <tqimage.h>
+#include <tqstringlist.h>
+#include <tqdatetime.h>
+#include <tqfileinfo.h>
#include <stdio.h>
#include <ctype.h>
@@ -42,17 +42,17 @@ struct EmbedImage
int width, height, depth;
int numColors;
QRgb* colorTable;
- QString name;
- QString cname;
+ TQString name;
+ TQString cname;
bool alpha;
#ifndef QT_NO_IMAGE_COLLECTION_COMPRESSION
ulong compressed;
#endif
};
-static QString convertToCIdentifier( const char *s )
+static TQString convertToCIdentifier( const char *s )
{
- QString r = s;
+ TQString r = s;
int len = r.length();
if ( len > 0 && !isalpha( (char)r[0].latin1() ) )
r[0] = '_';
@@ -64,16 +64,16 @@ static QString convertToCIdentifier( const char *s )
}
-static ulong embedData( QTextStream& out, const uchar* input, int nbytes )
+static ulong embedData( TQTextStream& out, const uchar* input, int nbytes )
{
#ifndef QT_NO_IMAGE_COLLECTION_COMPRESSION
- QByteArray bazip( qCompress( input, nbytes ) );
+ TQByteArray bazip( qCompress( input, nbytes ) );
uint len = bazip.size();
#else
uint len = (uint)nbytes;
#endif
static const char hexdigits[] = "0123456789abcdef";
- QString s;
+ TQString s;
for ( uint i=0; i<len; i++ ) {
if ( (i%14) == 0 ) {
if (i)
@@ -101,7 +101,7 @@ static ulong embedData( QTextStream& out, const uchar* input, int nbytes )
return (ulong)len;
}
-static void embedData( QTextStream& out, const QRgb* input, int n )
+static void embedData( TQTextStream& out, const QRgb* input, int n )
{
out << hex;
const QRgb *v = input;
@@ -116,26 +116,26 @@ static void embedData( QTextStream& out, const QRgb* input, int n )
out << dec; // back to decimal mode
}
-void Uic::embed( QTextStream& out, const char* project, const QStringList& images )
+void Uic::embed( TQTextStream& out, const char* project, const TQStringList& images )
{
- QString cProject = convertToCIdentifier( project );
+ TQString cProject = convertToCIdentifier( project );
- QStringList::ConstIterator it;
+ TQStringList::ConstIterator it;
out << "# Image collection for project '" << project << "'.\n";
out << "#\n";
out << "# Generated from reading image files: \n";
for ( it = images.begin(); it != images.end(); ++it )
out << "# " << *it << "\n";
out << "#\n";
- out << "# Created: " << QDateTime::currentDateTime().toString() << "\n";
+ out << "# Created: " << TQDateTime::currentDateTime().toString() << "\n";
out << "# by: The PyQt User Interface Compiler (pyuic) " << PYQT_VERSION << "\n";
out << "#\n";
out << "# WARNING! All changes made in this file will be lost!\n";
out << "\n";
out << "\n";
- out << "from qt import QImage, QMimeSourceFactory";
+ out << "from qt import TQImage, TQMimeSourceFactory";
#ifndef QT_NO_IMAGE_COLLECTION_COMPRESSION
out << ", qUncompress";
#endif
@@ -144,11 +144,11 @@ void Uic::embed( QTextStream& out, const char* project, const QStringList& image
out << "\n";
- QPtrList<EmbedImage> list_image;
+ TQPtrList<EmbedImage> list_image;
list_image.setAutoDelete( TRUE );
int image_count = 0;
for ( it = images.begin(); it != images.end(); ++it ) {
- QImage img;
+ TQImage img;
if ( !img.load( *it ) ) {
fprintf( stderr, "pyuic: cannot load image file %s\n", (*it).latin1() );
continue;
@@ -161,14 +161,14 @@ void Uic::embed( QTextStream& out, const char* project, const QStringList& image
e->colorTable = new QRgb[e->numColors];
e->alpha = img.hasAlphaBuffer();
memcpy(e->colorTable, img.colorTable(), e->numColors*sizeof(QRgb));
- QFileInfo fi( *it );
+ TQFileInfo fi( *it );
e->name = fi.fileName();
- e->cname = QString("image_%1").arg( image_count++);
+ e->cname = TQString("image_%1").arg( image_count++);
list_image.append( e );
out << "# " << *it << "\n";
- QString s;
+ TQString s;
if ( e->depth == 1 )
- img = img.convertBitOrder(QImage::BigEndian);
+ img = img.convertBitOrder(TQImage::BigEndian);
out << s.sprintf( "%s_data =",
(const char *)e->cname );
#ifndef QT_NO_IMAGE_COLLECTION_COMPRESSION
@@ -230,7 +230,7 @@ void Uic::embed( QTextStream& out, const char* project, const QStringList& image
// Keep the data object alive until we have a deep copy of the image.
out << indent << "data = qUncompress(data).data()\n";
#endif
- out << indent << "img = QImage(data,w,h,depth,colTab,nrCol,QImage.BigEndian).copy()\n";
+ out << indent << "img = TQImage(data,w,h,depth,colTab,nrCol,TQImage.BigEndian).copy()\n";
out << "\n";
out << indent << "if alpha:\n";
++indent;
@@ -241,21 +241,21 @@ void Uic::embed( QTextStream& out, const char* project, const QStringList& image
--indent;
--indent;
out << endl;
- out << indent << "return QImage()\n";
+ out << indent << "return TQImage()\n";
--indent;
out << "\n";
out << "\n";
- out << indent << "class MimeSourceFactory_" << cProject << "(QMimeSourceFactory):\n";
+ out << indent << "class MimeSourceFactory_" << cProject << "(TQMimeSourceFactory):\n";
++indent;
out << indent << "def __init__(self):\n";
++indent;
- out << indent << "QMimeSourceFactory.__init__(self)\n";
+ out << indent << "TQMimeSourceFactory.__init__(self)\n";
out << "\n";
--indent;
out << indent << "def data(self,abs_name):\n";
++indent;
- out << indent << "d = QMimeSourceFactory.data(self,abs_name)\n";
+ out << indent << "d = TQMimeSourceFactory.data(self,abs_name)\n";
out << indent << "if d or abs_name.isNull():\n";
++indent;
out << indent << "return d\n";
@@ -267,7 +267,7 @@ void Uic::embed( QTextStream& out, const char* project, const QStringList& image
out << indent << "self.setImage(abs_name,img)\n";
--indent;
out << "\n";
- out << indent << "return QMimeSourceFactory.data(self,abs_name)\n";
+ out << indent << "return TQMimeSourceFactory.data(self,abs_name)\n";
--indent;
--indent;
out << "\n";
@@ -283,7 +283,7 @@ void Uic::embed( QTextStream& out, const char* project, const QStringList& image
out << indent << "if factory is None:\n";
++indent;
out << indent << "factory = MimeSourceFactory_" << cProject << "()\n";
- out << indent << "QMimeSourceFactory.defaultFactory().addFactory(factory)\n";
+ out << indent << "TQMimeSourceFactory.defaultFactory().addFactory(factory)\n";
--indent;
--indent;
out << "\n";
@@ -295,7 +295,7 @@ void Uic::embed( QTextStream& out, const char* project, const QStringList& image
out << "\n";
out << indent << "if factory is not None:\n";
++indent;
- out << indent << "QMimeSourceFactory.defaultFactory().removeFactory(factory)\n";
+ out << indent << "TQMimeSourceFactory.defaultFactory().removeFactory(factory)\n";
out << indent << "factory = None\n";
--indent;
--indent;