summaryrefslogtreecommitdiffstats
path: root/puic
diff options
context:
space:
mode:
authorTimothy Pearson <kb9vqf@pearsoncomputing.net>2012-01-01 18:24:37 -0600
committerTimothy Pearson <kb9vqf@pearsoncomputing.net>2012-01-01 18:24:37 -0600
commit4e997a9c6e25689dca65a2ec573a599699ef8170 (patch)
treefdb5ecac42fb8204df9fc8c9abe1c784d4719e0e /puic
parentbfa107694b2507a7116f8856cafe4ab1375da8a9 (diff)
downloadlibtqt-perl-4e997a9c6e25689dca65a2ec573a599699ef8170.tar.gz
libtqt-perl-4e997a9c6e25689dca65a2ec573a599699ef8170.zip
Initial TQt conversion
Diffstat (limited to 'puic')
-rw-r--r--puic/LICENSE.GPL6
-rw-r--r--puic/Makefile.am6
-rw-r--r--puic/Makefile.in20
-rw-r--r--puic/TODO2
-rw-r--r--puic/domtool.cpp160
-rw-r--r--puic/domtool.h36
-rw-r--r--puic/embed.cpp86
-rw-r--r--puic/form.cpp366
-rw-r--r--puic/globaldefs.h14
-rw-r--r--puic/main.cpp90
-rw-r--r--puic/object.cpp278
-rw-r--r--puic/parser.cpp26
-rw-r--r--puic/parser.h4
-rw-r--r--puic/puic.18
-rw-r--r--puic/puic.pro4
-rw-r--r--puic/subclassing.cpp64
-rw-r--r--puic/uic.cpp480
-rw-r--r--puic/uic.h206
-rw-r--r--puic/widgetdatabase.cpp226
-rw-r--r--puic/widgetdatabase.h40
-rw-r--r--puic/widgetinterface.h6
21 files changed, 1064 insertions, 1064 deletions
diff --git a/puic/LICENSE.GPL b/puic/LICENSE.GPL
index c7aea18..2c14883 100644
--- a/puic/LICENSE.GPL
+++ b/puic/LICENSE.GPL
@@ -263,14 +263,14 @@ OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
-TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
+TO THE TQUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
REPAIR OR CORRECTION.
- 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+ 12. IN NO EVENT UNLESS RETQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
-INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
+INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSETQUENTIAL DAMAGES ARISING
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
diff --git a/puic/Makefile.am b/puic/Makefile.am
index d429dc7..b0d7d8b 100644
--- a/puic/Makefile.am
+++ b/puic/Makefile.am
@@ -1,4 +1,4 @@
-AM_CPPFLAGS = -DUIC -DQT_INTERNAL_XML
+AM_CPPFLAGS = -DUIC -DTQT_INTERNAL_XML
AM_CXXFLAGS= $(KDE_CXXFLAGS)
bin_PROGRAMS = puic
@@ -14,8 +14,8 @@ EXTRA_DIST = domtool.cpp domtool.h embed.cpp form.cpp globaldefs.h main.cpp obje
# kde_bindir Where executables should go to. Use bin_PROGRAMS or bin_SCRIPTS.
# kde_libdir Where shared libraries should go to. Use lib_LTLIBRARIES.
# kde_moduledir Where modules (e.g. parts) should go to. Use kde_module_LTLIBRARIES.
-# kde_styledir Where Qt/KDE widget styles should go to (new in KDE 3).
-# kde_designerdir Where Qt Designer plugins should go to (new in KDE 3).
+# kde_styledir Where TQt/KDE widget styles should go to (new in KDE 3).
+# kde_designerdir Where TQt Designer plugins should go to (new in KDE 3).
# set the include path for X, qt and KDE
INCLUDES= $(all_includes)
diff --git a/puic/Makefile.in b/puic/Makefile.in
index 5caff94..25a3e00 100644
--- a/puic/Makefile.in
+++ b/puic/Makefile.in
@@ -104,14 +104,14 @@ LIBUCB = @LIBUCB@
LIBUTIL = @LIBUTIL@
LIBZ = @LIBZ@
LIB_POLL = @LIB_POLL@
-LIB_QPE = @LIB_QPE@
+LIB_TQPE = @LIB_TQPE@
LIB_QT = @LIB_QT@
LIB_X11 = @LIB_X11@
LIB_XEXT = @LIB_XEXT@
LN_S = @LN_S@
LTLIBOBJS = @LTLIBOBJS@
MAKEINFO = @MAKEINFO@
-MOC = @MOC@
+TQMOC = @TQMOC@
NOOPT_CFLAGS = @NOOPT_CFLAGS@
NOOPT_CXXFLAGS = @NOOPT_CXXFLAGS@
OBJEXT = @OBJEXT@
@@ -122,9 +122,9 @@ PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
-QTE_NORTTI = @QTE_NORTTI@
-QT_INCLUDES = @QT_INCLUDES@
-QT_LDFLAGS = @QT_LDFLAGS@
+TQTE_NORTTI = @TQTE_NORTTI@
+TQT_INCLUDES = @TQT_INCLUDES@
+TQT_LDFLAGS = @TQT_LDFLAGS@
RANLIB = @RANLIB@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
@@ -193,7 +193,7 @@ sysconfdir = @sysconfdir@
target_alias = @target_alias@
x_includes = @x_includes@
x_libraries = @x_libraries@
-AM_CPPFLAGS = -DUIC -DQT_INTERNAL_XML
+AM_CPPFLAGS = -DUIC -DTQT_INTERNAL_XML
AM_CXXFLAGS = $(KDE_CXXFLAGS)
bin_PROGRAMS = puic
@@ -209,8 +209,8 @@ EXTRA_DIST = domtool.cpp domtool.h embed.cpp form.cpp globaldefs.h main.cpp obje
# kde_bindir Where executables should go to. Use bin_PROGRAMS or bin_SCRIPTS.
# kde_libdir Where shared libraries should go to. Use lib_LTLIBRARIES.
# kde_moduledir Where modules (e.g. parts) should go to. Use kde_module_LTLIBRARIES.
-# kde_styledir Where Qt/KDE widget styles should go to (new in KDE 3).
-# kde_designerdir Where Qt Designer plugins should go to (new in KDE 3).
+# kde_styledir Where TQt/KDE widget styles should go to (new in KDE 3).
+# kde_designerdir Where TQt Designer plugins should go to (new in KDE 3).
# set the include path for X, qt and KDE
INCLUDES = $(all_includes)
@@ -296,7 +296,7 @@ $(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
#>+ 3
cd $(top_srcdir) && \
$(AUTOMAKE) --gnu puic/Makefile
- cd $(top_srcdir) && perl admin/am_edit PerlQt-3.008/puic/Makefile.in
+ cd $(top_srcdir) && perl admin/am_edit PerlTQt-3.008/puic/Makefile.in
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)
binPROGRAMS_INSTALL = $(INSTALL_PROGRAM)
@@ -645,7 +645,7 @@ docs-am:
force-reedit:
cd $(top_srcdir) && \
$(AUTOMAKE) --gnu puic/Makefile
- cd $(top_srcdir) && perl admin/am_edit PerlQt-3.008/puic/Makefile.in
+ cd $(top_srcdir) && perl admin/am_edit PerlTQt-3.008/puic/Makefile.in
#>+ 9
diff --git a/puic/TODO b/puic/TODO
index 77702c9..c2f78ba 100644
--- a/puic/TODO
+++ b/puic/TODO
@@ -1,7 +1,7 @@
- PNGs embedded in ui files and B&W pictures in external MimeSourceFactory remain untested
(and thus probably wrong)
-- PerlQt does not handle subclassing yet, so don't use the -subimpl option
+- PerlTQt does not handle subclassing yet, so don't use the -subimpl option
- database code needs more testing
- ...
diff --git a/puic/domtool.cpp b/puic/domtool.cpp
index 492ce88..3448d41 100644
--- a/puic/domtool.cpp
+++ b/puic/domtool.cpp
@@ -1,15 +1,15 @@
/**********************************************************************
** Copyright (C) 2000 Trolltech AS. All rights reserved.
**
-** 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
** Foundation and appearing in the file LICENSE.GPL included in the
** packaging of this file.
**
-** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
-** licenses may use this file in accordance with the Qt Commercial License
+** Licensees holding valid TQt Enterprise Edition or TQt Professional Edition
+** licenses may use this file in accordance with the TQt Commercial License
** Agreement provided with the Software.
**
** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
@@ -17,7 +17,7 @@
**
** See http://www.trolltech.com/gpl/ for GPL licensing information.
** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
-** information about Qt Commercial License Agreements.
+** information about TQt Commercial License Agreements.
**
** Contact info@trolltech.com if any conditions of this licensing are
** not clear to you.
@@ -51,9 +51,9 @@
\sa hasProperty()
*/
-QVariant DomTool::readProperty( const QDomElement& e, const QString& name, const QVariant& defValue, QString& comment )
+TQVariant DomTool::readProperty( const TQDomElement& e, const TQString& name, const TQVariant& defValue, TQString& comment )
{
- QDomElement n;
+ TQDomElement n;
for ( n = e.firstChild().toElement(); !n.isNull(); n = n.nextSibling().toElement() ) {
if ( n.tagName() == "property" ) {
if ( n.attribute( "name" ) != name )
@@ -68,9 +68,9 @@ QVariant DomTool::readProperty( const QDomElement& e, const QString& name, const
/*!
\overload
*/
-QVariant DomTool::readProperty( const QDomElement& e, const QString& name, const QVariant& defValue )
+TQVariant DomTool::readProperty( const TQDomElement& e, const TQString& name, const TQVariant& defValue )
{
- QString comment;
+ TQString comment;
return readProperty( e, name, defValue, comment );
}
@@ -79,9 +79,9 @@ QVariant DomTool::readProperty( const QDomElement& e, const QString& name, const
\sa readProperty()
*/
-bool DomTool::hasProperty( const QDomElement& e, const QString& name )
+bool DomTool::hasProperty( const TQDomElement& e, const TQString& name )
{
- QDomElement n;
+ TQDomElement n;
for ( n = e.firstChild().toElement(); !n.isNull(); n = n.nextSibling().toElement() ) {
if ( n.tagName() == "property" ) {
if ( n.attribute( "name" ) != name )
@@ -92,13 +92,13 @@ bool DomTool::hasProperty( const QDomElement& e, const QString& name )
return FALSE;
}
-QStringList DomTool::propertiesOfType( const QDomElement& e, const QString& type )
+TQStringList DomTool::propertiesOfType( const TQDomElement& e, const TQString& type )
{
- QStringList result;
- QDomElement n;
+ TQStringList result;
+ TQDomElement n;
for ( n = e.firstChild().toElement(); !n.isNull(); n = n.nextSibling().toElement() ) {
if ( n.tagName() == "property" ) {
- QDomElement n2 = n.firstChild().toElement();
+ TQDomElement n2 = n.firstChild().toElement();
if ( n2.tagName() == type )
result += n.attribute( "name" );
}
@@ -107,20 +107,20 @@ QStringList DomTool::propertiesOfType( const QDomElement& e, const QString& type
}
-QVariant DomTool::elementToVariant( const QDomElement& e, const QVariant& defValue )
+TQVariant DomTool::elementToVariant( const TQDomElement& e, const TQVariant& defValue )
{
- QString dummy;
+ TQString dummy;
return elementToVariant( e, defValue, dummy );
}
/*!
Interprets element \a e as variant and returns the result of the interpretation.
*/
-QVariant DomTool::elementToVariant( const QDomElement& e, const QVariant& defValue, QString &comment )
+TQVariant DomTool::elementToVariant( const TQDomElement& e, const TQVariant& defValue, TQString &comment )
{
- QVariant v;
+ TQVariant v;
if ( e.tagName() == "rect" ) {
- QDomElement n3 = e.firstChild().toElement();
+ TQDomElement n3 = e.firstChild().toElement();
int x = 0, y = 0, w = 0, h = 0;
while ( !n3.isNull() ) {
if ( n3.tagName() == "x" )
@@ -133,9 +133,9 @@ QVariant DomTool::elementToVariant( const QDomElement& e, const QVariant& defVal
h = n3.firstChild().toText().data().toInt();
n3 = n3.nextSibling().toElement();
}
- v = QVariant( QRect( x, y, w, h ) );
+ v = TQVariant( TQRect( x, y, w, h ) );
} else if ( e.tagName() == "point" ) {
- QDomElement n3 = e.firstChild().toElement();
+ TQDomElement n3 = e.firstChild().toElement();
int x = 0, y = 0;
while ( !n3.isNull() ) {
if ( n3.tagName() == "x" )
@@ -144,9 +144,9 @@ QVariant DomTool::elementToVariant( const QDomElement& e, const QVariant& defVal
y = n3.firstChild().toText().data().toInt();
n3 = n3.nextSibling().toElement();
}
- v = QVariant( QPoint( x, y ) );
+ v = TQVariant( TQPoint( x, y ) );
} else if ( e.tagName() == "size" ) {
- QDomElement n3 = e.firstChild().toElement();
+ TQDomElement n3 = e.firstChild().toElement();
int w = 0, h = 0;
while ( !n3.isNull() ) {
if ( n3.tagName() == "width" )
@@ -155,12 +155,12 @@ QVariant DomTool::elementToVariant( const QDomElement& e, const QVariant& defVal
h = n3.firstChild().toText().data().toInt();
n3 = n3.nextSibling().toElement();
}
- v = QVariant( QSize( w, h ) );
+ v = TQVariant( TQSize( w, h ) );
} else if ( e.tagName() == "color" ) {
- v = QVariant( readColor( e ) );
+ v = TQVariant( readColor( e ) );
} else if ( e.tagName() == "font" ) {
- QDomElement n3 = e.firstChild().toElement();
- QFont f( defValue.toFont() );
+ TQDomElement n3 = e.firstChild().toElement();
+ TQFont f( defValue.toFont() );
while ( !n3.isNull() ) {
if ( n3.tagName() == "family" )
f.setFamily( n3.firstChild().toText().data() );
@@ -176,58 +176,58 @@ QVariant DomTool::elementToVariant( const QDomElement& e, const QVariant& defVal
f.setStrikeOut( n3.firstChild().toText().data().toInt() );
n3 = n3.nextSibling().toElement();
}
- v = QVariant( f );
+ v = TQVariant( f );
} else if ( e.tagName() == "string" ) {
- v = QVariant( e.firstChild().toText().data() );
- QDomElement n = e;
+ v = TQVariant( e.firstChild().toText().data() );
+ TQDomElement n = e;
n = n.nextSibling().toElement();
if ( n.tagName() == "comment" )
comment = n.firstChild().toText().data();
} else if ( e.tagName() == "cstring" ) {
- v = QVariant( QCString( e.firstChild().toText().data() ) );
+ v = TQVariant( TQCString( e.firstChild().toText().data() ) );
} else if ( e.tagName() == "number" ) {
bool ok = TRUE;
- v = QVariant( e.firstChild().toText().data().toInt( &ok ) );
+ v = TQVariant( e.firstChild().toText().data().toInt( &ok ) );
if ( !ok )
- v = QVariant( e.firstChild().toText().data().toDouble() );
+ v = TQVariant( e.firstChild().toText().data().toDouble() );
} else if ( e.tagName() == "bool" ) {
- QString t = e.firstChild().toText().data();
- v = QVariant( t == "true" || t == "1", 0 );
+ TQString t = e.firstChild().toText().data();
+ v = TQVariant( t == "true" || t == "1", 0 );
} else if ( e.tagName() == "pixmap" ) {
- v = QVariant( e.firstChild().toText().data() );
+ v = TQVariant( e.firstChild().toText().data() );
} else if ( e.tagName() == "iconset" ) {
- v = QVariant( e.firstChild().toText().data() );
+ v = TQVariant( e.firstChild().toText().data() );
} else if ( e.tagName() == "image" ) {
- v = QVariant( e.firstChild().toText().data() );
+ v = TQVariant( e.firstChild().toText().data() );
} else if ( e.tagName() == "enum" ) {
- v = QVariant( e.firstChild().toText().data() );
+ v = TQVariant( e.firstChild().toText().data() );
} else if ( e.tagName() == "set" ) {
- v = QVariant( e.firstChild().toText().data() );
+ v = TQVariant( e.firstChild().toText().data() );
} else if ( e.tagName() == "sizepolicy" ) {
- QDomElement n3 = e.firstChild().toElement();
- QSizePolicy sp;
+ TQDomElement n3 = e.firstChild().toElement();
+ TQSizePolicy sp;
while ( !n3.isNull() ) {
if ( n3.tagName() == "hsizetype" )
- sp.setHorData( (QSizePolicy::SizeType)n3.firstChild().toText().data().toInt() );
+ sp.setHorData( (TQSizePolicy::SizeType)n3.firstChild().toText().data().toInt() );
else if ( n3.tagName() == "vsizetype" )
- sp.setVerData( (QSizePolicy::SizeType)n3.firstChild().toText().data().toInt() );
+ sp.setVerData( (TQSizePolicy::SizeType)n3.firstChild().toText().data().toInt() );
else if ( n3.tagName() == "horstretch" )
sp.setHorStretch( n3.firstChild().toText().data().toInt() );
else if ( n3.tagName() == "verstretch" )
sp.setVerStretch( n3.firstChild().toText().data().toInt() );
n3 = n3.nextSibling().toElement();
}
- v = QVariant( sp );
+ v = TQVariant( sp );
} else if ( e.tagName() == "cursor" ) {
- v = QVariant( QCursor( e.firstChild().toText().data().toInt() ) );
+ v = TQVariant( TQCursor( e.firstChild().toText().data().toInt() ) );
} else if ( e.tagName() == "stringlist" ) {
- QStringList lst;
- QDomElement n;
+ TQStringList lst;
+ TQDomElement n;
for ( n = e.firstChild().toElement(); !n.isNull(); n = n.nextSibling().toElement() )
lst << n.firstChild().toText().data();
- v = QVariant( lst );
+ v = TQVariant( lst );
} else if ( e.tagName() == "date" ) {
- QDomElement n3 = e.firstChild().toElement();
+ TQDomElement n3 = e.firstChild().toElement();
int y, m, d;
y = m = d = 0;
while ( !n3.isNull() ) {
@@ -239,9 +239,9 @@ QVariant DomTool::elementToVariant( const QDomElement& e, const QVariant& defVal
d = n3.firstChild().toText().data().toInt();
n3 = n3.nextSibling().toElement();
}
- v = QVariant( QDate( y, m, d ) );
+ v = TQVariant( TQDate( y, m, d ) );
} else if ( e.tagName() == "time" ) {
- QDomElement n3 = e.firstChild().toElement();
+ TQDomElement n3 = e.firstChild().toElement();
int h, m, s;
h = m = s = 0;
while ( !n3.isNull() ) {
@@ -253,9 +253,9 @@ QVariant DomTool::elementToVariant( const QDomElement& e, const QVariant& defVal
s = n3.firstChild().toText().data().toInt();
n3 = n3.nextSibling().toElement();
}
- v = QVariant( QTime( h, m, s ) );
+ v = TQVariant( TQTime( h, m, s ) );
} else if ( e.tagName() == "datetime" ) {
- QDomElement n3 = e.firstChild().toElement();
+ TQDomElement n3 = e.firstChild().toElement();
int h, mi, s, y, mo, d ;
h = mi = s = y = mo = d = 0;
while ( !n3.isNull() ) {
@@ -273,7 +273,7 @@ QVariant DomTool::elementToVariant( const QDomElement& e, const QVariant& defVal
d = n3.firstChild().toText().data().toInt();
n3 = n3.nextSibling().toElement();
}
- v = QVariant( QDateTime( QDate( y, mo, d ), QTime( h, mi, s ) ) );
+ v = TQVariant( TQDateTime( TQDate( y, mo, d ), TQTime( h, mi, s ) ) );
}
return v;
}
@@ -282,9 +282,9 @@ QVariant DomTool::elementToVariant( const QDomElement& e, const QVariant& defVal
/*! Returns the color which is returned in the dom element \a e.
*/
-QColor DomTool::readColor( const QDomElement &e )
+TQColor DomTool::readColor( const TQDomElement &e )
{
- QDomElement n = e.firstChild().toElement();
+ TQDomElement n = e.firstChild().toElement();
int r= 0, g = 0, b = 0;
while ( !n.isNull() ) {
if ( n.tagName() == "red" )
@@ -296,7 +296,7 @@ QColor DomTool::readColor( const QDomElement &e )
n = n.nextSibling().toElement();
}
- return QColor( r, g, b );
+ return TQColor( r, g, b );
}
/*!
@@ -306,9 +306,9 @@ QColor DomTool::readColor( const QDomElement &e )
\sa hasAttribute()
*/
-QVariant DomTool::readAttribute( const QDomElement& e, const QString& name, const QVariant& defValue, QString& comment )
+TQVariant DomTool::readAttribute( const TQDomElement& e, const TQString& name, const TQVariant& defValue, TQString& comment )
{
- QDomElement n;
+ TQDomElement n;
for ( n = e.firstChild().toElement(); !n.isNull(); n = n.nextSibling().toElement() ) {
if ( n.tagName() == "attribute" ) {
if ( n.attribute( "name" ) != name )
@@ -322,9 +322,9 @@ QVariant DomTool::readAttribute( const QDomElement& e, const QString& name, cons
/*!
\overload
*/
-QVariant DomTool::readAttribute( const QDomElement& e, const QString& name, const QVariant& defValue )
+TQVariant DomTool::readAttribute( const TQDomElement& e, const TQString& name, const TQVariant& defValue )
{
- QString comment;
+ TQString comment;
return readAttribute( e, name, defValue, comment );
}
@@ -333,9 +333,9 @@ QVariant DomTool::readAttribute( const QDomElement& e, const QString& name, cons
\sa readAttribute()
*/
-bool DomTool::hasAttribute( const QDomElement& e, const QString& name )
+bool DomTool::hasAttribute( const TQDomElement& e, const TQString& name )
{
- QDomElement n;
+ TQDomElement n;
for ( n = e.firstChild().toElement(); !n.isNull(); n = n.nextSibling().toElement() ) {
if ( n.tagName() == "attribute" ) {
if ( n.attribute( "name" ) != name )
@@ -346,19 +346,19 @@ bool DomTool::hasAttribute( const QDomElement& e, const QString& name )
return FALSE;
}
-static bool toBool( const QString& s )
+static bool toBool( const TQString& s )
{
return s == "true" || s.toInt() != 0;
}
/*!
- Convert Qt 2.x format to Qt 3.0 format if necessary
+ Convert TQt 2.x format to TQt 3.0 format if necessary
*/
-void DomTool::fixDocument( QDomDocument& doc )
+void DomTool::fixDocument( TQDomDocument& doc )
{
- QDomElement e;
- QDomNode n;
- QDomNodeList nl;
+ TQDomElement e;
+ TQDomNode n;
+ TQDomNodeList nl;
int i = 0;
e = doc.firstChild().toElement();
@@ -374,8 +374,8 @@ void DomTool::fixDocument( QDomDocument& doc )
// in 3.0, we need to fix a spelling error
if ( e.hasAttribute("version") && e.attribute("version").toDouble() == 3.0 ) {
for ( i = 0; i < (int) nl.length(); i++ ) {
- QDomElement el = nl.item(i).toElement();
- QString s = el.attribute( "name" );
+ TQDomElement el = nl.item(i).toElement();
+ TQString s = el.attribute( "name" );
if ( s == "resizeable" ) {
el.removeAttribute( "name" );
el.setAttribute( "name", "resizable" );
@@ -391,8 +391,8 @@ void DomTool::fixDocument( QDomDocument& doc )
e.setAttribute("stdsetdef", 1 );
for ( i = 0; i < (int) nl.length(); i++ ) {
e = nl.item(i).toElement();
- QString name;
- QDomElement n2 = e.firstChild().toElement();
+ TQString name;
+ TQDomElement n2 = e.firstChild().toElement();
if ( n2.tagName() == "name" ) {
name = n2.firstChild().toText().data();
if ( name == "resizeable" )
@@ -416,8 +416,8 @@ void DomTool::fixDocument( QDomDocument& doc )
nl = doc.elementsByTagName( "attribute" );
for ( i = 0; i < (int) nl.length(); i++ ) {
e = nl.item(i).toElement();
- QString name;
- QDomElement n2 = e.firstChild().toElement();
+ TQString name;
+ TQDomElement n2 = e.firstChild().toElement();
if ( n2.tagName() == "name" ) {
name = n2.firstChild().toText().data();
e.setAttribute( "name", name );
@@ -428,8 +428,8 @@ void DomTool::fixDocument( QDomDocument& doc )
nl = doc.elementsByTagName( "image" );
for ( i = 0; i < (int) nl.length(); i++ ) {
e = nl.item(i).toElement();
- QString name;
- QDomElement n2 = e.firstChild().toElement();
+ TQString name;
+ TQDomElement n2 = e.firstChild().toElement();
if ( n2.tagName() == "name" ) {
name = n2.firstChild().toText().data();
e.setAttribute( "name", name );
@@ -440,8 +440,8 @@ void DomTool::fixDocument( QDomDocument& doc )
nl = doc.elementsByTagName( "widget" );
for ( i = 0; i < (int) nl.length(); i++ ) {
e = nl.item(i).toElement();
- QString name;
- QDomElement n2 = e.firstChild().toElement();
+ TQString name;
+ TQDomElement n2 = e.firstChild().toElement();
if ( n2.tagName() == "class" ) {
name = n2.firstChild().toText().data();
e.setAttribute( "class", name );
diff --git a/puic/domtool.h b/puic/domtool.h
index 61b4269..4619552 100644
--- a/puic/domtool.h
+++ b/puic/domtool.h
@@ -1,15 +1,15 @@
/**********************************************************************
** Copyright (C) 2000 Trolltech AS. All rights reserved.
**
-** 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
** Foundation and appearing in the file LICENSE.GPL included in the
** packaging of this file.
**
-** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
-** licenses may use this file in accordance with the Qt Commercial License
+** Licensees holding valid TQt Enterprise Edition or TQt Professional Edition
+** licenses may use this file in accordance with the TQt Commercial License
** Agreement provided with the Software.
**
** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
@@ -17,7 +17,7 @@
**
** See http://www.trolltech.com/gpl/ for GPL licensing information.
** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
-** information about Qt Commercial License Agreements.
+** information about TQt Commercial License Agreements.
**
** Contact info@trolltech.com if any conditions of this licensing are
** not clear to you.
@@ -30,23 +30,23 @@
#include <qvariant.h>
#include <qnamespace.h>
-class QDomElement;
-class QDomDocument;
+class TQDomElement;
+class TQDomDocument;
-class DomTool : public Qt
+class DomTool : public TQt
{
public:
- static QVariant readProperty( const QDomElement& e, const QString& name, const QVariant& defValue );
- static QVariant readProperty( const QDomElement& e, const QString& name, const QVariant& defValue, QString& comment );
- static bool hasProperty( const QDomElement& e, const QString& name );
- static QStringList propertiesOfType( const QDomElement& e, const QString& type );
- static QVariant elementToVariant( const QDomElement& e, const QVariant& defValue );
- static QVariant elementToVariant( const QDomElement& e, const QVariant& defValue, QString &comment );
- static QVariant readAttribute( const QDomElement& e, const QString& name, const QVariant& defValue );
- static QVariant readAttribute( const QDomElement& e, const QString& name, const QVariant& defValue, QString& comment );
- static bool hasAttribute( const QDomElement& e, const QString& name );
- static QColor readColor( const QDomElement &e );
- static void fixDocument( QDomDocument& );
+ static TQVariant readProperty( const TQDomElement& e, const TQString& name, const TQVariant& defValue );
+ static TQVariant readProperty( const TQDomElement& e, const TQString& name, const TQVariant& defValue, TQString& comment );
+ static bool hasProperty( const TQDomElement& e, const TQString& name );
+ static TQStringList propertiesOfType( const TQDomElement& e, const TQString& type );
+ static TQVariant elementToVariant( const TQDomElement& e, const TQVariant& defValue );
+ static TQVariant elementToVariant( const TQDomElement& e, const TQVariant& defValue, TQString &comment );
+ static TQVariant readAttribute( const TQDomElement& e, const TQString& name, const TQVariant& defValue );
+ static TQVariant readAttribute( const TQDomElement& e, const TQString& name, const TQVariant& defValue, TQString& comment );
+ static bool hasAttribute( const TQDomElement& e, const TQString& name );
+ static TQColor readColor( const TQDomElement &e );
+ static void fixDocument( TQDomDocument& );
};
diff --git a/puic/embed.cpp b/puic/embed.cpp
index aac9633..148aa61 100644
--- a/puic/embed.cpp
+++ b/puic/embed.cpp
@@ -4,7 +4,7 @@
** Copyright (c) 2002 Riverbank Computing Limited <info@riverbankcomputing.co.uk>
** Copyright (c) 2002 Germain Garand <germain@ebooksfrance.com>
**
-** 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
@@ -21,9 +21,9 @@
**
**********************************************************************/
/*
-** 06/2002 : Initial release of puic, the PerlQt User Interface Compiler,
-** a work derivated from uic (the Qt User Interface Compiler)
-** and pyuic (the PyQt User Interface Compiler).
+** 06/2002 : Initial release of puic, the PerlTQt User Interface Compiler,
+** a work derivated from uic (the TQt User Interface Compiler)
+** and pyuic (the PyTQt User Interface Compiler).
**
** G.Garand
**
@@ -46,15 +46,15 @@ struct EmbedImage
{
int width, height, depth;
int numColors;
- QRgb* colorTable;
- QString name;
- QString cname;
+ TQRgb* colorTable;
+ 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] = '_';
@@ -66,10 +66,10 @@ static QString convertToCIdentifier( const char *s )
}
-static void embedData( QTextStream& out, const uchar* input, int nbytes )
+static void embedData( TQTextStream& out, const uchar* input, int nbytes )
{
static const char hexdigits[] = "0123456789abcdef";
- QString s;
+ TQString s;
for ( int i=0; i<nbytes; i++ )
{
if ( (i%14) == 0 )
@@ -91,10 +91,10 @@ static void embedData( QTextStream& out, const uchar* input, int nbytes )
out << (const char*)s;
}
-static void embedData( QTextStream& out, const QRgb* input, int n )
+static void embedData( TQTextStream& out, const TQRgb* input, int n )
{
out << hex;
- const QRgb *v = input;
+ const TQRgb *v = input;
for ( int i=0; i<n; i++ ) {
if ( (i%6) == 0 )
out << endl << " ";
@@ -108,20 +108,20 @@ 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 << "# by: The PerlQt User Interface Compiler (puic)" << endl;
+ out << "# Created: " << TQDateTime::currentDateTime().toString() << endl;
+ out << "# by: The PerlTQt User Interface Compiler (puic)" << endl;
out << "#" << endl;
out << "# WARNING! All changes made in this file will be lost!" << endl;
out << endl;
@@ -130,14 +130,14 @@ void Uic::embed( QTextStream& out, const char* project, const QStringList& image
out << endl;
out << indent << "package DesignerMimeSourceFactory_" << cProject << ";" << endl;
- out << indent << "use Qt;" << endl;
- out << indent << "use Qt::isa qw(Qt::MimeSourceFactory);" << endl;
+ out << indent << "use TQt;" << endl;
+ out << indent << "use TQt::isa qw(TQt::MimeSourceFactory);" << endl;
out << endl;
- QPtrList<EmbedImage> list_image;
+ TQPtrList<EmbedImage> list_image;
int image_count = 0;
for ( it = images.begin(); it != images.end(); ++it ) {
- QImage img;
+ TQImage img;
if ( !img.load( *it ) ) {
fprintf( stderr, "puic: cannot load image file %s\n", (*it).latin1() );
continue;
@@ -147,28 +147,28 @@ void Uic::embed( QTextStream& out, const char* project, const QStringList& image
e->height = img.height();
e->depth = img.depth();
e->numColors = img.numColors();
- e->colorTable = new QRgb[e->numColors];
+ e->colorTable = new TQRgb[e->numColors];
e->alpha = img.hasAlphaBuffer();
- memcpy(e->colorTable, img.colorTable(), e->numColors*sizeof(QRgb));
- QFileInfo fi( *it );
+ memcpy(e->colorTable, img.colorTable(), e->numColors*sizeof(TQRgb));
+ 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 s;
- QString imgname = (const char *)e->cname;
+ TQString s;
+ TQString imgname = (const char *)e->cname;
-//my $i0 = Qt::Image($image_0_data, 22, 22, 32, undef, &Qt::Image::BigEndian);
+//my $i0 = TQt::Image($image_0_data, 22, 22, 32, undef, &TQt::Image::BigEndian);
//$i0->setAlphaBuffer(1);
-//my $image0 = Qt::Pixmap($i0);
+//my $image0 = TQt::Pixmap($i0);
if ( e->depth == 32 ) {
out << indent << "my " << imgname << "_data = pack 'L*'," << endl;
- embedData( out, (QRgb*)img.bits(), e->width*e->height );
+ embedData( out, (TQRgb*)img.bits(), e->width*e->height );
} else {
if ( e->depth == 1 )
- img = img.convertBitOrder(QImage::BigEndian);
+ img = img.convertBitOrder(TQImage::BigEndian);
out << indent << "my " << imgname << "_data = pack 'C*'," << endl;
embedData( out, img.bits(), img.numBytes() );
}
@@ -190,7 +190,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("undef") ) << ", "
+ << (e->numColors ? e->cname + "_ctable" : TQString::fromLatin1("undef") ) << ", "
<< (e->alpha ? "1" : "0") << "]," << endl;
e = list_image.next();
}
@@ -206,9 +206,9 @@ void Uic::embed( QTextStream& out, const char* project, const QStringList& image
++indent;
out << indent << "my $name = shift;" << endl;
out << indent << "return $images{$name} if exists $images{$name};" << endl;
- out << indent << "return Qt::Image() unless exists $embed_images{$name};" << endl;
+ out << indent << "return TQt::Image() unless exists $embed_images{$name};" << endl;
out << indent << endl;
- out << indent << "my $img = Qt::Image(@{$embed_images{$name}}[0..4], &Qt::Image::BigEndian);" << endl;
+ out << indent << "my $img = TQt::Image(@{$embed_images{$name}}[0..4], &TQt::Image::BigEndian);" << endl;
out << indent << "${$embed_images{$name}}[5] && $img->setAlphaBuffer(1);" << endl;
out << indent << "$images{$name} = $img;" << endl;
out << indent << "return $img;" << endl;
@@ -223,14 +223,14 @@ void Uic::embed( QTextStream& out, const char* project, const QStringList& image
out << indent << "if($img->isNull())" << endl;
out << indent << "{" << endl;
++indent;
- out << indent << "Qt::MimeSourceFactory::removeFactory(this);" << endl;
- out << indent << "my $s = Qt::MimeSourceFactory::defaultFactory()->data($abs_name);" << endl;
- out << indent << "Qt::MimeSourceFactory::addFactory(this);" << endl;
+ out << indent << "TQt::MimeSourceFactory::removeFactory(this);" << endl;
+ out << indent << "my $s = TQt::MimeSourceFactory::defaultFactory()->data($abs_name);" << endl;
+ out << indent << "TQt::MimeSourceFactory::addFactory(this);" << endl;
out << indent << "return $s;" << endl;
--indent;
out << indent << "}" << endl;
- out << indent << "Qt::MimeSourceFactory::defaultFactory()->setImage($abs_name, $img);" << endl;
- out << indent << "return Qt::MimeSourceFactory::defaultFactory()->data($abs_name);" << endl;
+ out << indent << "TQt::MimeSourceFactory::defaultFactory()->setImage($abs_name, $img);" << endl;
+ out << indent << "return TQt::MimeSourceFactory::defaultFactory()->data($abs_name);" << endl;
--indent;
out << indent << "}" << endl;
@@ -238,12 +238,12 @@ void Uic::embed( QTextStream& out, const char* project, const QStringList& image
out << endl;
out << indent << "package staticImages;" << endl;
- out << indent << "use Qt;" << endl;
+ out << indent << "use TQt;" << endl;
out << indent << "use DesignerMimeSourceFactory_" << cProject << ";" << endl;
out << indent << "our %factories;" << endl;
out << indent << endl;
out << indent << "my $factory = DesignerMimeSourceFactory_" << cProject << ";" << endl;
- out << indent << "Qt::MimeSourceFactory::defaultFactory()->addFactory($factory);" << endl;
+ out << indent << "TQt::MimeSourceFactory::defaultFactory()->addFactory($factory);" << endl;
out << indent << "$factories{'DesignerMimeSourceFactory_" << cProject << "'} = $factory;" << endl;
out << endl;
out << indent << "END" << endl;
@@ -252,7 +252,7 @@ void Uic::embed( QTextStream& out, const char* project, const QStringList& image
out << indent << "for( values %factories )" << endl;
out << indent << "{" << endl;
++indent;
- out << indent << "Qt::MimeSourceFactory::defaultFactory()->removeFactory($_);" << endl;
+ out << indent << "TQt::MimeSourceFactory::defaultFactory()->removeFactory($_);" << endl;
--indent;
out << indent << "}" << endl;
out << indent << "%factories = ();" << endl;
diff --git a/puic/form.cpp b/puic/form.cpp
index 56f44c2..55ee7a7 100644
--- a/puic/form.cpp
+++ b/puic/form.cpp
@@ -2,7 +2,7 @@
** Copyright (C) 2000 Trolltech AS. All rights reserved.
** Copyright (c) 2002 Germain Garand <germain@ebooksfrance.com>
**
-** 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
@@ -19,9 +19,9 @@
**
**********************************************************************/
/*
-** 06/2002 : Initial release of puic, the PerlQt User Interface Compiler,
-** a work derivated from uic (the Qt User Interface Compiler)
-** and pyuic (the PyQt User Interface Compiler).
+** 06/2002 : Initial release of puic, the PerlTQt User Interface Compiler,
+** a work derivated from uic (the TQt User Interface Compiler)
+** and pyuic (the PyTQt User Interface Compiler).
**
** G.Garand
**
@@ -40,27 +40,27 @@
#include <qregexp.h>
#define NO_STATIC_COLORS
#include <globaldefs.h>
-#if( QT_VERSION < 0x030101 )
+#if( TQT_VERSION < 0x030101 )
# include <zlib.h>
-static QByteArray qUncompress( const uchar* data, int nbytes )
+static TQByteArray qUncompress( const uchar* data, int nbytes )
{
if ( !data ) {
-#if defined(QT_CHECK_RANGE)
+#if defined(TQT_CHECK_RANGE)
qWarning( "qUncompress: data is NULL." );
#endif
- return QByteArray();
+ return TQByteArray();
}
if ( nbytes <= 4 ) {
-#if defined(QT_CHECK_RANGE)
+#if defined(TQT_CHECK_RANGE)
if ( nbytes < 4 || ( data[0]!=0 || data[1]!=0 || data[2]!=0 || data[3]!=0 ) )
qWarning( "qUncompress: Input data is corrupted." );
#endif
- return QByteArray();
+ return TQByteArray();
}
ulong expectedSize = ( data[0] << 24 ) | ( data[1] << 16 ) | ( data[2] << 8 ) | data[3];
- ulong len = QMAX( expectedSize, 1 );
- QByteArray baunzip;
+ ulong len = TQMAX( expectedSize, 1 );
+ TQByteArray baunzip;
int res;
do {
baunzip.resize( len );
@@ -73,7 +73,7 @@ static QByteArray qUncompress( const uchar* data, int nbytes )
baunzip.resize( len );
break;
case Z_MEM_ERROR:
-#if defined(QT_CHECK_RANGE)
+#if defined(TQT_CHECK_RANGE)
qWarning( "qUncompress: Z_MEM_ERROR: Not enough memory." );
#endif
break;
@@ -81,7 +81,7 @@ static QByteArray qUncompress( const uchar* data, int nbytes )
len *= 2;
break;
case Z_DATA_ERROR:
-#if defined(QT_CHECK_RANGE)
+#if defined(TQT_CHECK_RANGE)
qWarning( "qUncompress: Z_DATA_ERROR: Input data is corrupted." );
#endif
break;
@@ -89,15 +89,15 @@ static QByteArray qUncompress( const uchar* data, int nbytes )
} while ( res == Z_BUF_ERROR );
if ( res != Z_OK )
- baunzip = QByteArray();
+ baunzip = TQByteArray();
return baunzip;
}
-#endif // QT_VERSION < 0x030101
+#endif // TQT_VERSION < 0x030101
using namespace std;
-static QByteArray unzipXPM( QString data, ulong& length )
+static TQByteArray unzipXPM( TQString data, ulong& length )
{
const int lengthOffset = 4;
int baSize = data.length() / 2 + lengthOffset;
@@ -123,27 +123,27 @@ static QByteArray unzipXPM( QString data, ulong& length )
ba[1] = ( length & 0x00ff0000 ) >> 16;
ba[2] = ( length & 0x0000ff00 ) >> 8;
ba[3] = ( length & 0x000000ff );
- QByteArray baunzip = qUncompress( ba, baSize );
+ TQByteArray baunzip = qUncompress( ba, baSize );
delete[] ba;
return baunzip;
}
#if 0
//- kept for diffs
-#if QT_VERSION >= 0x030900
-#error Add this functionality to QDir (relativePathTo() maybe?) and \
+#if TQT_VERSION >= 0x030900
+#error Add this functionality to TQDir (relativePathTo() maybe?) and \
remove it from here and from moc
#endif
-QCString combinePath( const char *infile, const char *outfile )
+TQCString combinePath( const char *infile, const char *outfile )
{
- QFileInfo inFileInfo( QDir::current(), QFile::decodeName(infile) );
- QFileInfo outFileInfo( QDir::current(), QFile::decodeName(outfile) );
+ TQFileInfo inFileInfo( TQDir::current(), TQFile::decodeName(infile) );
+ TQFileInfo outFileInfo( TQDir::current(), TQFile::decodeName(outfile) );
int numCommonComponents = 0;
- QStringList inSplitted =
- QStringList::split( '/', inFileInfo.dir().canonicalPath(), TRUE );
- QStringList outSplitted =
- QStringList::split( '/', outFileInfo.dir().canonicalPath(), TRUE );
+ TQStringList inSplitted =
+ TQStringList::split( '/', inFileInfo.dir().canonicalPath(), TRUE );
+ TQStringList outSplitted =
+ TQStringList::split( '/', outFileInfo.dir().canonicalPath(), TRUE );
while ( !inSplitted.isEmpty() && !outSplitted.isEmpty() &&
inSplitted.first() == outSplitted.first() ) {
@@ -157,7 +157,7 @@ QCString combinePath( const char *infile, const char *outfile )
The paths don't have the same drive, or they don't have the
same root directory. Use an absolute path.
*/
- return QFile::encodeName( inFileInfo.absFilePath() );
+ return TQFile::encodeName( inFileInfo.absFilePath() );
} else {
/*
The paths have something in common. Use a path relative to
@@ -168,7 +168,7 @@ QCString combinePath( const char *infile, const char *outfile )
inSplitted.prepend( ".." );
}
inSplitted.append( inFileInfo.fileName() );
- return QFile::encodeName( inSplitted.join("/") );
+ return TQFile::encodeName( inSplitted.join("/") );
}
}
#endif
@@ -178,30 +178,30 @@ QCString combinePath( const char *infile, const char *outfile )
\sa createFormDecl(), createObjectImpl()
*/
-void Uic::createFormImpl( const QDomElement &e )
+void Uic::createFormImpl( const TQDomElement &e )
{
- QDomElement n;
- QDomNodeList nl;
+ TQDomElement n;
+ TQDomNodeList nl;
int i;
- QString objClass = getClassName( e );
+ TQString objClass = getClassName( e );
if ( objClass.isEmpty() )
return;
- QString objName = getObjectName( e );
+ TQString objName = getObjectName( e );
out << indent << "package " << nameOfClass << ";" << endl;
- out << indent << "use Qt;" << endl;
+ out << indent << "use TQt;" << endl;
// generate local and local includes required
- QStringList globalIncludes, localIncludes, useIncludes;
- QStringList::Iterator it;
- QStringList sqlClasses;
+ TQStringList globalIncludes, localIncludes, useIncludes;
+ TQStringList::Iterator it;
+ TQStringList sqlClasses;
- QMap<QString, CustomInclude> customWidgetIncludes;
- QMap<QString, QString> functionImpls;
- QString uiPmInclude;
+ TQMap<TQString, CustomInclude> customWidgetIncludes;
+ TQMap<TQString, TQString> functionImpls;
+ TQString uiPmInclude;
// find additional slots
- QStringList extraSlots;
- QStringList extraSlotTyp;
+ TQStringList extraSlots;
+ TQStringList extraSlotTyp;
nl = e.parentNode().toElement().elementsByTagName( "slot" );
for ( i = 0; i < (int) nl.length(); i++ ) {
@@ -209,10 +209,10 @@ void Uic::createFormImpl( const QDomElement &e )
if ( n.parentNode().toElement().tagName() != "slots"
&& n.parentNode().toElement().tagName() != "connections" )
continue;
- QString l = n.attribute( "language", "C++" );
+ TQString l = n.attribute( "language", "C++" );
if ( l != "C++" && l != "Perl" ) //- mmh
continue;
- QString slotName = n.firstChild().toText().data().stripWhiteSpace();
+ TQString slotName = n.firstChild().toText().data().stripWhiteSpace();
if ( slotName.endsWith( ";" ) )
slotName = slotName.left( slotName.length() - 1 );
@@ -221,18 +221,18 @@ void Uic::createFormImpl( const QDomElement &e )
}
// find additional functions
- QStringList extraFuncts;
- QStringList extraFunctTyp;
+ TQStringList extraFuncts;
+ TQStringList extraFunctTyp;
nl = e.parentNode().toElement().elementsByTagName( "function" );
for ( i = 0; i < (int) nl.length(); i++ ) {
n = nl.item(i).toElement();
if ( n.parentNode().toElement().tagName() != "functions" )
continue;
- QString l = n.attribute( "language", "C++" );
+ TQString l = n.attribute( "language", "C++" );
if ( l != "C++" && l != "Perl" ) //- mmh
continue;
- QString functionName = n.firstChild().toText().data().stripWhiteSpace();
+ TQString functionName = n.firstChild().toText().data().stripWhiteSpace();
if ( functionName.endsWith( ";" ) )
functionName = functionName.left( functionName.length() - 1 );
extraFuncts += Parser::cleanArgs(functionName);
@@ -240,17 +240,17 @@ void Uic::createFormImpl( const QDomElement &e )
}
// find signals
- QStringList extraSignals;
+ TQStringList extraSignals;
nl = e.parentNode().toElement().elementsByTagName( "signal" );
for ( i = 0; i < (int) nl.length(); i++ ) {
n = nl.item(i).toElement();
if ( n.parentNode().toElement().tagName() != "signals"
&& n.parentNode().toElement().tagName() != "connections" )
continue;
- QString l = n.attribute( "language", "C++" );
+ TQString l = n.attribute( "language", "C++" );
if ( l != "C++" && l != "Perl" ) //- mmh
continue;
- QString sigName = n.firstChild().toText().data().stripWhiteSpace();
+ TQString sigName = n.firstChild().toText().data().stripWhiteSpace();
if ( sigName.endsWith( ";" ) )
sigName = sigName.left( sigName.length() - 1 );
extraSignals += sigName;
@@ -258,7 +258,7 @@ void Uic::createFormImpl( const QDomElement &e )
#if 0
//- kept for diffs
- QStringList customImages;
+ TQStringList customImages;
for ( n = e; !n.isNull(); n = n.nextSibling().toElement() ) {
if ( n.tagName() == "customwidgets" ) {
nl = n.elementsByTagName( "pixmap" );
@@ -269,11 +269,11 @@ void Uic::createFormImpl( const QDomElement &e )
#endif
for ( n = e; !n.isNull(); n = n.nextSibling().toElement() ) {
if ( n.tagName() == "customwidgets" ) {
- QDomElement n2 = n.firstChild().toElement();
+ TQDomElement n2 = n.firstChild().toElement();
while ( !n2.isNull() ) {
if ( n2.tagName() == "customwidget" ) {
- QDomElement n3 = n2.firstChild().toElement();
- QString cl, header;
+ TQDomElement n3 = n2.firstChild().toElement();
+ TQString cl, header;
WidgetDatabaseRecord *r = new WidgetDatabaseRecord;
while ( !n3.isNull() ) {
if ( n3.tagName() == "class" ) {
@@ -310,11 +310,11 @@ void Uic::createFormImpl( const QDomElement &e )
}
}
- out << indent << "use Qt::isa qw(" << objClass << ");" << endl;
+ out << indent << "use TQt::isa qw(" << objClass << ");" << endl;
- // PerlQt sig/slot declaration
+ // PerlTQt sig/slot declaration
if ( !extraSlots.isEmpty() ) {
- out << indent << "use Qt::slots" << endl;
+ out << indent << "use TQt::slots" << endl;
++indent;
for ( it = extraSlots.begin(); it != extraSlots.end(); ++it )
{
@@ -326,7 +326,7 @@ void Uic::createFormImpl( const QDomElement &e )
// create signals
if ( !extraSignals.isEmpty() ) {
- out << indent << "use Qt::signals" << endl;
+ out << indent << "use TQt::signals" << endl;
++indent;
for ( it = extraSignals.begin(); it != extraSignals.end(); ++it )
{
@@ -336,8 +336,8 @@ void Uic::createFormImpl( const QDomElement &e )
--indent;
}
- // PerlQt attributes
- out << indent << "use Qt::attributes qw("<< endl;
+ // PerlTQt attributes
+ out << indent << "use TQt::attributes qw("<< endl;
++indent;
// children
@@ -352,7 +352,7 @@ void Uic::createFormImpl( const QDomElement &e )
objectNames.clear();
// additional attributes (from Designer)
- QStringList publicVars, protectedVars, privateVars;
+ TQStringList publicVars, protectedVars, privateVars;
nl = e.parentNode().toElement().elementsByTagName( "variable" );
for ( i = 0; i < (int)nl.length(); i++ ) {
n = nl.item( i ).toElement();
@@ -360,8 +360,8 @@ void Uic::createFormImpl( const QDomElement &e )
// Someday it should be uncommented.
//if ( n.parentNode().toElement().tagName() != "variables" )
// continue;
- QString access = n.attribute( "access", "protected" );
- QString var = n.firstChild().toText().data().stripWhiteSpace();
+ TQString access = n.attribute( "access", "protected" );
+ TQString var = n.firstChild().toText().data().stripWhiteSpace();
if ( var.endsWith( ";" ) )
var.truncate(var.length() - 1);
if ( access == "public" )
@@ -393,12 +393,12 @@ void Uic::createFormImpl( const QDomElement &e )
{
if ( n.tagName() == "actions" )
{
- for ( QDomElement a = n.firstChild().toElement(); !a.isNull(); a = a.nextSibling().toElement() )
+ for ( TQDomElement a = n.firstChild().toElement(); !a.isNull(); a = a.nextSibling().toElement() )
createActionDecl( a );
}
else if ( n.tagName() == "toolbars" )
{
- for ( QDomElement a = n.firstChild().toElement(); !a.isNull(); a = a.nextSibling().toElement() )
+ for ( TQDomElement a = n.firstChild().toElement(); !a.isNull(); a = a.nextSibling().toElement() )
{
if ( a.tagName() == "toolbar" )
out << indent << getObjectName( a ) << endl;
@@ -408,7 +408,7 @@ void Uic::createFormImpl( const QDomElement &e )
else if ( n.tagName() == "menubar" )
{
out << indent << getObjectName( n ) << endl;
- for ( QDomElement a = n.firstChild().toElement(); !a.isNull(); a = a.nextSibling().toElement() )
+ for ( TQDomElement a = n.firstChild().toElement(); !a.isNull(); a = a.nextSibling().toElement() )
{
if ( a.tagName() == "item" )
out << indent << a.attribute( "name" ) << endl;
@@ -434,10 +434,10 @@ void Uic::createFormImpl( const QDomElement &e )
// additional includes (local or global ) and forward declaractions
nl = e.parentNode().toElement().elementsByTagName( "include" );
for ( i = 0; i < (int) nl.length(); i++ ) {
- QDomElement n2 = nl.item(i).toElement();
- QString s = n2.firstChild().toText().data();
+ TQDomElement n2 = nl.item(i).toElement();
+ TQString s = n2.firstChild().toText().data();
if ( n2.attribute( "location" ) != "local" ) {
- if ( (s.right( 5 ) == ".ui.h" || s.right( 6 ) == ".ui.pm") && !QFile::exists( s ) )
+ if ( (s.right( 5 ) == ".ui.h" || s.right( 6 ) == ".ui.pm") && !TQFile::exists( s ) )
continue;
if ( n2.attribute( "impldecl", "in implementation" ) != "in implementation" )
continue;
@@ -447,10 +447,10 @@ void Uic::createFormImpl( const QDomElement &e )
// do the local includes afterwards, since global includes have priority on clashes
for ( i = 0; i < (int) nl.length(); i++ ) {
- QDomElement n2 = nl.item(i).toElement();
- QString s = n2.firstChild().toText().data();
+ TQDomElement n2 = nl.item(i).toElement();
+ TQString s = n2.firstChild().toText().data();
if ( n2.attribute( "location" ) == "local" &&!globalIncludes.contains( s ) ) {
- if ( (s.right( 5 ) == ".ui.h" || s.right( 6 ) == ".ui.pm") && !QFile::exists( s ) )
+ if ( (s.right( 5 ) == ".ui.h" || s.right( 6 ) == ".ui.pm") && !TQFile::exists( s ) )
continue;
if ( n2.attribute( "impldecl", "in declaration" ) == "in declaration" )
{
@@ -466,8 +466,8 @@ void Uic::createFormImpl( const QDomElement &e )
// additional custom widget headers
nl = e.parentNode().toElement().elementsByTagName( "header" );
for ( i = 0; i < (int) nl.length(); i++ ) {
- QDomElement n2 = nl.item(i).toElement();
- QString s = n2.firstChild().toText().data();
+ TQDomElement n2 = nl.item(i).toElement();
+ TQString s = n2.firstChild().toText().data();
if ( n2.attribute( "location" ) != "local" )
globalIncludes += s;
else
@@ -476,21 +476,21 @@ void Uic::createFormImpl( const QDomElement &e )
// Output the "use" clauses for extra stuff in "Includes (In Declaration)"
// => in the perleditor plugin, this is content of the "Use clauses" list
- for(QStringList::Iterator it = useIncludes.begin(); it != useIncludes.end(); ++it)
+ for(TQStringList::Iterator it = useIncludes.begin(); it != useIncludes.end(); ++it)
out << indent << (*it) << endl;
// grab slots/funcs defined in ui.h files / ui.pm files
- for(QStringList::Iterator it = localIncludes.begin(); it != localIncludes.end(); ++it)
+ for(TQStringList::Iterator it = localIncludes.begin(); it != localIncludes.end(); ++it)
{
if((*it).right( 5 ) == ".ui.h")
{
- QFile f((*it));
+ TQFile f((*it));
if( f.open( IO_ReadOnly ) )
{
- QRegExp re("^.*([a-zA-Z0-9_]+\\s*\\(.*\\))\\s*$");
- QRegExp re2("^\\}.*");
- QTextStream t( &f );
- QString s, s2, s3;
+ TQRegExp re("^.*([a-zA-Z0-9_]+\\s*\\(.*\\))\\s*$");
+ TQRegExp re2("^\\}.*");
+ TQTextStream t( &f );
+ TQString s, s2, s3;
while ( !t.eof() )
{
s = t.readLine();
@@ -499,7 +499,7 @@ void Uic::createFormImpl( const QDomElement &e )
continue;
s2 = re.cap(1);
s2 = Parser::cleanArgs(s2);
- s3 = QString::null;
+ s3 = TQString::null;
while( !t.eof() )
{
s = t.readLine();
@@ -515,14 +515,14 @@ void Uic::createFormImpl( const QDomElement &e )
}
else if((*it).right( 6 ) == ".ui.pm")
{
- //QFileInfo fname( fileName ); //- FIXME: .ui files seem to require being in CWD?
- //QString path = fname.absFilePath();
+ //TQFileInfo fname( fileName ); //- FIXME: .ui files seem to require being in CWD?
+ //TQString path = fname.absFilePath();
//path = path.left( path.length() - fname.fileName().length() );
- QFile f(*it);
+ TQFile f(*it);
if( f.open( IO_ReadOnly ) )
{
- QTextStream t( &f );
- QString s;
+ TQTextStream t( &f );
+ TQString s;
bool skip = true;
int count = 0;
while ( !t.eof() )
@@ -538,7 +538,7 @@ void Uic::createFormImpl( const QDomElement &e )
else
{
skip = false;
- uiPmInclude += "# line " + QString::number( count+1 ) + " \"" + *it + "\"\n";
+ uiPmInclude += "# line " + TQString::number( count+1 ) + " \"" + *it + "\"\n";
}
}
uiPmInclude += s + "\n";
@@ -553,7 +553,7 @@ void Uic::createFormImpl( const QDomElement &e )
for ( it = tags.begin(); it != tags.end(); ++it ) {
nl = e.parentNode().toElement().elementsByTagName( *it );
for ( i = 1; i < (int) nl.length(); i++ ) { // start at 1, 0 is the toplevel widget
- QString name = getClassName( nl.item(i).toElement() );
+ TQString name = getClassName( nl.item(i).toElement() );
if ( name == "Spacer" ) {
globalIncludes += "qlayout.h";
globalIncludes += "qapplication.h";
@@ -562,8 +562,8 @@ void Uic::createFormImpl( const QDomElement &e )
if ( name.mid( 4 ) == "ListView" )
globalIncludes += "qheader.h";
if ( name != objClass ) {
- int wid = WidgetDatabase::idFromClassName( name.replace( QRegExp("^Qt::"), "Q" ) );
- QMap<QString, CustomInclude>::Iterator it = customWidgetIncludes.find( name );
+ int wid = WidgetDatabase::idFromClassName( name.replace( TQRegExp("^TQt::"), "Q" ) );
+ TQMap<TQString, CustomInclude>::Iterator it = customWidgetIncludes.find( name );
if ( it == customWidgetIncludes.end() )
globalIncludes += WidgetDatabase::includeFile( wid );
}
@@ -572,9 +572,9 @@ void Uic::createFormImpl( const QDomElement &e )
dbConnections = unique( dbConnections );
if ( dbConnections.count() )
- sqlClasses += "Qt::SqlDatabase";
+ sqlClasses += "TQt::SqlDatabase";
if ( dbCursors.count() )
- sqlClasses += "Qt::SqlCursor";
+ sqlClasses += "TQt::SqlCursor";
bool dbForm = FALSE;
if ( dbForms[ "(default)" ].count() )
dbForm = TRUE;
@@ -588,28 +588,28 @@ void Uic::createFormImpl( const QDomElement &e )
}
}
if ( dbForm || subDbForms ) {
- sqlClasses += "Qt::SqlForm";
- sqlClasses += "Qt::SqlRecord";
+ sqlClasses += "TQt::SqlForm";
+ sqlClasses += "TQt::SqlRecord";
}
if (globalIncludes.findIndex("qdatatable.h") >= 0)
- sqlClasses += "Qt::DataTable";
+ sqlClasses += "TQt::DataTable";
if (globalIncludes.findIndex("qtableview.h") >= 0)
- sqlClasses += "Qt::TableView";
+ sqlClasses += "TQt::TableView";
if (globalIncludes.findIndex("qdatabrowser.h") >= 0)
- sqlClasses += "Qt::DataBrowser";
+ sqlClasses += "TQt::DataBrowser";
out << endl;
// find out what images are required
- QStringList requiredImages;
+ TQStringList requiredImages;
static const char *imgTags[] = { "pixmap", "iconset", 0 };
for ( i = 0; imgTags[i] != 0; i++ ) {
nl = e.parentNode().toElement().elementsByTagName( imgTags[i] );
for ( int j = 0; j < (int) nl.length(); j++ ) {
- QDomNode nn = nl.item(j);
+ TQDomNode nn = nl.item(j);
while ( nn.parentNode() != e.parentNode() )
nn = nn.parentNode();
if ( nn.nodeName() != "customwidgets" )
@@ -620,8 +620,8 @@ void Uic::createFormImpl( const QDomElement &e )
// register the object and unify its name
objName = registerObject( objName );
- QStringList images;
- QStringList xpmImages;
+ TQStringList images;
+ TQStringList xpmImages;
if ( pixmapLoaderFunction.isEmpty() && !externPixmaps )
{
// create images
@@ -632,20 +632,20 @@ void Uic::createFormImpl( const QDomElement &e )
nl = n.elementsByTagName( "image" );
for ( i = 0; i < (int) nl.length(); i++ )
{
- QString img = registerObject( nl.item(i).toElement().attribute( "name" ) );
+ TQString img = registerObject( nl.item(i).toElement().attribute( "name" ) );
if ( !requiredImages.contains( img ) )
continue;
- QDomElement tmp = nl.item(i).firstChild().toElement();
+ TQDomElement tmp = nl.item(i).firstChild().toElement();
if ( tmp.tagName() != "data" )
continue;
- QString format = tmp.attribute("format", "PNG" );
- QString data = tmp.firstChild().toText().data();
+ TQString format = tmp.attribute("format", "PNG" );
+ TQString data = tmp.firstChild().toText().data();
out << indent << "our $" << img << ";" << endl;
if ( format == "XPM.GZ" )
{
xpmImages += img;
ulong length = tmp.attribute("length").toULong();
- QByteArray baunzip = unzipXPM( data, length );
+ TQByteArray baunzip = unzipXPM( data, length );
length = baunzip.size();
// shouldn't we test the initial `length' against the
// resulting `length' to catch corrupt UIC files?
@@ -673,13 +673,13 @@ void Uic::createFormImpl( const QDomElement &e )
++indent;
int a ;
for ( a = 0; a < (int) (data.length()/2)-1; a++ ) {
- out << "0x" << QString(data[2*a]) << QString(data[2*a+1]) << ",";
+ out << "0x" << TQString(data[2*a]) << TQString(data[2*a+1]) << ",";
if ( a % 12 == 11 )
out << endl << " ";
else
out << " ";
}
- out << "0x" << QString(data[2*a]) << QString(data[2*a+1]) << ";" << endl;
+ out << "0x" << TQString(data[2*a]) << TQString(data[2*a+1]) << ";" << endl;
--indent;
out << endl;
}
@@ -690,7 +690,7 @@ void Uic::createFormImpl( const QDomElement &e )
}
else if ( externPixmaps )
{
- pixmapLoaderFunction = "Qt::Pixmap::fromMimeSource";
+ pixmapLoaderFunction = "TQt::Pixmap::fromMimeSource";
}
@@ -698,11 +698,11 @@ void Uic::createFormImpl( const QDomElement &e )
out << indent << "sub NEW" << endl;
out << indent << "{" << endl;
++indent;
- if ( objClass == "Qt::Dialog" || objClass == "Qt::Wizard" ) {
+ if ( objClass == "TQt::Dialog" || objClass == "TQt::Wizard" ) {
out << indent << "shift->SUPER::NEW(@_[0..3]);" << endl;
- } else if ( objClass == "Qt::Widget") {
+ } else if ( objClass == "TQt::Widget") {
out << indent << "shift->SUPER::NEW(@_[0..2]);" << endl;
- } else if ( objClass == "Qt::MainWindow" ) {
+ } else if ( objClass == "TQt::MainWindow" ) {
out << indent << "shift->SUPER::NEW(@_[0..2]);" << endl;
out << indent << "statusBar();" << endl;
isMainWindow = TRUE;
@@ -714,9 +714,9 @@ void Uic::createFormImpl( const QDomElement &e )
// create pixmaps for all images
if ( !images.isEmpty() ) {
- QStringList::Iterator it;
+ TQStringList::Iterator it;
for ( it = images.begin(); it != images.end(); ++it ) {
- out << indent << "$" << (*it) << " = Qt::Pixmap();" << endl;
+ out << indent << "$" << (*it) << " = TQt::Pixmap();" << endl;
out << indent << "$" << (*it) << "->loadFromData($" << (*it) << "_data, length ($" << (*it) << "_data), \"PNG\");" << endl;
}
out << endl;
@@ -724,28 +724,28 @@ void Uic::createFormImpl( const QDomElement &e )
// create pixmaps for all images
if ( !xpmImages.isEmpty() ) {
for ( it = xpmImages.begin(); it != xpmImages.end(); ++it ) {
- out << indent << "$" << (*it) << " = Qt::Pixmap($" << (*it) << "_data);" << endl;
+ out << indent << "$" << (*it) << " = TQt::Pixmap($" << (*it) << "_data);" << endl;
}
out << endl;
}
// set the properties
- QSize geometry( 0, 0 );
+ TQSize geometry( 0, 0 );
for ( n = e.firstChild().toElement(); !n.isNull(); n = n.nextSibling().toElement() ) {
if ( n.tagName() == "property" ) {
bool stdset = stdsetdef;
if ( n.hasAttribute( "stdset" ) )
stdset = toBool( n.attribute( "stdset" ) );
- QString prop = n.attribute("name");
- QDomElement n2 = n.firstChild().toElement();
- QString value = setObjectProperty( objClass, QString::null, prop, n2, stdset );
+ TQString prop = n.attribute("name");
+ TQDomElement n2 = n.firstChild().toElement();
+ TQString value = setObjectProperty( objClass, TQString::null, prop, n2, stdset );
if ( value.isEmpty() )
continue;
if ( prop == "geometry" && n2.tagName() == "rect" ) {
- QDomElement n3 = n2.firstChild().toElement();
+ TQDomElement n3 = n2.firstChild().toElement();
while ( !n3.isNull() ) {
if ( n3.tagName() == "width" )
geometry.setWidth( n3.firstChild().toText().data().toInt() );
@@ -754,11 +754,11 @@ void Uic::createFormImpl( const QDomElement &e )
n3 = n3.nextSibling().toElement();
}
} else {
- QString call;
+ TQString call;
if ( stdset )
call = mkStdSet( prop ) + "(" + value;
else
- call = "setProperty(\"" + prop + "\", Qt::Variant(" + value + ")";
+ call = "setProperty(\"" + prop + "\", TQt::Variant(" + value + ")";
call += " );";
if ( n2.tagName() == "string" ) {
trout << indent << call << endl;
@@ -780,18 +780,18 @@ void Uic::createFormImpl( const QDomElement &e )
// create all children, some forms have special requirements
- if ( objClass == "Qt::Wizard" )
+ if ( objClass == "TQt::Wizard" )
{
for ( n = e.firstChild().toElement(); !n.isNull(); n = n.nextSibling().toElement() )
{
if ( tags.contains( n.tagName() ) )
{
- QString page = createObjectImpl( n, objClass, "this" );
- QString comment;
- QString label = DomTool::readAttribute( n, "title", "", comment ).toString();
+ TQString page = createObjectImpl( n, objClass, "this" );
+ TQString comment;
+ TQString label = DomTool::readAttribute( n, "title", "", comment ).toString();
out << indent << "addPage( " << page << ", \"\" );" << endl;
trout << indent << "setTitle( " << page << ", " << trcall( label, comment ) << " );" << endl;
- QVariant def( FALSE, 0 );
+ TQVariant def( FALSE, 0 );
if ( DomTool::hasAttribute( n, "backEnabled" ) )
out << indent << "setBackEnabled(" << page << "," << mkBool( DomTool::readAttribute( n, "backEnabled", def).toBool() ) << ");" << endl;
if ( DomTool::hasAttribute( n, "nextEnabled" ) )
@@ -820,20 +820,20 @@ void Uic::createFormImpl( const QDomElement &e )
out << endl;
for ( it = dbConnections.begin(); it != dbConnections.end(); ++it ) {
if ( !(*it).isEmpty() && (*it) != "(default)") {
- out << indent << (*it) << "Connection = Qt::SqlDatabase::database(\"" <<(*it) << "\");" << endl;
+ out << indent << (*it) << "Connection = TQt::SqlDatabase::database(\"" <<(*it) << "\");" << endl;
}
}
nl = e.parentNode().toElement().elementsByTagName( "widget" );
for ( i = 1; i < (int) nl.length(); i++ ) { // start at 1, 0 is the toplevel widget
n = nl.item(i).toElement();
- QString s = getClassName( n );
- if ( (dbForm || subDbForms) && ( s == "Qt::DataBrowser" || s == "Qt::DataView" ) ) {
- QString objName = getObjectName( n );
- QString tab = getDatabaseInfo( n, "table" );
- QString con = getDatabaseInfo( n, "connection" );
- out << indent << "my $" << objName << "Form = Qt::SqlForm(this, \"" << objName << "Form\");" << endl;
- QDomElement n2;
+ TQString s = getClassName( n );
+ if ( (dbForm || subDbForms) && ( s == "TQt::DataBrowser" || s == "TQt::DataView" ) ) {
+ TQString objName = getObjectName( n );
+ TQString tab = getDatabaseInfo( n, "table" );
+ TQString con = getDatabaseInfo( n, "connection" );
+ out << indent << "my $" << objName << "Form = TQt::SqlForm(this, \"" << objName << "Form\");" << endl;
+ TQDomElement n2;
for ( n2 = n.firstChild().toElement(); !n2.isNull(); n2 = n2.nextSibling().toElement() )
createFormImpl( n2, objName, con, tab );
out << indent << objName << "->setForm($" << objName << "Form);" << endl;
@@ -879,11 +879,11 @@ void Uic::createFormImpl( const QDomElement &e )
// take minimumSizeHint() into account, for height-for-width widgets
if ( !geometry.isNull() ) {
- out << indent << "my $resize = Qt::Size(" << geometry.width() << ", "
+ out << indent << "my $resize = TQt::Size(" << geometry.width() << ", "
<< geometry.height() << ");" << endl;
out << indent << "$resize = $resize->expandedTo(minimumSizeHint());" << endl;
out << indent << "resize( $resize );" << endl;
- out << indent << "clearWState( &Qt::WState_Polished );" << endl;
+ out << indent << "clearWState( &TQt::WState_Polished );" << endl;
}
for ( n = e; !n.isNull(); n = n.nextSibling().toElement() ) {
@@ -892,8 +892,8 @@ void Uic::createFormImpl( const QDomElement &e )
out << endl;
nl = n.elementsByTagName( "connection" );
for ( i = 0; i < (int) nl.length(); i++ ) {
- QString sender, receiver, signal, slot;
- for ( QDomElement n2 = nl.item(i).firstChild().toElement(); !n2.isNull(); n2 = n2.nextSibling().toElement() ) {
+ TQString sender, receiver, signal, slot;
+ for ( TQDomElement n2 = nl.item(i).firstChild().toElement(); !n2.isNull(); n2 = n2.nextSibling().toElement() ) {
if ( n2.tagName() == "sender" )
sender = n2.firstChild().toText().data();
else if ( n2.tagName() == "receiver" )
@@ -921,17 +921,17 @@ void Uic::createFormImpl( const QDomElement &e )
if ( receiver == objName )
receiver = "this";
- out << indent << "Qt::Object::connect(" << sender
- << ", SIGNAL \"" << signal << "\", "<< receiver << ", SLOT \"" << slot << "\");" << endl;
+ out << indent << "TQt::Object::connect(" << sender
+ << ", TQT_SIGNAL \"" << signal << "\", "<< receiver << ", TQT_SLOT \"" << slot << "\");" << endl;
}
} else if ( n.tagName() == "tabstops" ) {
// setup tab order
out << endl;
- QString lastName;
- QDomElement n2 = n.firstChild().toElement();
+ TQString lastName;
+ TQDomElement n2 = n.firstChild().toElement();
while ( !n2.isNull() ) {
if ( n2.tagName() == "tabstop" ) {
- QString name = n2.firstChild().toText().data();
+ TQString name = n2.firstChild().toText().data();
name = registeredName( name );
if ( !lastName.isEmpty() )
out << indent << "setTabOrder(" << lastName << ", " << name << ");" << endl;
@@ -944,7 +944,7 @@ void Uic::createFormImpl( const QDomElement &e )
// buddies
bool firstBuddy = TRUE;
- for ( QValueList<Buddy>::Iterator buddy = buddies.begin(); buddy != buddies.end(); ++buddy ) {
+ for ( TQValueList<Buddy>::Iterator buddy = buddies.begin(); buddy != buddies.end(); ++buddy ) {
if ( isObjectRegistered( (*buddy).buddy ) ) {
if ( firstBuddy ) {
out << endl;
@@ -984,20 +984,20 @@ void Uic::createFormImpl( const QDomElement &e )
for ( i = 0; i < (int) nl.length(); i++ ) {
if ( !DomTool::propertiesOfType( nl.item(i).toElement() , "font" ).isEmpty() )
needFontEventHandler = TRUE;
- QString s = getClassName( nl.item(i).toElement() );
- if ( s == "Qt::DataTable" || s == "Qt::DataBrowser" ) {
+ TQString s = getClassName( nl.item(i).toElement() );
+ if ( s == "TQt::DataTable" || s == "TQt::DataBrowser" ) {
if ( !isFrameworkCodeGenerated( nl.item(i).toElement() ) )
continue;
- if ( s == "Qt::DataTable" )
+ if ( s == "TQt::DataTable" )
needSqlTableEventHandler = TRUE;
- if ( s == "Qt::DataBrowser" )
+ if ( s == "TQt::DataBrowser" )
needSqlDataBrowserEventHandler = TRUE;
}
if ( needFontEventHandler && needSqlTableEventHandler && needSqlDataBrowserEventHandler )
break;
}
-// PerlQt - TODO: is this needed ?
+// PerlTQt - TODO: is this needed ?
// Seems not.. let's ifzero for now...
if ( 0 && needFontEventHandler ) {
@@ -1012,10 +1012,10 @@ void Uic::createFormImpl( const QDomElement &e )
out << " my $ret = SUPER->event( $ev ); " << endl;
if ( needFontEventHandler ) {
++indent;
- out << " if ( $ev->type() == &Qt::Event::ApplicationFontChange ) {" << endl;
+ out << " if ( $ev->type() == &TQt::Event::ApplicationFontChange ) {" << endl;
for ( i = 0; i < (int) nl.length(); i++ ) {
n = nl.item(i).toElement();
- QStringList list = DomTool::propertiesOfType( n, "font" );
+ TQStringList list = DomTool::propertiesOfType( n, "font" );
for ( it = list.begin(); it != list.end(); ++it )
createExclusiveProperty( n, *it );
}
@@ -1038,12 +1038,12 @@ void Uic::createFormImpl( const QDomElement &e )
++indent;
if ( needSqlTableEventHandler ) {
for ( i = 0; i < (int) nl.length(); i++ ) {
- QString s = getClassName( nl.item(i).toElement() );
- if ( s == "Qt::DataTable" ) {
+ TQString s = getClassName( nl.item(i).toElement() );
+ if ( s == "TQt::DataTable" ) {
n = nl.item(i).toElement();
- QString c = getObjectName( n );
- QString conn = getDatabaseInfo( n, "connection" );
- QString tab = getDatabaseInfo( n, "table" );
+ TQString c = getObjectName( n );
+ TQString conn = getDatabaseInfo( n, "connection" );
+ TQString tab = getDatabaseInfo( n, "table" );
if ( !( conn.isEmpty() || tab.isEmpty() || !isFrameworkCodeGenerated( nl.item(i).toElement() ) ) ) {
out << indent << "if(" << c << ")" << endl;
out << indent << "{" << endl;
@@ -1054,13 +1054,13 @@ void Uic::createFormImpl( const QDomElement &e )
out << indent << "{" << endl;
++indent;
if ( conn == "(default)" )
- out << indent << "$cursor = Qt::SqlCursor(\"" << tab << "\");" << endl;
+ out << indent << "$cursor = TQt::SqlCursor(\"" << tab << "\");" << endl;
else
- out << indent << "$cursor = Qt::SqlCursor(\"" << tab << "\", 1, " << conn << "Connection);" << endl;
+ out << indent << "$cursor = TQt::SqlCursor(\"" << tab << "\", 1, " << conn << "Connection);" << endl;
out << indent << "if ( " << c << "->isReadOnly() ) " << endl;
out << indent << "{" << endl;
++indent;
- out << indent << "$cursor->setMode( &Qt::SqlCursor::ReadOnly )" << endl;
+ out << indent << "$cursor->setMode( &TQt::SqlCursor::ReadOnly )" << endl;
--indent;
out << indent << "}" << endl;
out << indent << c << "->setSqlCursor($cursor, 0, 1);" << endl;
@@ -1070,7 +1070,7 @@ void Uic::createFormImpl( const QDomElement &e )
out << indent << "if(!$cursor->isActive())" << endl;
out << indent << "{" << endl;
++indent;
- out << indent << c << "->refresh( &Qt::DataTable::RefreshAll );" << endl;
+ out << indent << c << "->refresh( &TQt::DataTable::RefreshAll );" << endl;
--indent;
out << indent << "}" << endl;
--indent;
@@ -1082,12 +1082,12 @@ void Uic::createFormImpl( const QDomElement &e )
if ( needSqlDataBrowserEventHandler ) {
nl = e.elementsByTagName( "widget" );
for ( i = 0; i < (int) nl.length(); i++ ) {
- QString s = getClassName( nl.item(i).toElement() );
- if ( s == "Qt::DataBrowser" ) {
- QString obj = getObjectName( nl.item(i).toElement() );
- QString tab = getDatabaseInfo( nl.item(i).toElement(),
+ TQString s = getClassName( nl.item(i).toElement() );
+ if ( s == "TQt::DataBrowser" ) {
+ TQString obj = getObjectName( nl.item(i).toElement() );
+ TQString tab = getDatabaseInfo( nl.item(i).toElement(),
"table" );
- QString conn = getDatabaseInfo( nl.item(i).toElement(),
+ TQString conn = getDatabaseInfo( nl.item(i).toElement(),
"connection" );
if ( !(tab).isEmpty() || !isFrameworkCodeGenerated( nl.item(i).toElement() ) ) {
out << indent << "if(" << obj << ")" << endl;
@@ -1097,9 +1097,9 @@ void Uic::createFormImpl( const QDomElement &e )
out << indent << "{" << endl;
++indent;
if ( conn == "(default)" )
- out << indent << "my $cursor = Qt::SqlCursor(\"" << tab << "\");" << endl;
+ out << indent << "my $cursor = TQt::SqlCursor(\"" << tab << "\");" << endl;
else
- out << indent << "my $cursor = Qt::SqlCursor(\"" << tab << "\", 1, " << conn << "Connection);" << endl;
+ out << indent << "my $cursor = TQt::SqlCursor(\"" << tab << "\", 1, " << conn << "Connection);" << endl;
out << indent << obj << "->setSqlCursor($cursor, 1);" << endl;
out << indent << obj << "->refresh();" << endl;
out << indent << obj << "->first();" << endl;
@@ -1140,11 +1140,11 @@ void Uic::createFormImpl( const QDomElement &e )
out << indent << "sub " << (*it).left(astart)<< endl;
out << indent << "{" << endl;
bool createWarning = TRUE;
- QString fname = Parser::cleanArgs( *it );
- QMap<QString, QString>::Iterator fit = functionImpls.find( fname );
+ TQString fname = Parser::cleanArgs( *it );
+ TQMap<TQString, TQString>::Iterator fit = functionImpls.find( fname );
if ( fit != functionImpls.end() ) {
int begin = (*fit).find( "{" );
- QString body = (*fit).mid( begin + 1, (*fit).findRev( "}" ) - begin - 1 );
+ TQString body = (*fit).mid( begin + 1, (*fit).findRev( "}" ) - begin - 1 );
createWarning = body.simplifyWhiteSpace().isEmpty();
if ( !createWarning )
out << body << endl;
@@ -1166,7 +1166,7 @@ void Uic::createFormImpl( const QDomElement &e )
if ( *it == "init()" || *it == "destroy()" )
continue;
int astart = (*it).find('(');
- QRegExp r( "(\\nsub\\s+" + (*it).left(astart) + "(?:\\s*#\\s*SLOT:[^\\n]+|[ \t]+)?\\n\\{)(\\s*)(\\}\\n)" );
+ TQRegExp r( "(\\nsub\\s+" + (*it).left(astart) + "(?:\\s*#\\s*SLOT:[^\\n]+|[ \t]+)?\\n\\{)(\\s*)(\\}\\n)" );
r.setMinimal( true );
uiPmInclude.replace( r, "\\1\n" +
indent + "print \"" + nameOfClass + "->" + (*it) +
@@ -1190,34 +1190,34 @@ void Uic::createFormImpl( const QDomElement &e )
Traverses recursively over all children.
*/
-void Uic::createFormImpl( const QDomElement& e, const QString& form, const QString& connection, const QString& table )
+void Uic::createFormImpl( const TQDomElement& e, const TQString& form, const TQString& connection, const TQString& table )
{
if ( e.tagName() == "widget" &&
- e.attribute( "class" ) != "Qt::DataTable" ) {
- QString field = getDatabaseInfo( e, "field" );
+ e.attribute( "class" ) != "TQt::DataTable" ) {
+ TQString field = getDatabaseInfo( e, "field" );
if ( !field.isEmpty() ) {
if ( isWidgetInTable( e, connection, table ) )
out << indent << "$" << form << "Form->insert(" << getObjectName( e ) << ", " << fixString( field ) << ");" << endl;
}
}
- QDomElement n;
+ TQDomElement n;
for ( n = e.firstChild().toElement(); !n.isNull(); n = n.nextSibling().toElement() ) {
createFormImpl( n, form, connection, table );
}
}
-// Generate a PerlQt signal/slot definition.
+// Generate a PerlTQt signal/slot definition.
-void Uic::perlSlot(QStringList::Iterator &it)
+void Uic::perlSlot(TQStringList::Iterator &it)
{
int astart = (*it).find('(');
out << indent << (*it).left(astart) << " => ";
- QString args = (*it).mid(astart + 1,(*it).find(')') - astart - 1).stripWhiteSpace();
+ TQString args = (*it).mid(astart + 1,(*it).find(')') - astart - 1).stripWhiteSpace();
out << "[";
if (!args.isEmpty())
{
- QStringList arglist = QStringList::split( QRegExp(","), args );
+ TQStringList arglist = TQStringList::split( TQRegExp(","), args );
out << "'" << arglist.join( "', '") << "'";
}
out << "]";
diff --git a/puic/globaldefs.h b/puic/globaldefs.h
index cc6ed40..a3e141f 100644
--- a/puic/globaldefs.h
+++ b/puic/globaldefs.h
@@ -1,7 +1,7 @@
/**********************************************************************
** Copyright (C) 2000 Trolltech AS. All rights reserved.
**
-** 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
@@ -27,17 +27,17 @@
#define BOXLAYOUT_DEFAULT_SPACING 6
#ifndef NO_STATIC_COLORS
-static QColor *backColor1 = 0;
-static QColor *backColor2 = 0;
-static QColor *selectedBack = 0;
+static TQColor *backColor1 = 0;
+static TQColor *backColor2 = 0;
+static TQColor *selectedBack = 0;
static void init_colors()
{
if ( backColor1 )
return;
- backColor1 = new QColor( 236, 245, 255 );
- backColor2 = new QColor( 250, 250, 250 );
- selectedBack = new QColor( 221, 221, 221 );
+ backColor1 = new TQColor( 236, 245, 255 );
+ backColor2 = new TQColor( 250, 250, 250 );
+ selectedBack = new TQColor( 221, 221, 221 );
}
#endif
diff --git a/puic/main.cpp b/puic/main.cpp
index 869702c..c56c75e 100644
--- a/puic/main.cpp
+++ b/puic/main.cpp
@@ -3,7 +3,7 @@
** Copyright (c) 2001 Phil Thompson <phil@river-bank.demon.co.uk>
** Copyright (c) 2002 Germain Garand <germain@ebooksfrance.com>
**
-** 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
@@ -20,9 +20,9 @@
**
**********************************************************************/
/*
-** 06/2002 : Initial release of puic, the PerlQt User Interface Compiler,
-** a work derivated from uic (the Qt User Interface Compiler)
-** and pyuic (the PyQt User Interface Compiler).
+** 06/2002 : Initial release of puic, the PerlTQt User Interface Compiler,
+** a work derivated from uic (the TQt User Interface Compiler)
+** and pyuic (the PyTQt User Interface Compiler).
**
** G.Garand
**
@@ -41,7 +41,7 @@
#include <stdlib.h>
#define PUIC_VERSION "0.70"
-void getDBConnections( Uic& uic, QString& s);
+void getDBConnections( Uic& uic, TQString& s);
int main( int argc, char * argv[] )
{
@@ -50,24 +50,24 @@ int main( int argc, char * argv[] )
bool subcl = FALSE;
bool imagecollection = FALSE;
bool imagecollection_tmpfile = FALSE;
- QStringList images;
+ TQStringList images;
const char *error = 0;
const char* fileName = 0;
const char* className = 0;
- QCString outputFile;
- QCString image_tmpfile;
+ TQCString outputFile;
+ TQCString image_tmpfile;
const char* projectName = 0;
const char* trmacro = 0;
bool nofwd = FALSE;
bool fix = FALSE;
- QApplication app(argc, argv, FALSE);
- QString uicClass;
+ TQApplication app(argc, argv, FALSE);
+ TQString 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-2) ) {
@@ -114,8 +114,8 @@ int main( int argc, char * argv[] )
}
} else if ( opt == "version" ) {
fprintf( stderr,
- "PerlQt User Interface Compiler v%s for Qt version %s\n", PUIC_VERSION,
- QT_VERSION_STR );
+ "PerlTQt User Interface Compiler v%s for TQt version %s\n", PUIC_VERSION,
+ TQT_VERSION_STR );
exit( 1 );
} else if ( opt == "help" ) {
break;
@@ -130,7 +130,7 @@ int main( int argc, char * argv[] )
error = "Missing indent";
break;
}
- tabstop = QCString(argv[++n]).toUInt(&ok);
+ tabstop = TQCString(argv[++n]).toUInt(&ok);
} else
tabstop = opt.mid(1).toUInt(&ok);
@@ -141,7 +141,7 @@ int main( int argc, char * argv[] )
} else if ( opt == "x" ) {
execCode = TRUE;
} else {
- error = QString( "Unrecognized option " + opt ).latin1();
+ error = TQString( "Unrecognized option " + opt ).latin1();
}
} else {
if ( imagecollection && !imagecollection_tmpfile )
@@ -154,7 +154,7 @@ int main( int argc, char * argv[] )
}
if ( argc < 2 || error || (!fileName && !imagecollection ) ) {
- fprintf( stderr, "PerlQt user interface compiler.\n" );
+ fprintf( stderr, "PerlTQt user interface compiler.\n" );
if ( error )
fprintf( stderr, "puic: %s\n", error );
@@ -185,20 +185,20 @@ int main( int argc, char * argv[] )
}
if ( imagecollection_tmpfile ) {
- QFile ifile( image_tmpfile );
+ TQFile ifile( image_tmpfile );
if ( ifile.open( IO_ReadOnly ) ) {
- QTextStream ts( &ifile );
- QString s = ts.read();
+ TQTextStream ts( &ifile );
+ TQString s = ts.read();
s = s.simplifyWhiteSpace();
- images = QStringList::split( ' ', s );
- for ( QStringList::Iterator it = images.begin(); it != images.end(); ++it )
+ images = TQStringList::split( ' ', s );
+ for ( TQStringList::Iterator it = images.begin(); it != images.end(); ++it )
*it = (*it).simplifyWhiteSpace();
}
}
Uic::setIndent(indent);
- QFile fileOut;
+ TQFile fileOut;
if ( !outputFile.isEmpty() ) {
fileOut.setName( outputFile );
if (!fileOut.open( IO_WriteOnly ) ) {
@@ -208,34 +208,34 @@ 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 );
Uic::embed( out, projectName, images );
return 0;
}
- out.setEncoding( QTextStream::UnicodeUTF8 );
+ out.setEncoding( TQTextStream::UnicodeUTF8 );
- QFile file( fileName );
+ TQFile file( fileName );
if ( !file.open( IO_ReadOnly ) ) {
qWarning( "puic: Could not open file '%s' ", fileName );
return 1;
}
- QDomDocument doc;
- QString errMsg;
+ TQDomDocument doc;
+ TQString errMsg;
int errLine;
if ( !doc.setContent( &file, &errMsg, &errLine ) ) {
- qWarning( QString("puic: Failed to parse %s: ") + errMsg + QString (" in line %d\n"), fileName, errLine );
+ qWarning( TQString("puic: Failed to parse %s: ") + errMsg + TQString (" in line %d\n"), fileName, errLine );
return 1;
}
- QDomElement e = doc.firstChild().toElement();
+ TQDomElement e = doc.firstChild().toElement();
if ( e.hasAttribute("version") && e.attribute("version").toDouble() > 3.2 ) {
- qWarning( QString("puic: File generated with too recent version of Qt Designer (%s). Recent extensions won't be handled."),
+ qWarning( TQString("puic: File generated with too recent version of TQt Designer (%s). Recent extensions won't be handled."),
e.attribute("version").latin1() );
return 1;
}
@@ -250,8 +250,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 PerlQt User Interface Compiler (puic)" << endl;
+ out << "# Created: " << TQDateTime::currentDateTime().toString() << endl;
+ out << "# by: The PerlTQt User Interface Compiler (puic)" << endl;
out << "#" << endl;
out << "# WARNING! All changes made in this file will be lost!" << endl;
out << endl;
@@ -269,14 +269,14 @@ int main( int argc, char * argv[] )
out << endl;
out << indent << "package main;" << endl;
out << endl;
- out << "use Qt;" << endl;
- out << "use " << (subcl ? QString::fromLatin1(className) : uicClass) << ";" << endl;
+ out << "use TQt;" << endl;
+ out << "use " << (subcl ? TQString::fromLatin1(className) : uicClass) << ";" << endl;
out << endl;
- out << indent << "my $a = Qt::Application(\\@ARGV);" << endl;
- QString s;
+ out << indent << "my $a = TQt::Application(\\@ARGV);" << endl;
+ TQString s;
getDBConnections( uic, s);
out << s;
- out << indent << "my $w = " << (subcl? QString::fromLatin1(className) : uicClass) << ";" << endl;
+ out << indent << "my $w = " << (subcl? TQString::fromLatin1(className) : uicClass) << ";" << endl;
out << indent << "$a->setMainWidget($w);" << endl;
out << indent << "$w->show;" << endl;
out << indent << "exit $a->exec;" << endl;
@@ -289,20 +289,20 @@ int main( int argc, char * argv[] )
return 0;
}
-void getDBConnections( Uic& uic, QString& s)
+void getDBConnections( Uic& uic, TQString& s)
{
int num = 0;
- for ( QStringList::Iterator it = uic.dbConnections.begin(); it != uic.dbConnections.end(); ++it ) {
+ for ( TQStringList::Iterator it = uic.dbConnections.begin(); it != uic.dbConnections.end(); ++it ) {
if ( !(*it).isEmpty()) {
- QString inc = (num ? QString::number(num+1) : QString::null);
+ TQString inc = (num ? TQString::number(num+1) : TQString::null);
s += "\n# Connection to database " + (*it) + "\n\n";
- s += "my $DRIVER" + inc + " =\t\t'QMYSQL3';" + (inc?"":" # appropriate driver") + "\n";
+ s += "my $DRIVER" + inc + " =\t\t'TQMYSQL3';" + (inc?"":" # appropriate driver") + "\n";
s += "my $DATABASE" + inc + " =\t\t'foo';" + (inc?"":" # name of your database") + "\n";
s += "my $USER" + inc + "=\t\t'john';" + (inc?"":" # username") + "\n";
s += "my $PASSWORD" + inc + "=\t\t'ZxjGG34s';" + (inc?"":" # password for USER") + "\n";
s += "my $HOST" + inc + "=\t\t'localhost';" + (inc?"":" # host on which the database is running") + "\n";
s += "\n";
- s += "my $db" + inc + " = Qt::SqlDatabase::addDatabase( $DRIVER" + inc;
+ s += "my $db" + inc + " = TQt::SqlDatabase::addDatabase( $DRIVER" + inc;
if (inc)
s+= ", '" + (*it) + "'";
s += " );\n";
@@ -313,7 +313,7 @@ void getDBConnections( Uic& uic, QString& s)
s += "\n";
s += "if( !$db" + inc + "->open() )\n";
s += "{\n";
- s += " Qt::MessageBox::information( undef, 'Unable to open database',\n";
+ s += " TQt::MessageBox::information( undef, 'Unable to open database',\n";
s += " $db" + inc + "->lastError()->databaseText() . \"\\n\");\n";
s += " exit 1;\n";
s += "}\n";
diff --git a/puic/object.cpp b/puic/object.cpp
index a7eb0c4..ec2f717 100644
--- a/puic/object.cpp
+++ b/puic/object.cpp
@@ -1,7 +1,7 @@
/**********************************************************************
** Copyright (C) 2000 Trolltech AS. All rights reserved.
**
-** 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
@@ -36,19 +36,19 @@
\sa createObjectImpl()
*/
-void Uic::createObjectDecl( const QDomElement& e )
+void Uic::createObjectDecl( const TQDomElement& e )
{
if ( e.tagName() == "vbox" || e.tagName() == "hbox" || e.tagName() == "grid" ) {
out << indent << registerObject(getLayoutName(e) ) << endl;
} else {
- QString objClass = getClassName( e );
+ TQString objClass = getClassName( e );
if ( objClass.isEmpty() )
return;
- QString objName = getObjectName( e );
+ TQString objName = getObjectName( e );
if ( objName.isEmpty() )
return;
- // ignore QLayoutWidgets
- if ( objClass == "Qt::LayoutWidget" )
+ // ignore TQLayoutWidgets
+ if ( objClass == "TQt::LayoutWidget" )
return;
// register the object and unify its name
@@ -58,29 +58,29 @@ void Uic::createObjectDecl( const QDomElement& e )
}
/*!
- Creates a PerlQt attribute declaration for the object given in \a e.
+ Creates a PerlTQt attribute declaration for the object given in \a e.
Children are not traversed recursively.
*/
-void Uic::createAttrDecl( const QDomElement& e )
+void Uic::createAttrDecl( const TQDomElement& e )
{
if ( e.tagName() == "vbox" || e.tagName() == "hbox" || e.tagName() == "grid" ) {
out << indent << registerObject(getLayoutName(e) ) << endl;
} else {
- QString objClass = getClassName( e );
+ TQString objClass = getClassName( e );
if ( objClass.isEmpty() )
return;
- QString objName = getObjectName( e );
+ TQString objName = getObjectName( e );
if ( objName.isEmpty() )
return;
- // ignore QLayoutWidgets
- if ( objClass == "Qt::LayoutWidget" )
+ // ignore TQLayoutWidgets
+ if ( objClass == "TQt::LayoutWidget" )
return;
// register the object and unify its name
objName = registerObject( objName );
out << indent << objName << endl;
- QDomElement n = getObjectProperty( e, "font");
+ TQDomElement n = getObjectProperty( e, "font");
if ( !n.isNull() )
out << indent << objName + "_font" << endl;
}
@@ -99,17 +99,17 @@ void Uic::createAttrDecl( const QDomElement& e )
static bool createdCentralWidget = FALSE;
-QString Uic::createObjectImpl( const QDomElement &e, const QString& parentClass, const QString& par, const QString& layout )
+TQString Uic::createObjectImpl( const TQDomElement &e, const TQString& parentClass, const TQString& par, const TQString& layout )
{
- QString parent( par );
+ TQString parent( par );
if ( parent == "this" && isMainWindow ) {
if ( !createdCentralWidget )
- out << indent << "setCentralWidget(Qt::Widget(this, \"qt_central_widget\"));" << endl;
+ out << indent << "setCentralWidget(TQt::Widget(this, \"qt_central_widget\"));" << endl;
createdCentralWidget = TRUE;
parent = "centralWidget()";
}
- QDomElement n;
- QString objClass, objName;
+ TQDomElement n;
+ TQString objClass, objName;
int numItems = 0;
int numColumns = 0;
int numRows = 0;
@@ -122,8 +122,8 @@ QString Uic::createObjectImpl( const QDomElement &e, const QString& parentClass,
return objName;
objName = getObjectName( e );
- QString definedName = objName;
- bool isTmpObject = objName.isEmpty() || objClass == "Qt::LayoutWidget";
+ TQString definedName = objName;
+ bool isTmpObject = objName.isEmpty() || objClass == "TQt::LayoutWidget";
if ( isTmpObject ) {
if ( objClass[0] == 'Q' )
objName = "$" + objClass.mid( 4 );
@@ -133,17 +133,17 @@ QString Uic::createObjectImpl( const QDomElement &e, const QString& parentClass,
bool isLine = objClass == "Line";
if ( isLine )
- objClass = "Qt::Frame";
+ objClass = "TQt::Frame";
out << endl;
- if ( objClass == "Qt::LayoutWidget" ) {
+ if ( objClass == "TQt::LayoutWidget" ) {
if ( layout.isEmpty() ) {
// register the object and unify its name
objName = registerObject( objName );
- out << indent << (isTmpObject ? QString::fromLatin1("my ") : QString::null) << objName << " = Qt::Widget(" << parent << ", '" << objName << "');" << endl;
+ out << indent << (isTmpObject ? TQString::fromLatin1("my ") : TQString::null) << objName << " = TQt::Widget(" << parent << ", '" << objName << "');" << endl;
} else {
// the layout widget is not necessary, hide it by creating its child in the parent
- QString result;
+ TQString result;
for ( n = e.firstChild().toElement(); !n.isNull(); n = n.nextSibling().toElement() ) {
if (tags.contains( n.tagName() ) )
result = createObjectImpl( n, parentClass, parent, layout );
@@ -151,17 +151,17 @@ QString Uic::createObjectImpl( const QDomElement &e, const QString& parentClass,
return result;
}
- } else if ( objClass != "Qt::ToolBar" && objClass != "Qt::MenuBar" ) {
+ } else if ( objClass != "TQt::ToolBar" && objClass != "TQt::MenuBar" ) {
// register the object and unify its name
objName = registerObject( objName );
// Temporary objects don't go into the class instance dictionary.
- out << indent << (isTmpObject ? QString("my ") : QString::null) << objName << " = " << createObjectInstance( objClass, parent, objName ) << ";" << endl;
+ out << indent << (isTmpObject ? TQString("my ") : TQString::null) << objName << " = " << createObjectInstance( objClass, parent, objName ) << ";" << endl;
}
- if ( objClass == "Qt::AxWidget" ) {
- QString controlId;
+ if ( objClass == "TQt::AxWidget" ) {
+ TQString controlId;
for ( n = e.firstChild().toElement(); !n.isNull(); n = n.nextSibling().toElement() ) {
if ( n.tagName() == "property" && n.attribute( "name" ) == "control" ) {
controlId = n.firstChild().toElement().text();
@@ -178,10 +178,10 @@ QString Uic::createObjectImpl( const QDomElement &e, const QString& parentClass,
bool stdset = stdsetdef;
if ( n.hasAttribute( "stdset" ) )
stdset = toBool( n.attribute( "stdset" ) );
- QString prop = n.attribute( "name" );
+ TQString prop = n.attribute( "name" );
if ( prop == "database" )
continue;
- QString value = setObjectProperty( objClass, objName, prop, n.firstChild().toElement(), stdset );
+ TQString value = setObjectProperty( objClass, objName, prop, n.firstChild().toElement(), stdset );
if ( value.isEmpty() )
continue;
if ( prop == "name" )
@@ -195,35 +195,35 @@ QString Uic::createObjectImpl( const QDomElement &e, const QString& parentClass,
if ( isLine && prop == "orientation" ) {
prop = "frameShape";
if ( value.right(10) == "Horizontal" )
- value = "&Qt::Frame::HLine";
+ value = "&TQt::Frame::HLine";
else
- value = "&Qt::Frame::VLine";
+ value = "&TQt::Frame::VLine";
if ( !hadFrameShadow ) {
prop = "frameStyle";
- value += " | &Qt::Frame::Sunken";
+ value += " | &TQt::Frame::Sunken";
}
}
if ( prop == "buttonGroupId" ) {
- if ( parentClass == "Qt::ButtonGroup" )
+ if ( parentClass == "TQt::ButtonGroup" )
out << indent << parent << "->insert( " << objName << "," << value << ");" << endl;
continue;
}
if ( prop == "frameworkCode" )
continue;
- if ( objClass == "Qt::MultiLineEdit" &&
- QRegExp("echoMode|hMargin|maxLength|maxLines|undoEnabled").exactMatch(prop) )
+ if ( objClass == "TQt::MultiLineEdit" &&
+ TQRegExp("echoMode|hMargin|maxLength|maxLines|undoEnabled").exactMatch(prop) )
continue;
- QString call = objName + "->";
+ TQString call = objName + "->";
bool needClose = false;
if ( stdset ) {
call += mkStdSet( prop ) + "( ";
} else {
- call += "setProperty( \"" + prop + "\", Qt::Variant(" ;
+ call += "setProperty( \"" + prop + "\", TQt::Variant(" ;
needClose = true;
}
if ( prop == "accel" )
- call += "Qt::KeySequence( " + value + " )"+ (needClose ? " )": "") + " );";
+ call += "TQt::KeySequence( " + value + " )"+ (needClose ? " )": "") + " );";
else
call += value + (needClose ? " )": "") + " );";
@@ -234,8 +234,8 @@ QString Uic::createObjectImpl( const QDomElement &e, const QString& parentClass,
out << indent << call << endl;
}
} else if ( n.tagName() == "item" ) {
- QString call;
- QString value;
+ TQString call;
+ TQString value;
if ( objClass.mid( 4 ) == "ListBox" ) {
call = createListBoxItemImpl( n, objName );
@@ -259,7 +259,7 @@ QString Uic::createObjectImpl( const QDomElement &e, const QString& parentClass,
trout << indent << call << endl;
}
} else if ( objClass.mid( 4 ) == "ListView" ) {
- call = createListViewItemImpl( n, objName, QString::null );
+ call = createListViewItemImpl( n, objName, TQString::null );
if ( !call.isEmpty() ) {
if ( numItems == 0 )
trout << indent << objName << "->clear();" << endl;
@@ -269,8 +269,8 @@ QString Uic::createObjectImpl( const QDomElement &e, const QString& parentClass,
if ( !call.isEmpty() )
numItems++;
} else if ( n.tagName() == "column" || n.tagName() == "row" ) {
- QString call;
- QString value;
+ TQString call;
+ TQString value;
if ( objClass.mid( 4 ) == "ListView" ) {
call = createListViewColumnImpl( n, objName, &value );
@@ -279,7 +279,7 @@ QString Uic::createObjectImpl( const QDomElement &e, const QString& parentClass,
trout << indent << objName << "->header()->setLabel( "
<< numColumns++ << ", " << value << " );\n";
}
- } else if ( objClass == "Qt::Table" || objClass == "Qt::DataTable" ) {
+ } else if ( objClass == "TQt::Table" || objClass == "TQt::DataTable" ) {
bool isCols = ( n.tagName() == "column" );
call = createTableRowColumnImpl( n, objName, &value );
if ( !call.isEmpty() ) {
@@ -296,52 +296,52 @@ QString Uic::createObjectImpl( const QDomElement &e, const QString& parentClass,
// create all children, some widgets have special requirements
- if ( objClass == "Qt::TabWidget" ) {
+ if ( objClass == "TQt::TabWidget" ) {
for ( n = e.firstChild().toElement(); !n.isNull(); n = n.nextSibling().toElement() ) {
if ( tags.contains( n.tagName() ) ) {
- QString page = createObjectImpl( n, objClass, objName );
- QString comment;
- QString label = DomTool::readAttribute( n, "title", "", comment ).toString();
+ TQString page = createObjectImpl( n, objClass, objName );
+ TQString comment;
+ TQString label = DomTool::readAttribute( n, "title", "", comment ).toString();
out << indent << objName << "->insertTab( " << page << ", \"\" );" << endl;
trout << indent << objName << "->changeTab( " << page << ", "
<< trcall( label, comment ) << " );" << endl;
}
}
- } else if ( objClass == "Qt::WidgetStack" ) {
+ } else if ( objClass == "TQt::WidgetStack" ) {
for ( n = e.firstChild().toElement(); !n.isNull(); n = n.nextSibling().toElement() ) {
if ( tags.contains( n.tagName() ) ) {
- QString page = createObjectImpl( n, objClass, objName );
+ TQString page = createObjectImpl( n, objClass, objName );
int id = DomTool::readAttribute( n, "id", "" ).toInt();
out << indent << objName << "->addWidget( " << page << ", " << id << " );" << endl;
}
}
- } else if ( objClass == "Qt::ToolBox" ) {
+ } else if ( objClass == "TQt::ToolBox" ) {
for ( n = e.firstChild().toElement(); !n.isNull(); n = n.nextSibling().toElement() ) {
if ( tags.contains( n.tagName() ) ) {
- QString page = createObjectImpl( n, objClass, objName );
- QString label = DomTool::readAttribute( n, "label", "" ).toString();
+ TQString page = createObjectImpl( n, objClass, objName );
+ TQString label = DomTool::readAttribute( n, "label", "" ).toString();
out << indent << objName << "->addItem( " << page << ", \"" << label << "\" );" << endl;
}
}
- } else if ( objClass != "Qt::ToolBar" && objClass != "Qt::MenuBar" ) { // standard widgets
+ } else if ( objClass != "TQt::ToolBar" && objClass != "TQt::MenuBar" ) { // standard widgets
WidgetInterface *iface = 0;
- QString QtObjClass = objClass;
- QtObjClass.replace( QRegExp("^Qt::"), "Q" );
- QtObjClass.replace( QRegExp("^KDE::"), "K" );
- widgetManager()->queryInterface( QtObjClass, &iface );
-#ifdef QT_CONTAINER_CUSTOM_WIDGETS
- int id = WidgetDatabase::idFromClassName( QtObjClass );
+ TQString TQtObjClass = objClass;
+ TQtObjClass.replace( TQRegExp("^TQt::"), "Q" );
+ TQtObjClass.replace( TQRegExp("^KDE::"), "K" );
+ widgetManager()->queryInterface( TQtObjClass, &iface );
+#ifdef TQT_CONTAINER_CUSTOM_WIDGETS
+ int id = WidgetDatabase::idFromClassName( TQtObjClass );
if ( WidgetDatabase::isContainer( id ) && WidgetDatabase::isCustomPluginWidget( id ) && iface ) {
- QWidgetContainerInterfacePrivate *iface2 = 0;
- iface->queryInterface( IID_QWidgetContainer, (QUnknownInterface**)&iface2 );
+ TQWidgetContainerInterfacePrivate *iface2 = 0;
+ iface->queryInterface( IID_TQWidgetContainer, (TQUnknownInterface**)&iface2 );
if ( iface2 ) {
- bool supportsPages = iface2->supportsPages( QtObjClass );
+ bool supportsPages = iface2->supportsPages( TQtObjClass );
for ( n = e.firstChild().toElement(); !n.isNull(); n = n.nextSibling().toElement() ) {
if ( tags.contains( n.tagName() ) ) {
if ( supportsPages ) {
- QString page = createObjectImpl( n, objClass, objName );
- QString comment;
- QString label = DomTool::readAttribute( n, "label", "", comment ).toString();
+ TQString page = createObjectImpl( n, objClass, objName );
+ TQString comment;
+ TQString label = DomTool::readAttribute( n, "label", "", comment ).toString();
out << indent << iface2->createCode( objClass, objName, page, label ) << endl;
} else {
createObjectImpl( n, objClass, objName );
@@ -357,7 +357,7 @@ QString Uic::createObjectImpl( const QDomElement &e, const QString& parentClass,
if ( tags.contains( n.tagName() ) )
createObjectImpl( n, objClass, objName );
}
-#ifdef QT_CONTAINER_CUSTOM_WIDGETS
+#ifdef TQT_CONTAINER_CUSTOM_WIDGETS
}
#endif
}
@@ -377,13 +377,13 @@ QString Uic::createObjectImpl( const QDomElement &e, const QString& parentClass,
application font or palette change handlers in createFormImpl().
*/
-void Uic::createExclusiveProperty( const QDomElement & e, const QString& exclusiveProp )
+void Uic::createExclusiveProperty( const TQDomElement & e, const TQString& exclusiveProp )
{
- QDomElement n;
- QString objClass = getClassName( e );
+ TQDomElement n;
+ TQString objClass = getClassName( e );
if ( objClass.isEmpty() )
return;
- QString objName = getObjectName( e );
+ TQString objName = getObjectName( e );
#if 0 // it's not clear whether this check should be here or not
if ( objName.isEmpty() )
return;
@@ -393,15 +393,15 @@ void Uic::createExclusiveProperty( const QDomElement & e, const QString& exclusi
bool stdset = stdsetdef;
if ( n.hasAttribute( "stdset" ) )
stdset = toBool( n.attribute( "stdset" ) );
- QString prop = n.attribute( "name" );
+ TQString prop = n.attribute( "name" );
if ( prop != exclusiveProp )
continue;
- QString value = setObjectProperty( objClass, objName, prop, n.firstChild().toElement(), stdset );
+ TQString value = setObjectProperty( objClass, objName, prop, n.firstChild().toElement(), stdset );
if ( value.isEmpty() )
continue;
// we assume the property isn't of type 'string'
++indent;
- out << indent << objName << "->setProperty(\"" << prop << "\", Qt::Variant(" << value << "));" << endl;
+ out << indent << objName << "->setProperty(\"" << prop << "\", TQt::Variant(" << value << "));" << endl;
--indent;
}
}
@@ -412,11 +412,11 @@ void Uic::createExclusiveProperty( const QDomElement & e, const QString& exclusi
Resource::saveProperty() and DomTool::elementToVariant. If you
change one, change all.
*/
-QString Uic::setObjectProperty( const QString& objClass, const QString& obj, const QString &prop, const QDomElement &e, bool stdset )
+TQString Uic::setObjectProperty( const TQString& objClass, const TQString& obj, const TQString &prop, const TQDomElement &e, bool stdset )
{
- QString v;
+ TQString v;
if ( e.tagName() == "rect" ) {
- QDomElement n3 = e.firstChild().toElement();
+ TQDomElement n3 = e.firstChild().toElement();
int x = 0, y = 0, w = 0, h = 0;
while ( !n3.isNull() ) {
if ( n3.tagName() == "x" )
@@ -429,11 +429,11 @@ QString Uic::setObjectProperty( const QString& objClass, const QString& obj, con
h = n3.firstChild().toText().data().toInt();
n3 = n3.nextSibling().toElement();
}
- v = "Qt::Rect(%1, %2, %3, %4)";
+ v = "TQt::Rect(%1, %2, %3, %4)";
v = v.arg(x).arg(y).arg(w).arg(h);
} else if ( e.tagName() == "point" ) {
- QDomElement n3 = e.firstChild().toElement();
+ TQDomElement n3 = e.firstChild().toElement();
int x = 0, y = 0;
while ( !n3.isNull() ) {
if ( n3.tagName() == "x" )
@@ -442,10 +442,10 @@ QString Uic::setObjectProperty( const QString& objClass, const QString& obj, con
y = n3.firstChild().toText().data().toInt();
n3 = n3.nextSibling().toElement();
}
- v = "Qt::Point(%1, %2)";
+ v = "TQt::Point(%1, %2)";
v = v.arg(x).arg(y);
} else if ( e.tagName() == "size" ) {
- QDomElement n3 = e.firstChild().toElement();
+ TQDomElement n3 = e.firstChild().toElement();
int w = 0, h = 0;
while ( !n3.isNull() ) {
if ( n3.tagName() == "width" )
@@ -454,10 +454,10 @@ QString Uic::setObjectProperty( const QString& objClass, const QString& obj, con
h = n3.firstChild().toText().data().toInt();
n3 = n3.nextSibling().toElement();
}
- v = "Qt::Size(%1, %2)";
+ v = "TQt::Size(%1, %2)";
v = v.arg(w).arg(h);
} else if ( e.tagName() == "color" ) {
- QDomElement n3 = e.firstChild().toElement();
+ TQDomElement n3 = e.firstChild().toElement();
int r = 0, g = 0, b = 0;
while ( !n3.isNull() ) {
if ( n3.tagName() == "red" )
@@ -468,18 +468,18 @@ QString Uic::setObjectProperty( const QString& objClass, const QString& obj, con
b = n3.firstChild().toText().data().toInt();
n3 = n3.nextSibling().toElement();
}
- v = "Qt::Color(%1, %2, %3)";
+ v = "TQt::Color(%1, %2, %3)";
v = v.arg(r).arg(g).arg(b);
} else if ( e.tagName() == "font" ) {
- QDomElement n3 = e.firstChild().toElement();
- QString attrname = e.parentNode().toElement().attribute( "name", "font" );
- QString fontname;
+ TQDomElement n3 = e.firstChild().toElement();
+ TQString attrname = e.parentNode().toElement().attribute( "name", "font" );
+ TQString fontname;
if ( !obj.isEmpty() ) {
fontname = registerObject( "$" + obj + "_" + attrname );
- out << indent << "my " << fontname << " = Qt::Font(" << obj << "->font);" << endl;
+ out << indent << "my " << fontname << " = TQt::Font(" << obj << "->font);" << endl;
} else {
fontname = "$" + registerObject( "font" );
- out << indent << "my " << fontname << " = Qt::Font(this->font);" << endl;
+ out << indent << "my " << fontname << " = TQt::Font(this->font);" << endl;
}
while ( !n3.isNull() ) {
if ( n3.tagName() == "family" )
@@ -506,22 +506,22 @@ QString Uic::setObjectProperty( const QString& objClass, const QString& obj, con
v = fontname;
}
} else if ( e.tagName() == "string" ) {
- QString txt = e.firstChild().toText().data();
- QString com = getComment( e.parentNode() );
+ TQString txt = e.firstChild().toText().data();
+ TQString com = getComment( e.parentNode() );
- if ( prop == "toolTip" && objClass != "Qt::Action" && objClass != "Qt::ActionGroup" ) {
+ if ( prop == "toolTip" && objClass != "TQt::Action" && objClass != "TQt::ActionGroup" ) {
if ( !obj.isEmpty() )
- trout << indent << "Qt::ToolTip::add(" << obj << ", "
+ trout << indent << "TQt::ToolTip::add(" << obj << ", "
<< trcall( txt, com ) << ");" << endl;
else
- out << indent << "Qt::ToolTip::add( this, "
+ out << indent << "TQt::ToolTip::add( this, "
<< trcall( txt, com ) << ");" << endl;
- } else if ( prop == "whatsThis" && objClass != "Qt::Action" && objClass != "Qt::ActionGroup" ) {
+ } else if ( prop == "whatsThis" && objClass != "TQt::Action" && objClass != "TQt::ActionGroup" ) {
if ( !obj.isEmpty() )
- trout << indent << "Qt::WhatsThis::add(" << obj << ", "
+ trout << indent << "TQt::WhatsThis::add(" << obj << ", "
<< trcall( txt, com ) << ");" << endl;
else
- trout << indent << "Qt::WhatsThis::add( this,"
+ trout << indent << "TQt::WhatsThis::add( this,"
<< trcall( txt, com ) << ");" << endl;
} else {
v = trcall( txt, com );
@@ -536,24 +536,24 @@ QString Uic::setObjectProperty( const QString& objClass, const QString& obj, con
if ( stdset )
v = "%1";
else
- v = "Qt::Variant(%1, 0)";
+ v = "TQt::Variant(%1, 0)";
v = v.arg( mkBool( e.firstChild().toText().data() ) );
} else if ( e.tagName() == "pixmap" ) {
v = e.firstChild().toText().data();
if( !externPixmaps )
v.prepend( '$' );
if ( !pixmapLoaderFunction.isEmpty() ) {
- v.prepend( pixmapLoaderFunction + "(" + QString( externPixmaps ? "\"" : "" ) );
- v.append( QString( externPixmaps ? "\"" : "" ) + ")" );
+ v.prepend( pixmapLoaderFunction + "(" + TQString( externPixmaps ? "\"" : "" ) );
+ v.append( TQString( externPixmaps ? "\"" : "" ) + ")" );
}
} else if ( e.tagName() == "iconset" ) {
- v = "Qt::IconSet(%1)";
- QString s = e.firstChild().toText().data();
+ v = "TQt::IconSet(%1)";
+ TQString s = e.firstChild().toText().data();
if( !externPixmaps )
s.prepend( '$' );
if ( !pixmapLoaderFunction.isEmpty() ) {
- s.prepend( pixmapLoaderFunction + "(" + QString( externPixmaps ? "\"" : "" ) );
- s.append( QString( externPixmaps ? "\"" : "" ) + ")" );
+ s.prepend( pixmapLoaderFunction + "(" + TQString( externPixmaps ? "\"" : "" ) );
+ s.append( TQString( externPixmaps ? "\"" : "" ) + ")" );
}
v = v.arg( s );
} else if ( e.tagName() == "image" ) {
@@ -563,19 +563,19 @@ QString Uic::setObjectProperty( const QString& objClass, const QString& obj, con
v = "&%1::%2()";
else
v = "\"%1\"";
- QString oc = objClass;
- QString ev = e.firstChild().toText().data();
- if ( oc == "Qt::ListView" && ev == "Manual" ) // #### workaround, rename QListView::Manual in 4.0
- oc = "Qt::ScrollView";
+ TQString oc = objClass;
+ TQString ev = e.firstChild().toText().data();
+ if ( oc == "TQt::ListView" && ev == "Manual" ) // #### workaround, rename TQListView::Manual in 4.0
+ oc = "TQt::ScrollView";
if ( stdset )
v = v.arg( oc ).arg( ev );
else
v = v.arg( ev );
} else if ( e.tagName() == "set" ) {
- QString keys( e.firstChild().toText().data() );
- QStringList lst = QStringList::split( '|', keys );
+ TQString keys( e.firstChild().toText().data() );
+ TQStringList lst = TQStringList::split( '|', keys );
v = "int(&";
- QStringList::Iterator it = lst.begin();
+ TQStringList::Iterator it = lst.begin();
while ( it != lst.end() ) {
v += objClass + "::" + *it;
if ( it != lst.fromLast() )
@@ -584,30 +584,30 @@ QString Uic::setObjectProperty( const QString& objClass, const QString& obj, con
}
v += ")";
} else if ( e.tagName() == "sizepolicy" ) {
- QDomElement n3 = e.firstChild().toElement();
- QSizePolicy sp;
+ TQDomElement n3 = e.firstChild().toElement();
+ TQSizePolicy sp;
while ( !n3.isNull() ) {
if ( n3.tagName() == "hsizetype" )
- sp.setHorData( (QSizePolicy::SizeType)n3.firstChild().toText().data().toInt() );
+ sp.setHorData( (TQSizePolicy::SizeType)n3.firstChild().toText().data().toInt() );
else if ( n3.tagName() == "vsizetype" )
- sp.setVerData( (QSizePolicy::SizeType)n3.firstChild().toText().data().toInt() );
+ sp.setVerData( (TQSizePolicy::SizeType)n3.firstChild().toText().data().toInt() );
else if ( n3.tagName() == "horstretch" )
sp.setHorStretch( n3.firstChild().toText().data().toInt() );
else if ( n3.tagName() == "verstretch" )
sp.setVerStretch( n3.firstChild().toText().data().toInt() );
n3 = n3.nextSibling().toElement();
}
- QString tmp = (obj.isEmpty() ? QString::fromLatin1("this") : obj) + "->";
- v = "Qt::SizePolicy(%1, %2, %3, %4, " + tmp + "sizePolicy()->hasHeightForWidth())";
+ TQString tmp = (obj.isEmpty() ? TQString::fromLatin1("this") : obj) + "->";
+ v = "TQt::SizePolicy(%1, %2, %3, %4, " + tmp + "sizePolicy()->hasHeightForWidth())";
v = v.arg( (int)sp.horData() ).arg( (int)sp.verData() ).arg( sp.horStretch() ).arg( sp.verStretch() );
} else if ( e.tagName() == "palette" ) {
- QPalette pal;
+ TQPalette pal;
bool no_pixmaps = e.elementsByTagName( "pixmap" ).count() == 0;
- QDomElement n;
+ TQDomElement n;
if ( no_pixmaps ) {
n = e.firstChild().toElement();
while ( !n.isNull() ) {
- QColorGroup cg;
+ TQColorGroup cg;
if ( n.tagName() == "active" ) {
cg = loadColorGroup( n );
pal.setActive( cg );
@@ -621,19 +621,19 @@ QString Uic::setObjectProperty( const QString& objClass, const QString& obj, con
n = n.nextSibling().toElement();
}
}
- if ( no_pixmaps && pal == QPalette( pal.active().button(), pal.active().background() ) ) {
- v = "Qt::Palette(Qt::Color(%1,%2,%3), Qt::Color(%1,%2,%3))";
+ if ( no_pixmaps && pal == TQPalette( pal.active().button(), pal.active().background() ) ) {
+ v = "TQt::Palette(TQt::Color(%1,%2,%3), TQt::Color(%1,%2,%3))";
v = v.arg( pal.active().button().red() ).arg( pal.active().button().green() ).arg( pal.active().button().blue() );
v = v.arg( pal.active().background().red() ).arg( pal.active().background().green() ).arg( pal.active().background().blue() );
} else {
- QString palette = "pal";
+ TQString palette = "pal";
if ( !pal_used ) {
- out << indent << palette << " = Qt::Palette();" << endl;
+ out << indent << palette << " = TQt::Palette();" << endl;
pal_used = TRUE;
}
- QString cg = "cg";
+ TQString cg = "cg";
if ( !cg_used ) {
- out << indent << cg << " = Qt::ColorGroup();" << endl;
+ out << indent << cg << " = TQt::ColorGroup();" << endl;
cg_used = TRUE;
}
n = e.firstChild().toElement();
@@ -656,10 +656,10 @@ QString Uic::setObjectProperty( const QString& objClass, const QString& obj, con
v = palette;
}
} else if ( e.tagName() == "cursor" ) {
- v = "Qt::Cursor(%1)";
+ v = "TQt::Cursor(%1)";
v = v.arg( e.firstChild().toText().data() );
} else if ( e.tagName() == "date" ) {
- QDomElement n3 = e.firstChild().toElement();
+ TQDomElement n3 = e.firstChild().toElement();
int y, m, d;
y = m = d = 0;
while ( !n3.isNull() ) {
@@ -671,10 +671,10 @@ QString Uic::setObjectProperty( const QString& objClass, const QString& obj, con
d = n3.firstChild().toText().data().toInt();
n3 = n3.nextSibling().toElement();
}
- v = "Qt::Date(%1,%2,%3)";
+ v = "TQt::Date(%1,%2,%3)";
v = v.arg(y).arg(m).arg(d);
} else if ( e.tagName() == "time" ) {
- QDomElement n3 = e.firstChild().toElement();
+ TQDomElement n3 = e.firstChild().toElement();
int h, m, s;
h = m = s = 0;
while ( !n3.isNull() ) {
@@ -686,10 +686,10 @@ QString Uic::setObjectProperty( const QString& objClass, const QString& obj, con
s = n3.firstChild().toText().data().toInt();
n3 = n3.nextSibling().toElement();
}
- v = "Qt::Time(%1, %2, %3)";
+ v = "TQt::Time(%1, %2, %3)";
v = v.arg(h).arg(m).arg(s);
} else if ( e.tagName() == "datetime" ) {
- QDomElement n3 = e.firstChild().toElement();
+ TQDomElement n3 = e.firstChild().toElement();
int h, mi, s, y, mo, d;
h = mi = s = y = mo = d = 0;
while ( !n3.isNull() ) {
@@ -707,12 +707,12 @@ QString Uic::setObjectProperty( const QString& objClass, const QString& obj, con
d = n3.firstChild().toText().data().toInt();
n3 = n3.nextSibling().toElement();
}
- v = "Qt::DateTime(Qt::Date(%1, %2, %3), Qt::Time(%4, %5, %6))";
+ v = "TQt::DateTime(TQt::Date(%1, %2, %3), TQt::Time(%4, %5, %6))";
v = v.arg(y).arg(mo).arg(d).arg(h).arg(mi).arg(s);
} else if ( e.tagName() == "stringlist" ) {
- QStringList l;
- QDomElement n3 = e.firstChild().toElement();
- QString listname;
+ TQStringList l;
+ TQDomElement n3 = e.firstChild().toElement();
+ TQString listname;
if ( !obj.isEmpty() ) {
listname = obj + "->{_strlist";
listname = registerObject( listname );
@@ -754,9 +754,9 @@ QString Uic::setObjectProperty( const QString& objClass, const QString& obj, con
/*! Extracts a named object property from \a e.
*/
-QDomElement Uic::getObjectProperty( const QDomElement& e, const QString& name )
+TQDomElement Uic::getObjectProperty( const TQDomElement& e, const TQString& name )
{
- QDomElement n;
+ TQDomElement n;
for ( n = e.firstChild().toElement();
!n.isNull();
n = n.nextSibling().toElement() ) {
diff --git a/puic/parser.cpp b/puic/parser.cpp
index 4fc13c5..a4def26 100644
--- a/puic/parser.cpp
+++ b/puic/parser.cpp
@@ -1,7 +1,7 @@
/**********************************************************************
** Copyright (C) 2000 Trolltech AS. All rights reserved.
**
-** 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
@@ -22,25 +22,25 @@
#include <qobject.h>
#include <qstringlist.h>
-class NormalizeObject : public QObject
+class NormalizeObject : public TQObject
{
public:
- NormalizeObject() : QObject() {}
- static QCString normalizeSignalSlot( const char *signalSlot ) { return QObject::normalizeSignalSlot( signalSlot ); }
+ NormalizeObject() : TQObject() {}
+ static TQCString normalizeSignalSlot( const char *signalSlot ) { return TQObject::normalizeSignalSlot( signalSlot ); }
};
-QString Parser::cleanArgs( const QString &func )
+TQString Parser::cleanArgs( const TQString &func )
{
- QString slot( func );
+ TQString slot( func );
int begin = slot.find( "(" ) + 1;
- QString args = slot.mid( begin );
+ TQString args = slot.mid( begin );
args = args.left( args.find( ")" ) );
- QStringList lst = QStringList::split( ',', args );
- QString res = slot.left( begin );
- for ( QStringList::Iterator it = lst.begin(); it != lst.end(); ++it ) {
+ TQStringList lst = TQStringList::split( ',', args );
+ TQString res = slot.left( begin );
+ for ( TQStringList::Iterator it = lst.begin(); it != lst.end(); ++it ) {
if ( it != lst.begin() )
res += ",";
- QString arg = *it;
+ TQString arg = *it;
int pos = 0;
if ( ( pos = arg.find( "&" ) ) != -1 ) {
arg = arg.left( pos + 1 );
@@ -50,7 +50,7 @@ QString Parser::cleanArgs( const QString &func )
arg = arg.simplifyWhiteSpace();
if ( ( pos = arg.find( ':' ) ) != -1 )
arg = arg.left( pos ).simplifyWhiteSpace() + ":" + arg.mid( pos + 1 ).simplifyWhiteSpace();
- QStringList l = QStringList::split( ' ', arg );
+ TQStringList l = TQStringList::split( ' ', arg );
if ( l.count() == 2 ) {
if ( l[ 0 ] != "const" && l[ 0 ] != "unsigned" && l[ 0 ] != "var" )
arg = l[ 0 ];
@@ -62,5 +62,5 @@ QString Parser::cleanArgs( const QString &func )
}
res += ")";
- return QString::fromLatin1( NormalizeObject::normalizeSignalSlot( res.latin1() ) );
+ return TQString::fromLatin1( NormalizeObject::normalizeSignalSlot( res.latin1() ) );
}
diff --git a/puic/parser.h b/puic/parser.h
index 5a5671a..db07ea2 100644
--- a/puic/parser.h
+++ b/puic/parser.h
@@ -1,7 +1,7 @@
/**********************************************************************
** Copyright (C) 2000 Trolltech AS. All rights reserved.
**
-** 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
@@ -26,7 +26,7 @@
class Parser
{
public:
- static QString cleanArgs( const QString &func );
+ static TQString cleanArgs( const TQString &func );
};
diff --git a/puic/puic.1 b/puic/puic.1
index a125a8d..2341fe3 100644
--- a/puic/puic.1
+++ b/puic/puic.1
@@ -26,12 +26,12 @@ This manual page documents briefly the
command.
.PP
\fBpuic\fP is a program you can use to compile .ui and .ui.h
-files (from Qt Designer) into perl (actually, PerlQt) code. This
-enables you to draw your application using Qt Designer, compile
+files (from TQt Designer) into perl (actually, PerlTQt) code. This
+enables you to draw your application using TQt Designer, compile
and then run it.
-PerlQt is an API for Perl to the Qt toolkit from Trolltech. With
-PerlQt, you can use Qt widgets in perl code, thus giving a GUI to
+PerlTQt is an API for Perl to the TQt toolkit from Trolltech. With
+PerlTQt, you can use TQt widgets in perl code, thus giving a GUI to
your perl programs.
.SH "OPTIONS"
\fBGenerate implementation:\fR
diff --git a/puic/puic.pro b/puic/puic.pro
index 157ae59..62916e2 100644
--- a/puic/puic.pro
+++ b/puic/puic.pro
@@ -4,11 +4,11 @@ INCLUDEPATH += .
CONFIG += qt warn_on
-exists( $(QTDIR)/lib/libqt-mt* ) {
+exists( $(TQTDIR)/lib/libqt-mt* ) {
CONFIG += thread
}
-DEFINES += UIC QT_INTERNAL_XML
+DEFINES += UIC TQT_INTERNAL_XML
# Input
HEADERS += domtool.h \
diff --git a/puic/subclassing.cpp b/puic/subclassing.cpp
index 51a5e55..f49dd27 100644
--- a/puic/subclassing.cpp
+++ b/puic/subclassing.cpp
@@ -1,7 +1,7 @@
/**********************************************************************
** Copyright (C) 2000 Trolltech AS. All rights reserved.
**
-** 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
@@ -38,19 +38,19 @@
\sa createSubDecl()
*/
-void Uic::createSubImpl( const QDomElement &e, const QString& subClass )
+void Uic::createSubImpl( const TQDomElement &e, const TQString& subClass )
{
- QDomElement n;
- QDomNodeList nl;
+ TQDomElement n;
+ TQDomNodeList nl;
int i;
- QString objClass = getClassName( e );
+ TQString objClass = getClassName( e );
if ( objClass.isEmpty() )
return;
out << indent << "package " << subClass << ";" << endl;
- out << indent << "use Qt;" << endl;
+ out << indent << "use TQt;" << endl;
out << indent << "use " << nameOfClass << ";" << endl;
- out << indent << "use Qt::isa qw("<< nameOfClass << ");" << endl;
+ out << indent << "use TQt::isa qw("<< nameOfClass << ");" << endl;
out << endl;
@@ -58,11 +58,11 @@ void Uic::createSubImpl( const QDomElement &e, const QString& subClass )
out << indent << "sub NEW" << endl;
out << indent << "{" << endl;
++indent;
- if ( objClass == "Qt::Dialog" || objClass == "Qt::Wizard" ) {
+ if ( objClass == "TQt::Dialog" || objClass == "TQt::Wizard" ) {
out << indent << "shift->SUPER::NEW(@_[0..3]);" << endl;
- } else if ( objClass == "Qt::Widget") {
+ } else if ( objClass == "TQt::Widget") {
out << indent << "shift->SUPER::NEW(@_[0..2]);" << endl;
- } else if ( objClass == "Qt::MainWindow" ) {
+ } else if ( objClass == "TQt::MainWindow" ) {
out << indent << "shift->SUPER::NEW(@_[0..2]);" << endl;
out << indent << "statusBar();" << endl;
isMainWindow = TRUE;
@@ -74,12 +74,12 @@ void Uic::createSubImpl( const QDomElement &e, const QString& subClass )
out << endl;
// find additional functions
- QStringList publicSlots, protectedSlots, privateSlots;
- QStringList publicSlotTypes, protectedSlotTypes, privateSlotTypes;
- QStringList publicSlotSpecifier, protectedSlotSpecifier, privateSlotSpecifier;
- QStringList publicFuncts, protectedFuncts, privateFuncts;
- QStringList publicFunctRetTyp, protectedFunctRetTyp, privateFunctRetTyp;
- QStringList publicFunctSpec, protectedFunctSpec, privateFunctSpec;
+ TQStringList publicSlots, protectedSlots, privateSlots;
+ TQStringList publicSlotTypes, protectedSlotTypes, privateSlotTypes;
+ TQStringList publicSlotSpecifier, protectedSlotSpecifier, privateSlotSpecifier;
+ TQStringList publicFuncts, protectedFuncts, privateFuncts;
+ TQStringList publicFunctRetTyp, protectedFunctRetTyp, privateFunctRetTyp;
+ TQStringList publicFunctSpec, protectedFunctSpec, privateFunctSpec;
nl = e.parentNode().toElement().elementsByTagName( "slot" );
@@ -88,15 +88,15 @@ void Uic::createSubImpl( const QDomElement &e, const QString& subClass )
if ( n.parentNode().toElement().tagName() != "slots"
&& n.parentNode().toElement().tagName() != "connections" )
continue;
- QString l = n.attribute( "language", "C++" );
+ TQString l = n.attribute( "language", "C++" );
if ( l != "C++" && l != "Perl" ) //- mmh
continue;
- QString returnType = n.attribute( "returnType", "void" );
- QString functionName = n.firstChild().toText().data().stripWhiteSpace();
+ TQString returnType = n.attribute( "returnType", "void" );
+ TQString functionName = n.firstChild().toText().data().stripWhiteSpace();
if ( functionName.endsWith( ";" ) )
functionName = functionName.left( functionName.length() - 1 );
- QString specifier = n.attribute( "specifier" );
- QString access = n.attribute( "access" );
+ TQString specifier = n.attribute( "specifier" );
+ TQString access = n.attribute( "access" );
if ( access == "protected" ) {
protectedSlots += functionName;
protectedSlotTypes += returnType;
@@ -115,19 +115,19 @@ void Uic::createSubImpl( const QDomElement &e, const QString& subClass )
nl = e.parentNode().toElement().elementsByTagName( "function" );
for ( i = 0; i < (int) nl.length(); i++ ) {
n = nl.item(i).toElement();
- QString fname = n.attribute( "name" );
+ TQString fname = n.attribute( "name" );
fname = Parser::cleanArgs( fname );
if ( n.parentNode().toElement().tagName() != "functions" )
continue;
- QString l = n.attribute( "language", "C++" );
+ TQString l = n.attribute( "language", "C++" );
if ( l != "C++" && l != "Perl" ) //- mmh
continue;
- QString returnType = n.attribute( "returnType", "void" );
- QString functionName = n.firstChild().toText().data().stripWhiteSpace();
+ TQString returnType = n.attribute( "returnType", "void" );
+ TQString functionName = n.firstChild().toText().data().stripWhiteSpace();
if ( functionName.endsWith( ";" ) )
functionName = functionName.left( functionName.length() - 1 );
- QString specifier = n.attribute( "specifier" );
- QString access = n.attribute( "access" );
+ TQString specifier = n.attribute( "specifier" );
+ TQString access = n.attribute( "access" );
if ( access == "protected" ) {
protectedFuncts += functionName;
protectedFunctRetTyp += returnType;
@@ -143,7 +143,7 @@ void Uic::createSubImpl( const QDomElement &e, const QString& subClass )
}
}
- // FIXME PerlQt: distinguishing public/protected/private slots does not make any sense in the forseable future
+ // FIXME PerlTQt: distinguishing public/protected/private slots does not make any sense in the forseable future
// but nevermind, never forget somewhere far beyond the sky, Ashley Winters is furbishing *Plan 42* ! :)
if ( !publicFuncts.isEmpty() )
@@ -167,13 +167,13 @@ void Uic::createSubImpl( const QDomElement &e, const QString& subClass )
out << "1;" << endl;
}
-void Uic::writeFunctionsSubImpl( const QStringList &fuLst, const QStringList &typLst, const QStringList &specLst,
- const QString &subClass, const QString &descr )
+void Uic::writeFunctionsSubImpl( const TQStringList &fuLst, const TQStringList &typLst, const TQStringList &specLst,
+ const TQString &subClass, const TQString &descr )
{
- QValueListConstIterator<QString> it, it2, it3;
+ TQValueListConstIterator<TQString> it, it2, it3;
for ( it = fuLst.begin(), it2 = typLst.begin(), it3 = specLst.begin();
it != fuLst.end(); ++it, ++it2, ++it3 ) {
- QString type = *it2;
+ TQString type = *it2;
if ( type.isEmpty() )
type = "void";
if ( *it3 == "non virtual" )
diff --git a/puic/uic.cpp b/puic/uic.cpp
index 5d87918..25ba919 100644
--- a/puic/uic.cpp
+++ b/puic/uic.cpp
@@ -3,7 +3,7 @@
** Copyright (c) 2001 Phil Thompson <phil@river-bank.demon.co.uk>
** Copyright (c) 2002 Germain Garand <germain@ebooksfrance.com>
**
-** 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
@@ -20,9 +20,9 @@
**
**********************************************************************/
/*
-** 06/2002 : Initial release of puic, the PerlQt User Interface Compiler,
-** a work derivated from uic (the Qt User Interface Compiler)
-** and pyuic (the PyQt User Interface Compiler).
+** 06/2002 : Initial release of puic, the PerlTQt User Interface Compiler,
+** a work derivated from uic (the TQt User Interface Compiler)
+** and pyuic (the PyTQt User Interface Compiler).
**
** G.Garand
**
@@ -60,55 +60,55 @@ void PyIndent::calc()
}
-QString Uic::getComment( const QDomNode& n )
+TQString Uic::getComment( const TQDomNode& n )
{
- QDomNode child = n.firstChild();
+ TQDomNode child = n.firstChild();
while ( !child.isNull() ) {
if ( child.toElement().tagName() == "comment" )
return child.toElement().firstChild().toText().data();
child = child.nextSibling();
}
- return QString::null;
+ return TQString::null;
}
-QString Uic::mkBool( bool b )
+TQString Uic::mkBool( bool b )
{
return b? "1" : "0";
}
-QString Uic::mkBool( const QString& s )
+TQString Uic::mkBool( const TQString& s )
{
return mkBool( s == "true" || s == "1" );
}
-bool Uic::toBool( const QString& s )
+bool Uic::toBool( const TQString& s )
{
return s == "true" || s.toInt() != 0;
}
-QString Uic::fixString( const QString &str, bool encode )
+TQString Uic::fixString( const TQString &str, bool encode )
{
- QString s;
+ TQString s;
if ( !encode ) {
s = str;
- // PerlQt: we don't want to use replace( QString, QString ) because we support Qt 3.0
- s.replace( QRegExp("\\\\"), "\\\\" );
- s.replace( QRegExp("\""), "\\\"" );
- s.replace( QRegExp("\\r?\\n"), "\\n\" .\n" + indent + "\"" );
+ // PerlTQt: we don't want to use replace( TQString, TQString ) because we support TQt 3.0
+ s.replace( TQRegExp("\\\\"), "\\\\" );
+ s.replace( TQRegExp("\""), "\\\"" );
+ s.replace( TQRegExp("\\r?\\n"), "\\n\" .\n" + indent + "\"" );
} else {
- QCString utf8 = str.utf8();
+ TQCString utf8 = str.utf8();
const int l = utf8.length();
for ( int i = 0; i < l; ++i )
- s += "\\x" + QString::number( (uchar)utf8[i], 16 );
+ s += "\\x" + TQString::number( (uchar)utf8[i], 16 );
}
return "\"" + s + "\"";
}
-QString Uic::trcall( const QString& sourceText, const QString& comment )
+TQString Uic::trcall( const TQString& sourceText, const TQString& comment )
{
if ( sourceText.isEmpty() && comment.isEmpty() )
return "\"\"";
- QString t = trmacro;
+ TQString t = trmacro;
bool encode = FALSE;
if ( t.isNull() ) {
t = "tr";
@@ -126,9 +126,9 @@ QString Uic::trcall( const QString& sourceText, const QString& comment )
return trmacro + "(" + fixString( sourceText, encode ) + "," + fixString( comment, encode ) + ")";
}
-QString Uic::mkStdSet( const QString& prop )
+TQString Uic::mkStdSet( const TQString& prop )
{
- return QString( "set" ) + prop[0].upper() + prop.mid(1);
+ return TQString( "set" ) + prop[0].upper() + prop.mid(1);
}
/*!
@@ -137,9 +137,9 @@ QString Uic::mkStdSet( const QString& prop )
The class Uic encapsulates the user interface compiler (uic).
*/
-Uic::Uic( const QString &fn, const char *outputFn, QTextStream &outStream,
- QDomDocument doc, bool subcl, const QString &trm,
- const QString& subClass, bool omitForwardDecls, QString &uicClass )
+Uic::Uic( const TQString &fn, const char *outputFn, TQTextStream &outStream,
+ TQDomDocument doc, bool subcl, const TQString &trm,
+ const TQString& subClass, bool omitForwardDecls, TQString &uicClass )
: out( outStream ), trout( &languageChangeBody ),
outputFileName( outputFn ), trmacro( trm ), nofwd( omitForwardDecls )
{
@@ -162,8 +162,8 @@ Uic::Uic( const QString &fn, const char *outputFn, QTextStream &outStream,
if ( doc.firstChild().isNull() || doc.firstChild().firstChild().isNull() )
return;
- QDomElement e = doc.firstChild().firstChild().toElement();
- QDomElement widget;
+ TQDomElement e = doc.firstChild().firstChild().toElement();
+ TQDomElement widget;
while ( !e.isNull() ) {
if ( e.tagName() == "widget" ) {
widget = e;
@@ -177,13 +177,13 @@ Uic::Uic( const QString &fn, const char *outputFn, QTextStream &outStream,
bool ok;
defSpacing.toInt( &ok );
if ( !ok ) {
- QString buf = defSpacing.toString();
+ TQString buf = defSpacing.toString();
defSpacing = buf.append( "()" );
}
defMargin = e.attribute( "margin", defMargin.toString() );
defMargin.toInt( &ok );
if ( !ok ) {
- QString buf = defMargin.toString();
+ TQString buf = defMargin.toString();
defMargin = buf.append( "()" );
}
}
@@ -193,7 +193,7 @@ Uic::Uic( const QString &fn, const char *outputFn, QTextStream &outStream,
if ( nameOfClass.isEmpty() )
nameOfClass = getObjectName( e );
- namespaces = QStringList::split( "::", nameOfClass );
+ namespaces = TQStringList::split( "::", nameOfClass );
bareNameOfClass = namespaces.last();
namespaces.remove( namespaces.fromLast() );
@@ -208,26 +208,26 @@ Uic::Uic( const QString &fn, const char *outputFn, QTextStream &outStream,
/*! Extracts a pixmap loader function from \a e
*/
-QString Uic::getPixmapLoaderFunction( const QDomElement& e )
+TQString Uic::getPixmapLoaderFunction( const TQDomElement& e )
{
- QDomElement n;
+ TQDomElement n;
for ( n = e.firstChild().toElement(); !n.isNull(); n = n.nextSibling().toElement() ) {
if ( n.tagName() == "pixmapfunction" )
return n.firstChild().toText().data();
}
- return QString::null;
+ return TQString::null;
}
/*! Extracts the forms class name from \a e
*/
-QString Uic::getFormClassName( const QDomElement& e )
+TQString Uic::getFormClassName( const TQDomElement& e )
{
- QDomElement n;
- QString cn;
+ TQDomElement n;
+ TQString cn;
for ( n = e.firstChild().toElement(); !n.isNull(); n = n.nextSibling().toElement() ) {
if ( n.tagName() == "class" ) {
- QString s = n.firstChild().toText().data();
+ TQString s = n.firstChild().toText().data();
int i;
while ( ( i = s.find(' ' )) != -1 )
s[i] = '_';
@@ -239,20 +239,20 @@ QString Uic::getFormClassName( const QDomElement& e )
/*! Extracts a Perl class name from \a e.
*/
-QString Uic::getClassName( const QDomElement& e )
+TQString Uic::getClassName( const TQDomElement& e )
{
- QString s = e.attribute( "class" );
+ TQString s = e.attribute( "class" );
if ( s.isEmpty() && e.tagName() == "toolbar" )
- s = "Qt::ToolBar";
+ s = "TQt::ToolBar";
else if ( s.isEmpty() && e.tagName() == "menubar" )
- s = "Qt::MenuBar";
+ s = "TQt::MenuBar";
else if( WidgetDatabase::idFromClassName( s ) == -1)
return s;
else
{
- QRegExp r("^([QK])(\\S+)");
+ TQRegExp r("^([QK])(\\S+)");
if( r.search( s ) != -1 )
- s = (r.cap(1) == 'K'?"KDE::":"Qt::") + r.cap(2);
+ s = (r.cap(1) == 'K'?"KDE::":"TQt::") + r.cap(2);
}
return s;
}
@@ -262,11 +262,11 @@ QString Uic::getClassName( const QDomElement& e )
/*! Returns TRUE if database framework code is generated, else FALSE.
*/
-bool Uic::isFrameworkCodeGenerated( const QDomElement& e )
+bool Uic::isFrameworkCodeGenerated( const TQDomElement& e )
{
- QDomElement n = getObjectProperty( e, "frameworkCode" );
+ TQDomElement n = getObjectProperty( e, "frameworkCode" );
if ( n.attribute("name") == "frameworkCode" &&
- !DomTool::elementToVariant( n.firstChild().toElement(), QVariant( TRUE, 0 ) ).toBool() )
+ !DomTool::elementToVariant( n.firstChild().toElement(), TQVariant( TRUE, 0 ) ).toBool() )
return FALSE;
return TRUE;
}
@@ -274,38 +274,38 @@ bool Uic::isFrameworkCodeGenerated( const QDomElement& e )
/*! Extracts an object name from \a e. It's stored in the 'name'
property.
*/
-QString Uic::getObjectName( const QDomElement& e )
+TQString Uic::getObjectName( const TQDomElement& e )
{
- QDomElement n = getObjectProperty( e, "name" );
+ TQDomElement n = getObjectProperty( e, "name" );
if ( n.firstChild().toElement().tagName() == "cstring" )
return n.firstChild().toElement().firstChild().toText().data();
- return QString::null;
+ return TQString::null;
}
/*! Extracts an layout name from \a e. It's stored in the 'name'
- property of the preceeding sibling (the first child of a QLayoutWidget).
+ property of the preceeding sibling (the first child of a TQLayoutWidget).
*/
-QString Uic::getLayoutName( const QDomElement& e )
+TQString Uic::getLayoutName( const TQDomElement& e )
{
- QDomElement p = e.parentNode().toElement();
- QString name;
+ TQDomElement p = e.parentNode().toElement();
+ TQString name;
- if ( getClassName(p) != "Qt::LayoutWidget" )
+ if ( getClassName(p) != "TQt::LayoutWidget" )
name = "Layout";
- QDomElement n = getObjectProperty( p, "name" );
+ TQDomElement n = getObjectProperty( p, "name" );
if ( n.firstChild().toElement().tagName() == "cstring" ) {
name.prepend( n.firstChild().toElement().firstChild().toText().data() );
- return QStringList::split( "::", name ).last();
+ return TQStringList::split( "::", name ).last();
}
return e.tagName();
}
-QString Uic::getDatabaseInfo( const QDomElement& e, const QString& tag )
+TQString Uic::getDatabaseInfo( const TQDomElement& e, const TQString& tag )
{
- QDomElement n;
- QDomElement n1;
+ TQDomElement n;
+ TQDomElement n1;
int child = 0;
// database info is a stringlist stored in this order
if ( tag == "connection" )
@@ -315,27 +315,27 @@ QString Uic::getDatabaseInfo( const QDomElement& e, const QString& tag )
else if ( tag == "field" )
child = 2;
else
- return QString::null;
+ return TQString::null;
n = getObjectProperty( e, "database" );
if ( n.firstChild().toElement().tagName() == "stringlist" ) {
// find correct stringlist entry
- QDomElement n1 = n.firstChild().firstChild().toElement();
+ TQDomElement n1 = n.firstChild().firstChild().toElement();
for ( int i = 0; i < child && !n1.isNull(); ++i )
n1 = n1.nextSibling().toElement();
if ( n1.isNull() )
- return QString::null;
+ return TQString::null;
return n1.firstChild().toText().data();
}
- return QString::null;
+ return TQString::null;
}
-void Uic::registerLayouts( const QDomElement &e )
+void Uic::registerLayouts( const TQDomElement &e )
{
if ( layouts.contains(e.tagName()) )
createObjectDecl(e);
- QDomNodeList nl = e.childNodes();
+ TQDomNodeList nl = e.childNodes();
for ( int i = 0; i < (int) nl.length(); ++i )
registerLayouts( nl.item(i).toElement() );
}
@@ -344,60 +344,60 @@ void Uic::registerLayouts( const QDomElement &e )
/*!
Returns include file for class \a className or a null string.
*/
-QString Uic::getInclude( const QString& className )
+TQString Uic::getInclude( const TQString& className )
{
int wid = WidgetDatabase::idFromClassName( className );
if ( wid != -1 )
return WidgetDatabase::includeFile( wid );
- return QString::null;
+ return TQString::null;
}
-void Uic::createActionDecl( const QDomElement& e )
+void Uic::createActionDecl( const TQDomElement& e )
{
- QString objName = getObjectName( e );
+ TQString objName = getObjectName( e );
if ( objName.isEmpty() )
return;
out << indent << objName << endl;
if ( e.tagName() == "actiongroup" ) {
- for ( QDomElement n = e.firstChild().toElement(); !n.isNull(); n = n.nextSibling().toElement() ) {
+ for ( TQDomElement n = e.firstChild().toElement(); !n.isNull(); n = n.nextSibling().toElement() ) {
if ( n.tagName() == "action" || n.tagName() == "actiongroup" )
createActionDecl( n );
}
}
}
-void Uic::createActionImpl( const QDomElement &n, const QString &parent )
+void Uic::createActionImpl( const TQDomElement &n, const TQString &parent )
{
- for ( QDomElement ae = n; !ae.isNull(); ae = ae.nextSibling().toElement() ) {
- QString objName = registerObject( getObjectName( ae ) );
+ for ( TQDomElement ae = n; !ae.isNull(); ae = ae.nextSibling().toElement() ) {
+ TQString objName = registerObject( getObjectName( ae ) );
if ( ae.tagName() == "action" )
- out << indent << objName << "= Qt::Action(" << parent << ", \"" << objName << "\");" << endl;
+ out << indent << objName << "= TQt::Action(" << parent << ", \"" << objName << "\");" << endl;
else if ( ae.tagName() == "actiongroup" )
- out << indent << objName << "= Qt::ActionGroup(" << parent << ", \"" << objName << "\");" << endl;
+ out << indent << objName << "= TQt::ActionGroup(" << parent << ", \"" << objName << "\");" << endl;
else
continue;
bool subActionsDone = FALSE;
- for ( QDomElement n2 = ae.firstChild().toElement(); !n2.isNull(); n2 = n2.nextSibling().toElement() ) {
+ for ( TQDomElement n2 = ae.firstChild().toElement(); !n2.isNull(); n2 = n2.nextSibling().toElement() ) {
if ( n2.tagName() == "property" ) {
bool stdset = stdsetdef;
if ( n2.hasAttribute( "stdset" ) )
stdset = toBool( n2.attribute( "stdset" ) );
- QString prop = n2.attribute("name");
+ TQString prop = n2.attribute("name");
if ( prop == "name" )
continue;
- QString value = setObjectProperty( "Qt::Action", objName, prop, n2.firstChild().toElement(), stdset );
+ TQString value = setObjectProperty( "TQt::Action", objName, prop, n2.firstChild().toElement(), stdset );
if ( value.isEmpty() )
continue;
- QString call = objName + "->";
+ TQString call = objName + "->";
bool needClose = false;
if ( stdset ) {
call += mkStdSet( prop ) + "( ";
} else {
- call += "setProperty( \"" + prop + "\", Qt::Variant(" ;
+ call += "setProperty( \"" + prop + "\", TQt::Variant(" ;
needClose = true;
}
if ( prop == "accel" )
- call += "Qt::KeySequence( " + value + " )"+ (needClose ? " )": "") + " );";
+ call += "TQt::KeySequence( " + value + " )"+ (needClose ? " )": "") + " );";
else
call += value + (needClose ? " )": "") + " );";
@@ -414,7 +414,7 @@ void Uic::createActionImpl( const QDomElement &n, const QString &parent )
}
}
-QString get_dock( const QString &d )
+TQString get_dock( const TQString &d )
{
if ( d == "0" )
return "&DockUnmanaged";
@@ -433,27 +433,27 @@ QString get_dock( const QString &d )
return "";
}
-void Uic::createToolbarImpl( const QDomElement &n, const QString &parentClass, const QString &parent )
+void Uic::createToolbarImpl( const TQDomElement &n, const TQString &parentClass, const TQString &parent )
{
- QDomNodeList nl = n.elementsByTagName( "toolbar" );
+ TQDomNodeList nl = n.elementsByTagName( "toolbar" );
for ( int i = 0; i < (int) nl.length(); i++ ) {
- QDomElement ae = nl.item( i ).toElement();
- QString dock = get_dock( ae.attribute( "dock" ) );
- QString objName = getObjectName( ae );
- out << indent << objName << " = Qt::ToolBar(\"\", this, " << dock << ");" << endl;
+ TQDomElement ae = nl.item( i ).toElement();
+ TQString dock = get_dock( ae.attribute( "dock" ) );
+ TQString objName = getObjectName( ae );
+ out << indent << objName << " = TQt::ToolBar(\"\", this, " << dock << ");" << endl;
createObjectImpl( ae, parentClass, parent );
- for ( QDomElement n2 = ae.firstChild().toElement(); !n2.isNull(); n2 = n2.nextSibling().toElement() ) {
+ for ( TQDomElement n2 = ae.firstChild().toElement(); !n2.isNull(); n2 = n2.nextSibling().toElement() ) {
if ( n2.tagName() == "action" ) {
out << indent << n2.attribute( "name" ) << "->addTo(" << objName << ");" << endl;
} else if ( n2.tagName() == "separator" ) {
out << indent << objName << "->addSeparator;" << endl;
} else if ( n2.tagName() == "widget" ) {
if ( n2.attribute( "class" ) != "Spacer" ) {
- createObjectImpl( n2, "Qt::ToolBar", objName );
+ createObjectImpl( n2, "TQt::ToolBar", objName );
} else {
- QString child = createSpacerImpl( n, parentClass, parent, objName );
- out << indent << "Qt::Application->sendPostedEvents( $" << objName
- << ", &Qt::Event::ChildInserted);" << endl;
+ TQString child = createSpacerImpl( n, parentClass, parent, objName );
+ out << indent << "TQt::Application->sendPostedEvents( $" << objName
+ << ", &TQt::Event::ChildInserted);" << endl;
out << indent << "$" << objName << "->boxLayout()->addItem(" << child << ");" << endl;
}
}
@@ -461,20 +461,20 @@ void Uic::createToolbarImpl( const QDomElement &n, const QString &parentClass, c
}
}
-void Uic::createMenuBarImpl( const QDomElement &n, const QString &parentClass, const QString &parent )
+void Uic::createMenuBarImpl( const TQDomElement &n, const TQString &parentClass, const TQString &parent )
{
- QString objName = getObjectName( n );
- out << indent << objName << "= Qt::MenuBar( this, \"" << objName << "\");" << endl;
+ TQString objName = getObjectName( n );
+ out << indent << objName << "= TQt::MenuBar( this, \"" << objName << "\");" << endl;
createObjectImpl( n, parentClass, parent );
- QDomNodeList nl = n.elementsByTagName( "item" );
+ TQDomNodeList nl = n.elementsByTagName( "item" );
int i = 0;
- QDomElement c = n.firstChild().toElement();
+ TQDomElement c = n.firstChild().toElement();
while ( !c.isNull() ) {
if ( c.tagName() == "item" ) {
- QString itemName = c.attribute( "name" );
+ TQString itemName = c.attribute( "name" );
out << endl;
- out << indent << itemName << " = Qt::PopupMenu( this );" << endl;
+ out << indent << itemName << " = TQt::PopupMenu( this );" << endl;
createPopupMenuImpl( c, parentClass, itemName );
out << indent << objName << "->insertItem( \"\", " << itemName << ", " << i << " );" << endl;
trout << indent << objName << "->findItem( " << i << " )->setText( " << trcall( c.attribute( "text" ) ) << " );" << endl;
@@ -487,15 +487,15 @@ void Uic::createMenuBarImpl( const QDomElement &n, const QString &parentClass, c
}
}
-void Uic::createPopupMenuImpl( const QDomElement &e, const QString &parentClass, const QString &parent )
+void Uic::createPopupMenuImpl( const TQDomElement &e, const TQString &parentClass, const TQString &parent )
{
- for ( QDomElement n = e.firstChild().toElement(); !n.isNull(); n = n.nextSibling().toElement() ) {
+ for ( TQDomElement n = e.firstChild().toElement(); !n.isNull(); n = n.nextSibling().toElement() ) {
if ( n.tagName() == "action" ) {
- QDomElement n2 = n.nextSibling().toElement();
+ TQDomElement n2 = n.nextSibling().toElement();
if ( n2.tagName() == "item" ) { // the action has a sub menu
- QString itemName = n2.attribute( "name" );
- QString itemText = n2.attribute( "text" );
- out << indent << itemName << " = Qt::PopupMenu( this );" << endl;
+ TQString itemName = n2.attribute( "name" );
+ TQString itemText = n2.attribute( "text" );
+ out << indent << itemName << " = TQt::PopupMenu( this );" << endl;
out << indent << parent << "->setAccel( tr( \"" << n2.attribute( "accel" ) << "\" ), " << endl;
++indent;
out << indent << parent << "->insertItem( " << n.attribute( "name" ) << "->iconSet(),";
@@ -516,18 +516,18 @@ void Uic::createPopupMenuImpl( const QDomElement &e, const QString &parentClass,
Creates implementation of an listbox item tag.
*/
-QString Uic::createListBoxItemImpl( const QDomElement &e, const QString &parent,
- QString *value )
+TQString Uic::createListBoxItemImpl( const TQDomElement &e, const TQString &parent,
+ TQString *value )
{
- QDomElement n = e.firstChild().toElement();
- QString txt;
- QString com;
- QString pix;
+ TQDomElement n = e.firstChild().toElement();
+ TQString txt;
+ TQString com;
+ TQString pix;
while ( !n.isNull() ) {
if ( n.tagName() == "property" ) {
- QString attrib = n.attribute( "name" );
- QVariant v = DomTool::elementToVariant( n.firstChild().toElement(), QVariant() );
+ TQString attrib = n.attribute( "name" );
+ TQVariant v = DomTool::elementToVariant( n.firstChild().toElement(), TQVariant() );
if ( attrib == "text" ) {
txt = v.toString();
com = getComment( n );
@@ -536,8 +536,8 @@ QString Uic::createListBoxItemImpl( const QDomElement &e, const QString &parent,
if( !pix.isEmpty() && !externPixmaps )
pix.prepend( '$' );
if ( !pix.isEmpty() && !pixmapLoaderFunction.isEmpty() ) {
- pix.prepend( pixmapLoaderFunction + "(" + QString( externPixmaps ? "\"" : "" ) );
- pix.append( QString( externPixmaps ? "\"" : "" ) + ")" );
+ pix.prepend( pixmapLoaderFunction + "(" + TQString( externPixmaps ? "\"" : "" ) );
+ pix.append( TQString( externPixmaps ? "\"" : "" ) + ")" );
}
}
}
@@ -559,16 +559,16 @@ QString Uic::createListBoxItemImpl( const QDomElement &e, const QString &parent,
Creates implementation of an iconview item tag.
*/
-QString Uic::createIconViewItemImpl( const QDomElement &e, const QString &parent )
+TQString Uic::createIconViewItemImpl( const TQDomElement &e, const TQString &parent )
{
- QDomElement n = e.firstChild().toElement();
- QString txt;
- QString com;
- QString pix;
+ TQDomElement n = e.firstChild().toElement();
+ TQString txt;
+ TQString com;
+ TQString pix;
while ( !n.isNull() ) {
if ( n.tagName() == "property" ) {
- QString attrib = n.attribute( "name" );
- QVariant v = DomTool::elementToVariant( n.firstChild().toElement(), QVariant() );
+ TQString attrib = n.attribute( "name" );
+ TQVariant v = DomTool::elementToVariant( n.firstChild().toElement(), TQVariant() );
if ( attrib == "text" ) {
txt = v.toString();
com = getComment( n );
@@ -577,8 +577,8 @@ QString Uic::createIconViewItemImpl( const QDomElement &e, const QString &parent
if( !pix.isEmpty() && !externPixmaps )
pix.prepend( '$' );
if ( !pix.isEmpty() && !pixmapLoaderFunction.isEmpty() ) {
- pix.prepend( pixmapLoaderFunction + "(" + QString( externPixmaps ? "\"" : "" ) );
- pix.append( QString( externPixmaps ? "\"" : "" ) + ")" );
+ pix.prepend( pixmapLoaderFunction + "(" + TQString( externPixmaps ? "\"" : "" ) );
+ pix.append( TQString( externPixmaps ? "\"" : "" ) + ")" );
}
}
}
@@ -586,24 +586,24 @@ QString Uic::createIconViewItemImpl( const QDomElement &e, const QString &parent
}
if ( pix.isEmpty() )
- return "Qt::IconViewItem(" + parent + ", " + trcall( txt, com ) + ");";
+ return "TQt::IconViewItem(" + parent + ", " + trcall( txt, com ) + ");";
else
- return "Qt::IconViewItem(" + parent + ", " + trcall( txt, com ) + ", " + pix + ");";
+ return "TQt::IconViewItem(" + parent + ", " + trcall( txt, com ) + ", " + pix + ");";
}
/*!
Creates implementation of an listview item tag.
*/
-QString Uic::createListViewItemImpl( const QDomElement &e, const QString &parent,
- const QString &parentItem )
+TQString Uic::createListViewItemImpl( const TQDomElement &e, const TQString &parent,
+ const TQString &parentItem )
{
- QString s;
+ TQString s;
- QDomElement n = e.firstChild().toElement();
+ TQDomElement n = e.firstChild().toElement();
bool hasChildren = e.elementsByTagName( "item" ).count() > 0;
- QString item;
+ TQString item;
if ( hasChildren ) {
item = "$" + registerObject( "item" );
@@ -618,25 +618,25 @@ QString Uic::createListViewItemImpl( const QDomElement &e, const QString &parent
}
if ( !parentItem.isEmpty() )
- s += "Qt::ListViewItem(" + parentItem + ", " + lastItem + ");\n";
+ s += "TQt::ListViewItem(" + parentItem + ", " + lastItem + ");\n";
else
- s += "Qt::ListViewItem(" + parent + ", " + lastItem + ");\n";
+ s += "TQt::ListViewItem(" + parent + ", " + lastItem + ");\n";
- QStringList texts;
- QStringList pixmaps;
+ TQStringList texts;
+ TQStringList pixmaps;
while ( !n.isNull() ) {
if ( n.tagName() == "property" ) {
- QString attrib = n.attribute("name");
- QVariant v = DomTool::elementToVariant( n.firstChild().toElement(), QVariant() );
+ TQString attrib = n.attribute("name");
+ TQVariant v = DomTool::elementToVariant( n.firstChild().toElement(), TQVariant() );
if ( attrib == "text" )
texts << v.toString();
else if ( attrib == "pixmap" ) {
- QString pix = v.toString();
+ TQString pix = v.toString();
if( !pix.isEmpty() && !externPixmaps )
pix.prepend( '$' );
if ( !pix.isEmpty() && !pixmapLoaderFunction.isEmpty() ) {
- pix.prepend( pixmapLoaderFunction + "(" + QString( externPixmaps ? "\"" : "" ) );
- pix.append( QString( externPixmaps ? "\"" : "" ) + ")" );
+ pix.prepend( pixmapLoaderFunction + "(" + TQString( externPixmaps ? "\"" : "" ) );
+ pix.append( TQString( externPixmaps ? "\"" : "" ) + ")" );
}
pixmaps << pix;
}
@@ -649,9 +649,9 @@ QString Uic::createListViewItemImpl( const QDomElement &e, const QString &parent
for ( int i = 0; i < (int)texts.count(); ++i ) {
if ( !texts[ i ].isEmpty() )
- s += indent + item + "->setText(" + QString::number( i ) + ", " + trcall( texts[ i ] ) + ");\n";
+ s += indent + item + "->setText(" + TQString::number( i ) + ", " + trcall( texts[ i ] ) + ");\n";
if ( !pixmaps[ i ].isEmpty() )
- s += indent + item + "->setPixmap(" + QString::number( i ) + ", " + pixmaps[ i ] + ");\n";
+ s += indent + item + "->setPixmap(" + TQString::number( i ) + ", " + pixmaps[ i ] + ");\n";
}
lastItem = item;
@@ -662,18 +662,18 @@ QString Uic::createListViewItemImpl( const QDomElement &e, const QString &parent
Creates implementation of an listview column tag.
*/
-QString Uic::createListViewColumnImpl( const QDomElement &e, const QString &parent,
- QString *value )
+TQString Uic::createListViewColumnImpl( const TQDomElement &e, const TQString &parent,
+ TQString *value )
{
- QDomElement n = e.firstChild().toElement();
- QString txt;
- QString com;
- QString pix;
+ TQDomElement n = e.firstChild().toElement();
+ TQString txt;
+ TQString com;
+ TQString pix;
bool clickable = FALSE, resizable = FALSE;
while ( !n.isNull() ) {
if ( n.tagName() == "property" ) {
- QString attrib = n.attribute("name");
- QVariant v = DomTool::elementToVariant( n.firstChild().toElement(), QVariant() );
+ TQString attrib = n.attribute("name");
+ TQVariant v = DomTool::elementToVariant( n.firstChild().toElement(), TQVariant() );
if ( attrib == "text" ) {
txt = v.toString();
com = getComment( n );
@@ -682,8 +682,8 @@ QString Uic::createListViewColumnImpl( const QDomElement &e, const QString &pare
if( !pix.isEmpty() && !externPixmaps )
pix.prepend( '$' );
if ( !pix.isEmpty() && !pixmapLoaderFunction.isEmpty() ) {
- pix.prepend( pixmapLoaderFunction + "(" + QString( externPixmaps ? "\"" : "" ) );
- pix.append( QString( externPixmaps ? "\"" : "" ) + ")" );
+ pix.prepend( pixmapLoaderFunction + "(" + TQString( externPixmaps ? "\"" : "" ) );
+ pix.append( TQString( externPixmaps ? "\"" : "" ) + ")" );
}
} else if ( attrib == "clickable" )
clickable = v.toBool();
@@ -696,7 +696,7 @@ QString Uic::createListViewColumnImpl( const QDomElement &e, const QString &pare
if ( value )
*value = trcall( txt, com );
- QString s;
+ TQString s;
s = indent + parent + "->addColumn(" + trcall( txt, com ) + ");\n";
if ( !pix.isEmpty() )
s += indent + parent + "->header()->setLabel(" + parent + "->header()->count() - 1," + pix + ", " + trcall( txt, com ) + ");\n";
@@ -708,20 +708,20 @@ QString Uic::createListViewColumnImpl( const QDomElement &e, const QString &pare
return s;
}
-QString Uic::createTableRowColumnImpl( const QDomElement &e, const QString &parent,
- QString *value )
+TQString Uic::createTableRowColumnImpl( const TQDomElement &e, const TQString &parent,
+ TQString *value )
{
- QString objClass = getClassName( e.parentNode().toElement() );
- QDomElement n = e.firstChild().toElement();
- QString txt;
- QString com;
- QString pix;
- QString field;
+ TQString objClass = getClassName( e.parentNode().toElement() );
+ TQDomElement n = e.firstChild().toElement();
+ TQString txt;
+ TQString com;
+ TQString pix;
+ TQString field;
bool isRow = e.tagName() == "row";
while ( !n.isNull() ) {
if ( n.tagName() == "property" ) {
- QString attrib = n.attribute("name");
- QVariant v = DomTool::elementToVariant( n.firstChild().toElement(), QVariant() );
+ TQString attrib = n.attribute("name");
+ TQVariant v = DomTool::elementToVariant( n.firstChild().toElement(), TQVariant() );
if ( attrib == "text" ) {
txt = v.toString();
com = getComment( n );
@@ -730,8 +730,8 @@ QString Uic::createTableRowColumnImpl( const QDomElement &e, const QString &pare
if( !pix.isEmpty() && !externPixmaps )
pix.prepend( '$' );
if ( !pix.isEmpty() && !pixmapLoaderFunction.isEmpty() ) {
- pix.prepend( pixmapLoaderFunction + "(" + QString( externPixmaps ? "\"" : "" ) );
- pix.append( QString( externPixmaps ? "\"" : "" ) + ")" );
+ pix.prepend( pixmapLoaderFunction + "(" + TQString( externPixmaps ? "\"" : "" ) );
+ pix.append( TQString( externPixmaps ? "\"" : "" ) + ")" );
}
} else if ( attrib == "field" )
field = v.toString();
@@ -744,32 +744,32 @@ QString Uic::createTableRowColumnImpl( const QDomElement &e, const QString &pare
// ### This generated code sucks! We have to set the number of
// rows/cols before and then only do setLabel/()
- // ### careful, though, since QDataTable has an API which makes this code pretty good
+ // ### careful, though, since TQDataTable has an API which makes this code pretty good
- QString s;
+ TQString s;
if ( isRow ) {
s = indent + parent + "->setNumRows(" + parent + "->numRows() + 1 );\n";
if ( pix.isEmpty() )
s += indent + parent + "->verticalHeader()->setLabel(" + parent + "->numRows() - 1, "
+ trcall( txt, com ) + ");\n";
else
- s += indent + parent + "->verticalHeader()->setLabel(" + parent + "->numRows() - 1, Qt::IconSet("
+ s += indent + parent + "->verticalHeader()->setLabel(" + parent + "->numRows() - 1, TQt::IconSet("
+ pix + " ), " + trcall( txt, com ) + ");\n";
} else {
- if ( objClass == "Qt::Table" ) {
+ if ( objClass == "TQt::Table" ) {
s = indent + parent + "->setNumCols(" + parent + "->numCols() + 1);\n";
if ( pix.isEmpty() )
s += indent + parent + "->horizontalHeader()->setLabel(" + parent + "->numCols() - 1, "
+ trcall( txt, com ) + ");\n";
else
- s += indent + parent + "->horizontalHeader()->setLabel(" + parent + "->numCols() - 1, Qt::IconSet("
+ s += indent + parent + "->horizontalHeader()->setLabel(" + parent + "->numCols() - 1, TQt::IconSet("
+ pix + " ), " + trcall( txt, com ) + ");\n";
- } else if ( objClass == "Qt::DataTable" ) {
+ } else if ( objClass == "TQt::DataTable" ) {
if ( !txt.isEmpty() && !field.isEmpty() ) {
if ( pix.isEmpty() )
out << indent << parent << "->addColumn(" << fixString( field ) << ", " << trcall( txt, com ) << ");" << endl;
else
- out << indent << parent << "->addColumn(" << fixString( field ) << ", " << trcall( txt, com ) << ", Qt::IconSet(" << pix << "));" << endl;
+ out << indent << parent << "->addColumn(" << fixString( field ) << ", " << trcall( txt, com ) << ", TQt::IconSet(" << pix << "));" << endl;
}
}
}
@@ -779,29 +779,29 @@ QString Uic::createTableRowColumnImpl( const QDomElement &e, const QString &pare
/*!
Creates the implementation of a layout tag. Called from createObjectImpl().
*/
-QString Uic::createLayoutImpl( const QDomElement &e, const QString& parentClass, const QString& parent, const QString& layout )
+TQString Uic::createLayoutImpl( const TQDomElement &e, const TQString& parentClass, const TQString& parent, const TQString& layout )
{
- QDomElement n;
- QString objClass, objName;
+ TQDomElement n;
+ TQString objClass, objName;
objClass = e.tagName();
- QString qlayout = "Qt::VBoxLayout";
+ TQString qlayout = "TQt::VBoxLayout";
if ( objClass == "hbox" )
- qlayout = "Qt::HBoxLayout";
+ qlayout = "TQt::HBoxLayout";
else if ( objClass == "grid" )
- qlayout = "Qt::GridLayout";
+ qlayout = "TQt::GridLayout";
bool isGrid = e.tagName() == "grid" ;
objName = registerObject( "$" + getLayoutName( e ) );
layoutObjects += objName;
- QString margin = DomTool::readProperty( e, "margin", defMargin ).toString();
- QString spacing = DomTool::readProperty( e, "spacing", defSpacing ).toString();
- QString resizeMode = DomTool::readProperty( e, "resizeMode", QString::null ).toString();
+ TQString margin = DomTool::readProperty( e, "margin", defMargin ).toString();
+ TQString spacing = DomTool::readProperty( e, "spacing", defSpacing ).toString();
+ TQString resizeMode = DomTool::readProperty( e, "resizeMode", TQString::null ).toString();
- QString optcells;
+ TQString optcells;
if ( isGrid )
optcells = "1, 1, ";
- if ( (parentClass == "Qt::GroupBox" || parentClass == "Qt::ButtonGroup") && layout.isEmpty() ) {
+ if ( (parentClass == "TQt::GroupBox" || parentClass == "TQt::ButtonGroup") && layout.isEmpty() ) {
// special case for group box
out << indent << parent << "->setColumnLayout( 0, &Vertical );" << endl;
out << indent << parent << "->layout()->setSpacing(" << spacing << ");" << endl;
@@ -820,15 +820,15 @@ QString Uic::createLayoutImpl( const QDomElement &e, const QString& parentClass,
out << ", " << optcells << margin << ", " << spacing << ", '" << objName << "');" << endl;
}
if ( !resizeMode.isEmpty() )
- out << indent << objName << "->setResizeMode( &Qt::Layout::" << resizeMode << " );" << endl;
+ out << indent << objName << "->setResizeMode( &TQt::Layout::" << resizeMode << " );" << endl;
if ( !isGrid ) {
for ( n = e.firstChild().toElement(); !n.isNull(); n = n.nextSibling().toElement() ) {
if ( n.tagName() == "spacer" ) {
- QString child = createSpacerImpl( n, parentClass, parent, objName );
+ TQString child = createSpacerImpl( n, parentClass, parent, objName );
out << indent << objName << "->addItem(" << child << ");" << endl;
} else if ( tags.contains( n.tagName() ) ) {
- QString child = createObjectImpl( n, parentClass, parent, objName );
+ TQString child = createObjectImpl( n, parentClass, parent, objName );
if ( isLayout( child ) )
out << indent << objName << "->addLayout(" << child << ");" << endl;
else
@@ -837,7 +837,7 @@ QString Uic::createLayoutImpl( const QDomElement &e, const QString& parentClass,
}
} else {
for ( n = e.firstChild().toElement(); !n.isNull(); n = n.nextSibling().toElement() ) {
- QDomElement ae = n;
+ TQDomElement ae = n;
int row = ae.attribute( "row" ).toInt();
int col = ae.attribute( "column" ).toInt();
int rowspan = ae.attribute( "rowspan" ).toInt();
@@ -847,7 +847,7 @@ QString Uic::createLayoutImpl( const QDomElement &e, const QString& parentClass,
if ( colspan < 1 )
colspan = 1;
if ( n.tagName() == "spacer" ) {
- QString child = createSpacerImpl( n, parentClass, parent, objName );
+ TQString child = createSpacerImpl( n, parentClass, parent, objName );
if ( rowspan * colspan != 1 )
out << indent << objName << "->addMultiCell(" << child << ", "
<< row << ", " << ( row + rowspan - 1 ) << ", " << col << ", " << col + colspan - 1 << ");" << endl;
@@ -855,9 +855,9 @@ QString Uic::createLayoutImpl( const QDomElement &e, const QString& parentClass,
out << indent << objName << "->addItem(" << child << ", "
<< row << ", " << col << ");" << endl;
} else if ( tags.contains( n.tagName() ) ) {
- QString child = createObjectImpl( n, parentClass, parent, objName );
+ TQString child = createObjectImpl( n, parentClass, parent, objName );
out << endl;
- QString o = "Widget";
+ TQString o = "Widget";
if ( isLayout( child ) )
o = "Layout";
if ( rowspan * colspan != 1 )
@@ -875,31 +875,31 @@ QString Uic::createLayoutImpl( const QDomElement &e, const QString& parentClass,
-QString Uic::createSpacerImpl( const QDomElement &e, const QString& /*parentClass*/, const QString& /*parent*/, const QString& /*layout*/)
+TQString Uic::createSpacerImpl( const TQDomElement &e, const TQString& /*parentClass*/, const TQString& /*parent*/, const TQString& /*layout*/)
{
- QDomElement n;
- QString objClass, objName;
+ TQDomElement n;
+ TQString objClass, objName;
objClass = e.tagName();
objName = registerObject( "$spacer" );
- QSize size = DomTool::readProperty( e, "sizeHint", QSize( 0, 0 ) ).toSize();
- QString sizeType = DomTool::readProperty( e, "sizeType", "Expanding" ).toString();
+ TQSize size = DomTool::readProperty( e, "sizeHint", TQSize( 0, 0 ) ).toSize();
+ TQString sizeType = DomTool::readProperty( e, "sizeType", "Expanding" ).toString();
bool isVspacer = DomTool::readProperty( e, "orientation", "Horizontal" ) == "Vertical";
if ( sizeType != "Expanding" && sizeType != "MinimumExpanding" &&
- DomTool::hasProperty( e, "geometry" ) ) { // compatibility Qt 2.2
- QRect geom = DomTool::readProperty( e, "geometry", QRect(0,0,0,0) ).toRect();
+ DomTool::hasProperty( e, "geometry" ) ) { // compatibility TQt 2.2
+ TQRect geom = DomTool::readProperty( e, "geometry", TQRect(0,0,0,0) ).toRect();
size = geom.size();
}
if ( isVspacer )
- out << indent << "my " << objName << " = Qt::SpacerItem("
+ out << indent << "my " << objName << " = TQt::SpacerItem("
<< size.width() << ", " << size.height()
- << ", &Qt::SizePolicy::Minimum, &Qt::SizePolicy::" << sizeType << ");" << endl;
+ << ", &TQt::SizePolicy::Minimum, &TQt::SizePolicy::" << sizeType << ");" << endl;
else
- out << indent << "my " << objName << " = Qt::SpacerItem("
+ out << indent << "my " << objName << " = TQt::SpacerItem("
<< size.width() << ", " << size.height()
- << ", &Qt::SizePolicy::" << sizeType << ", &Qt::SizePolicy::Minimum);" << endl;
+ << ", &TQt::SizePolicy::" << sizeType << ", &TQt::SizePolicy::Minimum);" << endl;
return objName;
}
@@ -914,35 +914,35 @@ static const char* const ColorRole[] = {
/*!
Creates a colorgroup with name \a name from the color group \a cg
*/
-void Uic::createColorGroupImpl( const QString& name, const QDomElement& e )
+void Uic::createColorGroupImpl( const TQString& name, const TQDomElement& e )
{
- QColorGroup cg;
+ TQColorGroup cg;
int r = -1;
- QDomElement n = e.firstChild().toElement();
- QString color;
+ TQDomElement n = e.firstChild().toElement();
+ TQString color;
while ( !n.isNull() ) {
if ( n.tagName() == "color" ) {
r++;
- QColor col = DomTool::readColor( n );
- color = "Qt::Color(%1,%2,%3)";
+ TQColor col = DomTool::readColor( n );
+ color = "TQt::Color(%1,%2,%3)";
color = color.arg( col.red() ).arg( col.green() ).arg( col.blue() );
if ( col == white )
color = "&white";
else if ( col == black )
color = "&black";
if ( n.nextSibling().toElement().tagName() != "pixmap" ) {
- out << indent << name << "->setColor(&Qt::ColorGroup::" << ColorRole[r] << ", " << color << ");" << endl;
+ out << indent << name << "->setColor(&TQt::ColorGroup::" << ColorRole[r] << ", " << color << ");" << endl;
}
} else if ( n.tagName() == "pixmap" ) {
- QString pixmap = n.firstChild().toText().data();
+ TQString pixmap = n.firstChild().toText().data();
if( !pixmap.isEmpty() && !externPixmaps )
pixmap.prepend( '$' );
if ( !pixmapLoaderFunction.isEmpty() ) {
- pixmap.prepend( pixmapLoaderFunction + "(" + QString( externPixmaps ? "\"" : "" ) );
- pixmap.append( QString( externPixmaps ? "\"" : "" ) + ")" );
+ pixmap.prepend( pixmapLoaderFunction + "(" + TQString( externPixmaps ? "\"" : "" ) );
+ pixmap.append( TQString( externPixmaps ? "\"" : "" ) + ")" );
}
- out << indent << name << "->setBrush(&Qt::ColorGroup::"
- << ColorRole[r] << ", Qt::Brush(" << color << ", " << pixmap << "));" << endl;
+ out << indent << name << "->setBrush(&TQt::ColorGroup::"
+ << ColorRole[r] << ", TQt::Brush(" << color << ", " << pixmap << "));" << endl;
}
n = n.nextSibling().toElement();
}
@@ -952,16 +952,16 @@ void Uic::createColorGroupImpl( const QString& name, const QDomElement& e )
Auxiliary function to load a color group. The colorgroup must not
contain pixmaps.
*/
-QColorGroup Uic::loadColorGroup( const QDomElement &e )
+TQColorGroup Uic::loadColorGroup( const TQDomElement &e )
{
- QColorGroup cg;
+ TQColorGroup cg;
int r = -1;
- QDomElement n = e.firstChild().toElement();
- QColor col;
+ TQDomElement n = e.firstChild().toElement();
+ TQColor col;
while ( !n.isNull() ) {
if ( n.tagName() == "color" ) {
r++;
- cg.setColor( (QColorGroup::ColorRole)r, (col = DomTool::readColor( n ) ) );
+ cg.setColor( (TQColorGroup::ColorRole)r, (col = DomTool::readColor( n ) ) );
}
n = n.nextSibling().toElement();
}
@@ -972,10 +972,10 @@ QColorGroup Uic::loadColorGroup( const QDomElement &e )
the database \a connection and \a table.
*/
-bool Uic::isWidgetInTable( const QDomElement& e, const QString& connection, const QString& table )
+bool Uic::isWidgetInTable( const TQDomElement& e, const TQString& connection, const TQString& table )
{
- QString conn = getDatabaseInfo( e, "connection" );
- QString tab = getDatabaseInfo( e, "table" );
+ TQString conn = getDatabaseInfo( e, "connection" );
+ TQString tab = getDatabaseInfo( e, "table" );
if ( conn == connection && tab == table )
return TRUE;
return FALSE;
@@ -985,17 +985,17 @@ bool Uic::isWidgetInTable( const QDomElement& e, const QString& connection, cons
Registers all database connections, cursors and forms.
*/
-void Uic::registerDatabases( const QDomElement& e )
+void Uic::registerDatabases( const TQDomElement& e )
{
- QDomElement n;
- QDomNodeList nl;
+ TQDomElement n;
+ TQDomNodeList nl;
int i;
nl = e.parentNode().toElement().elementsByTagName( "widget" );
for ( i = 0; i < (int) nl.length(); ++i ) {
n = nl.item(i).toElement();
- QString conn = getDatabaseInfo( n, "connection" );
- QString tab = getDatabaseInfo( n, "table" );
- QString fld = getDatabaseInfo( n, "field" );
+ TQString conn = getDatabaseInfo( n, "connection" );
+ TQString tab = getDatabaseInfo( n, "table" );
+ TQString fld = getDatabaseInfo( n, "field" );
if ( !conn.isNull() ) {
dbConnections += conn;
if ( !tab.isNull() ) {
@@ -1015,7 +1015,7 @@ void Uic::registerDatabases( const QDomElement& e )
\sa registeredName(), isObjectRegistered()
*/
-QString Uic::registerObject( const QString& name )
+TQString Uic::registerObject( const TQString& name )
{
if ( objectNames.isEmpty() ) {
// some temporary variables we need
@@ -1025,7 +1025,7 @@ QString Uic::registerObject( const QString& name )
objectNames += "pal";
}
- QString result = name;
+ TQString result = name;
int i;
while ( ( i = result.find(' ' )) != -1 ) {
result[i] = '_';
@@ -1033,10 +1033,10 @@ QString Uic::registerObject( const QString& name )
if ( objectNames.contains( result ) ) {
int i = 2;
- while ( objectNames.contains( result + "_" + QString::number(i) ) )
+ while ( objectNames.contains( result + "_" + TQString::number(i) ) )
i++;
result += "_";
- result += QString::number(i);
+ result += TQString::number(i);
}
objectNames += result;
objectMapper.insert( name, result );
@@ -1049,7 +1049,7 @@ QString Uic::registerObject( const QString& name )
\sa registerObject(), isObjectRegistered()
*/
-QString Uic::registeredName( const QString& name )
+TQString Uic::registeredName( const TQString& name )
{
if ( !objectMapper.contains( name ) )
return name;
@@ -1059,22 +1059,22 @@ QString Uic::registeredName( const QString& name )
/*!
Returns whether the object \a name was registered yet or not.
*/
-bool Uic::isObjectRegistered( const QString& name )
+bool Uic::isObjectRegistered( const TQString& name )
{
return objectMapper.contains( name );
}
/*!
- Unifies the entries in stringlist \a list. Should really be a QStringList feature.
+ Unifies the entries in stringlist \a list. Should really be a TQStringList feature.
*/
-QStringList Uic::unique( const QStringList& list )
+TQStringList Uic::unique( const TQStringList& list )
{
if ( list.isEmpty() )
return list;
- QStringList result;
- for ( QStringList::ConstIterator it = list.begin(); it != list.end(); ++it ) {
+ TQStringList result;
+ for ( TQStringList::ConstIterator it = list.begin(); it != list.end(); ++it ) {
if ( !result.contains(*it) )
result += *it;
}
@@ -1086,7 +1086,7 @@ QStringList Uic::unique( const QStringList& list )
/*!
Creates an instance of class \a objClass, with parent \a parent and name \a objName
*/
-QString Uic::createObjectInstance( const QString& objClass, const QString& parent, const QString& objName )
+TQString Uic::createObjectInstance( const TQString& objClass, const TQString& parent, const TQString& objName )
{
if ( objClass.mid( 4 ) == "ComboBox" ) {
@@ -1095,7 +1095,7 @@ QString Uic::createObjectInstance( const QString& objClass, const QString& paren
return objClass + "(" + parent + ", \"" + objName + "\")";
}
-bool Uic::isLayout( const QString& name ) const
+bool Uic::isLayout( const TQString& name ) const
{
return layoutObjects.contains( name );
}
diff --git a/puic/uic.h b/puic/uic.h
index 20d07e2..0b3b8a9 100644
--- a/puic/uic.h
+++ b/puic/uic.h
@@ -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
@@ -29,16 +29,16 @@
#include <qpalette.h>
#include <qvariant.h>
-#ifndef Q_DUMMY_COMPARISON_OPERATOR
-# warning "Defining Q_DUMMY_COMPARISON_OPERATOR"
-# ifdef Q_FULL_TEMPLATE_INSTANTIATION
-# define Q_DUMMY_COMPARISON_OPERATOR(C) \
+#ifndef TTQ_DUMMY_COMPARISON_OPERATOR
+# warning "Defining TTQ_DUMMY_COMPARISON_OPERATOR"
+# ifdef TTQ_FULL_TEMPLATE_INSTANTIATION
+# define TTQ_DUMMY_COMPARISON_OPERATOR(C) \
bool operator==( const C& ) const { \
qWarning( #C"::operator==( const "#C"& ) got called." ); \
return FALSE; \
}
# else
-# define Q_DUMMY_COMPARISON_OPERATOR(C)
+# define TTQ_DUMMY_COMPARISON_OPERATOR(C)
# endif
#endif
@@ -50,110 +50,110 @@ public:
void setTabStop(uint n) {tabStop = n; calc();}
void operator++() {++current; calc();}
void operator--() {--current; calc();}
- operator QString() {return indstr;}
+ operator TQString() {return indstr;}
private:
uint tabStop;
uint current;
- QString indstr;
+ TQString indstr;
void calc();
};
-class Uic : public Qt
+class Uic : public TQt
{
public:
- Uic( const QString &fn, const char *outputFn, QTextStream& outStream,
- QDomDocument doc, bool subcl, const QString &trm,
- const QString& subClass, bool omitForwardDecls, QString &uicClass );
+ Uic( const TQString &fn, const char *outputFn, TQTextStream& outStream,
+ TQDomDocument doc, bool subcl, const TQString &trm,
+ const TQString& subClass, bool omitForwardDecls, TQString &uicClass );
static void setIndent(const PyIndent &pyind) {indent = pyind;}
- void createFormImpl( const QDomElement &e );
-
- void createSubImpl( const QDomElement &e, const QString& subclname );
-
- void createObjectDecl( const QDomElement& e );
- void createAttrDecl( const QDomElement& e );
- void createActionDecl( const QDomElement& e );
- void createActionImpl( const QDomElement& e, const QString &parent );
- void createToolbarImpl( const QDomElement &e, const QString &parentClass, const QString &parent );
- void createMenuBarImpl( const QDomElement &e, const QString &parentClass, const QString &parent );
- void createPopupMenuImpl( const QDomElement &e, const QString &parentClass, const QString &parent );
- QString createObjectImpl( const QDomElement &e, const QString& parentClass, const QString& parent, const QString& layout = QString::null );
- QString createLayoutImpl( const QDomElement &e, const QString& parentClass, const QString& parent, const QString& layout = QString::null );
- QString createObjectInstance( const QString& objClass, const QString& parent, const QString& objName );
- QString createSpacerImpl( const QDomElement &e, const QString& parentClass, const QString& parent, const QString& layout = QString::null );
- void createExclusiveProperty( const QDomElement & e, const QString& exclusiveProp );
- QString createListBoxItemImpl( const QDomElement &e, const QString &parent, QString *value = 0 );
- QString createIconViewItemImpl( const QDomElement &e, const QString &parent );
- QString createListViewColumnImpl( const QDomElement &e, const QString &parent, QString *value = 0 );
- QString createTableRowColumnImpl( const QDomElement &e, const QString &parent, QString *value = 0 );
- QString createListViewItemImpl( const QDomElement &e, const QString &parent,
- const QString &parentItem );
- void createColorGroupImpl( const QString& cg, const QDomElement& e );
- QColorGroup loadColorGroup( const QDomElement &e );
-
- QDomElement getObjectProperty( const QDomElement& e, const QString& name );
- QString getPixmapLoaderFunction( const QDomElement& e );
- QString getFormClassName( const QDomElement& e );
- QString getClassName( const QDomElement& e );
- QString getObjectName( const QDomElement& e );
- QString getLayoutName( const QDomElement& e );
- QString getInclude( const QString& className );
-
- QString setObjectProperty( const QString& objClass, const QString& obj, const QString &prop, const QDomElement &e, bool stdset );
-
- QString registerObject( const QString& name );
- QString registeredName( const QString& name );
- bool isObjectRegistered( const QString& name );
- QStringList unique( const QStringList& );
-
- QString trcall( const QString& sourceText, const QString& comment = "" );
-
- static void embed( QTextStream& out, const char* project, const QStringList& images );
-
- friend void getDBConnections(Uic& uic, QString& s);
+ void createFormImpl( const TQDomElement &e );
+
+ void createSubImpl( const TQDomElement &e, const TQString& subclname );
+
+ void createObjectDecl( const TQDomElement& e );
+ void createAttrDecl( const TQDomElement& e );
+ void createActionDecl( const TQDomElement& e );
+ void createActionImpl( const TQDomElement& e, const TQString &parent );
+ void createToolbarImpl( const TQDomElement &e, const TQString &parentClass, const TQString &parent );
+ void createMenuBarImpl( const TQDomElement &e, const TQString &parentClass, const TQString &parent );
+ void createPopupMenuImpl( const TQDomElement &e, const TQString &parentClass, const TQString &parent );
+ TQString createObjectImpl( const TQDomElement &e, const TQString& parentClass, const TQString& parent, const TQString& layout = TQString::null );
+ TQString createLayoutImpl( const TQDomElement &e, const TQString& parentClass, const TQString& parent, const TQString& layout = TQString::null );
+ TQString createObjectInstance( const TQString& objClass, const TQString& parent, const TQString& objName );
+ TQString createSpacerImpl( const TQDomElement &e, const TQString& parentClass, const TQString& parent, const TQString& layout = TQString::null );
+ void createExclusiveProperty( const TQDomElement & e, const TQString& exclusiveProp );
+ TQString createListBoxItemImpl( const TQDomElement &e, const TQString &parent, TQString *value = 0 );
+ TQString createIconViewItemImpl( const TQDomElement &e, const TQString &parent );
+ TQString createListViewColumnImpl( const TQDomElement &e, const TQString &parent, TQString *value = 0 );
+ TQString createTableRowColumnImpl( const TQDomElement &e, const TQString &parent, TQString *value = 0 );
+ TQString createListViewItemImpl( const TQDomElement &e, const TQString &parent,
+ const TQString &parentItem );
+ void createColorGroupImpl( const TQString& cg, const TQDomElement& e );
+ TQColorGroup loadColorGroup( const TQDomElement &e );
+
+ TQDomElement getObjectProperty( const TQDomElement& e, const TQString& name );
+ TQString getPixmapLoaderFunction( const TQDomElement& e );
+ TQString getFormClassName( const TQDomElement& e );
+ TQString getClassName( const TQDomElement& e );
+ TQString getObjectName( const TQDomElement& e );
+ TQString getLayoutName( const TQDomElement& e );
+ TQString getInclude( const TQString& className );
+
+ TQString setObjectProperty( const TQString& objClass, const TQString& obj, const TQString &prop, const TQDomElement &e, bool stdset );
+
+ TQString registerObject( const TQString& name );
+ TQString registeredName( const TQString& name );
+ bool isObjectRegistered( const TQString& name );
+ TQStringList unique( const TQStringList& );
+
+ TQString trcall( const TQString& sourceText, const TQString& comment = "" );
+
+ static void embed( TQTextStream& out, const char* project, const TQStringList& images );
+
+ friend void getDBConnections(Uic& uic, TQString& s);
private:
- void registerLayouts ( const QDomElement& e );
-
- QTextStream& out;
- QTextOStream trout;
- QString languageChangeBody;
- QCString outputFileName;
- QStringList objectNames;
- QMap<QString,QString> objectMapper;
- QStringList tags;
- QStringList layouts;
- QString formName;
- QString lastItem;
- QString trmacro;
+ void registerLayouts ( const TQDomElement& e );
+
+ TQTextStream& out;
+ TQTextOStream trout;
+ TQString languageChangeBody;
+ TQCString outputFileName;
+ TQStringList objectNames;
+ TQMap<TQString,TQString> objectMapper;
+ TQStringList tags;
+ TQStringList layouts;
+ TQString formName;
+ TQString lastItem;
+ TQString trmacro;
bool nofwd;
static PyIndent indent;
struct Buddy
{
- Buddy( const QString& k, const QString& b )
+ Buddy( const TQString& k, const TQString& b )
: key( k ), buddy( b ) {}
Buddy(){} // for valuelist
- QString key;
- QString buddy;
+ TQString key;
+ TQString buddy;
bool operator==( const Buddy& other ) const
{ return (key == other.key); }
};
struct CustomInclude
{
- QString header;
- QString location;
- Q_DUMMY_COMPARISON_OPERATOR(CustomInclude)
+ TQString header;
+ TQString location;
+ TTQ_DUMMY_COMPARISON_OPERATOR(CustomInclude)
};
- QValueList<Buddy> buddies;
+ TQValueList<Buddy> buddies;
- QStringList layoutObjects;
- bool isLayout( const QString& name ) const;
+ TQStringList layoutObjects;
+ bool isLayout( const TQString& name ) const;
uint item_used : 1;
uint cg_used : 1;
@@ -161,35 +161,35 @@ private:
uint stdsetdef : 1;
uint externPixmaps : 1;
- QString nameOfClass;
- QStringList namespaces;
- QString bareNameOfClass;
- QString pixmapLoaderFunction;
-
- void registerDatabases( const QDomElement& e );
- bool isWidgetInTable( const QDomElement& e, const QString& connection, const QString& table );
- bool isFrameworkCodeGenerated( const QDomElement& e );
- QString getDatabaseInfo( const QDomElement& e, const QString& tag );
- void createFormImpl( const QDomElement& e, const QString& form, const QString& connection, const QString& table );
- void writeFunctionsSubImpl( const QStringList &fuLst, const QStringList &typLst, const QStringList &specLst,
- const QString &subClass, const QString &descr );
- QStringList dbConnections;
- QMap< QString, QStringList > dbCursors;
- QMap< QString, QStringList > dbForms;
+ TQString nameOfClass;
+ TQStringList namespaces;
+ TQString bareNameOfClass;
+ TQString pixmapLoaderFunction;
+
+ void registerDatabases( const TQDomElement& e );
+ bool isWidgetInTable( const TQDomElement& e, const TQString& connection, const TQString& table );
+ bool isFrameworkCodeGenerated( const TQDomElement& e );
+ TQString getDatabaseInfo( const TQDomElement& e, const TQString& tag );
+ void createFormImpl( const TQDomElement& e, const TQString& form, const TQString& connection, const TQString& table );
+ void writeFunctionsSubImpl( const TQStringList &fuLst, const TQStringList &typLst, const TQStringList &specLst,
+ const TQString &subClass, const TQString &descr );
+ TQStringList dbConnections;
+ TQMap< TQString, TQStringList > dbCursors;
+ TQMap< TQString, TQStringList > dbForms;
static bool isMainWindow;
- static QString mkBool( bool b );
- static QString mkBool( const QString& s );
- bool toBool( const QString& s );
- static QString fixString( const QString &str, bool encode = FALSE );
+ static TQString mkBool( bool b );
+ static TQString mkBool( const TQString& s );
+ bool toBool( const TQString& s );
+ static TQString fixString( const TQString &str, bool encode = FALSE );
static bool onlyAscii;
- static QString mkStdSet( const QString& prop );
- static QString getComment( const QDomNode& n );
- QVariant defSpacing, defMargin;
- QString fileName;
+ static TQString mkStdSet( const TQString& prop );
+ static TQString getComment( const TQDomNode& n );
+ TQVariant defSpacing, defMargin;
+ TQString fileName;
bool writeFunctImpl;
- void perlSlot(QStringList::Iterator &it);
+ void perlSlot(TQStringList::Iterator &it);
};
#endif
diff --git a/puic/widgetdatabase.cpp b/puic/widgetdatabase.cpp
index 6c447d5..99b59d6 100644
--- a/puic/widgetdatabase.cpp
+++ b/puic/widgetdatabase.cpp
@@ -1,15 +1,15 @@
/**********************************************************************
** Copyright (C) 2000-2002 Trolltech AS. All rights reserved.
**
-** 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
** Foundation and appearing in the file LICENSE.GPL included in the
** packaging of this file.
**
-** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
-** licenses may use this file in accordance with the Qt Commercial License
+** Licensees holding valid TQt Enterprise Edition or TQt Professional Edition
+** licenses may use this file in accordance with the TQt Commercial License
** Agreement provided with the Software.
**
** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
@@ -17,7 +17,7 @@
**
** See http://www.trolltech.com/gpl/ for GPL licensing information.
** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
-** information about Qt Commercial License Agreements.
+** information about TQt Commercial License Agreements.
**
** Contact info@trolltech.com if any conditions of this licensing are
** not clear to you.
@@ -43,17 +43,17 @@ const int dbsize = 300;
const int dbcustom = 200;
const int dbdictsize = 211;
static WidgetDatabaseRecord* db[ dbsize ];
-static QDict<int> *className2Id = 0;
+static TQDict<int> *className2Id = 0;
static int dbcount = 0;
static int dbcustomcount = 200;
-static QStrList *wGroups;
-static QStrList *invisibleGroups;
+static TQStrList *wGroups;
+static TQStrList *invisibleGroups;
static bool whatsThisLoaded = FALSE;
-static QPluginManager<WidgetInterface> *widgetPluginManager = 0;
+static TQPluginManager<WidgetInterface> *widgetPluginManager = 0;
static bool plugins_set_up = FALSE;
static bool was_in_setup = FALSE;
-QCleanupHandler<QPluginManager<WidgetInterface> > cleanup_manager;
+TQCleanupHandler<TQPluginManager<WidgetInterface> > cleanup_manager;
WidgetDatabaseRecord::WidgetDatabaseRecord()
{
@@ -103,7 +103,7 @@ void WidgetDatabase::setupDataBase( int id )
{
was_in_setup = TRUE;
#ifndef UIC
- Q_UNUSED( id )
+ TTQ_UNUSED( id )
if ( dbcount )
return;
#else
@@ -117,18 +117,18 @@ void WidgetDatabase::setupDataBase( int id )
return;
#endif
- wGroups = new QStrList;
- invisibleGroups = new QStrList;
+ wGroups = new TQStrList;
+ invisibleGroups = new TQStrList;
invisibleGroups->append( "Forms" );
invisibleGroups->append( "Temp" );
- className2Id = new QDict<int>( dbdictsize );
+ className2Id = new TQDict<int>( dbdictsize );
className2Id->setAutoDelete( TRUE );
WidgetDatabaseRecord *r = 0;
r = new WidgetDatabaseRecord;
r->iconSet = "designer_pushbutton.png";
- r->name = "QPushButton";
+ r->name = "TQPushButton";
r->group = widgetGroup( "Buttons" );
r->toolTip = "Push Button";
r->isCommon = TRUE;
@@ -137,7 +137,7 @@ void WidgetDatabase::setupDataBase( int id )
r = new WidgetDatabaseRecord;
r->iconSet = "designer_toolbutton.png";
- r->name = "QToolButton";
+ r->name = "TQToolButton";
r->group = widgetGroup( "Buttons" );
r->toolTip = "Tool Button";
@@ -145,7 +145,7 @@ void WidgetDatabase::setupDataBase( int id )
r = new WidgetDatabaseRecord;
r->iconSet = "designer_radiobutton.png";
- r->name = "QRadioButton";
+ r->name = "TQRadioButton";
r->group = widgetGroup( "Buttons" );
r->toolTip = "Radio Button";
r->isCommon = TRUE;
@@ -154,7 +154,7 @@ void WidgetDatabase::setupDataBase( int id )
r = new WidgetDatabaseRecord;
r->iconSet = "designer_checkbox.png";
- r->name = "QCheckBox";
+ r->name = "TQCheckBox";
r->group = widgetGroup( "Buttons" );
r->toolTip = "Check Box";
r->isCommon = TRUE;
@@ -163,7 +163,7 @@ void WidgetDatabase::setupDataBase( int id )
r = new WidgetDatabaseRecord;
r->iconSet = "designer_groupbox.png";
- r->name = "QGroupBox";
+ r->name = "TQGroupBox";
r->group = widgetGroup( "Containers" );
r->toolTip = "Group Box";
r->isContainer = TRUE;
@@ -172,7 +172,7 @@ void WidgetDatabase::setupDataBase( int id )
r = new WidgetDatabaseRecord;
r->iconSet = "designer_buttongroup.png";
- r->name = "QButtonGroup";
+ r->name = "TQButtonGroup";
r->group = widgetGroup( "Containers" );
r->toolTip = "Button Group";
r->isContainer = TRUE;
@@ -182,7 +182,7 @@ void WidgetDatabase::setupDataBase( int id )
r = new WidgetDatabaseRecord;
r->iconSet = "designer_frame.png";
- r->name = "QFrame";
+ r->name = "TQFrame";
r->group = widgetGroup( "Containers" );
r->toolTip = "Frame";
r->isContainer = TRUE;
@@ -191,7 +191,7 @@ void WidgetDatabase::setupDataBase( int id )
r = new WidgetDatabaseRecord;
r->iconSet = "designer_tabwidget.png";
- r->name = "QTabWidget";
+ r->name = "TQTabWidget";
r->group = widgetGroup( "Containers" );
r->toolTip = "Tabwidget";
r->isContainer = TRUE;
@@ -200,7 +200,7 @@ void WidgetDatabase::setupDataBase( int id )
r = new WidgetDatabaseRecord;
r->iconSet = "designer_widgetstack.png";
- r->name = "QWidgetStack";
+ r->name = "TQWidgetStack";
r->group = widgetGroup( "Containers" );
r->toolTip = "Widget Stack";
r->isContainer = TRUE;
@@ -209,7 +209,7 @@ void WidgetDatabase::setupDataBase( int id )
r = new WidgetDatabaseRecord;
r->iconSet = "designer_toolbox.png";
- r->name = "QToolBox";
+ r->name = "TQToolBox";
r->group = widgetGroup( "Containers" );
r->toolTip = "Tool Box";
r->isContainer = TRUE;
@@ -218,7 +218,7 @@ void WidgetDatabase::setupDataBase( int id )
r = new WidgetDatabaseRecord;
r->iconSet = "designer_listbox.png";
- r->name = "QListBox";
+ r->name = "TQListBox";
r->group = widgetGroup( "Views" );
r->toolTip = "List Box";
r->isCommon = TRUE;
@@ -227,37 +227,37 @@ void WidgetDatabase::setupDataBase( int id )
r = new WidgetDatabaseRecord;
r->iconSet = "designer_listview.png";
- r->name = "QListView";
+ r->name = "TQListView";
r->group = widgetGroup( "Views" );
r->toolTip = "List View";
append( r );
-#if !defined(QT_NO_ICONVIEW) || defined(UIC)
+#if !defined(TQT_NO_ICONVIEW) || defined(UIC)
r = new WidgetDatabaseRecord;
r->iconSet = "designer_iconview.png";
- r->name = "QIconView";
+ r->name = "TQIconView";
r->group = widgetGroup( "Views" );
r->toolTip = "Icon View";
append( r );
#endif
-#if !defined(QT_NO_TABLE)
+#if !defined(TQT_NO_TABLE)
r = new WidgetDatabaseRecord;
r->iconSet = "designer_table.png";
- r->name = "QTable";
+ r->name = "TQTable";
r->group = widgetGroup( "Views" );
r->toolTip = "Table";
append( r );
#endif
-#if !defined(QT_NO_SQL)
+#if !defined(TQT_NO_SQL)
r = new WidgetDatabaseRecord;
r->iconSet = "designer_datatable.png";
r->includeFile = "qdatatable.h";
- r->name = "QDataTable";
+ r->name = "TQDataTable";
r->group = widgetGroup( "Database" );
r->toolTip = "Data Table";
@@ -266,7 +266,7 @@ void WidgetDatabase::setupDataBase( int id )
r = new WidgetDatabaseRecord;
r->iconSet = "designer_lineedit.png";
- r->name = "QLineEdit";
+ r->name = "TQLineEdit";
r->group = widgetGroup( "Input" );
r->toolTip = "Line Edit";
r->isCommon = TRUE;
@@ -275,7 +275,7 @@ void WidgetDatabase::setupDataBase( int id )
r = new WidgetDatabaseRecord;
r->iconSet = "designer_spinbox.png";
- r->name = "QSpinBox";
+ r->name = "TQSpinBox";
r->group = widgetGroup( "Input" );
r->toolTip = "Spin Box";
r->isCommon = TRUE;
@@ -284,7 +284,7 @@ void WidgetDatabase::setupDataBase( int id )
r = new WidgetDatabaseRecord;
r->iconSet = "designer_dateedit.png";
- r->name = "QDateEdit";
+ r->name = "TQDateEdit";
r->group = widgetGroup( "Input" );
r->toolTip = "Date Edit";
r->includeFile = "qdatetimeedit.h";
@@ -293,7 +293,7 @@ void WidgetDatabase::setupDataBase( int id )
r = new WidgetDatabaseRecord;
r->iconSet = "designer_timeedit.png";
- r->name = "QTimeEdit";
+ r->name = "TQTimeEdit";
r->group = widgetGroup( "Input" );
r->toolTip = "Time Edit";
r->includeFile = "qdatetimeedit.h";
@@ -302,7 +302,7 @@ void WidgetDatabase::setupDataBase( int id )
r = new WidgetDatabaseRecord;
r->iconSet = "designer_datetimeedit.png";
- r->name = "QDateTimeEdit";
+ r->name = "TQDateTimeEdit";
r->group = widgetGroup( "Input" );
r->toolTip = "Date-Time Edit";
r->includeFile = "qdatetimeedit.h";
@@ -311,7 +311,7 @@ void WidgetDatabase::setupDataBase( int id )
r = new WidgetDatabaseRecord;
r->iconSet = "designer_multilineedit.png";
- r->name = "QMultiLineEdit";
+ r->name = "TQMultiLineEdit";
r->group = widgetGroup( "Temp" );
r->toolTip = "Multi Line Edit";
@@ -319,7 +319,7 @@ void WidgetDatabase::setupDataBase( int id )
r = new WidgetDatabaseRecord;
r->iconSet = "designer_richtextedit.png";
- r->name = "QTextEdit";
+ r->name = "TQTextEdit";
r->group = widgetGroup( "Input" );
r->toolTip = "Rich Text Edit";
r->isCommon = TRUE;
@@ -328,7 +328,7 @@ void WidgetDatabase::setupDataBase( int id )
r = new WidgetDatabaseRecord;
r->iconSet = "designer_combobox.png";
- r->name = "QComboBox";
+ r->name = "TQComboBox";
r->group = widgetGroup( "Input" );
r->toolTip = "Combo Box";
r->isCommon = TRUE;
@@ -337,7 +337,7 @@ void WidgetDatabase::setupDataBase( int id )
r = new WidgetDatabaseRecord;
r->iconSet = "designer_slider.png";
- r->name = "QSlider";
+ r->name = "TQSlider";
r->group = widgetGroup( "Input" );
r->toolTip = "Slider";
@@ -345,7 +345,7 @@ void WidgetDatabase::setupDataBase( int id )
r = new WidgetDatabaseRecord;
r->iconSet = "designer_scrollbar.png";
- r->name = "QScrollBar";
+ r->name = "TQScrollBar";
r->group = widgetGroup( "Input" );
r->toolTip = "Scrollbar";
@@ -353,7 +353,7 @@ void WidgetDatabase::setupDataBase( int id )
r = new WidgetDatabaseRecord;
r->iconSet = "designer_dial.png";
- r->name = "QDial";
+ r->name = "TQDial";
r->group = widgetGroup( "Input" );
r->toolTip = "Dial";
@@ -361,7 +361,7 @@ void WidgetDatabase::setupDataBase( int id )
r = new WidgetDatabaseRecord;
r->iconSet = "designer_label.png";
- r->name = "QLabel";
+ r->name = "TQLabel";
r->group = widgetGroup( "Temp" );
r->toolTip = "Label";
@@ -388,7 +388,7 @@ void WidgetDatabase::setupDataBase( int id )
r = new WidgetDatabaseRecord;
r->iconSet = "designer_lcdnumber.png";
- r->name = "QLCDNumber";
+ r->name = "TQLCDNumber";
r->group = widgetGroup( "Display" );
r->toolTip = "LCD Number";
@@ -406,7 +406,7 @@ void WidgetDatabase::setupDataBase( int id )
r = new WidgetDatabaseRecord;
r->iconSet = "designer_progress.png";
- r->name = "QProgressBar";
+ r->name = "TQProgressBar";
r->group = widgetGroup( "Display" );
r->toolTip = "Progress Bar";
@@ -414,7 +414,7 @@ void WidgetDatabase::setupDataBase( int id )
r = new WidgetDatabaseRecord;
r->iconSet = "designer_textview.png";
- r->name = "QTextView";
+ r->name = "TQTextView";
r->group = widgetGroup( "Temp" );
r->toolTip = "Text View";
@@ -422,7 +422,7 @@ void WidgetDatabase::setupDataBase( int id )
r = new WidgetDatabaseRecord;
r->iconSet = "designer_textbrowser.png";
- r->name = "QTextBrowser";
+ r->name = "TQTextBrowser";
r->group = widgetGroup( "Display" );
r->toolTip = "Text Browser";
@@ -438,35 +438,35 @@ void WidgetDatabase::setupDataBase( int id )
append( r );
r = new WidgetDatabaseRecord;
- r->name = "QWidget";
+ r->name = "TQWidget";
r->isForm = TRUE;
r->group = widgetGroup( "Forms" );
append( r );
r = new WidgetDatabaseRecord;
- r->name = "QDialog";
+ r->name = "TQDialog";
r->group = widgetGroup( "Forms" );
r->isForm = TRUE;
append( r );
r = new WidgetDatabaseRecord;
- r->name = "QWizard";
+ r->name = "TQWizard";
r->group = widgetGroup( "Forms" );
r->isContainer = TRUE;
append( r );
r = new WidgetDatabaseRecord;
- r->name = "QDesignerWizard";
+ r->name = "TQDesignerWizard";
r->group = widgetGroup( "Forms" );
r->isContainer = TRUE;
append( r );
r = new WidgetDatabaseRecord;
- r->name = "QLayoutWidget";
+ r->name = "TQLayoutWidget";
r->group = widgetGroup( "Temp" );
r->includeFile = "";
r->isContainer = TRUE;
@@ -474,7 +474,7 @@ void WidgetDatabase::setupDataBase( int id )
append( r );
r = new WidgetDatabaseRecord;
- r->name = "QSplitter";
+ r->name = "TQSplitter";
r->group = widgetGroup( "Temp" );
r->includeFile = "qsplitter.h";
r->isContainer = TRUE;
@@ -483,7 +483,7 @@ void WidgetDatabase::setupDataBase( int id )
r = new WidgetDatabaseRecord;
r->iconSet = "designer_tabwidget.png";
- r->name = "QDesignerTabWidget";
+ r->name = "TQDesignerTabWidget";
r->group = widgetGroup( "Temp" );
r->isContainer = TRUE;
@@ -491,7 +491,7 @@ void WidgetDatabase::setupDataBase( int id )
r = new WidgetDatabaseRecord;
r->iconSet = "designer_tabwidget.png";
- r->name = "QDesignerWidget";
+ r->name = "TQDesignerWidget";
r->group = widgetGroup( "Temp" );
r->isContainer = TRUE;
@@ -499,7 +499,7 @@ void WidgetDatabase::setupDataBase( int id )
r = new WidgetDatabaseRecord;
r->iconSet = "designer_tabwidget.png";
- r->name = "QDesignerDialog";
+ r->name = "TQDesignerDialog";
r->group = widgetGroup( "Temp" );
r->isContainer = TRUE;
@@ -507,7 +507,7 @@ void WidgetDatabase::setupDataBase( int id )
r = new WidgetDatabaseRecord;
r->iconSet = "";
- r->name = "QMainWindow";
+ r->name = "TQMainWindow";
r->includeFile = "qmainwindow.h";
r->group = widgetGroup( "Temp" );
r->isContainer = TRUE;
@@ -516,7 +516,7 @@ void WidgetDatabase::setupDataBase( int id )
r = new WidgetDatabaseRecord;
r->iconSet = "";
- r->name = "QDesignerAction";
+ r->name = "TQDesignerAction";
r->includeFile = "qaction.h";
r->group = widgetGroup( "Temp" );
r->isContainer = FALSE;
@@ -525,7 +525,7 @@ void WidgetDatabase::setupDataBase( int id )
r = new WidgetDatabaseRecord;
r->iconSet = "";
- r->name = "QDesignerActionGroup";
+ r->name = "TQDesignerActionGroup";
r->includeFile = "qaction.h";
r->group = widgetGroup( "Temp" );
r->isContainer = FALSE;
@@ -534,17 +534,17 @@ void WidgetDatabase::setupDataBase( int id )
r = new WidgetDatabaseRecord;
r->iconSet = "";
- r->name = "QScrollView";
+ r->name = "TQScrollView";
r->includeFile = "qscrollview.h";
r->group = widgetGroup( "Temp" );
r->isContainer = TRUE;
append( r );
-#ifndef QT_NO_SQL
+#ifndef TQT_NO_SQL
r = new WidgetDatabaseRecord;
r->iconSet = "";
- r->name = "QDataBrowser";
+ r->name = "TQDataBrowser";
r->includeFile = "qdatabrowser.h";
r->group = widgetGroup( "Database" );
r->toolTip = "Data Browser";
@@ -555,7 +555,7 @@ void WidgetDatabase::setupDataBase( int id )
r = new WidgetDatabaseRecord;
r->iconSet = "";
- r->name = "QDataView";
+ r->name = "TQDataView";
r->includeFile = "qdataview.h";
r->group = widgetGroup( "Database" );
r->toolTip = "Data View";
@@ -575,8 +575,8 @@ void WidgetDatabase::setupPlugins()
if ( plugins_set_up )
return;
plugins_set_up = TRUE;
- QStringList widgets = widgetManager()->featureList();
- for ( QStringList::Iterator it = widgets.begin(); it != widgets.end(); ++it ) {
+ TQStringList widgets = widgetManager()->featureList();
+ for ( TQStringList::Iterator it = widgets.begin(); it != widgets.end(); ++it ) {
if ( hasWidget( *it ) )
continue;
WidgetDatabaseRecord *r = new WidgetDatabaseRecord;
@@ -586,11 +586,11 @@ void WidgetDatabase::setupPlugins()
continue;
#ifndef UIC
- QIconSet icon = iface->iconSet( *it );
+ TQIconSet icon = iface->iconSet( *it );
if ( !icon.pixmap().isNull() )
- r->icon = new QIconSet( icon );
+ r->icon = new TQIconSet( icon );
#endif
- QString grp = iface->group( *it );
+ TQString grp = iface->group( *it );
if ( grp.isEmpty() )
grp = "3rd party widgets";
r->group = widgetGroup( grp );
@@ -629,24 +629,24 @@ int WidgetDatabase::startCustom()
Returns the iconset which represents the class registered as \a id.
*/
-QIconSet WidgetDatabase::iconSet( int id )
+TQIconSet WidgetDatabase::iconSet( int id )
{
setupDataBase( id );
WidgetDatabaseRecord *r = at( id );
if ( !r )
- return QIconSet();
+ return TQIconSet();
#if !defined(UIC) && !defined(RESOURCE)
if ( !r->icon ) {
if ( r->iconSet.isEmpty() )
- return QIconSet();
- QPixmap pix = QPixmap::fromMimeSource( r->iconSet );
+ return TQIconSet();
+ TQPixmap pix = TQPixmap::fromMimeSource( r->iconSet );
if ( pix.isNull() )
- pix = QPixmap( r->iconSet );
- r->icon = new QIconSet( pix );
+ pix = TQPixmap( r->iconSet );
+ r->icon = new TQIconSet( pix );
}
return *r->icon;
#else
- return QIconSet();
+ return TQIconSet();
#endif
}
@@ -654,12 +654,12 @@ QIconSet WidgetDatabase::iconSet( int id )
Returns the classname of the widget which is registered as \a id.
*/
-QString WidgetDatabase::className( int id )
+TQString WidgetDatabase::className( int id )
{
setupDataBase( id );
WidgetDatabaseRecord *r = at( id );
if ( !r )
- return QString::null;
+ return TQString::null;
return r->name;
}
@@ -667,12 +667,12 @@ QString WidgetDatabase::className( int id )
Returns the group the widget registered as \a id belongs to.
*/
-QString WidgetDatabase::group( int id )
+TQString WidgetDatabase::group( int id )
{
setupDataBase( id );
WidgetDatabaseRecord *r = at( id );
if ( !r )
- return QString::null;
+ return TQString::null;
return r->group;
}
@@ -680,12 +680,12 @@ QString WidgetDatabase::group( int id )
Returns the tooltip text of the widget which is registered as \a id.
*/
-QString WidgetDatabase::toolTip( int id )
+TQString WidgetDatabase::toolTip( int id )
{
setupDataBase( id );
WidgetDatabaseRecord *r = at( id );
if ( !r )
- return QString::null;
+ return TQString::null;
return r->toolTip;
}
@@ -693,12 +693,12 @@ QString WidgetDatabase::toolTip( int id )
Returns the what's this? text of the widget which is registered as \a id.
*/
-QString WidgetDatabase::whatsThis( int id )
+TQString WidgetDatabase::whatsThis( int id )
{
setupDataBase( id );
WidgetDatabaseRecord *r = at( id );
if ( !r )
- return QString::null;
+ return TQString::null;
return r->whatsThis;
}
@@ -706,12 +706,12 @@ QString WidgetDatabase::whatsThis( int id )
Returns the include file if the widget which is registered as \a id.
*/
-QString WidgetDatabase::includeFile( int id )
+TQString WidgetDatabase::includeFile( int id )
{
setupDataBase( id );
WidgetDatabaseRecord *r = at( id );
if ( !r )
- return QString::null;
+ return TQString::null;
if ( r->includeFile.isNull() )
return r->name.lower() + ".h";
return r->includeFile;
@@ -749,11 +749,11 @@ bool WidgetDatabase::isCommon( int id )
return r->isCommon;
}
-QString WidgetDatabase::createWidgetName( int id )
+TQString WidgetDatabase::createWidgetName( int id )
{
setupDataBase( id );
- QString n = className( id );
- if ( n == "QLayoutWidget" )
+ TQString n = className( id );
+ if ( n == "TQLayoutWidget" )
n = "Layout";
if ( n[ 0 ] == 'Q' && n[ 1 ].lower() != n[ 1 ] )
n = n.mid( 1 );
@@ -764,14 +764,14 @@ QString WidgetDatabase::createWidgetName( int id )
WidgetDatabaseRecord *r = at( id );
if ( !r )
return n;
- n += QString::number( ++r->nameCounter );
+ n += TQString::number( ++r->nameCounter );
n[0] = n[0].lower();
return n;
}
/*! Returns the id for \a name or -1 if \a name is unknown.
*/
-int WidgetDatabase::idFromClassName( const QString &name )
+int WidgetDatabase::idFromClassName( const TQString &name )
{
setupDataBase( -1 );
if ( name.isEmpty() )
@@ -780,7 +780,7 @@ int WidgetDatabase::idFromClassName( const QString &name )
if ( i )
return *i;
if ( name == "FormWindow" )
- return idFromClassName( "QLayoutWidget" );
+ return idFromClassName( "TQLayoutWidget" );
#ifdef UIC
setupDataBase( -2 );
i = className2Id->find( name );
@@ -790,7 +790,7 @@ int WidgetDatabase::idFromClassName( const QString &name )
return -1;
}
-bool WidgetDatabase::hasWidget( const QString &name )
+bool WidgetDatabase::hasWidget( const TQString &name )
{
return className2Id->find( name ) != 0;
}
@@ -813,7 +813,7 @@ void WidgetDatabase::insert( int index, WidgetDatabaseRecord *r )
db[ index ] = r;
className2Id->insert( r->name, new int( index ) );
if ( index < dbcustom )
- dbcount = QMAX( dbcount, index );
+ dbcount = TQMAX( dbcount, index );
}
void WidgetDatabase::append( WidgetDatabaseRecord *r )
@@ -823,14 +823,14 @@ void WidgetDatabase::append( WidgetDatabaseRecord *r )
insert( dbcount++, r );
}
-QString WidgetDatabase::widgetGroup( const QString &g )
+TQString WidgetDatabase::widgetGroup( const TQString &g )
{
if ( wGroups->find( g ) == -1 )
wGroups->append( g );
return g;
}
-bool WidgetDatabase::isGroupEmpty( const QString &grp )
+bool WidgetDatabase::isGroupEmpty( const TQString &grp )
{
WidgetDatabaseRecord *r = 0;
for ( int i = 0; i < dbcount; ++i ) {
@@ -842,12 +842,12 @@ bool WidgetDatabase::isGroupEmpty( const QString &grp )
return TRUE;
}
-QString WidgetDatabase::widgetGroup( int i )
+TQString WidgetDatabase::widgetGroup( int i )
{
setupDataBase( -1 );
if ( i >= 0 && i < (int)wGroups->count() )
return wGroups->at( i );
- return QString::null;
+ return TQString::null;
}
int WidgetDatabase::numWidgetGroups()
@@ -856,7 +856,7 @@ int WidgetDatabase::numWidgetGroups()
return wGroups->count();
}
-bool WidgetDatabase::isGroupVisible( const QString &g )
+bool WidgetDatabase::isGroupVisible( const TQString &g )
{
setupDataBase( -1 );
return invisibleGroups->find( g ) == -1;
@@ -868,8 +868,8 @@ int WidgetDatabase::addCustomWidget( WidgetDatabaseRecord *r )
return dbcustomcount - 1;
}
-void WidgetDatabase::customWidgetClassNameChanged( const QString &oldName,
- const QString &newName )
+void WidgetDatabase::customWidgetClassNameChanged( const TQString &oldName,
+ const TQString &newName )
{
int id = idFromClassName( oldName );
if ( id == -1 )
@@ -901,16 +901,16 @@ bool WidgetDatabase::isWhatsThisLoaded()
return whatsThisLoaded;
}
-void WidgetDatabase::loadWhatsThis( const QString &docPath )
+void WidgetDatabase::loadWhatsThis( const TQString &docPath )
{
- QString whatsthisFile = docPath + "/whatsthis";
- QFile f( whatsthisFile );
+ TQString whatsthisFile = docPath + "/whatsthis";
+ TQFile f( whatsthisFile );
if ( !f.open( IO_ReadOnly ) )
return;
- QTextStream ts( &f );
+ TQTextStream ts( &f );
while ( !ts.atEnd() ) {
- QString s = ts.readLine();
- QStringList l = QStringList::split( " | ", s );
+ TQString s = ts.readLine();
+ TQStringList l = TQStringList::split( " | ", s );
int id = idFromClassName( l[ 1 ] );
WidgetDatabaseRecord *r = at( id );
if ( r )
@@ -920,30 +920,30 @@ void WidgetDatabase::loadWhatsThis( const QString &docPath )
}
-// ### Qt 3.1: make these publically accessible via QWidgetDatabase API
+// ### TQt 3.1: make these publically accessible via TQWidgetDatabase API
#if defined(UIC)
bool dbnounload = FALSE;
-QStringList *dbpaths = 0;
+TQStringList *dbpaths = 0;
#else
-extern QString *qwf_plugin_dir;
+extern TQString *qwf_plugin_dir;
#endif
-QPluginManager<WidgetInterface> *widgetManager()
+TQPluginManager<WidgetInterface> *widgetManager()
{
if ( !widgetPluginManager ) {
- QString pluginDir = "/designer";
+ TQString pluginDir = "/designer";
#if !defined(UIC)
if ( qwf_plugin_dir )
pluginDir = *qwf_plugin_dir;
#endif
- widgetPluginManager = new QPluginManager<WidgetInterface>( IID_Widget, QApplication::libraryPaths(), pluginDir );
+ widgetPluginManager = new TQPluginManager<WidgetInterface>( IID_Widget, TQApplication::libraryPaths(), pluginDir );
cleanup_manager.add( &widgetPluginManager );
#if defined(UIC)
if ( dbnounload )
widgetPluginManager->setAutoUnload( FALSE );
if ( dbpaths ) {
- QStringList::ConstIterator it = dbpaths->begin();
+ TQStringList::ConstIterator it = dbpaths->begin();
for ( ; it != dbpaths->end(); ++it )
widgetPluginManager->addLibraryPath( *it );
}
diff --git a/puic/widgetdatabase.h b/puic/widgetdatabase.h
index dee809d..37baa6d 100644
--- a/puic/widgetdatabase.h
+++ b/puic/widgetdatabase.h
@@ -1,7 +1,7 @@
/**********************************************************************
** Copyright (C) 2000 Trolltech AS. All rights reserved.
**
-** 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
@@ -27,22 +27,22 @@
#include <private/qpluginmanager_p.h>
-extern QPluginManager<WidgetInterface> *widgetManager();
+extern TQPluginManager<WidgetInterface> *widgetManager();
struct WidgetDatabaseRecord
{
WidgetDatabaseRecord();
~WidgetDatabaseRecord();
- QString iconSet, name, group, toolTip, whatsThis, includeFile;
+ TQString iconSet, name, group, toolTip, whatsThis, includeFile;
uint isContainer : 1;
uint isForm : 1;
uint isCommon : 1;
uint isPlugin : 1;
- QIconSet *icon;
+ TQIconSet *icon;
int nameCounter;
};
-class WidgetDatabase : public Qt
+class WidgetDatabase : public TQt
{
public:
WidgetDatabase();
@@ -52,38 +52,38 @@ public:
static int count();
static int startCustom();
- static QIconSet iconSet( int id );
- static QString className( int id );
- static QString group( int id );
- static QString toolTip( int id );
- static QString whatsThis( int id );
- static QString includeFile( int id );
+ static TQIconSet iconSet( int id );
+ static TQString className( int id );
+ static TQString group( int id );
+ static TQString toolTip( int id );
+ static TQString whatsThis( int id );
+ static TQString includeFile( int id );
static bool isForm( int id );
static bool isContainer( int id );
static bool isCommon( int id );
- static int idFromClassName( const QString &name );
- static QString createWidgetName( int id );
+ static int idFromClassName( const TQString &name );
+ static TQString createWidgetName( int id );
static WidgetDatabaseRecord *at( int index );
static void insert( int index, WidgetDatabaseRecord *r );
static void append( WidgetDatabaseRecord *r );
- static QString widgetGroup( const QString &g );
- static QString widgetGroup( int i );
+ static TQString widgetGroup( const TQString &g );
+ static TQString widgetGroup( int i );
static int numWidgetGroups();
- static bool isGroupVisible( const QString &g );
- static bool isGroupEmpty( const QString &grp );
+ static bool isGroupVisible( const TQString &g );
+ static bool isGroupEmpty( const TQString &grp );
static int addCustomWidget( WidgetDatabaseRecord *r );
static bool isCustomWidget( int id );
static bool isCustomPluginWidget( int id );
static bool isWhatsThisLoaded();
- static void loadWhatsThis( const QString &docPath );
+ static void loadWhatsThis( const TQString &docPath );
- static bool hasWidget( const QString &name );
- static void customWidgetClassNameChanged( const QString &oldName, const QString &newName );
+ static bool hasWidget( const TQString &name );
+ static void customWidgetClassNameChanged( const TQString &oldName, const TQString &newName );
};
diff --git a/puic/widgetinterface.h b/puic/widgetinterface.h
index bf6bcd5..530d812 100644
--- a/puic/widgetinterface.h
+++ b/puic/widgetinterface.h
@@ -1,7 +1,7 @@
/**********************************************************************
** Copyright (C) 2000-2001 Trolltech AS. All rights reserved.
**
-** 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
@@ -23,7 +23,7 @@
#include <private/qwidgetinterface_p.h>
-#define WidgetInterface QWidgetFactoryInterface
-#define IID_Widget IID_QWidgetFactory
+#define WidgetInterface TQWidgetFactoryInterface
+#define IID_Widget IID_TQWidgetFactory
#endif