From 479f5f799523bffbcc83dff581a2299c047c6fff Mon Sep 17 00:00:00 2001 From: tpearson Date: Sat, 31 Jul 2010 19:44:01 +0000 Subject: Trinity Qt initial conversion git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdebindings@1157645 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- qtruby/rubylib/designer/rbuic/embed.cpp | 52 ++++++++++++++++----------------- 1 file changed, 26 insertions(+), 26 deletions(-) (limited to 'qtruby/rubylib/designer/rbuic/embed.cpp') diff --git a/qtruby/rubylib/designer/rbuic/embed.cpp b/qtruby/rubylib/designer/rbuic/embed.cpp index 89985968..a1cf0a3f 100644 --- a/qtruby/rubylib/designer/rbuic/embed.cpp +++ b/qtruby/rubylib/designer/rbuic/embed.cpp @@ -35,14 +35,14 @@ **********************************************************************/ #include "uic.h" -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include #define NO_STATIC_COLORS #include -#include +#include #include #include #include @@ -52,14 +52,14 @@ struct EmbedImage int width, height, depth; int numColors; QRgb* colorTable; - QString name; - QString cname; + TQString name; + TQString cname; bool alpha; }; -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] = '_'; @@ -71,16 +71,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 ) ); ulong len = bazip.size(); #else ulong len = nbytes; #endif static const char hexdigits[] = "0123456789abcdef"; - QString s; + TQString s; for ( int i=0; i<(int)len; i++ ) { if ( (i%14) == 0 ) { s += "\n "; @@ -105,7 +105,7 @@ static ulong embedData( QTextStream& out, const uchar* input, int nbytes ) return 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; @@ -120,19 +120,19 @@ 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 << "'." << endl; out << "#" << endl; out << "# Generated from reading image files: " << endl; for ( it = images.begin(); it != images.end(); ++it ) out << "# " << *it << endl; out << "#" << endl; - out << "# Created: " << QDateTime::currentDateTime().toString() << endl; + out << "# Created: " << TQDateTime::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; @@ -147,10 +147,10 @@ void Uic::embed( QTextStream& out, const char* project, const QStringList& image out << indent << "class MimeSourceFactory_" << cProject << " < Qt::MimeSourceFactory" << endl; out << endl; - QPtrList list_image; + TQPtrList list_image; int image_count = 0; for ( it = images.begin(); it != images.end(); ++it ) { - QImage img; + TQImage img; if ( !img.load( *it ) ) { fprintf( stderr, "rbuic: cannot load image file %s\n", (*it).latin1() ); continue; @@ -163,16 +163,16 @@ 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 << endl; - QString imgname = (const char *)e->cname; + TQString imgname = (const char *)e->cname; - QString s; + TQString s; if ( e->depth == 1 ) - img = img.convertBitOrder(QImage::BigEndian); + img = img.convertBitOrder(TQImage::BigEndian); out << indent << imgname << "_data = ["; embedData( out, img.bits(), img.numBytes() ); out << "]\n\n"; @@ -192,7 +192,7 @@ void Uic::embed( QTextStream& out, const char* project, const QStringList& image { out << indent << "\"" << e->name << "\"" << " => [" << e->cname << "_data, " << e->width << ", " << e->height << ", " << e->depth << ", " - << (e->numColors ? e->cname + "_ctable" : QString::fromLatin1( "[]" ) ) << ", " + << (e->numColors ? e->cname + "_ctable" : TQString::fromLatin1( "[]" ) ) << ", " << (e->alpha ? "true" : "false") << "]," << endl; e = list_image.next(); } -- cgit v1.2.1