From 479f5f799523bffbcc83dff581a2299c047c6fff Mon Sep 17 00:00:00 2001 From: tpearson Date: Sat, 31 Jul 2010 19:44:01 +0000 Subject: Trinity Qt initial conversion git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdebindings@1157645 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- python/pyqt/doc/PyQt.html | 1568 ++++++++++++++--------------- python/pyqt/examples3/SQL/connect.ui.h | 2 +- python/pyqt/examples3/SQL/sqlex.ui.h | 6 +- python/pyqt/pylupdate3/fetchtr.cpp | 46 +- python/pyqt/pylupdate3/main.cpp | 38 +- python/pyqt/pylupdate3/merge.cpp | 6 +- python/pyqt/pylupdate3/metatranslator.cpp | 194 ++-- python/pyqt/pylupdate3/metatranslator.h | 30 +- python/pyqt/pylupdate3/numberh.cpp | 38 +- python/pyqt/pylupdate3/proparser.cpp | 46 +- python/pyqt/pylupdate3/proparser.h | 6 +- python/pyqt/pylupdate3/sametexth.cpp | 12 +- python/pyqt/pyuic2/domtool.cpp | 112 +-- python/pyqt/pyuic2/domtool.h | 20 +- python/pyqt/pyuic2/globaldefs.h | 8 +- python/pyqt/pyuic2/uic.cpp | 520 +++++----- python/pyqt/pyuic2/uic.h | 106 +- python/pyqt/pyuic2/widgetdatabase.cpp | 130 +-- python/pyqt/pyuic2/widgetdatabase.h | 34 +- python/pyqt/pyuic3/domtool.cpp | 166 +-- python/pyqt/pyuic3/domtool.h | 26 +- python/pyqt/pyuic3/embed.cpp | 64 +- python/pyqt/pyuic3/form.cpp | 290 +++--- python/pyqt/pyuic3/globaldefs.h | 24 +- python/pyqt/pyuic3/main.cpp | 52 +- python/pyqt/pyuic3/object.cpp | 270 ++--- python/pyqt/pyuic3/parser.cpp | 26 +- python/pyqt/pyuic3/parser.h | 4 +- python/pyqt/pyuic3/subclassing.cpp | 56 +- python/pyqt/pyuic3/uic.cpp | 474 ++++----- python/pyqt/pyuic3/uic.h | 194 ++-- python/pyqt/pyuic3/widgetdatabase.cpp | 210 ++-- python/pyqt/pyuic3/widgetdatabase.h | 38 +- 33 files changed, 2408 insertions(+), 2408 deletions(-) (limited to 'python/pyqt') diff --git a/python/pyqt/doc/PyQt.html b/python/pyqt/doc/PyQt.html index c2768f33..78c04c2a 100644 --- a/python/pyqt/doc/PyQt.html +++ b/python/pyqt/doc/PyQt.html @@ -340,7 +340,7 @@ CLASS="PROGRAMLISTING" >void DebMainWindowFrm::browsePushButtonClicked() { if self.debugging: - QMessageBox.critical(self, "Event", "browse pushbutton was clicked!") + TQMessageBox.critical(self, "Event", "browse pushbutton was clicked!") }
class DebMainWindowFrm(QMainWindow):
+>class DebMainWindowFrm(TQMainWindow):
     ...stuff...
     def browsePushButtonClicked(self):
         if self.debugging:
-            QMessageBox.critical(self, "Event", "browse pushbutton was clicked!")
Unicode support was added to Qt in v2.0 and to Python in v1.6. In Qt, Unicode support is implemented using the QStringTQString class. It is important to understand that QStringTQStrings, Python string objects and Python Unicode objects are all different but conversions between them are automatic in many cases and easy to achieve manually when needed.

Whenever PyQt expects a QStringTQString as a function argument, a Python string object or a Python Unicode object can be provided instead, and PyQt will do the necessary conversion automatically.

You may also manually convert Python string and Unicode objects to QStringTQStrings by using the QStringTQString constructor as demonstrated in the following code fragment.

qs1 = QString('Converted Python string object')
-qs2 = QString(u'Converted Python Unicode object')
qs1 = TQString('Converted Python string object') +qs2 = TQString(u'Converted Python Unicode object')

In order to convert a QStringTQString to a Python string object use the Python str() to a null QStringTQString and an empty QStringTQString both result in an empty Python string object.

In order to convert a QStringTQString to a Python Unicode object use the Python unicode() to a null QStringTQString and an empty QStringTQString both result in an empty Python Unicode object.

c = new QColor();
-c = new QColor();
c = new TQColor(); +c = new TQColor();
c = QColor()
-c = QColor()
c = TQColor() +c = TQColor()
self.c1 = QColor()
-self.c2 = QColor()
self.c1 = TQColor() +self.c2 = TQColor()QObjectTQObject (and any of its sub-classes) keeps pointers to its children and will automatically call their destructors. In these cases, the corresponding Python object will also keep a reference to the @@ -1527,7 +1527,7 @@ corresponding child objects.

So, in the following Python fragment, the first QLabelTQLabel is not destroyed when the second is assigned to because the parent QWidgetTQWidget still has a reference to it.

p = QWidget()
-l = QLabel('First label',p)
-l = QLabel('Second label',p)
p = TQWidget() +l = TQLabel('First label',p) +l = TQLabel('Second label',p)
tab = QTab()
+>tab = TQTab()
 tab.label = "First Tab"
-tab.r = QRect(10,10,75,30)
class, and the QApplication::translate()TQApplication::translate(), QObject::tr()TQObject::tr() and QObject::trUtf8()TQObject::trUtf8() methods. Usually the and uses the hardcoded class name as the context. On the other hand, QApplication::translate()TQApplication::translate() allows to context to be explicitly stated.

class A(QObject):
+>class A(TQObject):
     def __init__(self):
-        QObject.__init__(self)
+        TQObject.__init__(self)
 
     def hello(self):
         return self.tr("Hello")
@@ -1712,7 +1712,7 @@ CLASS="LITERAL"
 >The PyQt behaviour is unsatisfactory and may be changed in the future.  It is
 recommended that QApplication.translate()TQApplication.translate() be used in
 preference to  that uses
 QApplication.translate()TQApplication.translate().

class A(QObject):
+>class A(TQObject):
     def __init__(self):
-        QObject.__init__(self)
+        TQObject.__init__(self)
 
     def hello(self):
         return qApp.translate("A","Hello")
uses QApplication.translate()TQApplication.translate().

A signal may be either a Qt signal (specified using SIGNAL()TQT_SIGNAL()) or a Python signal (specified using PYSIGNAL()PYQT_SIGNAL()).

A slot can be either a Python callable object, a Qt signal (specified using SIGNAL()TQT_SIGNAL()), a Python signal (specified using PYSIGNAL()PYQT_SIGNAL()), or a Qt slot (specified using SLOT()TQT_SLOT()).

You connect signals to slots (and other signals) as you would from C++. For @@ -1802,14 +1802,14 @@ WIDTH="100%" >

QObject.connect(a,SIGNAL("QtSig()"),pyFunction)
-QObject.connect(a,SIGNAL("QtSig()"),pyClass.pyMethod)
-QObject.connect(a,SIGNAL("QtSig()"),PYSIGNAL("PySig"))
-QObject.connect(a,SIGNAL("QtSig()"),SLOT("QtSlot()"))
-QObject.connect(a,PYSIGNAL("PySig"),pyFunction)
-QObject.connect(a,PYSIGNAL("PySig"),pyClass.pyMethod)
-QObject.connect(a,PYSIGNAL("PySig"),SIGNAL("QtSig()"))
-QObject.connect(a,PYSIGNAL("PySig"),SLOT("QtSlot()"))
TQObject.connect(a,TQT_SIGNAL("QtSig()"),pyFunction) +TQObject.connect(a,TQT_SIGNAL("QtSig()"),pyClass.pyMethod) +TQObject.connect(a,TQT_SIGNAL("QtSig()"),PYQT_SIGNAL("PySig")) +TQObject.connect(a,TQT_SIGNAL("QtSig()"),TQT_SLOT("QtSlot()")) +TQObject.connect(a,PYQT_SIGNAL("PySig"),pyFunction) +TQObject.connect(a,PYQT_SIGNAL("PySig"),pyClass.pyMethod) +TQObject.connect(a,PYQT_SIGNAL("PySig"),TQT_SIGNAL("QtSig()")) +TQObject.connect(a,PYQT_SIGNAL("PySig"),TQT_SLOT("QtSlot()"))
sbar = QScrollBar()
-lcd = QLCDNumber()
+>sbar = TQScrollBar()
+lcd = TQLCDNumber()
 
-QObject.connect(sbar,SIGNAL("valueChanged(int)"),lcd.display)
-QObject.connect(sbar,SIGNAL("valueChanged(int)"),lcd,SLOT("display(int)"))

Any instance of a class that is derived from the QObjectTQObject class can emit a signal using the

a.emit(SIGNAL("clicked()"),())
-a.emit(PYSIGNAL("pySig"),("Hello","World"))
a.emit(TQT_SIGNAL("clicked()"),()) +a.emit(PYQT_SIGNAL("pySig"),("Hello","World"))
QObject::connect()TQObject::connect() is called from Python as QObject.connect()TQObject.connect() or self.connect() if called from a sub-class of QObjectTQObject.

Qt.SolidPattern
-QWidget.TabFocus
-QFrame.TabFocus
QAccelTQAccel

QAccelTQAccel is fully implemented.

QAction (Qt v2.2+)TQAction (Qt v2.2+)

QActionTQAction is fully implemented.

QActionGroup (Qt v2.2+)TQActionGroup (Qt v2.2+)

QActionGroupTQActionGroup is fully implemented.

QApplicationTQApplication
QApplicationTQApplication(int &argc, char **argv);

QApplicationTQApplication(int &argc, char **argv, bool GUIenabled);

QApplicationTQApplication(int &argc, char **argv, Type type);

QBitmapTQBitmap

QBitmapTQBitmap is fully implemented.

QBrushTQBrush

QBrushTQBrush is fully implemented, including the Python QButtonTQButton

QButtonTQButton is fully implemented.

QButtonGroupTQButtonGroup

QButtonGroupTQButtonGroup is fully implemented.

QByteArrayTQByteArray

A Python string can be used whenever a QByteArrayTQByteArray can be used. A QByteArrayTQByteArray can be converted to a Python string using the Python QByteArray &assignTQByteArray &assign(const char *data, uint size);

QByteArray &setRawDataTQByteArray &setRawData(const char *data, uintsize);

QCDEStyle (Qt v2+)TQCDEStyle (Qt v2+)

QCDEStyleTQCDEStyle is fully implemented.

QCheckBoxTQCheckBox

QCheckBoxTQCheckBox is fully implemented.

QColorTQColor

The Python static QRgb getRgba(QRgb initial, bool *ok, QWidget *parent = 0, const char *name = 0);

(QRgb initial, bool *ok, TQWidget *parent = 0, const char *name = 0);

QColorGroupTQColorGroup

QColorGroupTQColorGroup is fully implemented.

QComboBoxTQComboBox

QComboBoxTQComboBox is fully implemented.

QCommonStyle (Qt v2+)TQCommonStyle (Qt v2+)
virtual void tabbarMetrics(const QTabBar *t, int &hframe, int &vframe, int &overlap);

(const TQTabBar *t, int &hframe, int &vframe, int &overlap);

QCString (Qt v2+)TQCString (Qt v2+)

A Python string can be used whenever a QCStringTQCString can be used. A QCStringTQCString can be converted to a Python string using the Python QCString &sprintfTQCString &sprintf(const char *format, ...);

QCursorTQCursor

QCursorTQCursor is fully implemented.

QDataStreamTQDataStream
QDataStream &readBytesTQDataStream &readBytes(const char *&s, uint &l);

This takes no parameters. The QDataStreamTQDataStream result and the data read are returned as a tuple.

QDataStream &readRawBytesTQDataStream &readRawBytes(const char *s, uint l);

parameter. The QDataStreamTQDataStream result and the data read are returned as a tuple.

QDataStream &writeBytesTQDataStream &writeBytes(const char *s, uint len);

QDataStream &writeRawBytesTQDataStream &writeRawBytes(const char *s, uint len);

QDateTQDate

The Python @@ -3026,12 +3026,12 @@ CLASS="SECT2" CLASS="SECT2" >QDateTimeTQDateTime

QDateTimeTQDateTime is fully implemented, including the Python QTimeTQTime

QTimeTQTime is fully implemented, including the Python QDesktopWidget (Qt v3+)TQDesktopWidget (Qt v3+)

QDesktopWidgetTQDesktopWidget is fully implemented.

QDial (Qt v2.2+)TQDial (Qt v2.2+)

QDialTQDial is fully implemented.

QDialogTQDialog
QObject.deleteLater()TQObject.deleteLater() or other techniques.

QDirTQDir

QDirTQDir is fully implemented, including the Python QFileInfoTQFileInfo instances is used instead.

QDockArea (Qt v3+)TQDockArea (Qt v3+)
bool hasDockWindow const(QDockWindow *w, int *index = 0);

(TQDockWindow *w, int *index = 0);

w parameter and returns the index of the -QDockWIndow or -1 if the QDockArea does not contain the QDockWindow.

QDockWindow (Qt v3+)TQDockWindow (Qt v3+)

QDockWindowTQDockWindow is fully implemented.

QColorDrag (Qt v2.1+)TQColorDrag (Qt v2.1+)

QColorDragTQColorDrag is fully implemented.

QDragObjectTQDragObject

QDragObjectTQDragObject is fully implemented.

QImageDragTQImageDrag

QImageDragTQImageDrag is fully implemented.

QStoredDragTQStoredDrag

QStoredDragTQStoredDrag is fully implemented.

QTextDragTQTextDrag

QTextDragTQTextDrag is fully implemented.

QUriDrag (Qt v2+)TQUriDrag (Qt v2+)

QUriDragTQUriDrag is fully implemented.

QDropSiteTQDropSite

QDropSiteTQDropSite is fully implemented.

QErrorMessage (Qt v3+)TQErrorMessage (Qt v3+)

QErrorMessageTQErrorMessage is fully implemented.

QEventTQEvent

QEventTQEvent is fully implemented.

Instances of QEventTQEvents are automatically converted to the correct sub-class.

QChildEventTQChildEvent

QChildEventTQChildEvent is fully implemented.

QCloseEventTQCloseEvent

QCloseEventTQCloseEvent is fully implemented.

QIconDragEvent (Qt v3.3+)TQIconDragEvent (Qt v3.3+)

QIconDragEventTQIconDragEvent is fully implemented.

QContextMenuEvent (Qt v3+)TQContextMenuEvent (Qt v3+)

QContextMenuEventTQContextMenuEvent is fully implemented.

QCustomEventTQCustomEvent

QCustomEventTQCustomEvent is fully implemented. Any Python object can be passed as the event data and its reference count is increased.

QDragEnterEventTQDragEnterEvent

QDragEnterEventTQDragEnterEvent is fully implemented.

QDragLeaveEventTQDragLeaveEvent

QDragLeaveEventTQDragLeaveEvent is fully implemented.

QDragMoveEventTQDragMoveEvent

QDragMoveEventTQDragMoveEvent is fully implemented.

QDropEventTQDropEvent

QDropEventTQDropEvent is fully implemented.

QFocusEventTQFocusEvent

QFocusEventTQFocusEvent is fully implemented.

QHideEventTQHideEvent

QHideEventTQHideEvent is fully implemented.

QIMComposeEvent (Qt v3.1+)TQIMComposeEvent (Qt v3.1+)

QIMComposeEventTQIMComposeEvent is fully implemented.

QIMEvent (Qt v3+)TQIMEvent (Qt v3+)

QIMEventTQIMEvent is fully implemented.

QKeyEventTQKeyEvent

QKeyEventTQKeyEvent is fully implemented.

QMouseEventTQMouseEvent

QMouseEventTQMouseEvent is fully implemented.

QMoveEventTQMoveEvent

QMoveEventTQMoveEvent is fully implemented.

QPaintEventTQPaintEvent

QPaintEventTQPaintEvent is fully implemented.

QResizeEventTQResizeEvent

QResizeEventTQResizeEvent is fully implemented.

QShowEventTQShowEvent

QShowEventTQShowEvent is fully implemented.

QTabletEvent (Qt v3+)TQTabletEvent (Qt v3+)

QTabletEventTQTabletEvent is fully implemented.

QTimerEventTQTimerEvent

QTimerEventTQTimerEvent is fully implemented.

QWheelEvent (Qt v2+)TQWheelEvent (Qt v2+)

QWheelEventTQWheelEvent is fully implemented.

QEventLoop (Qt v3.1+)TQEventLoop (Qt v3.1+)
QFileTQFile
QFileDialogTQFileDialog

QFileDialogTQFileDialog is fully implemented.

QFileIconProviderTQFileIconProvider

QFileIconProviderTQFileIconProvider is fully implemented.

QFilePreviewTQFilePreview

QFilePreviewTQFilePreview is fully implemented. However it cannot be used from Python in the same way as it is used from C++ because PyQt does not support multiple inheritance involving more than one wrapped class. A trick @@ -3962,19 +3962,19 @@ WIDTH="100%" >

class FilePreview(QFilePreview):
+>class FilePreview(TQFilePreview):
     pass
 
-class Preview(QLabel):
+class Preview(TQLabel):
     def __init__(self, parent=None):
-        QLabel.__init__(self, parent)
+        TQLabel.__init__(self, parent)
         self.preview = FilePreview()
         self.preview.previewUrl = self.previewUrl

Note that QFilePreview cannot be instantiated directly because it is abstract. +>Note that TQFilePreview cannot be instantiated directly because it is abstract. Thanks to Hans-Peter Jansen for this trick.

QFileInfoTQFileInfo

QFileInfoTQFileInfo is fully implemented.

QFontTQFont

QFontTQFont is fully implemented, including the Python QFontDatabase (Qt v2.1+)TQFontDatabase (Qt v2.1+)

QFontDatabaseTQFontDatabase is fully implemented.

static QFont getFont(bool *ok, const QFont &def, QWidget *parent = 0, const char *name = 0);

static TQFont getFont(bool *ok, const TQFont &def, TQWidget *parent = 0, const char *name = 0);

parameters and returns a tuple containing the QFontTQFont result and the okstatic QFont getFont(bool *ok, QWidget *parent = 0, const char *name = 0);

static TQFont getFont(bool *ok, TQWidget *parent = 0, const char *name = 0);

parameters and returns a tuple containing the QFontTQFont result and the QFontInfoTQFontInfo

QFontInfoTQFontInfo is fully implemented.

QFontMetricsTQFontMetrics
QRect boundingRect(int x, int y, int w, int h, int flags, const QString &str, int len = -1, int tabstops = 0, int *tabarray = 0);

TQRect boundingRect(int x, int y, int w, int h, int flags, const TQString &str, int len = -1, int tabstops = 0, int *tabarray = 0);

QSize size(int flags, const QString &str, int len = -1, int tabstops = 0, int *tabarray = 0);

TQSize size(int flags, const TQString &str, int len = -1, int tabstops = 0, int *tabarray = 0);

QFrameTQFrame

QFrameTQFrame is fully implemented.

QGrid (Qt v2+)TQGrid (Qt v2+)

QGridTQGrid is fully implemented.

QGridView (Qt v3+)TQGridView (Qt v3+)

QGridViewTQGridView is fully implemented.

QGroupBoxTQGroupBox

QGroupBoxTQGroupBox is fully implemented.

QHBox (Qt v2+)TQHBox (Qt v2+)

QHBoxTQHBox is fully implemented.

QHButtonGroup (Qt v2+)TQHButtonGroup (Qt v2+)

QHButtonGroupTQHButtonGroup is fully implemented.

QHeaderTQHeader

QHeaderTQHeader is fully implemented.

QHGroupBox (Qt v2+)TQHGroupBox (Qt v2+)

QHGroupBoxTQHGroupBox is fully implemented.

QIconSetTQIconSet

QIconSetTQIconSet is fully implemented.

QIconFactory (Qt v3.1+)TQIconFactory (Qt v3.1+)

QIconFactoryTQIconFactory is fully implemented.

QIconView (Qt v2.1+)TQIconView (Qt v2.1+)
QIconViewItem *makeRowLayout(QIconViewItem *begin, int &y);

TQIconViewItem *makeRowLayout(TQIconViewItem *begin, int &y);

QIconViewItem (Qt v2.1+)TQIconViewItem (Qt v2.1+)

QIconViewItemTQIconViewItem is fully implemented.

QIconDrag (Qt v2.1+)TQIconDrag (Qt v2.1+)

QIconDragTQIconDrag is fully implemented.

QIconDragItem (Qt v2.1+)TQIconDragItem (Qt v2.1+)

QIconDragItemTQIconDragItem is fully implemented.

QImageTQImage

The Python QImageTQImage(const char *xpm[]);

QImageTQImage(uchar *data, int w, int h, int depth, QRgb *colorTable, int numColors, Endian bitOrder);

QImage convertDepthWithPaletteTQImage convertDepthWithPalette(int, QRgb *p, int pc, int cf = 0);

QImageIOTQImageIO
QImageTextKeyLangTQImageTextKeyLang

QImageTextKeyLangTQImageTextKeyLang is fully implemented.

static QString getText(const QString &caption, const QString &label, const QString &text = QString::null, bool *ok = 0, QWidget *parent = 0, const char *name = 0);

static TQString getText(const TQString &caption, const TQString &label, const TQString &text = TQString::null, bool *ok = 0, TQWidget *parent = 0, const char *name = 0);

is not passed and the returned value is a tuple of the QStringTQString result and the okstatic QString getText(const QString &caption, const QString &label, QLineEdit::EchoModeecho, const QString &text = QString::null, bool *ok = 0, QWidget *parent = 0, const char *name = 0);

static TQString getText(const TQString &caption, const TQString &label, TQLineEdit::EchoModeecho, const TQString &text = TQString::null, bool *ok = 0, TQWidget *parent = 0, const char *name = 0);

is not passed and the returned value is a tuple of the QStringTQString result and the okstatic QString getText(const QString &caption, const QString &label, QLineEdit::EchoModeecho = QLineEdit::Normal, const QString &text = QString::null, bool *ok = 0, QWidget *parent = 0, const char *name = 0);

static TQString getText(const TQString &caption, const TQString &label, TQLineEdit::EchoModeecho = TQLineEdit::Normal, const TQString &text = TQString::null, bool *ok = 0, TQWidget *parent = 0, const char *name = 0);

is not passed and the returned value is a tuple of the QStringTQString result and the okstatic int getInteger(const QString &caption, const QString &label, int num = 0, int from = -2147483647, int to = 2147483647, int step = 1, bool *ok = 0, QWidget *parent = 0, const char *name = 0);

(const TQString &caption, const TQString &label, int num = 0, int from = -2147483647, int to = 2147483647, int step = 1, bool *ok = 0, TQWidget *parent = 0, const char *name = 0);

static double getDouble(const QString &caption, const QString &label, double num = 0, double from = -2147483647, double to = 2147483647, int step = 1, bool *ok = 0, QWidget *parent = 0, const char *name = 0);

(const TQString &caption, const TQString &label, double num = 0, double from = -2147483647, double to = 2147483647, int step = 1, bool *ok = 0, TQWidget *parent = 0, const char *name = 0);

static QString getItem(const QString &caption, const QString &label, const QStringList &list, int current = 0, bool editable = TRUE, bool *ok = 0, QWidget *parent = 0, const char *name = 0);

static TQString getItem(const TQString &caption, const TQString &label, const TQStringList &list, int current = 0, bool editable = TRUE, bool *ok = 0, TQWidget *parent = 0, const char *name = 0);

is not passed and the returned value is a tuple of the QStringTQString result and the okvoid scrollBarMetrics(const QTabBar *sb, int &sliderMin, int &sliderMax, int &sliderLength, int &buttonDim);

(const TQTabBar *sb, int &sliderMin, int &sliderMax, int &sliderLength, int &buttonDim);

QIODeviceTQIODevice

QIODeviceTQIODevice is fully implemented.

QKeySequence (Qt v3+)TQKeySequence (Qt v3+)

QKeySequenceTQKeySequence is fully implemented including the operators !=, QString()TQString() and int(). A QStringTQString instance or a Python integer may be used whenever a QKeySequenceTQKeySequence can be used.

QLabelTQLabel

QLabelTQLabel is fully implemented.

QLayoutTQLayout

QLayoutTQLayout is fully implemented.

QBoxLayoutTQBoxLayout

QBoxLayoutTQBoxLayout is fully implemented.

QGLayoutIterator (Qt v2+)TQGLayoutIterator (Qt v2+)

QGLayoutIteratorTQGLayoutIterator is fully implemented.

QGridLayoutTQGridLayout
bool findWidget(QWidget *w, int *row, int *col);

(TQWidget *w, int *row, int *col);

QHBoxLayoutTQHBoxLayout

QHBoxLayoutTQHBoxLayout is fully implemented.

QLayoutItem (Qt v2+)TQLayoutItem (Qt v2+)

QLayoutItemTQLayoutItem is fully implemented.

QLayoutIterator (Qt v2+)TQLayoutIterator (Qt v2+)
QLayoutItem *nextTQLayoutItem *next();

This is a wrapper around the QLayoutIteratorTQLayoutIterator QSpacerItem (Qt v2+)TQSpacerItem (Qt v2+)

QSpacerItemTQSpacerItem is fully implemented.

QVBoxLayoutTQVBoxLayout

QVBoxLayoutTQVBoxLayout is fully implemented.

QWidgetItem (Qt v2+)TQWidgetItem (Qt v2+)

QWidgetItemTQWidgetItem is fully implemented.

QLCDNumberTQLCDNumber

QLCDNumberTQLCDNumber is fully implemented.

QLibrary (Qt v3+)TQLibrary (Qt v3+)

QLibraryTQLibrary is fully implemented.

QLineEditTQLineEdit
int characterAt(int xpos, QChar *chr);

(int xpos, TQChar *chr);

QListBoxTQListBox

QListBoxItemTQListBoxItem

QListBoxItemTQListBoxItem is fully implemented.

QListBoxPixmapTQListBoxPixmap

QListBoxPixmapTQListBoxPixmap is fully implemented.

QListBoxTextTQListBoxText

QListBoxTextTQListBoxText is fully implemented.

QListViewTQListView

QListViewTQListView is fully implemented.

Note that to remove a child QListViewItemTQListViewItem you must first call QListViewItemTQListViewItem

QListViewItemTQListViewItem is fully implemented.

Note that to remove a child QListViewItemTQListViewItem you must first call QCheckListItemTQCheckListItem

QCheckListItemTQCheckListItem is fully implemented.

QListViewItemIterator (Qt v2+)TQListViewItemIterator (Qt v2+)

QListViewItemIteratorTQListViewItemIterator is fully implemented.

QLocale (Qt v3.3+)TQLocale (Qt v3.3+)
QMainWindowTQMainWindow
QTextStream &operator<<(QTextStream &, const QMainWindow &);

TQTextStream &operator<<(TQTextStream &, const TQMainWindow &);

QTextStream &operator>>(QTextStream &, QMainWindow &);

TQTextStream &operator>>(TQTextStream &, TQMainWindow &);

bool getLocation(QToolBar *tb, ToolBarDock &dock, int &index, bool &nl, int &extraOffset);

(TQToolBar *tb, ToolBarDock &dock, int &index, bool &nl, int &extraOffset);

QList<QToolBar> toolBarsQList<TQToolBar> toolBars(ToolBarDock dock);

This returns a list of QToolBarTQToolBar instances. (Qt v2.1.0+)

QMemArray<type> (Qt v3+)TQMemArray<type> (Qt v3+)

Types based on the QMemArrayTQMemArray template are automatically converted to and from Python lists of the type.

QMenuBarTQMenuBar

QMenuBarTQMenuBar is fully implemented.

QMenuDataTQMenuData
QMenuItem *findItem(int id, QMenuData **parent);

TQMenuItem *findItem(int id, TQMenuData **parent);

QCustomMenuItem (Qt v2.1+)TQCustomMenuItem (Qt v2.1+)

QCustomMenuItemTQCustomMenuItem is fully implemented.

QMenuItemTQMenuItem

QMenuItemTQMenuItem is an internal Qt class.

QMessageBoxTQMessageBox

QMessageBoxTQMessageBox is fully implemented.

QMetaObjectTQMetaObject
QMetaPropertyTQMetaProperty

QMetaPropertyTQMetaProperty is fully implemented.

QMimeSource (Qt v2+)TQMimeSource (Qt v2+)

QMimeSourceTQMimeSource is fully implemented.

QMimeSourceFactory (Qt v2+)TQMimeSourceFactory (Qt v2+)

QMimeSourceFactoryTQMimeSourceFactory is fully implemented.

QWindowsMime (Qt v3+)TQWindowsMime (Qt v3+)

QWindowsMimeTQWindowsMime is fully implemented.

QMotifPlusStyle (Qt v2.2+)TQMotifPlusStyle (Qt v2.2+)
void scrollBarMetrics(const QScrollBar *sb, int &sliderMin, int &sliderMax, int &sliderLength, int &buttonDim);

(const TQScrollBar *sb, int &sliderMin, int &sliderMax, int &sliderLength, int &buttonDim);

QMotifStyle (Qt v2+)TQMotifStyle (Qt v2+)

void scrollBarMetrics(const QTabBar *sb, int &sliderMin, int &sliderMax, int &sliderLength, int &buttonDim);

(const TQTabBar *sb, int &sliderMin, int &sliderMax, int &sliderLength, int &buttonDim);

void tabbarMetrics(const QTabBar *t, int &hframe, int &vframe, int &overlap);

(const TQTabBar *t, int &hframe, int &vframe, int &overlap);

QMovieTQMovie

QMovie(QDataSource *src, int bufsize = 1024);

TQMovie(TQDataSource *src, int bufsize = 1024);

QMultiLineEditTQMultiLineEdit

QMutex (Qt v2.2+)TQMutex (Qt v2.2+)

QMutexTQMutex is fully implemented.

QMutexLocker (Qt v3.1+)TQMutexLocker (Qt v3.1+)

QMutexLockerTQMutexLocker is fully implemented.

QNetworkOperation (Qt v2.1+)TQNetworkOperation (Qt v2.1+)

QNetworkOperationTQNetworkOperation is fully implemented.

QNetworkProtocol (Qt v2.1+)TQNetworkProtocol (Qt v2.1+)

QNetworkProtocolTQNetworkProtocol is fully implemented.

QNetworkProtocolFactoryBase (Qt v2.1+)TQNetworkProtocolFactoryBase (Qt v2.1+)

QNetworkProtocolFactoryBaseTQNetworkProtocolFactoryBase is fully implemented.

QObjectTQObject
bool disconnect(const QObject *receiver, const char *member = 0);

(const TQObject *receiver, const char *member = 0);

bool disconnect(const char *signal = 0, const QObject *receiver = 0, const char *member = 0);

(const char *signal = 0, const TQObject *receiver = 0, const char *member = 0);

static bool disconnect(const QObject *sender, const char *signal, const QObject *receiver, const char *member);

(const TQObject *sender, const char *signal, const TQObject *receiver, const char *member);

QObjectCleanupHandler (Qt v3+)TQObjectCleanupHandler (Qt v3+)

QObjectCleanupHandlerTQObjectCleanupHandler is fully implemented.

QObjectListTQObjectList

This class isn't implemented. Whenever a QObjectListTQObjectList is the return type of a function or the type of an argument, a Python list of QObjectTQObject instances is used instead.

QPaintDeviceMetricsTQPaintDeviceMetrics

QPaintDeviceMetricsTQPaintDeviceMetrics is fully implemented.

QPaintDeviceTQPaintDevice
virtual bool cmd(int, QPainter *, QPDevCmdParam *);

(int, TQPainter *, QPDevCmdParam *);

QPainterTQPainter

QRect boundingRectTQRect boundingRect(int x, int y, int w, int h, int flags, const char *str, int len = -1, char **intern = 0);

QRect boundingRect(const QRect&, int flags, const char *str, int len = -1, char **intern = 0);

TQRect boundingRect(const TQRect&, int flags, const char *str, int len = -1, char **intern = 0);

void drawText(int x, int y, int w, int h, int flags, const char *str, int len = -1, QRect *br = 0, char **intern = 0);

(int x, int y, int w, int h, int flags, const char *str, int len = -1, TQRect *br = 0, char **intern = 0);

void drawText(const QRect&, int flags, const char *str, int len = -1, QRect *br = 0, char **intern = 0);

(const TQRect&, int flags, const char *str, int len = -1, TQRect *br = 0, char **intern = 0);

QPaletteTQPalette

QPaletteTQPalette is fully implemented, including the Python QPixmapTQPixmap

QPixmapTQPixmap(const char *xpm[]);

QPixmapCache (Qt v3+)TQPixmapCache (Qt v3+)

QPixmapCacheTQPixmapCache is fully implemented.

QPenTQPen

QPenTQPen is fully implemented, including the Python QPictureTQPicture

QPlatinumStyle (Qt v2+)TQPlatinumStyle (Qt v2+)
void scrollBarMetrics(const QTabBar *sb, int &sliderMin, int &sliderMax, int &sliderLength, int &buttonDim);

(const TQTabBar *sb, int &sliderMin, int &sliderMax, int &sliderLength, int &buttonDim);

QPointTQPoint

The Python @@ -6680,7 +6680,7 @@ CLASS="SECT2" CLASS="SECT2" >QPointArrayTQPointArray

QPointArrayTQPointArray(int nPoints, const QCOORD *points);

QPopupMenuTQPopupMenu
int exec(const QPoint &pos, int indexAtPoint = 0);

(const TQPoint &pos, int indexAtPoint = 0);

QPrintDialog (X11)TQPrintDialog (X11)

QPrintDialogTQPrintDialog is fully implemented.

QPrinterTQPrinter

QPrinterTQPrinter is fully implemented.

QProcess (Qt v3+)TQProcess (Qt v3+)

QProcessTQProcess is fully implemented.

QProgressBarTQProgressBar

QProgressBarTQProgressBar is fully implemented.

QProgressDialogTQProgressDialog

QProgressDialogTQProgressDialog is fully implemented. value.

QPtrList<type> (Qt v3+)TQPtrList<type> (Qt v3+)

Types based on the QPtrListTQPtrList template are automatically converted to and from Python lists of the type.

QPushButtonTQPushButton

QPushButtonTQPushButton is fully implemented.

QRadioButtonTQRadioButton

QRadioButtonTQRadioButton is fully implemented.

QRangeControlTQRangeControl

QRangeControlTQRangeControl is fully implemented.

QRectTQRect

The Python @@ -7094,7 +7094,7 @@ CLASS="SECT2" CLASS="SECT2" >QRegExpTQRegExp

The Python int match(const QString &str, int index = 0, int *len = 0);

(const TQString &str, int index = 0, int *len = 0);

QRegionTQRegion

The Python @@ -7232,7 +7232,7 @@ NAME="AEN2719" >QArray<QRect> rectsQArray<TQRect> rects();

void setRects(QRect *rects, int num);

(TQRect *rects, int num);

QScrollBarTQScrollBar

QScrollBarTQScrollBar is fully implemented.

QScrollViewTQScrollView
QSemaphore (Qt v2.2+)TQSemaphore (Qt v2.2+)

QSemaphoreTQSemaphore is fully implemented. The +=QSemiModal (Qt v1, v2)TQSemiModal (Qt v1, v2)

QSemiModalTQSemiModal is fully implemented.

QSettings (Qt v3+)TQSettings (Qt v3+)
bool readBoolEntry(const QString &key, bool def = 0, bool *ok = 0);

(const TQString &key, bool def = 0, bool *ok = 0);

double readDoubleEntry(const QString &key, double def = 0, bool *ok = 0);

(const TQString &key, double def = 0, bool *ok = 0);

QString readEntry(const QString &key, const QString &def = QString::null, bool *ok = 0);

TQString readEntry(const TQString &key, const TQString &def = TQString::null, bool *ok = 0);

is not passed and the returned value is a tuple of the QStringTQString result and the okQStringList readListEntry(const QString &key, bool *ok = 0);

TQStringList readListEntry(const TQString &key, bool *ok = 0);

is not passed and the returned value is a tuple of the QStringListTQStringList result and the okQStringList readListEntry(const QString &key, const QChar &separator, bool *ok = 0);

TQStringList readListEntry(const TQString &key, const TQChar &separator, bool *ok = 0);

is not passed and the returned value is a tuple of the QStringListTQStringList result and the okint readNumEntry(const QString &key, int def = 0, bool *ok = 0);

(const TQString &key, int def = 0, bool *ok = 0);

bool writeEntry(const QString &key, bool value);

(const TQString &key, bool value);

QSGIStyle (Qt v2.2+)TQSGIStyle (Qt v2.2+)

void scrollBarMetrics(const QScrollBar *sb, int &sliderMin, int &sliderMax, int &sliderLength, int &buttonDim);

(const TQScrollBar *sb, int &sliderMin, int &sliderMax, int &sliderLength, int &buttonDim);

QSignalMapperTQSignalMapper

QSignalMapperTQSignalMapper is fully implemented.

QSimpleRichText (Qt v2+)TQSimpleRichText (Qt v2+)

QSimpleRichTextTQSimpleRichText is fully implemented.

QSizeTQSize

The Python @@ -7715,12 +7715,12 @@ CLASS="SECT2" CLASS="SECT2" >QSizeGrip (Qt v2+)TQSizeGrip (Qt v2+)

QSizeGripTQSizeGrip is fully implemented.

QSizePolicy (Qt v2+)TQSizePolicy (Qt v2+)

QSizePolicyTQSizePolicy is fully implemented.

QSliderTQSlider

QSliderTQSlider is fully implemented.

QSocketNotifierTQSocketNotifier

QSocketNotifierTQSocketNotifier is fully implemented.

QSound (Qt v2.2+)TQSound (Qt v2.2+)

QSoundTQSound is fully implemented.

QSpinBoxTQSpinBox
QSplashScreen (Qt v3.2.0+)TQSplashScreen (Qt v3.2.0+)

QSplashScreenTQSplashScreen is fully implemented.

QSplitterTQSplitter
QStatusBarTQStatusBar

QStatusBarTQStatusBar is fully implemented.

QChar (Qt v2+)TQChar (Qt v2+)
QStringTQString

A Python string object (or Unicode object) can be used whenever a QStringTQString can be used. A QStringTQString can be converted to a Python string object using the Python QCharRef atTQCharRef at(uint i);

QChar constref constTQChar constref const(uint i);

QChar &refTQChar &ref(uint i);

QString &setUnicodeCodesTQString &setUnicodeCodes(const ushort *unicode_as_shorts, uint len);

QString &sprintfTQString &sprintf(const char *format, ...);

QStringList (Qt v2+)TQStringList (Qt v2+)

The Python Iterator append(const QString &x);

(const TQString &x);

Iterator prepend(const QString &x);

(const TQString &x);

QStrListTQStrList

This class isn't implemented. Whenever a QStrListTQStrList is the return type of a function or the type of an argument, a Python list of strings is used instead.

QStyle (Qt v2+)TQStyle (Qt v2+)
virtual void scrollBarMetrics(const QScrollBar *b, int &sliderMin, int &sliderMax, int &sliderLength, int &buttonDim);

(const TQScrollBar *b, int &sliderMin, int &sliderMax, int &sliderLength, int &buttonDim);

virtual void tabbarMetrics(const QTabBar *t, int &hframe, int &vframe, int &overlap);

(const TQTabBar *t, int &hframe, int &vframe, int &overlap);

QStyleOption (Qt v3+)TQStyleOption (Qt v3+)

QStyleOptionTQStyleOption is fully implemented.

QStyleSheet (Qt v2+)TQStyleSheet (Qt v2+)

QStyleSheetTQStyleSheet is fully implemented.

QStyleSheetItem (Qt v2+)TQStyleSheetItem (Qt v2+)

QStyleSheetItemTQStyleSheetItem is fully implemented.

QSyntaxHighlighter (Qt v3.1+)TQSyntaxHighlighter (Qt v3.1+)

QSyntaxHighlighterTQSyntaxHighlighter is fully implemented.

QTabTQTab

QTabTQTab is fully implemented.

QTabBarTQTabBar
QList<QTab> tabListQList<TQTab> tabList();

This returns a list of QTabTQTab instances.

QTabDialogTQTabDialog

QTabDialogTQTabDialog is fully implemented.

QTabWidget (Qt v2+)TQTabWidget (Qt v2+)

QTabWidgetTQTabWidget is fully implemented.

QTextBrowser (Qt v2+)TQTextBrowser (Qt v2+)

QTextBrowserTQTextBrowser is fully implemented.

QTextCodec (Qt v2+)TQTextCodec (Qt v2+)
virtual QCString fromUnicode(const QString &uc, int &lenInOut);

virtual TQCString fromUnicode(const TQString &uc, int &lenInOut);

The returned value is a tuple of the QCStringTQCString result and the updated QTextDecoder (Qt v2+)TQTextDecoder (Qt v2+)

QTextDecoderTQTextDecoder is fully implemented.

QTextEncoder (Qt v2+)TQTextEncoder (Qt v2+)
virtual QCString fromUnicode = 0(const QString &uc, int &lenInOut);

virtual TQCString fromUnicode = 0(const TQString &uc, int &lenInOut);

The returned value is a tuple of the QCStringTQCString result and the updated QTextEdit (Qt v3+)TQTextEdit (Qt v3+)

int charAt(const QPoint &pos, int *para = 0);

(const TQPoint &pos, int *para = 0);

virtual bool find(const QString &expr, bool cs, bool wo, bool forward = TRUE, int *para = 0, int *index = 0);

(const TQString &expr, bool cs, bool wo, bool forward = TRUE, int *para = 0, int *index = 0);

QTextStreamTQTextStream

QTextStreamTQTextStream(FILE *fp, int mode);

QTextStream &readRawBytesTQTextStream &readRawBytes(char *buf, uint len);

QTextStream &writeRawBytesTQTextStream &writeRawBytes(const char *buf, uint len);

QTextIStream (Qt v2+)TQTextIStream (Qt v2+)
QTextIStreamTQTextIStream(FILE *fp, int mode);

QTextOStream (Qt v2+)TQTextOStream (Qt v2+)
QTextOStreamTQTextOStream(FILE *fp, int mode);

QTextView (Qt v2+)TQTextView (Qt v2+)

QTextViewTQTextView is fully implemented.

QThread (Qt v2.2+)TQThread (Qt v2.2+)

QThreadTQThread is fully implemented.

QTimerTQTimer

QTimerTQTimer is fully implemented.

QToolBarTQToolBar

QToolBarTQToolBar is fully implemented.

QToolBox (Qt v3.2.0+)TQToolBox (Qt v3.2.0+)

QToolBoxTQToolBox is fully implemented.

QToolButtonTQToolButton

QToolButtonTQToolButton is fully implemented.

QToolTipTQToolTip

QToolTipTQToolTip is fully implemented.

QToolTipGroupTQToolTipGroup

QToolTipGroupTQToolTipGroup is fully implemented.

QUrl (Qt v2.1+)TQUrl (Qt v2.1+)

QUrlTQUrl is fully implemented, including the QString()TQString(), ==QUrlInfo (Qt v2.1+)TQUrlInfo (Qt v2.1+)

QUrlInfoTQUrlInfo is fully implemented.

QUrlOperator (Qt v2.1+)TQUrlOperator (Qt v2.1+)
QValidatorTQValidator
virtual State validate(QString& input, int& pos);

(TQString& input, int& pos);

QDoubleValidatorTQDoubleValidator

State validate(QString& input, int& pos);

(TQString& input, int& pos);

QIntValidatorTQIntValidator

State validate(QString& input, int& pos);

(TQString& input, int& pos);

QRegExpValidator (Qt v3+)TQRegExpValidator (Qt v3+)

virtual State validate(QString& input, int& pos);

(TQString& input, int& pos);

QValueList<type> (Qt v2+)TQValueList<type> (Qt v2+)

Types based on the QValueListTQValueList template are automatically converted to and from Python lists of the type.

QVariant (Qt v2.1+)TQVariant (Qt v2.1+)
QVariantTQVariant(const char *val);

QVariant(const QBitArray &val);

TQVariant(const TQBitArray &val);

QVariant(const QValueList<QVariant> &val);

TQVariant(const TQValueList<TQVariant> &val);

QVariant(const QMap<QString,QVariant> &val);

TQVariant(const TQMap<TQString,TQVariant> &val);

QBitArray &asBitArrayTQBitArray &asBitArray();

QValueList<QVariant> &asListTQValueList<TQVariant> &asList();

QMap<QString,QVariant> &asMapTQMap<TQString,TQVariant> &asMap();

QValueListConstIterator<QVariant>listBegin constTQValueListConstIterator<TQVariant>listBegin const();

QValueListConstIterator<QVariant>listEnd constTQValueListConstIterator<TQVariant>listEnd const();

QMapConstIterator<QString,QVariant>mapBegin constTQMapConstIterator<TQString,TQVariant>mapBegin const();

QMapConstIterator<QString,QVariant>mapEnd constTQMapConstIterator<TQString,TQVariant>mapEnd const();

QMapConstIterator<QString,QVariant>mapFind const(const QString &key);

TQMapConstIterator<TQString,TQVariant>mapFind const(const TQString &key);

QValueListConstIterator<QString>stringListBegin constTQValueListConstIterator<TQString>stringListBegin const();

QValueListConstIterator<QString>stringListEnd constTQValueListConstIterator<TQString>stringListEnd const();

const QBitArray toBitArray constconst TQBitArray toBitArray const();

const QValueList<QVariant>toList constconst TQValueList<TQVariant>toList const();

const QMap<QString,QVariant>toMap constconst TQMap<TQString,TQVariant>toMap const();

QVBox (Qt v2+)TQVBox (Qt v2+)

QVBoxTQVBox is fully implemented.

QVButtonGroup (Qt v2+)TQVButtonGroup (Qt v2+)

QVButtonGroupTQVButtonGroup is fully implemented.

QVGroupBox (Qt v2+)TQVGroupBox (Qt v2+)

QVGroupBoxTQVGroupBox is fully implemented.

QWaitCondition (Qt v2.2+)TQWaitCondition (Qt v2.2+)

QWaitConditionTQWaitCondition is fully implemented.

QWhatsThisTQWhatsThis

QWhatsThisTQWhatsThis is fully implemented.

QWidgetTQWidget
QFocusData *focusDataTQFocusData *focusData();

QWidgetListTQWidgetList

This class isn't implemented. Whenever a QWidgetListTQWidgetList is the return type of a function or the type of an argument, a Python list of instances is used instead.

QWidgetStackTQWidgetStack

QWidgetStackTQWidgetStack is fully implemented.

QWindowsStyle (Qt v2+)TQWindowsStyle (Qt v2+)
void scrollBarMetrics(const QTabBar *sb, int &sliderMin, int &sliderMax, int &sliderLength, int &buttonDim);

(const TQTabBar *sb, int &sliderMin, int &sliderMax, int &sliderLength, int &buttonDim);

void tabbarMetrics(const QTabBar *t, int &hframe, int &vframe, int &overlap);

(const TQTabBar *t, int &hframe, int &vframe, int &overlap);

QWizard (Qt v2+)TQWizard (Qt v2+)

QWizardTQWizard is fully implemented.

QWMatrixTQWMatrix

The Python QWMatrix invert constTQWMatrix invert const(bool *invertible = 0);

This takes no parameters and returns a tuple of the QWMatrixTQWMatrix result and the QWorkspace (Qt v2.1+)TQWorkspace (Qt v2.1+)

QWorkspaceTQWorkspace is fully implemented.

unsigned long registerWeakActiveObject(const QString &guid);

(const TQString &guid);

QAxObject(IUnknown *iface, QObject *parent = 0, const char *name = 0);

(IUnknown *iface, TQObject *parent = 0, const char *name = 0);

QAxWidget(IUnknown *iface, QWidget *parent = 0, const char *name = 0);

(IUnknown *iface, TQWidget *parent = 0, const char *name = 0);

QCanvas (Qt v2.2+)TQCanvas (Qt v2.2+)

QCanvasTQCanvas is fully implemented.

QCanvasEllipse (Qt v2.2+)TQCanvasEllipse (Qt v2.2+)

QCanvasEllipseTQCanvasEllipse is fully implemented.

QCanvasItem (Qt v2.2+)TQCanvasItem (Qt v2.2+)

QCanvasItemTQCanvasItem is fully implemented.

QCanvasItemList (Qt v2.2+)TQCanvasItemList (Qt v2.2+)

This class isn't implemented. Whenever a QCanvasItemListTQCanvasItemList is the return type of a function or the type of an argument, a Python list of QCanvasItemTQCanvasItem instances is used instead.

QCanvasLine (Qt v2.2+)TQCanvasLine (Qt v2.2+)

QCanvasLineTQCanvasLine is fully implemented.

QCanvasPixmap (Qt v2.2+)TQCanvasPixmap (Qt v2.2+)

QCanvasPixmapTQCanvasPixmap is fully implemented.

QCanvasPixmapArray (Qt v2.2+)TQCanvasPixmapArray (Qt v2.2+)
QPixmapArray(QList<QPixmap> pixmaps, QList<QPoint> hotspots);

(QList<TQPixmap> pixmaps, QList<TQPoint> hotspots);

The pixmaps argument is a Python list of QPixmap instances, +> argument is a Python list of TQPixmap instances, and the hotspotsQPixmapArray(QValueList<QPixmap> pixmaps, QPointArray hotspots = QPointArray());

(TQValueList<TQPixmap> pixmaps, TQPointArray hotspots = TQPointArray());

The pixmaps argument is a Python list of QPixmap instances. +> argument is a Python list of TQPixmap instances. (Qt v3+)

QCanvasPolygon (Qt v2.2+)TQCanvasPolygon (Qt v2.2+)

QCanvasPolygonTQCanvasPolygon is fully implemented.

QCanvasPolygonalItem (Qt v2.2+)TQCanvasPolygonalItem (Qt v2.2+)

QCanvasPolygonalItemTQCanvasPolygonalItem is fully implemented.

QCanvasRectangle (Qt v2.2+)TQCanvasRectangle (Qt v2.2+)

QCanvasRectangleTQCanvasRectangle is fully implemented.

QCanvasSpline (Qt v3.0+)TQCanvasSpline (Qt v3.0+)

QCanvasSplineTQCanvasSpline is fully implemented.

QCanvasSprite (Qt v2.2+)TQCanvasSprite (Qt v2.2+)

QCanvasSpriteTQCanvasSprite is fully implemented.

QCanvasText (Qt v2.2+)TQCanvasText (Qt v2.2+)

QCanvasTextTQCanvasText is fully implemented.

QCanvasView (Qt v2.2+)TQCanvasView (Qt v2.2+)

QCanvasViewTQCanvasView is fully implemented.

QGLTQGL

QGLTQGL is fully implemented.

QGLContextTQGLContext

QGLContextTQGLContext is fully implemented.

QGLFormatTQGLFormat

QGLFormatTQGLFormat is fully implemented.

QGLWidgetTQGLWidget

QGLWidgetTQGLWidget is fully implemented.

QGLColormap (Qt v3.0+)TQGLColormap (Qt v3.0+)
QDns (Qt v2.2+)TQDns (Qt v2.2+)

QDnsTQDns is fully implemented.

QFtp (Qt v2.2+)TQFtp (Qt v2.2+)
QHostAddress (Qt v2.2+)TQHostAddress (Qt v2.2+)
QHostAddressTQHostAddress(Q_UINT8 *ip6Addr);

QHostAddressTQHostAddress(const Q_IPV6ADDR &ip6Addr);

QHttp (Qt v3+)TQHttp (Qt v3+)
QHttpHeader (Qt v3.1+)TQHttpHeader (Qt v3.1+)

QHttpHeaderTQHttpHeader is fully implemented.

QHttpRequestHeader (Qt v3.1+)TQHttpRequestHeader (Qt v3.1+)

QHttpRequestHeaderTQHttpRequestHeader is fully implemented.

QHttpResponseHeader (Qt v3.1+)TQHttpResponseHeader (Qt v3.1+)

QHttpResponseHeaderTQHttpResponseHeader is fully implemented.

QLocalFs (Qt v2.1+)TQLocalFs (Qt v2.1+)

QLocalFsTQLocalFs is fully implemented.

QServerSocket (Qt v2.2+)TQServerSocket (Qt v2.2+)

QServerSocketTQServerSocket is fully implemented.

QSocket (Qt v2.2+)TQSocket (Qt v2.2+)
QSocketDevice (Qt v2.2+)TQSocketDevice (Qt v2.2+)
QApplicationTQApplication(int& argc, char **argv, Type type);

virtual QString exec constvirtual TQString exec const();

QString exec constTQString exec const();

QDataBrowser (Qt v3+)TQDataBrowser (Qt v3+)
QDataTable (Qt v3+)TQDataTable (Qt v3+)

QDataTableTQDataTable is fully implemented.

QDataView (Qt v3+)TQDataView (Qt v3+)

QDataViewTQDataView is fully implemented.

QEditorFactory (Qt v3+)TQEditorFactory (Qt v3+)

QEditorFactoryTQEditorFactory is fully implemented.

QSql (Qt v3+)TQSql (Qt v3+)

QSqlTQSql is fully implemented.

QSqlCursor (Qt v3+)TQSqlCursor (Qt v3+)
virtual int del(const QString &filter, bool invalidate = TRUE);

(const TQString &filter, bool invalidate = TRUE);

bool exec(const QString &query);

(const TQString &query);

QSqlDatabase (Qt v3+)TQSqlDatabase (Qt v3+)

QSqlQuery exec(const QString &query = QString::null);

TQSqlQuery exec(const TQString &query = TQString::null);

QSqlDriver (Qt v3+)TQSqlDriver (Qt v3+)

QSqlDriverTQSqlDriver is fully implemented.

QSqlEditorFactory (Qt v3+)TQSqlEditorFactory (Qt v3+)

QSqlEditorFactoryTQSqlEditorFactory is fully implemented.

QSqlError (Qt v3+)TQSqlError (Qt v3+)

QSqlErrorTQSqlError is fully implemented.

QSqlField (Qt v3+)TQSqlField (Qt v3+)

QSqlFieldTQSqlField is fully implemented.

QSqlFieldInfo (Qt v3+)TQSqlFieldInfo (Qt v3+)

QSqlFieldInfoTQSqlFieldInfo is fully implemented.

QSqlForm (Qt v3+)TQSqlForm (Qt v3+)

QSqlFormTQSqlForm is fully implemented.

QSqlIndex (Qt v3+)TQSqlIndex (Qt v3+)

QSqlIndexTQSqlIndex is fully implemented.

QSqlPropertyMap (Qt v3+)TQSqlPropertyMap (Qt v3+)

QSqlPropertyMapTQSqlPropertyMap is fully implemented. However, because PyQt does not allow new properties to be defined, it is not possible to implement custom editor widgets in Python and add them to a property map. This will @@ -12038,7 +12038,7 @@ CLASS="SECT2" CLASS="SECT2" >QSqlQuery (Qt v3+)TQSqlQuery (Qt v3+)

QMap<QString,QVariant> boundValues constTQMap<TQString,TQVariant> boundValues const();

virtual bool exec(const QString &query);

(const TQString &query);

QSqlRecord (Qt v3+)TQSqlRecord (Qt v3+)

QSqlRecordTQSqlRecord is fully implemented.

QSqlRecordInfo (Qt v3+)TQSqlRecordInfo (Qt v3+)

QSqlRecordInfoTQSqlRecordInfo is implemented as a Python list of QSqlFieldInfoTQSqlFieldInfo instances.

QSqlResult (Qt v3+)TQSqlResult (Qt v3+)

QSqlResultTQSqlResult is fully implemented.

QSqlSelectCursor (Qt v3.2.0+)TQSqlSelectCursor (Qt v3.2.0+)
bool exec(const QString &query);

(const TQString &query);

QTable (Qt v2.2+)TQTable (Qt v2.2+)

QTableTQTable is fully implemented.

QTableItem (Qt v2.2+)TQTableItem (Qt v2.2+)

QTableItemTQTableItem is fully implemented.

QCheckTableItem (Qt v3+)TQCheckTableItem (Qt v3+)

QCheckTableItemTQCheckTableItem is fully implemented.

QComboTableItem (Qt v3+)TQComboTableItem (Qt v3+)

QComboTableItemTQComboTableItem is fully implemented.

QTableSelection (Qt v2.2+)TQTableSelection (Qt v2.2+)

QTableSelectionTQTableSelection is fully implemented.

QWidgetFactory (Qt v3+)TQWidgetFactory (Qt v3+)

QWidgetFactoryTQWidgetFactory is fully implemented.

QDomImplementation (Qt v2.2+)TQDomImplementation (Qt v2.2+)

QDomImplementationTQDomImplementation is fully implemented.

QDomNode (Qt v2.2+)TQDomNode (Qt v2.2+)

QDomNodeTQDomNode is fully implemented, including the Python QDomNodeList (Qt v2.2+)TQDomNodeList (Qt v2.2+)

QDomNodeListTQDomNodeList is fully implemented.

QDomDocument (Qt v2.2+)TQDomDocument (Qt v2.2+)
bool setContent(const QCString &buffer, bool namespaceProcessing, QString *errorMsg = 0, int *errorLine = 0, int *errorColumn = 0);

(const TQCString &buffer, bool namespaceProcessing, TQString *errorMsg = 0, int *errorLine = 0, int *errorColumn = 0);

bool setContent(const QByteArray &buffer, bool namespaceProcessing, QString *errorMsg = 0, int *errorLine = 0, int *errorColumn = 0);

(const TQByteArray &buffer, bool namespaceProcessing, TQString *errorMsg = 0, int *errorLine = 0, int *errorColumn = 0);

bool setContent(const QString &text, bool namespaceProcessing, QString *errorMsg = 0, int *errorLine = 0, int *errorColumn = 0);

(const TQString &text, bool namespaceProcessing, TQString *errorMsg = 0, int *errorLine = 0, int *errorColumn = 0);

bool setContent(const QIODevice *dev, bool namespaceProcessing, QString *errorMsg = 0, int *errorLine = 0, int *errorColumn = 0);

(const TQIODevice *dev, bool namespaceProcessing, TQString *errorMsg = 0, int *errorLine = 0, int *errorColumn = 0);

bool setContent(const QCString &buffer, QString *errorMsg = 0, int *errorLine = 0, int *errorColumn = 0);

(const TQCString &buffer, TQString *errorMsg = 0, int *errorLine = 0, int *errorColumn = 0);

bool setContent(const QByteArray &buffer, QString *errorMsg = 0, int *errorLine = 0, int *errorColumn = 0);

(const TQByteArray &buffer, TQString *errorMsg = 0, int *errorLine = 0, int *errorColumn = 0);

bool setContent(const QString &text, QString *errorMsg = 0, int *errorLine = 0, int *errorColumn = 0);

(const TQString &text, TQString *errorMsg = 0, int *errorLine = 0, int *errorColumn = 0);

bool setContent(const QIODevice *dev, QString *errorMsg = 0, int *errorLine = 0, int *errorColumn = 0);

(const TQIODevice *dev, TQString *errorMsg = 0, int *errorLine = 0, int *errorColumn = 0);

bool setContent(QXmlInputSource *source, QXmlReader *reader, QString *errorMsg = 0, int *errorLine = 0, int *errorColumn = 0);

(TQXmlInputSource *source, TQXmlReader *reader, TQString *errorMsg = 0, int *errorLine = 0, int *errorColumn = 0);

QDomDocumentFragment (Qt v2.2+)TQDomDocumentFragment (Qt v2.2+)

QDomDocumentFragmentTQDomDocumentFragment is fully implemented.

QDomDocumentType (Qt v2.2+)TQDomDocumentType (Qt v2.2+)

QDomDocumentTypeTQDomDocumentType is fully implemented.

QDomNamedNodeMap (Qt v2.2+)TQDomNamedNodeMap (Qt v2.2+)

QDomNamedNodeMapTQDomNamedNodeMap is fully implemented.

QDomCharacterData (Qt v2.2+)TQDomCharacterData (Qt v2.2+)

QDomCharacterDataTQDomCharacterData is fully implemented.

QDomAttr (Qt v2.2+)TQDomAttr (Qt v2.2+)

QDomAttrTQDomAttr is fully implemented.

QDomElement (Qt v2.2+)TQDomElement (Qt v2.2+)

QDomElementTQDomElement is fully implemented.

QDomText (Qt v2.2+)TQDomText (Qt v2.2+)

QDomTextTQDomText is fully implemented.

QDomComment (Qt v2.2+)TQDomComment (Qt v2.2+)

QDomCommentTQDomComment is fully implemented.

QDomCDATASection (Qt v2.2+)TQDomCDATASection (Qt v2.2+)

QDomCDATASectionTQDomCDATASection is fully implemented.

QDomNotation (Qt v2.2+)TQDomNotation (Qt v2.2+)

QDomNotationTQDomNotation is fully implemented.

QDomEntity (Qt v2.2+)TQDomEntity (Qt v2.2+)

QDomEntityTQDomEntity is fully implemented.

QDomEntityReference (Qt v2.2+)TQDomEntityReference (Qt v2.2+)

QDomEntityReferenceTQDomEntityReference is fully implemented.

QDomProcessingInstruction (Qt v2.2+)TQDomProcessingInstruction (Qt v2.2+)

QDomProcessingInstructionTQDomProcessingInstruction is fully implemented.

-#include -#include -#include +#include +#include +#include +#include #include #include #include #include #include -/*#include */ +/*#include */ static const char MagicComment[] = "TRANSLATOR "; -static QMap needs_Q_OBJECT; -static QMap lacks_Q_OBJECT; +static TQMap needs_Q_OBJECT; +static TQMap lacks_Q_OBJECT; /* The first part of this source file is the python tokenizer. We skip @@ -62,7 +62,7 @@ enum { Tok_Eof, Tok_class, Tok_return, Tok_tr, The tokenizer maintains the following global variables. The names should be self-explanatory. */ -static QCString yyFileName; +static TQCString yyFileName; static int yyCh; static char yyIdent[128]; static size_t yyIdentLen; @@ -78,7 +78,7 @@ static int yyCurLineNo; static FILE *yyInFile; // the string to read from and current position in the string (otherwise) -static QString yyInStr; +static TQString yyInStr; static int yyInPos; static int buf; @@ -225,7 +225,7 @@ static int getToken() yyCh = getChar(); if ( yyCh == 'x' ) { - QCString hex = "0"; + TQCString hex = "0"; yyCh = getChar(); while ( isxdigit(yyCh) ) { @@ -236,7 +236,7 @@ static int getToken() if ( yyStringLen < sizeof(yyString) - 1 ) yyString[yyStringLen++] = (char) n; } else if ( yyCh >= '0' && yyCh < '8' ) { - QCString oct = ""; + TQCString oct = ""; do { oct += (char) yyCh; @@ -316,7 +316,7 @@ static bool match( int t ) return matches; } -static bool matchString( QCString *s ) +static bool matchString( TQCString *s ) { bool matches = ( yyTok == Tok_String ); *s = ""; @@ -330,10 +330,10 @@ static bool matchString( QCString *s ) static bool matchEncoding( bool *utf8 ) { if ( yyTok == Tok_Ident ) { - if ( strcmp(yyIdent, "QApplication") == 0 ) { + if ( strcmp(yyIdent, "TQApplication") == 0 ) { yyTok = getToken(); } - *utf8 = QString( yyIdent ).endsWith( QString("UTF8") ); + *utf8 = TQString( yyIdent ).endsWith( TQString("UTF8") ); yyTok = getToken(); return TRUE; } else { @@ -344,12 +344,12 @@ static bool matchEncoding( bool *utf8 ) static void parse( MetaTranslator *tor, const char *initialContext, const char *defaultContext ) { - QMap qualifiedContexts; - QCString context; - QCString text; - QCString com; - QCString functionContext = initialContext; - QCString prefix; + TQMap qualifiedContexts; + TQCString context; + TQCString text; + TQCString com; + TQCString functionContext = initialContext; + TQCString prefix; bool utf8 = FALSE; yyTok = getToken(); @@ -380,7 +380,7 @@ static void parse( MetaTranslator *tor, const char *initialContext, if ( qualifiedContexts.contains(context) ) context = qualifiedContexts[context]; tor->insert( MetaTranslatorMessage(context, text, com, - QString::null, utf8) ); + TQString::null, utf8) ); } } break; @@ -400,7 +400,7 @@ static void parse( MetaTranslator *tor, const char *initialContext, matchEncoding(&utf8) && match(Tok_RightParen))) ) tor->insert( MetaTranslatorMessage(context, text, com, - QString::null, utf8) ); + TQString::null, utf8) ); } break; case Tok_Ident: @@ -423,7 +423,7 @@ static void parse( MetaTranslator *tor, const char *initialContext, context = com.left( k ); com.remove( 0, k + 1 ); tor->insert( MetaTranslatorMessage(context, "", com, - QString::null, FALSE) ); + TQString::null, FALSE) ); } } yyTok = getToken(); diff --git a/python/pyqt/pylupdate3/main.cpp b/python/pyqt/pylupdate3/main.cpp index 427fed51..bd3d7612 100644 --- a/python/pyqt/pylupdate3/main.cpp +++ b/python/pyqt/pylupdate3/main.cpp @@ -29,10 +29,10 @@ ** **********************************************************************/ -#include -#include -#include -#include +#include +#include +#include +#include #include #include @@ -47,7 +47,7 @@ extern void fetchtr_py( const char *fileName, MetaTranslator *tor, extern void merge( MetaTranslator *tor, const MetaTranslator *virginTor, bool verbose ); -typedef QValueList TML; +typedef TQValueList TML; static void printUsage() { @@ -85,39 +85,39 @@ int main( int argc, char **argv ) } numProFiles++; - QFile f( argv[i] ); + TQFile f( argv[i] ); if ( !f.open(IO_ReadOnly) ) { qWarning( "pylupdate error: Cannot open project file '%s': %s", argv[i], strerror(errno) ); return 1; } - QTextStream t( &f ); - QString fullText = t.read(); + TQTextStream t( &f ); + TQString fullText = t.read(); f.close(); MetaTranslator fetchedTor; - QString defaultContext = "@default"; - QCString codec; - QStringList translatorFiles; - QStringList::Iterator tf; + TQString defaultContext = "@default"; + TQCString codec; + TQStringList translatorFiles; + TQStringList::Iterator tf; - QMap tagMap = proFileTagMap( fullText ); - QMap::Iterator it; + TQMap tagMap = proFileTagMap( fullText ); + TQMap::Iterator it; for ( it = tagMap.begin(); it != tagMap.end(); ++it ) { - QStringList toks = QStringList::split( QChar(' '), it.data() ); - QStringList::Iterator t; + TQStringList toks = TQStringList::split( TQChar(' '), it.data() ); + TQStringList::Iterator t; for ( t = toks.begin(); t != toks.end(); ++t ) { - if ( it.key() == QString("SOURCES") ) { + if ( it.key() == TQString("SOURCES") ) { fetchtr_py( *t, &fetchedTor, defaultContext, TRUE ); metSomething = TRUE; - } else if ( it.key() == QString("TRANSLATIONS") ) { + } else if ( it.key() == TQString("TRANSLATIONS") ) { translatorFiles.append( *t ); metSomething = TRUE; - } else if ( it.key() == QString("CODEC") ) { + } else if ( it.key() == TQString("CODEC") ) { codec = (*t).latin1(); } } diff --git a/python/pyqt/pylupdate3/merge.cpp b/python/pyqt/pylupdate3/merge.cpp index c569c938..6ae9673d 100644 --- a/python/pyqt/pylupdate3/merge.cpp +++ b/python/pyqt/pylupdate3/merge.cpp @@ -21,7 +21,7 @@ extern void applyNumberHeuristic( MetaTranslator *tor, bool verbose ); // defined in sametexth.cpp extern void applySameTextHeuristic( MetaTranslator *tor, bool verbose ); -typedef QValueList TML; +typedef TQValueList TML; /* Merges two MetaTranslator objects into the first one. The first one is a set @@ -47,7 +47,7 @@ void merge( MetaTranslator *tor, const MetaTranslator *virginTor, bool verbose ) MetaTranslatorMessage m = *it; // skip context comment - if ( !QCString((*it).sourceText()).isEmpty() ) { + if ( !TQCString((*it).sourceText()).isEmpty() ) { if ( !virginTor->contains((*it).context(), (*it).sourceText(), (*it).comment()) ) { newType = MetaTranslatorMessage::Obsolete; @@ -86,7 +86,7 @@ void merge( MetaTranslator *tor, const MetaTranslator *virginTor, bool verbose ) if ( !tor->contains((*it).context(), (*it).sourceText(), (*it).comment()) ) { tor->insert( *it ); - if ( !QCString((*it).sourceText()).isEmpty() ) + if ( !TQCString((*it).sourceText()).isEmpty() ) neww++; } } diff --git a/python/pyqt/pylupdate3/metatranslator.cpp b/python/pyqt/pylupdate3/metatranslator.cpp index c3d06738..24a23f4b 100644 --- a/python/pyqt/pylupdate3/metatranslator.cpp +++ b/python/pyqt/pylupdate3/metatranslator.cpp @@ -14,25 +14,25 @@ ** **********************************************************************/ -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include #include "metatranslator.h" -static bool encodingIsUtf8( const QXmlAttributes& atts ) +static bool encodingIsUtf8( const TQXmlAttributes& atts ) { for ( int i = 0; i < atts.length(); i++ ) { // utf8="true" is a pre-3.0 syntax - if ( atts.qName(i) == QString("utf8") ) { - return ( atts.value(i) == QString("true") ); - } else if ( atts.qName(i) == QString("encoding") ) { - return ( atts.value(i) == QString("UTF-8") ); + if ( atts.qName(i) == TQString("utf8") ) { + return ( atts.value(i) == TQString("true") ); + } else if ( atts.qName(i) == TQString("encoding") ) { + return ( atts.value(i) == TQString("UTF-8") ); } } return FALSE; @@ -46,38 +46,38 @@ public: inMessage( FALSE ), ferrorCount( 0 ), contextIsUtf8( FALSE ), messageIsUtf8( FALSE ) { } - virtual bool startElement( const QString& namespaceURI, - const QString& localName, const QString& qName, - const QXmlAttributes& atts ); - virtual bool endElement( const QString& namespaceURI, - const QString& localName, const QString& qName ); - virtual bool characters( const QString& ch ); - virtual bool fatalError( const QXmlParseException& exception ); + virtual bool startElement( const TQString& namespaceURI, + const TQString& localName, const TQString& qName, + const TQXmlAttributes& atts ); + virtual bool endElement( const TQString& namespaceURI, + const TQString& localName, const TQString& qName ); + virtual bool characters( const TQString& ch ); + virtual bool fatalError( const TQXmlParseException& exception ); private: MetaTranslator *tor; MetaTranslatorMessage::Type type; bool inMessage; - QString context; - QString source; - QString comment; - QString translation; + TQString context; + TQString source; + TQString comment; + TQString translation; - QString accum; + TQString accum; int ferrorCount; bool contextIsUtf8; bool messageIsUtf8; }; -bool TsHandler::startElement( const QString& /* namespaceURI */, - const QString& /* localName */, - const QString& qName, - const QXmlAttributes& atts ) +bool TsHandler::startElement( const TQString& /* namespaceURI */, + const TQString& /* localName */, + const TQString& qName, + const TQXmlAttributes& atts ) { - if ( qName == QString("byte") ) { + if ( qName == TQString("byte") ) { for ( int i = 0; i < atts.length(); i++ ) { - if ( atts.qName(i) == QString("value") ) { - QString value = atts.value( i ); + if ( atts.qName(i) == TQString("value") ) { + TQString value = atts.value( i ); int base = 10; if ( value.startsWith("x") ) { base = 16; @@ -85,29 +85,29 @@ bool TsHandler::startElement( const QString& /* namespaceURI */, } int n = value.toUInt( 0, base ); if ( n != 0 ) - accum += QChar( n ); + accum += TQChar( n ); } } } else { - if ( qName == QString("context") ) { + if ( qName == TQString("context") ) { context.truncate( 0 ); source.truncate( 0 ); comment.truncate( 0 ); translation.truncate( 0 ); contextIsUtf8 = encodingIsUtf8( atts ); - } else if ( qName == QString("message") ) { + } else if ( qName == TQString("message") ) { inMessage = TRUE; type = MetaTranslatorMessage::Finished; source.truncate( 0 ); comment.truncate( 0 ); translation.truncate( 0 ); messageIsUtf8 = encodingIsUtf8( atts ); - } else if ( qName == QString("translation") ) { + } else if ( qName == TQString("translation") ) { for ( int i = 0; i < atts.length(); i++ ) { - if ( atts.qName(i) == QString("type") ) { - if ( atts.value(i) == QString("unfinished") ) + if ( atts.qName(i) == TQString("type") ) { + if ( atts.value(i) == TQString("unfinished") ) type = MetaTranslatorMessage::Unfinished; - else if ( atts.value(i) == QString("obsolete") ) + else if ( atts.value(i) == TQString("obsolete") ) type = MetaTranslatorMessage::Obsolete; else type = MetaTranslatorMessage::Finished; @@ -119,33 +119,33 @@ bool TsHandler::startElement( const QString& /* namespaceURI */, return TRUE; } -bool TsHandler::endElement( const QString& /* namespaceURI */, - const QString& /* localName */, - const QString& qName ) +bool TsHandler::endElement( const TQString& /* namespaceURI */, + const TQString& /* localName */, + const TQString& qName ) { - if ( qName == QString("codec") || qName == QString("defaultcodec") ) { + if ( qName == TQString("codec") || qName == TQString("defaultcodec") ) { // "codec" is a pre-3.0 syntax tor->setCodec( accum ); - } else if ( qName == QString("name") ) { + } else if ( qName == TQString("name") ) { context = accum; - } else if ( qName == QString("source") ) { + } else if ( qName == TQString("source") ) { source = accum; - } else if ( qName == QString("comment") ) { + } else if ( qName == TQString("comment") ) { if ( inMessage ) { comment = accum; } else { if ( contextIsUtf8 ) tor->insert( MetaTranslatorMessage(context.utf8(), "", - accum.utf8(), QString::null, TRUE, + accum.utf8(), TQString::null, TRUE, MetaTranslatorMessage::Unfinished) ); else tor->insert( MetaTranslatorMessage(context.ascii(), "", - accum.ascii(), QString::null, FALSE, + accum.ascii(), TQString::null, FALSE, MetaTranslatorMessage::Unfinished) ); } - } else if ( qName == QString("translation") ) { + } else if ( qName == TQString("translation") ) { translation = accum; - } else if ( qName == QString("message") ) { + } else if ( qName == TQString("message") ) { if ( messageIsUtf8 ) tor->insert( MetaTranslatorMessage(context.utf8(), source.utf8(), comment.utf8(), translation, @@ -159,56 +159,56 @@ bool TsHandler::endElement( const QString& /* namespaceURI */, return TRUE; } -bool TsHandler::characters( const QString& ch ) +bool TsHandler::characters( const TQString& ch ) { - QString t = ch; - t.replace( QRegExp(QChar('\r')), "" ); + TQString t = ch; + t.replace( TQRegExp(TQChar('\r')), "" ); accum += t; return TRUE; } -bool TsHandler::fatalError( const QXmlParseException& exception ) +bool TsHandler::fatalError( const TQXmlParseException& exception ) { if ( ferrorCount++ == 0 ) { - QString msg; + TQString msg; msg.sprintf( "Parse error at line %d, column %d (%s).", exception.lineNumber(), exception.columnNumber(), exception.message().latin1() ); if ( qApp == 0 ) qWarning( "XML error: %s", msg.latin1() ); else - QMessageBox::information( qApp->mainWidget(), - QObject::tr("Qt Linguist"), msg ); + TQMessageBox::information( qApp->mainWidget(), + TQObject::tr("Qt Linguist"), msg ); } return FALSE; } -static QString numericEntity( int ch ) +static TQString numericEntity( int ch ) { - return QString( ch <= 0x20 ? "" : "&#x%1;" ) + return TQString( ch <= 0x20 ? "" : "&#x%1;" ) .arg( ch, 0, 16 ); } -static QString protect( const QCString& str ) +static TQString protect( const TQCString& str ) { - QString result; + TQString result; int len = (int) str.length(); for ( int k = 0; k < len; k++ ) { switch( str[k] ) { case '\"': - result += QString( """ ); + result += TQString( """ ); break; case '&': - result += QString( "&" ); + result += TQString( "&" ); break; case '>': - result += QString( ">" ); + result += TQString( ">" ); break; case '<': - result += QString( "<" ); + result += TQString( "<" ); break; case '\'': - result += QString( "'" ); + result += TQString( "'" ); break; default: if ( (uchar) str[k] < 0x20 && str[k] != '\n' ) @@ -220,19 +220,19 @@ static QString protect( const QCString& str ) return result; } -static QString evilBytes( const QCString& str, bool utf8 ) +static TQString evilBytes( const TQCString& str, bool utf8 ) { if ( utf8 ) { return protect( str ); } else { - QString result; - QCString t = protect( str ).latin1(); + TQString result; + TQCString t = protect( str ).latin1(); int len = (int) t.length(); for ( int k = 0; k < len; k++ ) { if ( (uchar) t[k] >= 0x7f ) result += numericEntity( (uchar) t[k] ); else - result += QChar( t[k] ); + result += TQChar( t[k] ); } return result; } @@ -246,7 +246,7 @@ MetaTranslatorMessage::MetaTranslatorMessage() MetaTranslatorMessage::MetaTranslatorMessage( const char *context, const char *sourceText, const char *comment, - const QString& translation, + const TQString& translation, bool utf8, Type type ) : QTranslatorMessage( context, sourceText, comment, translation ), utfeight( FALSE ), ty( type ) @@ -330,23 +330,23 @@ MetaTranslator& MetaTranslator::operator=( const MetaTranslator& tor ) return *this; } -bool MetaTranslator::load( const QString& filename ) +bool MetaTranslator::load( const TQString& filename ) { mm.clear(); - QFile f( filename ); + TQFile f( filename ); if ( !f.open(IO_ReadOnly) ) return FALSE; - QTextStream t( &f ); - QXmlInputSource in( t ); - QXmlSimpleReader reader; + TQTextStream t( &f ); + TQXmlInputSource in( t ); + TQXmlSimpleReader reader; // don't click on these! reader.setFeature( "http://xml.org/sax/features/namespaces", FALSE ); reader.setFeature( "http://xml.org/sax/features/namespace-prefixes", TRUE ); reader.setFeature( "http://trolltech.com/xml/features/report-whitespace" "-only-CharData", FALSE ); - QXmlDefaultHandler *hand = new TsHandler( this ); + TQXmlDefaultHandler *hand = new TsHandler( this ); reader.setContentHandler( hand ); reader.setErrorHandler( hand ); @@ -360,14 +360,14 @@ bool MetaTranslator::load( const QString& filename ) return ok; } -bool MetaTranslator::save( const QString& filename ) const +bool MetaTranslator::save( const TQString& filename ) const { - QFile f( filename ); + TQFile f( filename ); if ( !f.open(IO_WriteOnly) ) return FALSE; - QTextStream t( &f ); - t.setCodec( QTextCodec::codecForName("ISO-8859-1") ); + TQTextStream t( &f ); + t.setCodec( TQTextCodec::codecForName("ISO-8859-1") ); t << "\n"; if ( codecName != "ISO-8859-1" ) @@ -377,19 +377,19 @@ bool MetaTranslator::save( const QString& filename ) const TMMInv inv; TMMInv::Iterator i; bool contextIsUtf8 = m.key().utf8(); - QCString context = m.key().context(); - QCString comment = ""; + TQCString context = m.key().context(); + TQCString comment = ""; do { - if ( QCString(m.key().sourceText()).isEmpty() ) { + if ( TQCString(m.key().sourceText()).isEmpty() ) { if ( m.key().type() != MetaTranslatorMessage::Obsolete ) { contextIsUtf8 = m.key().utf8(); - comment = QCString( m.key().comment() ); + comment = TQCString( m.key().comment() ); } } else { inv.insert( *m, m.key() ); } - } while ( ++m != mm.end() && QCString(m.key().context()) == context ); + } while ( ++m != mm.end() && TQCString(m.key().context()) == context ); t << "" << evilBytes( (*i).sourceText(), (*i).utf8() ) << "\n"; - if ( !QCString((*i).comment()).isEmpty() ) + if ( !TQCString((*i).comment()).isEmpty() ) t << " " << evilBytes( (*i).comment(), (*i).utf8() ) << "\n"; @@ -429,7 +429,7 @@ bool MetaTranslator::save( const QString& filename ) const return TRUE; } -bool MetaTranslator::release( const QString& filename, bool verbose ) const +bool MetaTranslator::release( const TQString& filename, bool verbose ) const { QTranslator tor( 0 ); int finished = 0; @@ -494,7 +494,7 @@ void MetaTranslator::stripEmptyContexts() TMM::Iterator m = mm.begin(); while ( m != mm.end() ) { - if ( QCString(m.key().sourceText()).isEmpty() ) { + if ( TQCString(m.key().sourceText()).isEmpty() ) { TMM::Iterator n = m; ++n; // the context comment is followed by other messages @@ -514,22 +514,22 @@ void MetaTranslator::setCodec( const char *name ) const int latin1 = 4; codecName = name; - codec = QTextCodec::codecForName( name ); + codec = TQTextCodec::codecForName( name ); if ( codec == 0 || codec->mibEnum() == latin1 ) codec = 0; } -QString MetaTranslator::toUnicode( const char *str, bool utf8 ) const +TQString MetaTranslator::toUnicode( const char *str, bool utf8 ) const { if ( utf8 ) - return QString::fromUtf8( str ); + return TQString::fromUtf8( str ); else if ( codec == 0 ) - return QString( str ); + return TQString( str ); else return codec->toUnicode( str ); } -QValueList MetaTranslator::messages() const +TQValueList MetaTranslator::messages() const { int n = mm.count(); TMM::ConstIterator *t = new TMM::ConstIterator[n + 1]; @@ -537,7 +537,7 @@ QValueList MetaTranslator::messages() const for ( m = mm.begin(); m != mm.end(); ++m ) t[*m] = m; - QValueList val; + TQValueList val; for ( int i = 0; i < n; i++ ) val.append( t[i].key() ); @@ -545,9 +545,9 @@ QValueList MetaTranslator::messages() const return val; } -QValueList MetaTranslator::translatedMessages() const +TQValueList MetaTranslator::translatedMessages() const { - QValueList val; + TQValueList val; TMM::ConstIterator m; for ( m = mm.begin(); m != mm.end(); ++m ) { if ( m.key().type() == MetaTranslatorMessage::Finished ) diff --git a/python/pyqt/pylupdate3/metatranslator.h b/python/pyqt/pylupdate3/metatranslator.h index a071207e..eb2a645d 100644 --- a/python/pyqt/pylupdate3/metatranslator.h +++ b/python/pyqt/pylupdate3/metatranslator.h @@ -17,10 +17,10 @@ #ifndef METATRANSLATOR_H #define METATRANSLATOR_H -#include -#include -#include -#include +#include +#include +#include +#include class QTextCodec; @@ -32,7 +32,7 @@ public: MetaTranslatorMessage(); MetaTranslatorMessage( const char *context, const char *sourceText, const char *comment, - const QString& translation = QString::null, + const TQString& translation = TQString::null, bool utf8 = FALSE, Type type = Unfinished ); MetaTranslatorMessage( const MetaTranslatorMessage& m ); @@ -66,9 +66,9 @@ public: MetaTranslator& operator=( const MetaTranslator& tor ); - bool load( const QString& filename ); - bool save( const QString& filename ) const; - bool release( const QString& filename, bool verbose = FALSE ) const; + bool load( const TQString& filename ); + bool save( const TQString& filename ) const; + bool release( const TQString& filename, bool verbose = FALSE ) const; bool contains( const char *context, const char *sourceText, const char *comment ) const; @@ -78,18 +78,18 @@ public: void stripEmptyContexts(); void setCodec( const char *name ); - QString toUnicode( const char *str, bool utf8 ) const; + TQString toUnicode( const char *str, bool utf8 ) const; - QValueList messages() const; - QValueList translatedMessages() const; + TQValueList messages() const; + TQValueList translatedMessages() const; private: - typedef QMap TMM; - typedef QMap TMMInv; + typedef TQMap TMM; + typedef TQMap TMMInv; TMM mm; - QCString codecName; - QTextCodec *codec; + TQCString codecName; + TQTextCodec *codec; }; #endif diff --git a/python/pyqt/pylupdate3/numberh.cpp b/python/pyqt/pylupdate3/numberh.cpp index 67048031..2280ba27 100644 --- a/python/pyqt/pylupdate3/numberh.cpp +++ b/python/pyqt/pylupdate3/numberh.cpp @@ -14,16 +14,16 @@ ** **********************************************************************/ -#include -#include -#include -#include +#include +#include +#include +#include #include #include -typedef QMap TMM; -typedef QValueList TML; +typedef TQMap TMM; +typedef TQValueList TML; static bool isDigitFriendly( int c ) { @@ -49,9 +49,9 @@ static int numberLength( const char *s ) Returns a version of 'key' where all numbers have been replaced by zeroes. If there were none, returns "". */ -static QCString zeroKey( const char *key ) +static TQCString zeroKey( const char *key ) { - QCString zeroed( strlen(key) + 1 ); + TQCString zeroed( strlen(key) + 1 ); char *z = zeroed.data(); int i = 0, j = 0; int len; @@ -75,17 +75,17 @@ static QCString zeroKey( const char *key ) return ""; } -static QString translationAttempt( const QString& oldTranslation, +static TQString translationAttempt( const TQString& oldTranslation, const char *oldSource, const char *newSource ) { int p = zeroKey( oldSource ).contains( '0' ); int oldSourceLen = qstrlen( oldSource ); - QString attempt; - QStringList oldNumbers; - QStringList newNumbers; - QMemArray met( p ); - QMemArray matchedYet( p ); + TQString attempt; + TQStringList oldNumbers; + TQStringList newNumbers; + TQMemArray met( p ); + TQMemArray matchedYet( p ); int i, j; int k = 0, ell, best; int m, n; @@ -103,8 +103,8 @@ static QString translationAttempt( const QString& oldTranslation, m = numberLength( oldSource + i ); n = numberLength( newSource + j ); if ( m > 0 ) { - oldNumbers.append( QCString(oldSource + i, m + 1) ); - newNumbers.append( QCString(newSource + j, n + 1) ); + oldNumbers.append( TQCString(oldSource + i, m + 1) ); + newNumbers.append( TQCString(newSource + j, n + 1) ); i += m; j += n; met[k] = FALSE; @@ -168,7 +168,7 @@ static QString translationAttempt( const QString& oldTranslation, */ for ( k = 0; k < p; k++ ) { if ( !met[k] ) - attempt += QString( " {" ) + newNumbers[k] + QString( "?}" ); + attempt += TQString( " {" ) + newNumbers[k] + TQString( "?}" ); } /* @@ -180,8 +180,8 @@ static QString translationAttempt( const QString& oldTranslation, for ( ell = 0; ell < p; ell++ ) { if ( k != ell && oldNumbers[k] == oldNumbers[ell] && newNumbers[k] < newNumbers[ell] ) - attempt += QString( " {" ) + newNumbers[k] + QString( " or " ) + - newNumbers[ell] + QString( "?}" ); + attempt += TQString( " {" ) + newNumbers[k] + TQString( " or " ) + + newNumbers[ell] + TQString( "?}" ); } } return attempt; diff --git a/python/pyqt/pylupdate3/proparser.cpp b/python/pyqt/pylupdate3/proparser.cpp index f018b4c3..6010cbeb 100644 --- a/python/pyqt/pylupdate3/proparser.cpp +++ b/python/pyqt/pylupdate3/proparser.cpp @@ -14,58 +14,58 @@ ** **********************************************************************/ -#include -#include +#include +#include #include "proparser.h" -QMap proFileTagMap( const QString& text ) +TQMap proFileTagMap( const TQString& text ) { - QString t = text; + TQString t = text; /* Strip comments, merge lines ending with backslash, add spaces around '=' and '+=', replace '\n' with ';', and simplify white spaces. */ - t.replace( QRegExp(QString("#[^\n]$")), QString(" ") ); - t.replace( QRegExp(QString("\\\\\\s*\n")), QString(" ") ); - t.replace( QRegExp(QString("=")), QString(" = ") ); - t.replace( QRegExp(QString("\\+ =")), QString(" += ") ); - t.replace( QRegExp(QString("\n")), QString(";") ); + t.replace( TQRegExp(TQString("#[^\n]$")), TQString(" ") ); + t.replace( TQRegExp(TQString("\\\\\\s*\n")), TQString(" ") ); + t.replace( TQRegExp(TQString("=")), TQString(" = ") ); + t.replace( TQRegExp(TQString("\\+ =")), TQString(" += ") ); + t.replace( TQRegExp(TQString("\n")), TQString(";") ); t = t.simplifyWhiteSpace(); - QMap tagMap; + TQMap tagMap; - QStringList lines = QStringList::split( QChar(';'), t ); - QStringList::Iterator line; + TQStringList lines = TQStringList::split( TQChar(';'), t ); + TQStringList::Iterator line; for ( line = lines.begin(); line != lines.end(); ++line ) { - QStringList toks = QStringList::split( QChar(' '), *line ); + TQStringList toks = TQStringList::split( TQChar(' '), *line ); if ( toks.count() >= 3 && - (toks[1] == QString("=") || toks[1] == QString("+=")) ) { - QString tag = toks.first(); - int k = tag.findRev( QChar(':') ); // as in 'unix:' + (toks[1] == TQString("=") || toks[1] == TQString("+=")) ) { + TQString tag = toks.first(); + int k = tag.findRev( TQChar(':') ); // as in 'unix:' if ( k != -1 ) tag = tag.mid( k + 1 ); toks.remove( toks.begin() ); - QString action = toks.first(); + TQString action = toks.first(); toks.remove( toks.begin() ); if ( tagMap.contains(tag) ) { - if ( action == QString("=") ) - tagMap.replace( tag, toks.join(QChar(' ')) ); + if ( action == TQString("=") ) + tagMap.replace( tag, toks.join(TQChar(' ')) ); else - tagMap[tag] += QChar( ' ' ) + toks.join( QChar(' ') ); + tagMap[tag] += TQChar( ' ' ) + toks.join( TQChar(' ') ); } else { - tagMap[tag] = toks.join( QChar(' ') ); + tagMap[tag] = toks.join( TQChar(' ') ); } } } - QRegExp var( "\\$\\$[a-zA-Z0-9_]+" ); - QMap::Iterator it; + TQRegExp var( "\\$\\$[a-zA-Z0-9_]+" ); + TQMap::Iterator it; for ( it = tagMap.begin(); it != tagMap.end(); ++it ) { int i = 0; diff --git a/python/pyqt/pylupdate3/proparser.h b/python/pyqt/pylupdate3/proparser.h index 2a66c8ab..7d0df31a 100644 --- a/python/pyqt/pylupdate3/proparser.h +++ b/python/pyqt/pylupdate3/proparser.h @@ -17,9 +17,9 @@ #ifndef PROPARSER_H #define PROPARSER_H -#include -#include +#include +#include -QMap proFileTagMap( const QString& text ); +TQMap proFileTagMap( const TQString& text ); #endif diff --git a/python/pyqt/pylupdate3/sametexth.cpp b/python/pyqt/pylupdate3/sametexth.cpp index 1ee869f2..c007cfc3 100644 --- a/python/pyqt/pylupdate3/sametexth.cpp +++ b/python/pyqt/pylupdate3/sametexth.cpp @@ -14,13 +14,13 @@ ** **********************************************************************/ -#include -#include +#include +#include #include -typedef QMap TMM; -typedef QValueList TML; +typedef TQMap TMM; +typedef TQValueList TML; /* Augments a MetaTranslator with trivially derived translations. @@ -45,7 +45,7 @@ void applySameTextHeuristic( MetaTranslator *tor, bool verbose ) if ( (*it).translation().isEmpty() ) untranslated.append( *it ); } else { - QCString key = (*it).sourceText(); + TQCString key = (*it).sourceText(); t = translated.find( key ); if ( t != translated.end() ) { /* @@ -63,7 +63,7 @@ void applySameTextHeuristic( MetaTranslator *tor, bool verbose ) } for ( u = untranslated.begin(); u != untranslated.end(); ++u ) { - QCString key = (*u).sourceText(); + TQCString key = (*u).sourceText(); t = translated.find( key ); if ( t != translated.end() ) { MetaTranslatorMessage m( *u ); diff --git a/python/pyqt/pyuic2/domtool.cpp b/python/pyqt/pyuic2/domtool.cpp index 2b14ee6c..a1ffac47 100644 --- a/python/pyqt/pyuic2/domtool.cpp +++ b/python/pyqt/pyuic2/domtool.cpp @@ -21,12 +21,12 @@ #include "domtool.h" -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include /*! @@ -46,14 +46,14 @@ \sa hasProperty() */ -QVariant DomTool::readProperty( const QDomElement& e, const QString& name, const QVariant& defValue ) +TQVariant DomTool::readProperty( const TQDomElement& e, const TQString& name, const TQVariant& defValue ) { - QDomElement n; + 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() == "name" ) { - QString prop = n2.firstChild().toText().data(); + TQString prop = n2.firstChild().toText().data(); if ( prop == name ) return elementToVariant( n2.nextSibling().toElement(), defValue ); } @@ -67,14 +67,14 @@ 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" ) { - QDomElement n2 = n.firstChild().toElement(); + TQDomElement n2 = n.firstChild().toElement(); if ( n2.tagName() == "name" ) { - QString prop = n2.firstChild().toText().data(); + TQString prop = n2.firstChild().toText().data(); if ( prop == name ) return TRUE; } @@ -83,20 +83,20 @@ bool DomTool::hasProperty( const QDomElement& e, const QString& name ) return FALSE; } -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" ) @@ -109,9 +109,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" ) @@ -120,9 +120,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" ) @@ -131,12 +131,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() ); @@ -152,43 +152,43 @@ 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" ) { - v = QVariant( e.firstChild().toText().data().toInt() ); + v = TQVariant( e.firstChild().toText().data().toInt() ); } 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() ); 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() ) ); } return v; @@ -198,9 +198,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" ) @@ -212,7 +212,7 @@ QColor DomTool::readColor( const QDomElement &e ) n = n.nextSibling().toElement(); } - return QColor( r, g, b ); + return TQColor( r, g, b ); } /*! @@ -222,14 +222,14 @@ QColor DomTool::readColor( const QDomElement &e ) \sa hasAttribute() */ -QVariant DomTool::readAttribute( const QDomElement& e, const QString& name, const QVariant& defValue ) +TQVariant DomTool::readAttribute( const TQDomElement& e, const TQString& name, const TQVariant& defValue ) { - QDomElement n; + TQDomElement n; for ( n = e.firstChild().toElement(); !n.isNull(); n = n.nextSibling().toElement() ) { if ( n.tagName() == "attribute" ) { - QDomElement n2 = n.firstChild().toElement(); + TQDomElement n2 = n.firstChild().toElement(); if ( n2.tagName() == "name" ) { - QString prop = n2.firstChild().toText().data(); + TQString prop = n2.firstChild().toText().data(); if ( prop == name ) return elementToVariant( n2.nextSibling().toElement(), defValue ); } @@ -243,14 +243,14 @@ 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" ) { - QDomElement n2 = n.firstChild().toElement(); + TQDomElement n2 = n.firstChild().toElement(); if ( n2.tagName() == "name" ) { - QString prop = n2.firstChild().toText().data(); + TQString prop = n2.firstChild().toText().data(); if ( prop == name ) return TRUE; } diff --git a/python/pyqt/pyuic2/domtool.h b/python/pyqt/pyuic2/domtool.h index 7230bce8..9d31897b 100644 --- a/python/pyqt/pyuic2/domtool.h +++ b/python/pyqt/pyuic2/domtool.h @@ -19,21 +19,21 @@ #ifndef DOMTOOL_H #define DOMTOOL_H -#include -#include -#include +#include +#include +#include class DomTool : public Qt { public: - static QVariant readProperty( const QDomElement& e, const QString& name, const QVariant& defValue ); - static bool hasProperty( const QDomElement& e, const QString& name ); - 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 bool hasAttribute( const QDomElement& e, const QString& name ); - static QColor readColor( const QDomElement &e ); + static TQVariant readProperty( const TQDomElement& e, const TQString& name, const TQVariant& defValue ); + static bool hasProperty( const TQDomElement& e, const TQString& name ); + 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 bool hasAttribute( const TQDomElement& e, const TQString& name ); + static TQColor readColor( const TQDomElement &e ); }; diff --git a/python/pyqt/pyuic2/globaldefs.h b/python/pyqt/pyuic2/globaldefs.h index 700f7d20..e436e5a6 100644 --- a/python/pyqt/pyuic2/globaldefs.h +++ b/python/pyqt/pyuic2/globaldefs.h @@ -21,13 +21,13 @@ #ifndef GLOBALDEFS_H #define GLOBALDEFS_H -#include +#include #define BOXLAYOUT_DEFAULT_MARGIN 11 #define BOXLAYOUT_DEFAULT_SPACING 6 -static QColor backColor1( 226, 244, 216 ); -static QColor backColor2( 235, 235, 235 ); -static QColor selectedBack( 192, 192, 192 ); +static TQColor backColor1( 226, 244, 216 ); +static TQColor backColor2( 235, 235, 235 ); +static TQColor selectedBack( 192, 192, 192 ); #endif diff --git a/python/pyqt/pyuic2/uic.cpp b/python/pyqt/pyuic2/uic.cpp index 19fb0794..93c67f6b 100644 --- a/python/pyqt/pyuic2/uic.cpp +++ b/python/pyqt/pyuic2/uic.cpp @@ -18,31 +18,31 @@ **********************************************************************/ #include "uic.h" -#include -#include -#include +#include +#include +#include #include #include -#include -#include -#include +#include +#include +#include #include #include #include -#include +#include #include -static QString mkBool( bool b ) +static TQString mkBool( bool b ) { return b? "1" : "0"; } -static QString mkBool( const QString& s ) +static TQString mkBool( const TQString& s ) { return mkBool( s == "true" || s == "1" ); } -static bool toBool( const QString& s ) +static bool toBool( const TQString& s ) { return s == "true" || s.toInt() != 0; } @@ -50,13 +50,13 @@ static bool toBool( const QString& s ) // fixString is only used in conjunction with tr(). We need to write out the // string in utf8 and make sure it's converted from utf8 when created. -static QString fixString( const QString &str ) +static TQString fixString( const TQString &str ) { - QString s( str ); - s.replace( QRegExp( "\\\\" ), "\\\\" ); - s.replace( QRegExp( "\"" ), "\\\"" ); - s.replace( QRegExp( "\n" ), "\\n\"\n\"" ); - s.replace( QRegExp( "\r" ), "\\r" ); + TQString s( str ); + s.replace( TQRegExp( "\\\\" ), "\\\\" ); + s.replace( TQRegExp( "\"" ), "\\\"" ); + s.replace( TQRegExp( "\n" ), "\\n\"\n\"" ); + s.replace( TQRegExp( "\r" ), "\\r" ); bool onlyAscii = TRUE; unsigned int i; @@ -69,13 +69,13 @@ static QString fixString( const QString &str ) if ( onlyAscii ) s = "\"" + s + "\""; else - s = "QString.fromUtf8(\"" + s + "\")"; + s = "TQString.fromUtf8(\"" + s + "\")"; return s; } -static QString mkStdSet( const QString& prop ) +static TQString mkStdSet( const TQString& prop ) { - return QString( "set" ) + prop[0].upper() + prop.mid(1); + return TQString( "set" ) + prop[0].upper() + prop.mid(1); } @@ -86,9 +86,9 @@ static QString mkStdSet( const QString& prop ) The class Uic encapsulates the user interface compiler (uic). */ -static QString className; +static TQString className; -Uic::Uic( QTextStream &outStream, QDomDocument doc, const QString &trm ) +Uic::Uic( TQTextStream &outStream, TQDomDocument doc, const TQString &trm ) : out( outStream ), trmacro( trm ) { item_used = cg_used = pal_used = 0; @@ -101,7 +101,7 @@ Uic::Uic( QTextStream &outStream, QDomDocument doc, const QString &trm ) nameOfClass = getClassName( doc.firstChild().toElement() ); - QDomElement firstWidget = doc.firstChild().firstChild().toElement(); + TQDomElement firstWidget = doc.firstChild().firstChild().toElement(); while ( firstWidget.tagName() != "widget" ) firstWidget = firstWidget.nextSibling().toElement(); @@ -117,13 +117,13 @@ Uic::Uic( QTextStream &outStream, QDomDocument doc, const QString &trm ) /*! Extracts a class name from \a e */ -QString Uic::getClassName( const QDomElement& e ) +TQString Uic::getClassName( 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] = '_'; @@ -138,35 +138,35 @@ QString Uic::getClassName( 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; + 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() == "name" && n2.firstChild().toText().data() == "name" ) { return n2.nextSibling().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). */ -QString Uic::getLayoutName( const QDomElement& e ) +TQString Uic::getLayoutName( const TQDomElement& e ) { - QDomElement p = e.parentNode().toElement(); - QString tail = QString::null; + TQDomElement p = e.parentNode().toElement(); + TQString tail = TQString::null; if (getClassName(p) != "QLayoutWidget") tail = "Layout"; - QDomElement n; + TQDomElement n; for ( n = p.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() == "name" && n2.firstChild().toText().data() == "name" ) { return n2.nextSibling().toElement().firstChild().toText().data() + tail; } @@ -175,7 +175,7 @@ QString Uic::getLayoutName( const QDomElement& e ) return e.tagName(); } -QByteArray unzipXPM( QString data, ulong& length ) +TQByteArray unzipXPM( TQString data, ulong& length ) { char *ba = new char[ data.length() / 2 ]; for ( int i = 0; i < (int)data.length() / 2; ++i ) { @@ -195,7 +195,7 @@ QByteArray unzipXPM( QString data, ulong& length ) } if ( length < data.length() * 5 ) length = data.length() * 5; - QByteArray baunzip( length ); + TQByteArray baunzip( length ); ::uncompress( (uchar*) baunzip.data(), &length, (uchar*) ba, data.length()/2 ); return baunzip; } @@ -206,16 +206,16 @@ QByteArray unzipXPM( QString data, ulong& length ) \sa createFormDecl(), createObjectImpl() */ -void Uic::createFormImpl( const QDomElement &e ) +void Uic::createFormImpl( const TQDomElement &e ) { - QStringList::Iterator it; - QDomElement n; - QDomNodeList nl; + TQStringList::Iterator it; + 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 ); // Handle custom widgets. for (n = e; !n.isNull(); n = n.nextSibling().toElement()) @@ -223,14 +223,14 @@ void Uic::createFormImpl( const QDomElement &e ) if (n.tagName() != "customwidgets") continue; - QDomElement n2 = n.firstChild().toElement(); + TQDomElement n2 = n.firstChild().toElement(); while (!n2.isNull()) { if (n2.tagName() == "customwidget") { - QDomElement n3 = n2.firstChild().toElement(); - QString cname, header; + TQDomElement n3 = n2.firstChild().toElement(); + TQString cname, header; while (!n3.isNull()) { @@ -261,27 +261,27 @@ void Uic::createFormImpl( const QDomElement &e ) } // find out what images are required - QStringList requiredImages; + TQStringList requiredImages; nl = e.elementsByTagName( "pixmap" ); for ( int j = 0; j < (int) nl.length(); j++ ) { requiredImages += nl.item(j).firstChild().toText().data(); } - QStringList images; - QStringList xpmImages; + TQStringList images; + TQStringList xpmImages; if ( pixmapLoaderFunction.isEmpty() ) { // create images for ( n = e; !n.isNull(); n = n.nextSibling().toElement() ) { if ( n.tagName() == "images" ) { nl = n.elementsByTagName( "image" ); for ( i = 0; i < (int) nl.length(); i++ ) { - QDomElement tmp = nl.item(i).firstChild().toElement(); - QString img = registerObject( tmp.firstChild().toText().data() ); + TQDomElement tmp = nl.item(i).firstChild().toElement(); + TQString img = registerObject( tmp.firstChild().toText().data() ); if ( !requiredImages.contains( img ) ) continue; tmp = tmp.nextSibling().toElement(); - 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 << endl; out << endl; @@ -289,7 +289,7 @@ void Uic::createFormImpl( const QDomElement &e ) if ( format == "XPM.GZ" ) { xpmImages += img; ulong length = tmp.attribute("length").toULong(); - QByteArray baunzip = unzipXPM( data, length ); + TQByteArray baunzip = unzipXPM( data, length ); int a = 0; out << indent << img << "_data = [" << endl; while ( baunzip[a] != '\"' ) @@ -316,11 +316,11 @@ void Uic::createFormImpl( const QDomElement &e ) out << indent << "'"; int a ; for ( a = 0; a < (int) (data.length()/2)-1; a++ ) { - out << "\\x" << QString(data[2*a]) << QString(data[2*a+1]); + out << "\\x" << TQString(data[2*a]) << TQString(data[2*a+1]); if ( a % 12 == 11 ) out << "' \\" << endl << indent << "'"; } - out << "\\x" << QString(data[2*a]) << QString(data[2*a+1]) << "'" << endl; + out << "\\x" << TQString(data[2*a]) << TQString(data[2*a+1]) << "'" << endl; popIndent(); } } @@ -339,11 +339,11 @@ void Uic::createFormImpl( const QDomElement &e ) out << indent << "class " << nameOfClass << "(" << objClass << "):" << endl; pushIndent(); - if ( objClass == "QDialog" || objClass == "QWizard" ) { + if ( objClass == "TQDialog" || objClass == "TQWizard" ) { out << indent << "def __init__(self,parent = None,name = None,modal = 0,fl = 0):" << endl; pushIndent(); out << indent << objClass << ".__init__(self,parent,name,modal,fl)" << endl; - } else if ( objClass == "QWidget" ) { // standard QWidget + } else if ( objClass == "TQWidget" ) { // standard QWidget out << indent << "def __init__(self,parent = None,name = None,fl = 0):" << endl; pushIndent(); out << indent << objClass << ".__init__(self,parent,name,fl)" << endl; @@ -357,9 +357,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) << " = QPixmap()" << endl; + out << indent << (*it) << " = TQPixmap()" << endl; out << indent << (*it) << ".loadFromData(" << (*it) << "_data,'PNG')" << endl; } @@ -368,7 +368,7 @@ 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) << " = QPixmap(" << (*it) << "_data)" << endl; + out << indent << (*it) << " = TQPixmap(" << (*it) << "_data)" << endl; } out << endl; @@ -379,11 +379,11 @@ void Uic::createFormImpl( const QDomElement &e ) for ( n = e.firstChild().toElement(); !n.isNull(); n = n.nextSibling().toElement() ) { if ( n.tagName() == "property" ) { bool stdset = toBool( n.attribute( "stdset" ) ); - QDomElement n2 = n.firstChild().toElement(); + TQDomElement n2 = n.firstChild().toElement(); if ( n2.tagName() == "name" ) { - QString prop = n2.firstChild().toText().data(); - QString value = setObjectProperty( objClass, QString::null, prop, n2.nextSibling().toElement(), stdset ); + TQString prop = n2.firstChild().toText().data(); + TQString value = setObjectProperty( objClass, TQString::null, prop, n2.nextSibling().toElement(), stdset ); if ( value.isEmpty() ) continue; @@ -396,7 +396,7 @@ void Uic::createFormImpl( const QDomElement &e ) out << indent; if ( prop == "geometry" && n2.nextSibling().toElement().tagName() == "rect") { - QDomElement n3 = n2.nextSibling().toElement().firstChild().toElement(); + TQDomElement n3 = n2.nextSibling().toElement().firstChild().toElement(); int w = 0, h = 0; while ( !n3.isNull() ) { @@ -412,7 +412,7 @@ void Uic::createFormImpl( const QDomElement &e ) if ( stdset ) out << "self." << mkStdSet(prop) << "(" << value << ")" << endl; else - out << "self.setProperty('" << prop << "',QVariant(" << value << "))" << endl; + out << "self.setProperty('" << prop << "',TQVariant(" << value << "))" << endl; } if (prop == "name") { @@ -426,13 +426,13 @@ void Uic::createFormImpl( const QDomElement &e ) // create all children, some forms have special requirements - if ( objClass == "QWizard" ) { + if ( objClass == "TQWizard" ) { for ( n = e.firstChild().toElement(); !n.isNull(); n = n.nextSibling().toElement() ) { if ( tags.contains( n.tagName() ) ) { - QString page = createObjectImpl( n, objClass, "self" ); - QString label = DomTool::readAttribute( n, "title", "" ).toString(); + TQString page = createObjectImpl( n, objClass, "self" ); + TQString label = DomTool::readAttribute( n, "title", "" ).toString(); out << indent << "self.addPage(" << page << ","<< trmacro << "(" << fixString( label ) << "))" << endl; - QVariant def( FALSE, 0 ); + TQVariant def( FALSE, 0 ); if ( DomTool::hasAttribute( n, "backEnabled" ) ) out << indent << "self.setBackEnabled(" << page << "," << mkBool( DomTool::readAttribute( n, "backEnabled", def).toBool() ) << ")" << endl; if ( DomTool::hasAttribute( n, "nextEnabled" ) ) @@ -454,11 +454,11 @@ void Uic::createFormImpl( const QDomElement &e ) // Get the list of any user defined slots. - QStringList userSlots; + TQStringList userSlots; for ( n = e; !n.isNull(); n = n.nextSibling().toElement() ) { if ( n.tagName() == "connections" ) { - for ( QDomElement n2 = n.firstChild().toElement(); !n2.isNull(); n2 = n2.nextSibling().toElement() ) { + for ( TQDomElement n2 = n.firstChild().toElement(); !n2.isNull(); n2 = n2.nextSibling().toElement() ) { if ( n2.tagName() == "slot" ) { userSlots += n2.firstChild().toText().data(); } @@ -472,8 +472,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" ) @@ -499,20 +499,20 @@ void Uic::createFormImpl( const QDomElement &e ) else receiver = "self." + receiver; - // Note that we never use the SLOT() macro in case we have + // Note that we never use the TQT_SLOT() macro in case we have // custom widgets implemented in Python. out << indent << "self.connect(" << sender - << ",SIGNAL('" << signal << "'),self." + << ",TQT_SIGNAL('" << signal << "'),self." << slot.left(slot.find('(')) << ")" << 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 << "self.setTabOrder(self." << lastName << ",self." << name << ")" << endl; @@ -526,7 +526,7 @@ void Uic::createFormImpl( const QDomElement &e ) // buddies bool firstBuddy = TRUE; - for ( QValueList::Iterator buddy = buddies.begin(); buddy != buddies.end(); ++buddy ) { + for ( TQValueList::Iterator buddy = buddies.begin(); buddy != buddies.end(); ++buddy ) { if ( isObjectRegistered( (*buddy).buddy ) ) { if ( firstBuddy ) { out << endl; @@ -555,7 +555,7 @@ void Uic::createFormImpl( const QDomElement &e ) pushIndent(); out << indent << "ret = " << objClass << ".event(self,ev)" << endl; out << endl; - out << indent << "if ev.type() == QEvent.ApplicationFontChange:" << endl; + out << indent << "if ev.type() == TQEvent.ApplicationFontChange:" << endl; pushIndent(); for ( i = 0; i < (int) nl.length(); i++ ) { @@ -583,7 +583,7 @@ void Uic::createFormImpl( const QDomElement &e ) // to remove the types - too complicated for the moment, so we just // count them and give them names based on their position. - QString args = (*it).mid(astart + 1,(*it).find(')') - astart - 1).stripWhiteSpace(); + TQString args = (*it).mid(astart + 1,(*it).find(')') - astart - 1).stripWhiteSpace(); if (!args.isEmpty()) { int nrargs = args.contains(',') + 1; @@ -611,11 +611,11 @@ void Uic::createFormImpl( const QDomElement &e ) \sa createObjectDecl() */ -QString Uic::createObjectImpl( const QDomElement &e, const QString& parentClass, const QString& parent, const QString& layout ) +TQString Uic::createObjectImpl( const TQDomElement &e, const TQString& parentClass, const TQString& parent, const TQString& layout ) { - QDomElement n; - QString objClass, objName, fullObjName; + TQDomElement n; + TQString objClass, objName, fullObjName; if ( layouts.contains( e.tagName() ) ) return createLayoutImpl( e, parentClass, parent, layout ); @@ -625,7 +625,7 @@ QString Uic::createObjectImpl( const QDomElement &e, const QString& parentClass, return objName; objName = getObjectName( e ); - QString definedName = objName; + TQString definedName = objName; bool isTmpObject = objName.isEmpty() || objClass == "QLayoutWidget"; if ( isTmpObject ) { if ( objClass[0] == 'Q' ) @@ -636,17 +636,17 @@ QString Uic::createObjectImpl( const QDomElement &e, const QString& parentClass, bool isLine = objClass == "Line"; if ( isLine ) - objClass = "QFrame"; + objClass = "TQFrame"; out << endl; if ( objClass == "QLayoutWidget" ) { if ( layout.isEmpty() ) { // register the object and unify its name objName = registerObject( objName ); - out << indent << objName << " = QWidget(" << parent << ",'" << definedName << "')" << endl; + out << indent << objName << " = TQWidget(" << parent << ",'" << definedName << "')" << 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 ); @@ -671,11 +671,11 @@ QString Uic::createObjectImpl( const QDomElement &e, const QString& parentClass, for ( n = e.firstChild().toElement(); !n.isNull(); n = n.nextSibling().toElement() ) { if ( n.tagName() == "property" ) { bool stdset = toBool( n.attribute( "stdset" ) ); - QDomElement n2 = n.firstChild().toElement(); + TQDomElement n2 = n.firstChild().toElement(); if ( n2.tagName() == "name" ) { - QString prop = n2.firstChild().toText().data(); - QString value = setObjectProperty( objClass, objName, prop, n2.nextSibling().toElement(), stdset ); + TQString prop = n2.firstChild().toText().data(); + TQString value = setObjectProperty( objClass, objName, prop, n2.nextSibling().toElement(), stdset ); if ( value.isEmpty() ) continue; @@ -688,12 +688,12 @@ QString Uic::createObjectImpl( const QDomElement &e, const QString& parentClass, if ( isLine && prop == "orientation" ) { prop = "frameStyle"; if ( value.right(10) == "Horizontal" ) - value = "QFrame.HLine | QFrame.Sunken"; + value = "TQFrame.HLine | TQFrame.Sunken"; else - value = "QFrame.VLine | QFrame.Sunken"; + value = "TQFrame.VLine | TQFrame.Sunken"; } if ( prop == "buttonGroupId" ) { - if ( parentClass == "QButtonGroup" ) + if ( parentClass == "TQButtonGroup" ) out << indent << parent << ".insert(" << fullObjName << "," << value << ")" << endl; continue; } @@ -703,31 +703,31 @@ QString Uic::createObjectImpl( const QDomElement &e, const QString& parentClass, if ( stdset ) out << indent << fullObjName << "." << mkStdSet(prop) << "(" << value << ")" << endl; else - out << indent << fullObjName << ".setProperty('" << prop << "',QVariant(" << value << "))" << endl; + out << indent << fullObjName << ".setProperty('" << prop << "',TQVariant(" << value << "))" << endl; } } } else if ( n.tagName() == "item" ) { if ( objClass.mid(1) == "ListBox" ) { - QString s = createListBoxItemImpl( n, fullObjName ); + TQString s = createListBoxItemImpl( n, fullObjName ); if ( !s.isEmpty() ) out << indent << s << endl; } else if ( objClass.mid(1) == "ComboBox" ) { - QString s = createListBoxItemImpl( n, fullObjName ); + TQString s = createListBoxItemImpl( n, fullObjName ); if ( !s.isEmpty() ) out << indent << s << endl; } else if ( objClass.mid(1) == "IconView" ) { - QString s = createIconViewItemImpl( n, fullObjName ); + TQString s = createIconViewItemImpl( n, fullObjName ); if ( !s.isEmpty() ) out << indent << s << endl; } else if ( objClass.mid(1) == "ListView" ) { - QString s = createListViewItemImpl( n, fullObjName, QString::null ); + TQString s = createListViewItemImpl( n, fullObjName, TQString::null ); if ( !s.isEmpty() ) out << s << endl; } } else if ( n.tagName() == "column" ) { if ( objClass.mid(1) == "ListView" ) { - QString s = createListViewColumnImpl( n, fullObjName ); + TQString s = createListViewColumnImpl( n, fullObjName ); if ( !s.isEmpty() ) out << s; } @@ -736,11 +736,11 @@ QString Uic::createObjectImpl( const QDomElement &e, const QString& parentClass, // create all children, some widgets have special requirements - if ( objClass == "QTabWidget" ) { + if ( objClass == "TQTabWidget" ) { for ( n = e.firstChild().toElement(); !n.isNull(); n = n.nextSibling().toElement() ) { if ( tags.contains( n.tagName() ) ) { - QString page = createObjectImpl( n, objClass, fullObjName ); - QString label = DomTool::readAttribute( n, "title", "" ).toString(); + TQString page = createObjectImpl( n, objClass, fullObjName ); + TQString label = DomTool::readAttribute( n, "title", "" ).toString(); out << indent << fullObjName << ".insertTab(" << page << "," << trmacro << "(" << fixString( label ) << "))" << endl; } } @@ -758,17 +758,17 @@ QString Uic::createObjectImpl( const QDomElement &e, const QString& parentClass, Creates implementation of an listbox item tag. */ -QString Uic::createListBoxItemImpl( const QDomElement &e, const QString &parent ) +TQString Uic::createListBoxItemImpl( const TQDomElement &e, const TQString &parent ) { - QDomElement n = e.firstChild().toElement(); - QString txt; - QString pix; + TQDomElement n = e.firstChild().toElement(); + TQString txt; + TQString pix; while ( !n.isNull() ) { if ( n.tagName() == "property" ) { - QDomElement n2 = n.firstChild().toElement(); + TQDomElement n2 = n.firstChild().toElement(); if ( n2.tagName() == "name" ) { - QString attrib = n2.firstChild().toText().data(); - QVariant v = DomTool::elementToVariant( n2.nextSibling().toElement(), QVariant() ); + TQString attrib = n2.firstChild().toText().data(); + TQVariant v = DomTool::elementToVariant( n2.nextSibling().toElement(), TQVariant() ); if ( attrib == "text" ) txt = v.toString(); else if ( attrib == "pixmap" ) { @@ -792,17 +792,17 @@ 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 pix; + TQDomElement n = e.firstChild().toElement(); + TQString txt; + TQString pix; while ( !n.isNull() ) { if ( n.tagName() == "property" ) { - QDomElement n2 = n.firstChild().toElement(); + TQDomElement n2 = n.firstChild().toElement(); if ( n2.tagName() == "name" ) { - QString attrib = n2.firstChild().toText().data(); - QVariant v = DomTool::elementToVariant( n2.nextSibling().toElement(), QVariant() ); + TQString attrib = n2.firstChild().toText().data(); + TQVariant v = DomTool::elementToVariant( n2.nextSibling().toElement(), TQVariant() ); if ( attrib == "text" ) txt = v.toString(); else if ( attrib == "pixmap" ) { @@ -818,8 +818,8 @@ QString Uic::createIconViewItemImpl( const QDomElement &e, const QString &parent } if ( pix.isEmpty() ) - return "QIconViewItem(" + parent + "," + trmacro + "(" + fixString( txt ) + "))"; - return "QIconViewItem(" + parent + "," + trmacro + "(" + fixString( txt ) + ")," + pix + ")"; + return "TQIconViewItem(" + parent + "," + trmacro + "(" + fixString( txt ) + "))"; + return "TQIconViewItem(" + parent + "," + trmacro + "(" + fixString( txt ) + ")," + pix + ")"; } @@ -827,15 +827,15 @@ QString Uic::createIconViewItemImpl( const QDomElement &e, const QString &parent 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" ); @@ -850,22 +850,22 @@ QString Uic::createListViewItemImpl( const QDomElement &e, const QString &parent } if ( !parentItem.isEmpty() ) - s += "QListViewItem(" + parentItem + "," + lastItem + ")\n"; + s += "TQListViewItem(" + parentItem + "," + lastItem + ")\n"; else - s += "QListViewItem(" + parent + "," + lastItem + ")\n"; + s += "TQListViewItem(" + parent + "," + lastItem + ")\n"; - QStringList textes; - QStringList pixmaps; + TQStringList textes; + TQStringList pixmaps; while ( !n.isNull() ) { if ( n.tagName() == "property" ) { - QDomElement n2 = n.firstChild().toElement(); + TQDomElement n2 = n.firstChild().toElement(); if ( n2.tagName() == "name" ) { - QString attrib = n2.firstChild().toText().data(); - QVariant v = DomTool::elementToVariant( n2.nextSibling().toElement(), QVariant() ); + TQString attrib = n2.firstChild().toText().data(); + TQVariant v = DomTool::elementToVariant( n2.nextSibling().toElement(), TQVariant() ); if ( attrib == "text" ) textes << v.toString(); else if ( attrib == "pixmap" ) { - QString pix = v.toString(); + TQString pix = v.toString(); if ( !pix.isEmpty() && !pixmapLoaderFunction.isEmpty() ) { pix.prepend( pixmapLoaderFunction + "( " ); pix.append( " )" ); @@ -882,9 +882,9 @@ QString Uic::createListViewItemImpl( const QDomElement &e, const QString &parent for ( int i = 0; i < (int)textes.count(); ++i ) { if ( !textes[ i ].isEmpty() ) - s += indent + item + ".setText(" + QString::number( i ) + "," + trmacro + "(" + fixString( textes[ i ] ) + "))\n"; + s += indent + item + ".setText(" + TQString::number( i ) + "," + trmacro + "(" + fixString( textes[ 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; @@ -895,18 +895,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 ) +TQString Uic::createListViewColumnImpl( const TQDomElement &e, const TQString &parent ) { - QDomElement n = e.firstChild().toElement(); - QString txt; - QString pix; + TQDomElement n = e.firstChild().toElement(); + TQString txt; + TQString pix; bool clickable = FALSE, resizeable = FALSE; while ( !n.isNull() ) { if ( n.tagName() == "property" ) { - QDomElement n2 = n.firstChild().toElement(); + TQDomElement n2 = n.firstChild().toElement(); if ( n2.tagName() == "name" ) { - QString attrib = n2.firstChild().toText().data(); - QVariant v = DomTool::elementToVariant( n2.nextSibling().toElement(), QVariant() ); + TQString attrib = n2.firstChild().toText().data(); + TQVariant v = DomTool::elementToVariant( n2.nextSibling().toElement(), TQVariant() ); if ( attrib == "text" ) txt = v.toString(); else if ( attrib == "pixmap" ) { @@ -924,7 +924,7 @@ QString Uic::createListViewColumnImpl( const QDomElement &e, const QString &pare n = n.nextSibling().toElement(); } - QString s; + TQString s; s = indent + parent + ".addColumn(" + trmacro + "(" + fixString( txt ) + "))\n"; if ( !pix.isEmpty() ) s += indent + parent + ".header().setLabel(" + parent + ".header().count() - 1," + pix + "," + trmacro + "(" + fixString( txt ) + "))\n"; @@ -939,17 +939,17 @@ QString Uic::createListViewColumnImpl( 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 = "QVBoxLayout"; + TQString qlayout = "TQVBoxLayout"; if ( objClass == "hbox" ) - qlayout = "QHBoxLayout"; + qlayout = "TQHBoxLayout"; else if ( objClass == "grid" ) - qlayout = "QGridLayout"; + qlayout = "TQGridLayout"; bool isGrid = e.tagName() == "grid" ; objName = registerObject( getLayoutName( e ) ); @@ -957,7 +957,7 @@ QString Uic::createLayoutImpl( const QDomElement &e, const QString& parentClass, int margin = DomTool::readProperty( e, "margin", BOXLAYOUT_DEFAULT_MARGIN ).toInt(); int spacing = DomTool::readProperty( e, "spacing", BOXLAYOUT_DEFAULT_SPACING ).toInt(); - if ( (parentClass == "QGroupBox" || parentClass == "QButtonGroup") && layout.isEmpty() ) { + if ( (parentClass == "TQGroupBox" || parentClass == "TQButtonGroup") && layout.isEmpty() ) { // special case for group box out << indent << parent << ".setColumnLayout(0,Qt.Vertical)" << endl; out << indent << parent << ".layout().setSpacing(0)" << endl; @@ -977,10 +977,10 @@ QString Uic::createLayoutImpl( const QDomElement &e, const QString& parentClass, 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 @@ -989,7 +989,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(); @@ -999,7 +999,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 << "," @@ -1008,9 +1008,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 ) @@ -1028,31 +1028,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(); + TQRect geom = DomTool::readProperty( e, "geometry", TQRect(0,0,0,0) ).toRect(); size = geom.size(); } if ( isVspacer ) - out << indent << objName << " = QSpacerItem(" + out << indent << objName << " = TQSpacerItem(" << size.width() << "," << size.height() - << ",QSizePolicy.Minimum,QSizePolicy." << sizeType << ")" << endl; + << ",TQSizePolicy.Minimum,TQSizePolicy." << sizeType << ")" << endl; else - out << indent << objName << " = QSpacerItem(" + out << indent << objName << " = TQSpacerItem(" << size.width() << "," << size.height() - << ",QSizePolicy." << sizeType << ",QSizePolicy.Minimum)" << endl; + << ",TQSizePolicy." << sizeType << ",TQSizePolicy.Minimum)" << endl; return objName; } @@ -1067,27 +1067,27 @@ QString Uic::createSpacerImpl( const QDomElement &e, const QString& /*parentClas 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 ( objClass.isEmpty() ) return; for ( n = e.firstChild().toElement(); !n.isNull(); n = n.nextSibling().toElement() ) { if ( n.tagName() == "property" ) { bool stdset = toBool( n.attribute( "stdset" ) ); - QDomElement n2 = n.firstChild().toElement(); + TQDomElement n2 = n.firstChild().toElement(); if ( n2.tagName() == "name" ) { - QString prop = n2.firstChild().toText().data(); + TQString prop = n2.firstChild().toText().data(); if ( prop != exclusiveProp ) continue; - QString value = setObjectProperty( objClass, objName, prop, n2.nextSibling().toElement(), stdset ); + TQString value = setObjectProperty( objClass, objName, prop, n2.nextSibling().toElement(), stdset ); if ( value.isEmpty() ) continue; - out << indent << objName << ".setProperty('" << prop << "',QVariant(" << value << "))" << endl; + out << indent << objName << ".setProperty('" << prop << "',TQVariant(" << value << "))" << endl; } } } @@ -1105,11 +1105,11 @@ const char* const ColorRole[] = { /*! Attention: this function has to be in sync with Resource::setWidgetProperty(). If you change one, change both. */ -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" ) @@ -1122,11 +1122,11 @@ QString Uic::setObjectProperty( const QString& objClass, const QString& obj, con h = n3.firstChild().toText().data().toInt(); n3 = n3.nextSibling().toElement(); } - v = "QRect(%1,%2,%3,%4)"; + v = "TQRect(%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" ) @@ -1135,10 +1135,10 @@ QString Uic::setObjectProperty( const QString& objClass, const QString& obj, con y = n3.firstChild().toText().data().toInt(); n3 = n3.nextSibling().toElement(); } - v = "QPoint(%1,%2)"; + v = "TQPoint(%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" ) @@ -1147,10 +1147,10 @@ QString Uic::setObjectProperty( const QString& objClass, const QString& obj, con h = n3.firstChild().toText().data().toInt(); n3 = n3.nextSibling().toElement(); } - v = "QSize(%1,%2)"; + v = "TQSize(%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" ) @@ -1161,16 +1161,16 @@ QString Uic::setObjectProperty( const QString& objClass, const QString& obj, con b = n3.firstChild().toText().data().toInt(); n3 = n3.nextSibling().toElement(); } - v = "QColor(%1,%2,%3)"; + v = "TQColor(%1,%2,%3)"; v = v.arg(r).arg(g).arg(b); } else if ( e.tagName() == "font" ) { - QDomElement n3 = e.firstChild().toElement(); - QString fontname = "f"; + TQDomElement n3 = e.firstChild().toElement(); + TQString fontname = "f"; if ( !obj.isEmpty() ) { fontname = obj + "_font"; - out << indent << fontname << " = QFont(self." << obj << ".font())" << endl; + out << indent << fontname << " = TQFont(self." << obj << ".font())" << endl; } else { - out << indent << fontname << " = QFont(self.font())" << endl; + out << indent << fontname << " = TQFont(self.font())" << endl; } while ( !n3.isNull() ) { if ( n3.tagName() == "family" ) @@ -1199,14 +1199,14 @@ QString Uic::setObjectProperty( const QString& objClass, const QString& obj, con } else if ( e.tagName() == "string" ) { if ( prop == "toolTip" ) { if ( !obj.isEmpty() ) - out << indent << "QToolTip.add(self." << obj << "," + trmacro + "(" << fixString( e.firstChild().toText().data() ) << "))" << endl; + out << indent << "TQToolTip.add(self." << obj << "," + trmacro + "(" << fixString( e.firstChild().toText().data() ) << "))" << endl; else - out << indent << "QToolTip.add(self," + trmacro + "(" << fixString( e.firstChild().toText().data() ) << "))" << endl; + out << indent << "TQToolTip.add(self," + trmacro + "(" << fixString( e.firstChild().toText().data() ) << "))" << endl; } else if ( prop == "whatsThis" ) { if ( !obj.isEmpty() ) - out << indent << "QWhatsThis.add(self." << obj << "," << trmacro << "(" << fixString( e.firstChild().toText().data() ) << "))" << endl; + out << indent << "TQWhatsThis.add(self." << obj << "," << trmacro << "(" << fixString( e.firstChild().toText().data() ) << "))" << endl; else - out << indent << "QWhatsThis.add(self," << trmacro << "(" << fixString( e.firstChild().toText().data() ) << "))" << endl; + out << indent << "TQWhatsThis.add(self," << trmacro << "(" << fixString( e.firstChild().toText().data() ) << "))" << endl; } else { v = trmacro + "(%1)"; v = v.arg( fixString( e.firstChild().toText().data() ) ); @@ -1230,51 +1230,51 @@ QString Uic::setObjectProperty( const QString& objClass, const QString& obj, con v.append( " )" ); } } else if ( e.tagName() == "iconset" ) { - v = "QIconSet(%1)"; + v = "TQIconSet(%1)"; v = v.arg( e.firstChild().toText().data() ); } else if ( e.tagName() == "image" ) { v = e.firstChild().toText().data() + ".convertToImage()"; } else if ( e.tagName() == "enum" ) { v = "%1.%2"; - QString oc = objClass; - QString ev = e.firstChild().toText().data(); - if ( oc == "QListView" && ev == "Manual" ) // #### workaround, rename QListView::Manual of WithMode enum in 3.0 - oc = "QScrollView"; + TQString oc = objClass; + TQString ev = e.firstChild().toText().data(); + if ( oc == "TQListView" && ev == "Manual" ) // #### workaround, rename TQListView::Manual of WithMode enum in 3.0 + oc = "TQScrollView"; v = v.arg( oc ).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 = ""; - for ( QStringList::Iterator it = lst.begin(); it != lst.end(); ++it ) { + for ( TQStringList::Iterator it = lst.begin(); it != lst.end(); ++it ) { v += objClass + "." + *it; if ( it != lst.fromLast() ) 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() ); n3 = n3.nextSibling().toElement(); } - QString tmp; + TQString tmp; if ( !obj.isEmpty() ) tmp = "self." + obj; else tmp = "self"; - v = "QSizePolicy(%1,%2," + tmp + ".sizePolicy().hasHeightForWidth())"; + v = "TQSizePolicy(%1,%2," + tmp + ".sizePolicy().hasHeightForWidth())"; v = v.arg( (int)sp.horData() ).arg( (int)sp.verData() ); } 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 ); @@ -1288,19 +1288,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 = "QPalette(QColor(%1,%2,%3),QColor(%1,%2,%3))"; + if ( no_pixmaps && pal == TQPalette( pal.active().button(), pal.active().background() ) ) { + v = "TQPalette(TQColor(%1,%2,%3),TQColor(%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 << " = QPalette()" << endl; + out << indent << palette << " = TQPalette()" << endl; pal_used = TRUE; } - QString cg = "cg"; + TQString cg = "cg"; if ( !cg_used ) { - out << indent << cg << " = QColorGroup()" << endl; + out << indent << cg << " = TQColorGroup()" << endl; cg_used = TRUE; } n = e.firstChild().toElement(); @@ -1323,7 +1323,7 @@ QString Uic::setObjectProperty( const QString& objClass, const QString& obj, con v = palette; } } else if ( e.tagName() == "cursor" ) { - v = "QCursor(%1)"; + v = "TQCursor(%1)"; v = v.arg( e.firstChild().toText().data() ); } return v; @@ -1334,33 +1334,33 @@ QString Uic::setObjectProperty( const QString& objClass, const QString& obj, con /*! 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 = "QColor(%1,%2,%3)"; + TQColor col = DomTool::readColor( n ); + color = "TQColor(%1,%2,%3)"; color = color.arg( col.red() ).arg( col.green() ).arg( col.blue() ); if ( col == white ) color = "Qt.white"; else if ( col == black ) color = "Qt.black"; if ( n.nextSibling().toElement().tagName() != "pixmap" ) { - out << indent << name << ".setColor(QColorGroup." << ColorRole[r] << "," << color << ")" << endl; + out << indent << name << ".setColor(TQColorGroup." << ColorRole[r] << "," << color << ")" << endl; } } else if ( n.tagName() == "pixmap" ) { - QString pixmap = n.firstChild().toText().data(); + TQString pixmap = n.firstChild().toText().data(); if ( !pixmapLoaderFunction.isEmpty() ) { pixmap.prepend( pixmapLoaderFunction + "(" ); pixmap.append( ")" ); } - out << indent << name << ".setBrush(QColorGroup." - << ColorRole[r] << ",QBrush(" << color << "," << pixmap << "))" << endl; + out << indent << name << ".setBrush(TQColorGroup." + << ColorRole[r] << ",TQBrush(" << color << "," << pixmap << "))" << endl; } n = n.nextSibling().toElement(); } @@ -1370,16 +1370,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(); } @@ -1396,7 +1396,7 @@ QColorGroup Uic::loadColorGroup( 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 @@ -1406,7 +1406,7 @@ QString Uic::registerObject( const QString& name ) objectNames += "pal"; } - QString result = name; + TQString result = name; int i; while ( ( i = result.find(' ' )) != -1 ) { result[i] = '_'; @@ -1414,10 +1414,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 ); @@ -1430,7 +1430,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; @@ -1440,24 +1440,24 @@ 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 ) { - QStringList result; + TQStringList result; if (list.isEmpty() ) return result; - QStringList l = list; + TQStringList l = list; l.sort(); result += l.first(); - for ( QStringList::Iterator it = l.begin(); it != l.end(); ++it ) { + for ( TQStringList::Iterator it = l.begin(); it != l.end(); ++it ) { if ( *it != result.last() ) result += *it; } @@ -1469,7 +1469,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(1) == "ComboBox" ) { @@ -1478,7 +1478,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 ); } @@ -1487,22 +1487,22 @@ bool Uic::isLayout( const QString& name ) const #if defined(BLACKADDER) #include "ba.h" -int BA::compilePython(const QString &fileName,const QString &outputFile, - const QString &trmacro,bool execCode) +int BA::compilePython(const TQString &fileName,const TQString &outputFile, + const TQString &trmacro,bool execCode) { #else int main( int argc, char * argv[] ) { const char *error = 0; - QString fileName; - QString outputFile; - QString trmacro; + TQString fileName; + TQString outputFile; + TQString trmacro; bool execCode = FALSE; for ( int n = 1; n < argc && error == 0; n++ ) { - QCString arg = argv[n]; + TQCString arg = argv[n]; if ( arg[0] == '-' ) { // option - QCString opt = &arg[1]; + TQCString opt = &arg[1]; if ( opt[0] == 'o' ) { // output redirection if ( opt[1] == '\0' ) { if ( !(n < argc-1) ) { @@ -1550,11 +1550,11 @@ int main( int argc, char * argv[] ) } #endif - QFile file( fileName ); + TQFile file( fileName ); if ( !file.open( IO_ReadOnly ) ) qFatal( "pyuic: Could not open file '%s' ", (const char *)fileName ); - QFile fileOut; + TQFile fileOut; if (!outputFile.isEmpty()) { fileOut.setName( outputFile ); if (!fileOut.open( IO_WriteOnly ) ) @@ -1562,16 +1562,16 @@ int main( int argc, char * argv[] ) } else { fileOut.open( IO_WriteOnly, stdout ); } - QTextStream out( &fileOut ); - out.setEncoding( QTextStream::UnicodeUTF8 ); + TQTextStream out( &fileOut ); + out.setEncoding( TQTextStream::UnicodeUTF8 ); - QDomDocument doc; + TQDomDocument doc; if ( !doc.setContent( &file ) ) qFatal( "pyuic: Failed to parse %s\n", (const char *)fileName ); out << "# Form implementation generated from reading ui file '" << fileName << "'" << endl; out << "#" << endl; - out << "# Created: " << QDateTime::currentDateTime().toString() << endl; + out << "# Created: " << TQDateTime::currentDateTime().toString() << endl; out << "# by: The Python User Interface Compiler (pyuic) " << PYQT_VERSION << endl; out << "#" << endl; out << "# WARNING! All changes made in this file will be lost!" << endl; @@ -1583,14 +1583,14 @@ int main( int argc, char * argv[] ) out << "from qt import *" << endl; - Uic( out, doc, trmacro.isEmpty() ? QString("self.tr") : trmacro ); + Uic( out, doc, trmacro.isEmpty() ? TQString("self.tr") : trmacro ); if (execCode) { out << endl; out << endl; out << "if __name__ == '__main__':" << endl; - out << " a = QApplication(sys.argv)" << endl; - out << " QObject.connect(a,SIGNAL('lastWindowClosed()'),a,SLOT('quit()'))" << endl; + out << " a = TQApplication(sys.argv)" << endl; + out << " TQObject.connect(a,TQT_SIGNAL('lastWindowClosed()'),a,TQT_SLOT('quit()'))" << endl; out << " w = " << className << "()" << endl; out << " a.setMainWidget(w)" << endl; out << " w.show()" << endl; diff --git a/python/pyqt/pyuic2/uic.h b/python/pyqt/pyuic2/uic.h index 6c7befc4..50e1d7a3 100644 --- a/python/pyqt/pyuic2/uic.h +++ b/python/pyqt/pyuic2/uic.h @@ -19,13 +19,13 @@ #ifndef UIC_H #define UIC_H -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include #define PYQT_VERSION "3.17.2" @@ -34,33 +34,33 @@ class Uic : public Qt { public: - Uic( QTextStream& out, QDomDocument doc, const QString &trm ); - - void createFormImpl( const QDomElement &e ); - - 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 createIconViewItemImpl( const QDomElement &e, const QString &parent ); - QString createListViewColumnImpl( const QDomElement &e, const QString &parent ); - QString createListViewItemImpl( const QDomElement &e, const QString &parent, - const QString &parentItem ); - void createColorGroupImpl( const QString& cg, const QDomElement& e ); - QColorGroup loadColorGroup( const QDomElement &e ); - - QString getClassName( const QDomElement& e ); - QString getObjectName( const QDomElement& e ); - QString getLayoutName( const QDomElement& e ); - - 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& ); + Uic( TQTextStream& out, TQDomDocument doc, const TQString &trm ); + + void createFormImpl( const TQDomElement &e ); + + 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 createIconViewItemImpl( const TQDomElement &e, const TQString &parent ); + TQString createListViewColumnImpl( const TQDomElement &e, const TQString &parent ); + TQString createListViewItemImpl( const TQDomElement &e, const TQString &parent, + const TQString &parentItem ); + void createColorGroupImpl( const TQString& cg, const TQDomElement& e ); + TQColorGroup loadColorGroup( const TQDomElement &e ); + + TQString getClassName( const TQDomElement& e ); + TQString getObjectName( const TQDomElement& e ); + TQString getLayoutName( const TQDomElement& e ); + + 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& ); private: void pushIndent() @@ -90,44 +90,44 @@ private: nrindents = 0; } - QString indent, newindent; + TQString indent, newindent; int nrindents; - QTextStream& out; - QStringList objectNames; - QMap objectMapper; - QStringList tags; - QStringList layouts; - QString formName; - QString lastItem; - QString trmacro; + TQTextStream& out; + TQStringList objectNames; + TQMap objectMapper; + TQStringList tags; + TQStringList layouts; + TQString formName; + TQString lastItem; + TQString trmacro; 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; + TQString header; + TQString location; }; - QValueList buddies; + TQValueList 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; uint pal_used : 1; - QString pixmapLoaderFunction; - QString nameOfClass; + TQString pixmapLoaderFunction; + TQString nameOfClass; }; #endif diff --git a/python/pyqt/pyuic2/widgetdatabase.cpp b/python/pyqt/pyuic2/widgetdatabase.cpp index 0733fcef..ced269f3 100644 --- a/python/pyqt/pyuic2/widgetdatabase.cpp +++ b/python/pyqt/pyuic2/widgetdatabase.cpp @@ -18,7 +18,7 @@ ** **********************************************************************/ -#include // HP-UX compiler needs this here +#include // HP-UX compiler needs this here #include "widgetdatabase.h" @@ -30,22 +30,22 @@ //#include "../integration/kdevelop/kdewidgets.h" #include -#include -#include -#include -#include +#include +#include +#include +#include -#include +#include const int dbsize = 300; const int dbcustom = 200; const int dbdictsize = 211; static WidgetDatabaseRecord* db[ dbsize ]; -static QDict *className2Id = 0; +static TQDict *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; @@ -99,14 +99,14 @@ void WidgetDatabase::setupDataBase() invisibleGroups = new QStrList; invisibleGroups->append( "Forms" ); invisibleGroups->append( "Temp" ); - className2Id = new QDict( dbdictsize ); + className2Id = new TQDict( dbdictsize ); className2Id->setAutoDelete( TRUE ); WidgetDatabaseRecord *r = 0; r = new WidgetDatabaseRecord; r->iconSet = "pushbutton.xpm"; - r->name = "QPushButton"; + r->name = "TQPushButton"; r->group = widgetGroup( "Buttons" ); r->toolTip = "Push Button"; @@ -114,7 +114,7 @@ void WidgetDatabase::setupDataBase() r = new WidgetDatabaseRecord; r->iconSet = "toolbutton.xpm"; - r->name = "QToolButton"; + r->name = "TQToolButton"; r->group = widgetGroup( "Buttons" ); r->toolTip = "Tool Button"; @@ -122,7 +122,7 @@ void WidgetDatabase::setupDataBase() r = new WidgetDatabaseRecord; r->iconSet = "radiobutton.xpm"; - r->name = "QRadioButton"; + r->name = "TQRadioButton"; r->group = widgetGroup( "Buttons" ); r->toolTip = "Radio Button"; @@ -130,7 +130,7 @@ void WidgetDatabase::setupDataBase() r = new WidgetDatabaseRecord; r->iconSet = "checkbox.xpm"; - r->name = "QCheckBox"; + r->name = "TQCheckBox"; r->group = widgetGroup( "Buttons" ); r->toolTip = "Check Box"; @@ -140,7 +140,7 @@ void WidgetDatabase::setupDataBase() append( r ); r = new WidgetDatabaseRecord; r->iconSet = "groupbox.xpm"; - r->name = "QGroupBox"; + r->name = "TQGroupBox"; r->group = widgetGroup( "Containers" ); r->toolTip = "Group Box"; r->isContainer = TRUE; @@ -149,7 +149,7 @@ void WidgetDatabase::setupDataBase() r = new WidgetDatabaseRecord; r->iconSet = "buttongroup.xpm"; - r->name = "QButtonGroup"; + r->name = "TQButtonGroup"; r->group = widgetGroup( "Containers" ); r->toolTip = "Button Group"; r->isContainer = TRUE; @@ -158,7 +158,7 @@ void WidgetDatabase::setupDataBase() r = new WidgetDatabaseRecord; r->iconSet = "frame.xpm"; - r->name = "QFrame"; + r->name = "TQFrame"; r->group = widgetGroup( "Containers" ); r->toolTip = "Frame"; r->isContainer = TRUE; @@ -167,7 +167,7 @@ void WidgetDatabase::setupDataBase() r = new WidgetDatabaseRecord; r->iconSet = "tabwidget.xpm"; - r->name = "QTabWidget"; + r->name = "TQTabWidget"; r->group = widgetGroup( "Containers" ); r->toolTip = "Tabwidget"; r->isContainer = TRUE; @@ -177,7 +177,7 @@ void WidgetDatabase::setupDataBase() r = new WidgetDatabaseRecord; r->iconSet = "listbox.xpm"; - r->name = "QListBox"; + r->name = "TQListBox"; r->group = widgetGroup( "Views" ); r->toolTip = "List Box"; @@ -185,7 +185,7 @@ void WidgetDatabase::setupDataBase() r = new WidgetDatabaseRecord; r->iconSet = "listview.xpm"; - r->name = "QListView"; + r->name = "TQListView"; r->group = widgetGroup( "Views" ); r->toolTip = "List View"; @@ -194,7 +194,7 @@ void WidgetDatabase::setupDataBase() #if defined(QT_MODULE_ICONVIEW) || defined(UIC) r = new WidgetDatabaseRecord; r->iconSet = "iconview.xpm"; - r->name = "QIconView"; + r->name = "TQIconView"; r->group = widgetGroup( "Views" ); r->toolTip = "Icon View"; @@ -204,7 +204,7 @@ void WidgetDatabase::setupDataBase() #if defined(QT_MODULE_TABLE) r = new WidgetDatabaseRecord; r->iconSet = "table.xpm"; - r->name = "QTable"; + r->name = "TQTable"; r->group = widgetGroup( "Views" ); r->toolTip = "Table"; @@ -214,7 +214,7 @@ void WidgetDatabase::setupDataBase() r = new WidgetDatabaseRecord; r->iconSet = "lineedit.xpm"; - r->name = "QLineEdit"; + r->name = "TQLineEdit"; r->group = widgetGroup( "Input" ); r->toolTip = "Line Edit"; @@ -222,7 +222,7 @@ void WidgetDatabase::setupDataBase() r = new WidgetDatabaseRecord; r->iconSet = "spinbox.xpm"; - r->name = "QSpinBox"; + r->name = "TQSpinBox"; r->group = widgetGroup( "Input" ); r->toolTip = "Spin Box"; @@ -230,7 +230,7 @@ void WidgetDatabase::setupDataBase() r = new WidgetDatabaseRecord; r->iconSet = "multilineedit.xpm"; - r->name = "QMultiLineEdit"; + r->name = "TQMultiLineEdit"; r->group = widgetGroup( "Input" ); r->toolTip = "Multi Line Edit"; @@ -238,7 +238,7 @@ void WidgetDatabase::setupDataBase() r = new WidgetDatabaseRecord; r->iconSet = "combobox.xpm"; - r->name = "QComboBox"; + r->name = "TQComboBox"; r->group = widgetGroup( "Input" ); r->toolTip = "Combo Box"; @@ -246,7 +246,7 @@ void WidgetDatabase::setupDataBase() r = new WidgetDatabaseRecord; r->iconSet = "slider.xpm"; - r->name = "QSlider"; + r->name = "TQSlider"; r->group = widgetGroup( "Input" ); r->toolTip = "Slider"; @@ -254,7 +254,7 @@ void WidgetDatabase::setupDataBase() r = new WidgetDatabaseRecord; r->iconSet = "dial.xpm"; - r->name = "QDial"; + r->name = "TQDial"; r->group = widgetGroup( "Input" ); r->toolTip = "Dial"; @@ -262,7 +262,7 @@ void WidgetDatabase::setupDataBase() r = new WidgetDatabaseRecord; r->iconSet = "label.xpm"; - r->name = "QLabel"; + r->name = "TQLabel"; r->group = widgetGroup( "Temp" ); r->toolTip = "Label"; @@ -288,7 +288,7 @@ void WidgetDatabase::setupDataBase() r = new WidgetDatabaseRecord; r->iconSet = "lcdnumber.xpm"; - r->name = "QLCDNumber"; + r->name = "TQLCDNumber"; r->group = widgetGroup( "Display" ); r->toolTip = "LCD Number"; @@ -299,14 +299,14 @@ void WidgetDatabase::setupDataBase() r->name = "Line"; r->group = widgetGroup( "Display" ); r->toolTip = "Line"; - r->includeFile = "qframe.h"; + r->includeFile = "tqframe.h"; r->whatsThis = "The Line widget provides horizontal and vertical lines."; append( r ); r = new WidgetDatabaseRecord; r->iconSet = "progress.xpm"; - r->name = "QProgressBar"; + r->name = "TQProgressBar"; r->group = widgetGroup( "Display" ); r->toolTip = "Progress Bar"; @@ -314,7 +314,7 @@ void WidgetDatabase::setupDataBase() r = new WidgetDatabaseRecord; r->iconSet = "textview.xpm"; - r->name = "QTextView"; + r->name = "TQTextView"; r->group = widgetGroup( "Display" ); r->toolTip = "Text View"; @@ -322,7 +322,7 @@ void WidgetDatabase::setupDataBase() r = new WidgetDatabaseRecord; r->iconSet = "textbrowser.xpm"; - r->name = "QTextBrowser"; + r->name = "TQTextBrowser"; r->group = widgetGroup( "Display" ); r->toolTip = "Text Browser"; @@ -338,21 +338,21 @@ void WidgetDatabase::setupDataBase() append( r ); r = new WidgetDatabaseRecord; - r->name = "QWidget"; + r->name = "TQWidget"; r->isContainer = FALSE; r->group = widgetGroup( "Forms" ); append( r ); r = new WidgetDatabaseRecord; - r->name = "QDialog"; + r->name = "TQDialog"; r->group = widgetGroup( "Forms" ); r->isContainer = FALSE; append( r ); r = new WidgetDatabaseRecord; - r->name = "QWizard"; + r->name = "TQWizard"; r->group = widgetGroup( "Forms" ); r->isContainer = TRUE; @@ -424,32 +424,32 @@ int WidgetDatabase::startCustom() id. */ -QIconSet WidgetDatabase::iconSet( int id ) +TQIconSet WidgetDatabase::iconSet( int id ) { setupDataBase(); WidgetDatabaseRecord *r = at( id ); if ( !r ) - return QIconSet(); + return TQIconSet(); #if defined(DESIGNER) if ( !r->icon ) - r->icon = new QIconSet( PixmapChooser::loadPixmap( r->iconSet, PixmapChooser::Small ), + r->icon = new TQIconSet( PixmapChooser::loadPixmap( r->iconSet, PixmapChooser::Small ), PixmapChooser::loadPixmap( r->iconSet, PixmapChooser::Large ) ); return *r->icon; #endif - return QIconSet(); + return TQIconSet(); } /*! Returns the classname of the widget which is registered as \a id. */ -QString WidgetDatabase::className( int id ) +TQString WidgetDatabase::className( int id ) { setupDataBase(); WidgetDatabaseRecord *r = at( id ); if ( !r ) - return QString::null; + return TQString::null; return r->name; } @@ -457,12 +457,12 @@ QString WidgetDatabase::className( int id ) Returns the group to which the widget registered as \a id belongs. */ -QString WidgetDatabase::group( int id ) +TQString WidgetDatabase::group( int id ) { setupDataBase(); WidgetDatabaseRecord *r = at( id ); if ( !r ) - return QString::null; + return TQString::null; return r->group; } @@ -470,12 +470,12 @@ QString WidgetDatabase::group( int id ) id. */ -QString WidgetDatabase::toolTip( int id ) +TQString WidgetDatabase::toolTip( int id ) { setupDataBase(); WidgetDatabaseRecord *r = at( id ); if ( !r ) - return QString::null; + return TQString::null; return r->toolTip; } @@ -483,12 +483,12 @@ QString WidgetDatabase::toolTip( int id ) as \a id. */ -QString WidgetDatabase::whatsThis( int id ) +TQString WidgetDatabase::whatsThis( int id ) { setupDataBase(); WidgetDatabaseRecord *r = at( id ); if ( !r ) - return QString::null; + return TQString::null; return r->whatsThis; } @@ -496,12 +496,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(); WidgetDatabaseRecord *r = at( id ); if ( !r ) - return QString::null; + return TQString::null; if ( r->includeFile.isNull() ) return r->name.lower() + ".h"; return r->includeFile; @@ -520,10 +520,10 @@ bool WidgetDatabase::isContainer( int id ) return r->isContainer; } -QString WidgetDatabase::createWidgetName( int id ) +TQString WidgetDatabase::createWidgetName( int id ) { setupDataBase(); - QString n = className( id ); + TQString n = className( id ); if ( n == "QLayoutWidget" ) n = "Layout"; if ( n[ 0 ] == 'Q' ) @@ -531,13 +531,13 @@ QString WidgetDatabase::createWidgetName( int id ) WidgetDatabaseRecord *r = at( id ); if ( !r ) return n; - n += QString::number( ++r->nameCounter ); + n += TQString::number( ++r->nameCounter ); 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(); if ( name.isEmpty() ) @@ -576,19 +576,19 @@ 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; } -QString WidgetDatabase::widgetGroup( int i ) +TQString WidgetDatabase::widgetGroup( int i ) { setupDataBase(); if ( i >= 0 && i < (int)wGroups->count() ) return wGroups->at( i ); - return QString::null; + return TQString::null; } int WidgetDatabase::numWidgetGroups() @@ -597,7 +597,7 @@ int WidgetDatabase::numWidgetGroups() return wGroups->count(); } -bool WidgetDatabase::isGroupVisible( const QString &g ) +bool WidgetDatabase::isGroupVisible( const TQString &g ) { setupDataBase(); return invisibleGroups->find( g ) == -1; @@ -621,16 +621,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 ) diff --git a/python/pyqt/pyuic2/widgetdatabase.h b/python/pyqt/pyuic2/widgetdatabase.h index a28cd5fb..dd327d7a 100644 --- a/python/pyqt/pyuic2/widgetdatabase.h +++ b/python/pyqt/pyuic2/widgetdatabase.h @@ -21,17 +21,17 @@ #ifndef WIDGETDATABASE_H #define WIDGETDATABASE_H -#include -#include -#include +#include +#include +#include struct WidgetDatabaseRecord { WidgetDatabaseRecord(); ~WidgetDatabaseRecord(); - QString iconSet, name, group, toolTip, whatsThis, includeFile; + TQString iconSet, name, group, toolTip, whatsThis, includeFile; uint isContainer : 1; - QIconSet *icon; + TQIconSet *icon; int nameCounter; }; @@ -44,31 +44,31 @@ 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 isContainer( 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 isGroupVisible( const TQString &g ); static int addCustomWidget( WidgetDatabaseRecord *r ); static bool isCustomWidget( int id ); static bool isWhatsThisLoaded(); - static void loadWhatsThis( const QString &docPath ); + static void loadWhatsThis( const TQString &docPath ); }; diff --git a/python/pyqt/pyuic3/domtool.cpp b/python/pyqt/pyuic3/domtool.cpp index b3514a06..d083aaae 100644 --- a/python/pyqt/pyuic3/domtool.cpp +++ b/python/pyqt/pyuic3/domtool.cpp @@ -20,14 +20,14 @@ #include "domtool.h" -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include /*! \class DomTool domtool.h @@ -45,9 +45,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 ) @@ -62,9 +62,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 ); } @@ -73,9 +73,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 ) @@ -86,13 +86,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" ); } @@ -101,20 +101,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" ) @@ -127,9 +127,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" ) @@ -138,9 +138,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" ) @@ -149,12 +149,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() ); @@ -170,58 +170,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() ) { @@ -233,9 +233,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() ) { @@ -247,9 +247,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() ) { @@ -267,7 +267,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; } @@ -276,9 +276,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" ) @@ -290,7 +290,7 @@ QColor DomTool::readColor( const QDomElement &e ) n = n.nextSibling().toElement(); } - return QColor( r, g, b ); + return TQColor( r, g, b ); } /*! @@ -300,9 +300,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 ) @@ -316,9 +316,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 ); } @@ -327,9 +327,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 ) @@ -340,7 +340,7 @@ 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; } @@ -348,11 +348,11 @@ static bool toBool( const QString& s ) /*! Convert Qt 2.x format to Qt 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(); @@ -368,8 +368,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" ); @@ -385,8 +385,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" ) @@ -410,8 +410,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 ); @@ -422,8 +422,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 ); @@ -434,8 +434,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/python/pyqt/pyuic3/domtool.h b/python/pyqt/pyuic3/domtool.h index 25b795d3..a75e3d3f 100644 --- a/python/pyqt/pyuic3/domtool.h +++ b/python/pyqt/pyuic3/domtool.h @@ -21,8 +21,8 @@ #ifndef DOMTOOL_H #define DOMTOOL_H -#include -#include +#include +#include class QDomElement; class QDomDocument; @@ -30,17 +30,17 @@ class QDomDocument; class DomTool : public Qt { 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/python/pyqt/pyuic3/embed.cpp b/python/pyqt/pyuic3/embed.cpp index 04f6494c..da1c1d5c 100644 --- a/python/pyqt/pyuic3/embed.cpp +++ b/python/pyqt/pyuic3/embed.cpp @@ -21,11 +21,11 @@ **********************************************************************/ #include "uic.h" -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include #include #include @@ -42,17 +42,17 @@ struct EmbedImage int width, height, depth; int numColors; QRgb* colorTable; - QString name; - QString cname; + TQString name; + TQString cname; bool alpha; #ifndef QT_NO_IMAGE_COLLECTION_COMPRESSION ulong compressed; #endif }; -static QString convertToCIdentifier( const char *s ) +static TQString convertToCIdentifier( const char *s ) { - QString r = s; + TQString r = s; int len = r.length(); if ( len > 0 && !isalpha( (char)r[0].latin1() ) ) r[0] = '_'; @@ -64,16 +64,16 @@ static QString convertToCIdentifier( const char *s ) } -static ulong embedData( QTextStream& out, const uchar* input, int nbytes ) +static ulong embedData( TQTextStream& out, const uchar* input, int nbytes ) { #ifndef QT_NO_IMAGE_COLLECTION_COMPRESSION - QByteArray bazip( qCompress( input, nbytes ) ); + TQByteArray bazip( qCompress( input, nbytes ) ); uint len = bazip.size(); #else uint len = (uint)nbytes; #endif static const char hexdigits[] = "0123456789abcdef"; - QString s; + TQString s; for ( uint i=0; i list_image; + TQPtrList list_image; list_image.setAutoDelete( TRUE ); int image_count = 0; for ( it = images.begin(); it != images.end(); ++it ) { - QImage img; + TQImage img; if ( !img.load( *it ) ) { fprintf( stderr, "pyuic: cannot load image file %s\n", (*it).latin1() ); continue; @@ -161,14 +161,14 @@ void Uic::embed( QTextStream& out, const char* project, const QStringList& image e->colorTable = new QRgb[e->numColors]; e->alpha = img.hasAlphaBuffer(); memcpy(e->colorTable, img.colorTable(), e->numColors*sizeof(QRgb)); - QFileInfo fi( *it ); + TQFileInfo fi( *it ); e->name = fi.fileName(); - e->cname = QString("image_%1").arg( image_count++); + e->cname = TQString("image_%1").arg( image_count++); list_image.append( e ); out << "# " << *it << "\n"; - QString s; + TQString s; if ( e->depth == 1 ) - img = img.convertBitOrder(QImage::BigEndian); + img = img.convertBitOrder(TQImage::BigEndian); out << s.sprintf( "%s_data =", (const char *)e->cname ); #ifndef QT_NO_IMAGE_COLLECTION_COMPRESSION @@ -230,7 +230,7 @@ void Uic::embed( QTextStream& out, const char* project, const QStringList& image // Keep the data object alive until we have a deep copy of the image. out << indent << "data = qUncompress(data).data()\n"; #endif - out << indent << "img = QImage(data,w,h,depth,colTab,nrCol,QImage.BigEndian).copy()\n"; + out << indent << "img = TQImage(data,w,h,depth,colTab,nrCol,TQImage.BigEndian).copy()\n"; out << "\n"; out << indent << "if alpha:\n"; ++indent; @@ -241,21 +241,21 @@ void Uic::embed( QTextStream& out, const char* project, const QStringList& image --indent; --indent; out << endl; - out << indent << "return QImage()\n"; + out << indent << "return TQImage()\n"; --indent; out << "\n"; out << "\n"; - out << indent << "class MimeSourceFactory_" << cProject << "(QMimeSourceFactory):\n"; + out << indent << "class MimeSourceFactory_" << cProject << "(TQMimeSourceFactory):\n"; ++indent; out << indent << "def __init__(self):\n"; ++indent; - out << indent << "QMimeSourceFactory.__init__(self)\n"; + out << indent << "TQMimeSourceFactory.__init__(self)\n"; out << "\n"; --indent; out << indent << "def data(self,abs_name):\n"; ++indent; - out << indent << "d = QMimeSourceFactory.data(self,abs_name)\n"; + out << indent << "d = TQMimeSourceFactory.data(self,abs_name)\n"; out << indent << "if d or abs_name.isNull():\n"; ++indent; out << indent << "return d\n"; @@ -267,7 +267,7 @@ void Uic::embed( QTextStream& out, const char* project, const QStringList& image out << indent << "self.setImage(abs_name,img)\n"; --indent; out << "\n"; - out << indent << "return QMimeSourceFactory.data(self,abs_name)\n"; + out << indent << "return TQMimeSourceFactory.data(self,abs_name)\n"; --indent; --indent; out << "\n"; @@ -283,7 +283,7 @@ void Uic::embed( QTextStream& out, const char* project, const QStringList& image out << indent << "if factory is None:\n"; ++indent; out << indent << "factory = MimeSourceFactory_" << cProject << "()\n"; - out << indent << "QMimeSourceFactory.defaultFactory().addFactory(factory)\n"; + out << indent << "TQMimeSourceFactory.defaultFactory().addFactory(factory)\n"; --indent; --indent; out << "\n"; @@ -295,7 +295,7 @@ void Uic::embed( QTextStream& out, const char* project, const QStringList& image out << "\n"; out << indent << "if factory is not None:\n"; ++indent; - out << indent << "QMimeSourceFactory.defaultFactory().removeFactory(factory)\n"; + out << indent << "TQMimeSourceFactory.defaultFactory().removeFactory(factory)\n"; out << indent << "factory = None\n"; --indent; --indent; diff --git a/python/pyqt/pyuic3/form.cpp b/python/pyqt/pyuic3/form.cpp index aedb4ac2..ca68db39 100644 --- a/python/pyqt/pyuic3/form.cpp +++ b/python/pyqt/pyuic3/form.cpp @@ -23,10 +23,10 @@ #include "parser.h" #include "widgetdatabase.h" #include "domtool.h" -#include -#include -#include -#include +#include +#include +#include +#include #define NO_STATIC_COLORS #include @@ -34,7 +34,7 @@ #include #endif -static QByteArray unzipXPM( QString data, ulong& length ) +static TQByteArray unzipXPM( TQString data, ulong& length ) { #if QT_VERSION >= 0x030100 const int lengthOffset = 4; @@ -61,7 +61,7 @@ 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; #else @@ -94,7 +94,7 @@ static QByteArray unzipXPM( QString data, ulong& length ) // crashes in some cases of slightly corrupt UIC files. if ( length < data.length() * 5 ) length = data.length() * 5; - QByteArray baunzip( length ); + TQByteArray baunzip( length ); ::uncompress( (uchar*) baunzip.data(), &length, ba, data.length()/2 ); delete[] ba; return baunzip; @@ -108,27 +108,27 @@ static QByteArray unzipXPM( QString data, ulong& length ) \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 ); // generate local and local includes required - QStringList globalIncludes; - QStringList::Iterator it; - QStringList sqlClasses; - QStringList axwidgets, databrowsers; + TQStringList globalIncludes; + TQStringList::Iterator it; + TQStringList sqlClasses; + TQStringList axwidgets, databrowsers; - QMap customWidgetIncludes; - QMap functionImpls; + TQMap customWidgetIncludes; + TQMap functionImpls; // find additional slots and functions - QStringList extraSlots; - QStringList extraSlotTypes; + TQStringList extraSlots; + TQStringList extraSlotTypes; nl = e.parentNode().toElement().elementsByTagName( "slot" ); for ( i = 0; i < (int) nl.length(); i++ ) { n = nl.item(i).toElement(); @@ -137,7 +137,7 @@ void Uic::createFormImpl( const QDomElement &e ) continue; if ( n.attribute( "language", "C++" ) != "C++" ) continue; - QString slotName = n.firstChild().toText().data().stripWhiteSpace(); + TQString slotName = n.firstChild().toText().data().stripWhiteSpace(); if ( slotName.endsWith( ";" ) ) slotName = slotName.left( slotName.length() - 1 ); @@ -147,9 +147,9 @@ void Uic::createFormImpl( const QDomElement &e ) for ( n = e; !n.isNull(); n = n.nextSibling().toElement() ) { if ( n.tagName() == "functions" ) { // compatibility - for ( QDomElement n2 = n.firstChild().toElement(); !n2.isNull(); n2 = n2.nextSibling().toElement() ) { + for ( TQDomElement n2 = n.firstChild().toElement(); !n2.isNull(); n2 = n2.nextSibling().toElement() ) { if ( n2.tagName() == "function" ) { - QString fname = n2.attribute( "name" ); + TQString fname = n2.attribute( "name" ); fname = Parser::cleanArgs( fname ); functionImpls.insert( fname, n2.firstChild().toText().data() ); } @@ -160,11 +160,11 @@ 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(); + TQDomElement n2 = nl.item(i).toElement(); - QString s = n2.firstChild().toText().data(); + TQString s = n2.firstChild().toText().data(); if ( n2.attribute( "location" ) != "local" ) { - if ( s.right( 5 ) == ".ui.h" && !QFile::exists( s ) ) + if ( s.right( 5 ) == ".ui.h" && !TQFile::exists( s ) ) continue; if ( n2.attribute( "impldecl", "in implementation" ) != "in implementation" ) continue; @@ -173,32 +173,32 @@ void Uic::createFormImpl( const QDomElement &e ) } // do the local includes afterwards, since global includes have priority on clashes - QFileInfo fi(fileName); + TQFileInfo fi(fileName); 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" ) continue; - if ( !QFile::exists( s ) ) + if ( !TQFile::exists( s ) ) { s = fi.dirPath() + "/" + s; - if ( !QFile::exists( s ) ) + if ( !TQFile::exists( s ) ) continue; } - if ( QFile::exists( s ) ) + if ( TQFile::exists( s ) ) { - QFile f(s); + TQFile f(s); f.open(IO_ReadOnly); - QTextStream headerStream(&f); - QString line; - QString functionText; - QString functionName; - QRegExp rx("void .*::(.*\\(.*\\))"); + TQTextStream headerStream(&f); + TQString line; + TQString functionText; + TQString functionName; + TQRegExp rx("void .*::(.*\\(.*\\))"); int pos, inFunction = 0; while (line = headerStream.readLine()) @@ -226,8 +226,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; } @@ -236,29 +236,29 @@ 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"; + globalIncludes += "tqlayout.h"; + globalIncludes += "tqapplication.h"; continue; } if ( name.mid( 1 ) == "ListView" ) - globalIncludes += "qheader.h"; + globalIncludes += "tqheader.h"; else if ( name == "QAxWidget" ) axwidgets += getObjectName(nl.item(i).toElement()); - else if ( name == "QDataBrowser" ) + else if ( name == "TQDataBrowser" ) databrowsers += getObjectName(nl.item(i).toElement()); if ( name != objClass ) { int wid = WidgetDatabase::idFromClassName( name ); - QMap::Iterator it = customWidgetIncludes.find( name ); + TQMap::Iterator it = customWidgetIncludes.find( name ); if ( it == customWidgetIncludes.end() ) globalIncludes += WidgetDatabase::includeFile( wid ); } } } - if (globalIncludes.findIndex("qtable.h") >= 0) - out << indent << "from qttable import QTable" << endl; + if (globalIncludes.findIndex("tqtable.h") >= 0) + out << indent << "from qttable import TQTable" << endl; if (!axwidgets.empty()) out << indent << "from qtaxcontainer import QAxWidget" << endl; @@ -269,9 +269,9 @@ void Uic::createFormImpl( const QDomElement &e ) registerDatabases( e ); dbConnections = unique( dbConnections ); if ( dbConnections.count() ) - sqlClasses += "QSqlDatabase"; + sqlClasses += "TQSqlDatabase"; if ( dbCursors.count() ) - sqlClasses += "QSqlCursor"; + sqlClasses += "TQSqlCursor"; bool dbForm = FALSE; if ( dbForms[ "(default)" ].count() ) dbForm = TRUE; @@ -285,21 +285,21 @@ void Uic::createFormImpl( const QDomElement &e ) } } if ( dbForm || subDbForms ) { - sqlClasses += "QSqlForm"; - sqlClasses += "QSqlRecord"; + sqlClasses += "TQSqlForm"; + sqlClasses += "TQSqlRecord"; } - if (globalIncludes.findIndex("qdatatable.h") >= 0) - sqlClasses += "QDataTable"; + if (globalIncludes.findIndex("tqdatatable.h") >= 0) + sqlClasses += "TQDataTable"; if (globalIncludes.findIndex("qtableview.h") >= 0) sqlClasses += "QTableView"; - if (globalIncludes.findIndex("qdatabrowser.h") >= 0) - sqlClasses += "QDataBrowser"; + if (globalIncludes.findIndex("tqdatabrowser.h") >= 0) + sqlClasses += "TQDataBrowser"; - if (globalIncludes.findIndex("qdataview.h") >= 0) - sqlClasses += "QDataView"; + if (globalIncludes.findIndex("tqdataview.h") >= 0) + sqlClasses += "TQDataView"; if ( !sqlClasses.empty() ) { out << indent << "from qtsql import"; @@ -320,12 +320,12 @@ void Uic::createFormImpl( const QDomElement &e ) 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" ) @@ -336,26 +336,26 @@ 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 for ( n = e; !n.isNull(); n = n.nextSibling().toElement() ) { if ( n.tagName() == "images" ) { 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(); 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? @@ -383,11 +383,11 @@ void Uic::createFormImpl( const QDomElement &e ) out << indent << "\""; int a ; for ( a = 0; a < (int) (data.length()/2)-1; a++ ) { - out << "\\x" << QString(data[2*a]) << QString(data[2*a+1]); + out << "\\x" << TQString(data[2*a]) << TQString(data[2*a+1]); if ( a % 12 == 11 ) out << "\" \\" << endl << indent << "\""; } - out << "\\x" << QString(data[2*a]) << QString(data[2*a+1]) << "\"" << endl; + out << "\\x" << TQString(data[2*a]) << TQString(data[2*a+1]) << "\"" << endl; --indent; } } @@ -396,16 +396,16 @@ void Uic::createFormImpl( const QDomElement &e ) out << endl; } else if ( externPixmaps ) { #if QT_VERSION >= 0x030100 - pixmapLoaderFunction = "QPixmap.fromMimeSource"; + pixmapLoaderFunction = "TQPixmap.fromMimeSource"; #else out << indent << "def uic_load_pixmap_" << objName << "(name):" << endl; ++indent; - out << indent << "pix = QPixmap()" << endl; - out << indent << "m = QMimeSourceFactory.defaultFactory().data(name)" << endl; + out << indent << "pix = TQPixmap()" << endl; + out << indent << "m = TQMimeSourceFactory.defaultFactory().data(name)" << endl; out << endl; out << indent << "if m:" << endl; ++indent; - out << indent << "QImageDrag.decode(m,pix)" << endl; + out << indent << "TQImageDrag.decode(m,pix)" << endl; --indent; out << endl; out << indent << "return pix" << endl; @@ -422,15 +422,15 @@ void Uic::createFormImpl( const QDomElement &e ) out << indent << "class " << nameOfClass << "(" << objClass << "):" << endl; ++indent; - if ( objClass == "QDialog" || objClass == "QWizard" ) { + if ( objClass == "TQDialog" || objClass == "TQWizard" ) { out << indent << "def __init__(self,parent = None,name = None,modal = 0,fl = 0):" << endl; ++indent; out << indent << objClass << ".__init__(self,parent,name,modal,fl)" << endl; - } else if ( objClass == "QWidget" ) { + } else if ( objClass == "TQWidget" ) { out << indent << "def __init__(self,parent = None,name = None,fl = 0):" << endl; ++indent; out << indent << objClass << ".__init__(self,parent,name,fl)" << endl; - } else if ( objClass == "QMainWindow" ) { + } else if ( objClass == "TQMainWindow" ) { out << indent << "def __init__(self,parent = None,name = None,fl = 0):" << endl; ++indent; out << indent << objClass << ".__init__(self,parent,name,fl)" << endl; @@ -446,37 +446,37 @@ 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 << "self." << (*it) << " = QPixmap()" << endl; + out << indent << "self." << (*it) << " = TQPixmap()" << endl; out << indent << "self." << (*it) << ".loadFromData(" << (*it) << "_data,\"PNG\")" << endl; } } // create pixmaps for all images if ( !xpmImages.isEmpty() ) { for ( it = xpmImages.begin(); it != xpmImages.end(); ++it ) { - out << indent << "self." << (*it) << " = QPixmap(" << (*it) << "_data)" << endl; + out << indent << "self." << (*it) << " = TQPixmap(" << (*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() ); @@ -485,11 +485,11 @@ void Uic::createFormImpl( const QDomElement &e ) n3 = n3.nextSibling().toElement(); } } else { - QString call; + TQString call; if ( stdset ) call = "self." + mkStdSet( prop ) + "(" + value + ")"; else - call = "self.setProperty(\"" + prop + "\",QVariant(" + value + "))"; + call = "self.setProperty(\"" + prop + "\",TQVariant(" + value + "))"; if ( n2.tagName() == "string" ) { trout << trindent << call << endl; @@ -510,15 +510,15 @@ void Uic::createFormImpl( const QDomElement &e ) // create all children, some forms have special requirements - if ( objClass == "QWizard" ) { + if ( objClass == "TQWizard" ) { for ( n = e.firstChild().toElement(); !n.isNull(); n = n.nextSibling().toElement() ) { if ( tags.contains( n.tagName() ) ) { - QString page = createObjectImpl( n, objClass, "self" ); - QString comment; - QString label = DomTool::readAttribute( n, "title", "", comment ).toString(); - out << indent << "self.addPage(" << page << ",QString(\"\"))" << endl; + TQString page = createObjectImpl( n, objClass, "self" ); + TQString comment; + TQString label = DomTool::readAttribute( n, "title", "", comment ).toString(); + out << indent << "self.addPage(" << page << ",TQString(\"\"))" << endl; trout << trindent << "self.setTitle(" << page << ","<< trcall( label, comment ) << ")" << endl; - QVariant def( FALSE, 0 ); + TQVariant def( FALSE, 0 ); if ( DomTool::hasAttribute( n, "backEnabled" ) ) out << indent << "self.setBackEnabled(" << page << "," << mkBool( DomTool::readAttribute( n, "backEnabled", def).toBool() ) << ")" << endl; if ( DomTool::hasAttribute( n, "nextEnabled" ) ) @@ -544,20 +544,20 @@ void Uic::createFormImpl( const QDomElement &e ) out << endl; for ( it = dbConnections.begin(); it != dbConnections.end(); ++it ) { if ( !(*it).isEmpty() && (*it) != "(default)") { - out << indent << "self." << (*it) << "Connection = QSqlDatabase.database(\"" <<(*it) << "\")" << endl; + out << indent << "self." << (*it) << "Connection = TQSqlDatabase.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 == "QDataBrowser" || s == "QDataView") ) { - QString objName = getObjectName( n ); - QString tab = getDatabaseInfo( n, "table" ); - QString con = getDatabaseInfo( n, "connection" ); - out << indent << objName << "Form = QSqlForm(self,\"" << objName << "Form\")" << endl; - QDomElement n2; + TQString s = getClassName( n ); + if ( (dbForm || subDbForms) && (s == "TQDataBrowser" || s == "TQDataView") ) { + TQString objName = getObjectName( n ); + TQString tab = getDatabaseInfo( n, "table" ); + TQString con = getDatabaseInfo( n, "connection" ); + out << indent << objName << "Form = TQSqlForm(self,\"" << objName << "Form\")" << endl; + TQDomElement n2; for ( n2 = n.firstChild().toElement(); !n2.isNull(); n2 = n2.nextSibling().toElement() ) createFormImpl( n2, objName, con, tab ); out << indent << "self." << objName << ".setForm(" << objName << "Form)" << endl; @@ -605,7 +605,7 @@ void Uic::createFormImpl( const QDomElement &e ) // take minimumSizeHint() into account, for height-for-width widgets if ( !geometry.isNull() ) { - out << indent << "self.resize(QSize(" << geometry.width() << "," + out << indent << "self.resize(TQSize(" << geometry.width() << "," << geometry.height() <<").expandedTo(self.minimumSizeHint()))" << endl; out << indent << "self.clearWState(Qt.WState_Polished)" << endl; } @@ -616,8 +616,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" ) @@ -656,17 +656,17 @@ void Uic::createFormImpl( const QDomElement &e ) receiver = "self." + receiver; out << indent << "self.connect(" << sender - << ",SIGNAL(\"" << signal << "\")," << receiver; + << ",TQT_SIGNAL(\"" << signal << "\")," << receiver; - // Normally we never use the SLOT() macro in case the + // Normally we never use the TQT_SLOT() macro in case the // connection is to a method of a Python custom widget. The // exception is if the receiver is a QAxWidget where it must be // used because the slots are dynamic. if (isaxwidget) - out << ",SLOT(\"" << slot << "\")"; + out << ",TQT_SLOT(\"" << slot << "\")"; else { - QString mname = slot.left(slot.find('(')); + TQString mname = slot.left(slot.find('(')); // Rename slots that have different names in PyQt. if (isdatabrowser && mname == "del") @@ -680,11 +680,11 @@ void Uic::createFormImpl( const QDomElement &e ) } 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 << "self.setTabOrder(self." << lastName << ",self." << name << ")" << endl; @@ -697,7 +697,7 @@ void Uic::createFormImpl( const QDomElement &e ) // buddies bool firstBuddy = TRUE; - for ( QValueList::Iterator buddy = buddies.begin(); buddy != buddies.end(); ++buddy ) { + for ( TQValueList::Iterator buddy = buddies.begin(); buddy != buddies.end(); ++buddy ) { if ( isObjectRegistered( (*buddy).buddy ) ) { if ( firstBuddy ) { out << endl; @@ -731,13 +731,13 @@ 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 == "QDataTable" || s == "QDataBrowser" ) { + TQString s = getClassName( nl.item(i).toElement() ); + if ( s == "TQDataTable" || s == "TQDataBrowser" ) { if ( !isFrameworkCodeGenerated( nl.item(i).toElement() ) ) continue; - if ( s == "QDataTable" ) + if ( s == "TQDataTable" ) needSqlTableEventHandler = TRUE; - if ( s == "QDataBrowser" ) + if ( s == "TQDataBrowser" ) needSqlDataBrowserEventHandler = TRUE; } if ( needFontEventHandler && needSqlTableEventHandler && needSqlDataBrowserEventHandler ) @@ -749,15 +749,15 @@ void Uic::createFormImpl( const QDomElement &e ) out << " * Main event handler. Reimplemented to handle" << endl; out << " * application font changes"; out << " */" << endl; - out << "bool " << nameOfClass << "::event( QEvent* ev )" << endl; + out << "bool " << nameOfClass << "::event( TQEvent* ev )" << endl; out << "{" << endl; out << " bool ret = " << objClass << "::event( ev ); " << endl; if ( needFontEventHandler ) { ++indent; - out << " if ( ev->type() == QEvent::ApplicationFontChange ) {" << endl; + out << " if ( ev->type() == TQEvent::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 ); } @@ -779,12 +779,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 == "QDataTable" ) { + TQString s = getClassName( nl.item(i).toElement() ); + if ( s == "TQDataTable" ) { 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 self." << c << ":" << endl; ++indent; @@ -793,19 +793,19 @@ void Uic::createFormImpl( const QDomElement &e ) out << indent << "if not cursor:" << endl; ++indent; if ( conn == "(default)" ) - out << indent << "cursor = QSqlCursor(\"" << tab << "\")" << endl; + out << indent << "cursor = TQSqlCursor(\"" << tab << "\")" << endl; else - out << indent << "cursor = QSqlCursor(\"" << tab << "\",1,self." << conn << "Connection)" << endl; + out << indent << "cursor = TQSqlCursor(\"" << tab << "\",1,self." << conn << "Connection)" << endl; out << indent << "if self." << c << ".isReadOnly():" << endl; ++indent; - out << indent << "cursor.setMode(QSqlCursor.ReadOnly)" << endl; + out << indent << "cursor.setMode(TQSqlCursor.ReadOnly)" << endl; --indent; out << indent << "self." << c << ".setSqlCursor(cursor,0,1)" << endl; --indent; out << endl; out << indent << "if not cursor.isActive():" << endl; ++indent; - out << indent << "self." << c << ".refresh(QDataTable.RefreshAll)" << endl; + out << indent << "self." << c << ".refresh(TQDataTable.RefreshAll)" << endl; --indent; --indent; } @@ -815,12 +815,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 == "QDataBrowser" ) { - QString obj = getObjectName( nl.item(i).toElement() ); - QString tab = getDatabaseInfo( nl.item(i).toElement(), + TQString s = getClassName( nl.item(i).toElement() ); + if ( s == "TQDataBrowser" ) { + 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 self." << obj << ":" << endl; @@ -828,9 +828,9 @@ void Uic::createFormImpl( const QDomElement &e ) out << indent << "if not self." << obj << ".sqlCursor():" << endl; ++indent; if ( conn == "(default)" ) - out << indent << "cursor = QSqlCursor(\"" << tab << "\")" << endl; + out << indent << "cursor = TQSqlCursor(\"" << tab << "\")" << endl; else - out << indent << "cursor = QSqlCursor(\"" << tab << "\",1,self." << conn << "Connection)" << endl; + out << indent << "cursor = TQSqlCursor(\"" << tab << "\",1,self." << conn << "Connection)" << endl; out << indent << "self." << obj << ".setSqlCursor(cursor,1)" << endl; out << indent << "self." << obj << ".refresh()" << endl; out << indent << "self." << obj << ".first()" << endl; @@ -853,22 +853,22 @@ void Uic::createFormImpl( const QDomElement &e ) // create stubs for additional slots if necessary if ( !extraSlots.isEmpty() && writeFunctImpl ) { - QStringList::ConstIterator cit; + TQStringList::ConstIterator cit; for ( cit = extraSlots.begin(); cit != extraSlots.end(); ++cit ) { pySlot(cit); bool createWarning = TRUE; - QString fname = Parser::cleanArgs( *cit ); - QMap::Iterator fit = functionImpls.find( fname ); + TQString fname = Parser::cleanArgs( *cit ); + TQMap::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 ) { ++indent; - QString formatted_body = body.replace(QRegExp("\n"), QString("\n") + QString(indent)); + TQString formatted_body = body.replace(TQRegExp("\n"), TQString("\n") + TQString(indent)); out << formatted_body << endl; --indent; } @@ -895,17 +895,17 @@ 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" ) != "QDataTable" ) { - QString field = getDatabaseInfo( e, "field" ); + e.attribute( "class" ) != "TQDataTable" ) { + TQString field = getDatabaseInfo( e, "field" ); if ( !field.isEmpty() ) { if ( isWidgetInTable( e, connection, table ) ) out << indent << form << "Form.insert(self." << 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 ); } @@ -914,7 +914,7 @@ void Uic::createFormImpl( const QDomElement& e, const QString& form, const QStri // Generate a Python slot definition. -void Uic::pySlot(QStringList::ConstIterator &it) +void Uic::pySlot(TQStringList::ConstIterator &it) { out << endl; @@ -925,7 +925,7 @@ void Uic::pySlot(QStringList::ConstIterator &it) // remove the types - too complicated for the moment, so we just count them // and give them names based on their position. - QString args = (*it).mid(astart + 1,(*it).find(')') - astart - 1).stripWhiteSpace(); + TQString args = (*it).mid(astart + 1,(*it).find(')') - astart - 1).stripWhiteSpace(); if (!args.isEmpty()) { int nrargs = args.contains(',') + 1; diff --git a/python/pyqt/pyuic3/globaldefs.h b/python/pyqt/pyuic3/globaldefs.h index 4ae0cd83..87fafbef 100644 --- a/python/pyqt/pyuic3/globaldefs.h +++ b/python/pyqt/pyuic3/globaldefs.h @@ -21,16 +21,16 @@ #ifndef GLOBALDEFS_H #define GLOBALDEFS_H -#include -#include +#include +#include #define BOXLAYOUT_DEFAULT_MARGIN 11 #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() { @@ -38,17 +38,17 @@ static void init_colors() return; #if 0 // a calculated alternative for backColor1 - QColorGroup myCg = qApp->palette().active(); + TQColorGroup myCg = qApp->palette().active(); int h1, s1, v1; int h2, s2, v2; - myCg.color( QColorGroup::Base ).hsv( &h1, &s1, &v1 ); - myCg.color( QColorGroup::Background ).hsv( &h2, &s2, &v2 ); - QColor c( h1, s1, ( v1 + v2 ) / 2, QColor::Hsv ); + myCg.color( TQColorGroup::Base ).hsv( &h1, &s1, &v1 ); + myCg.color( TQColorGroup::Background ).hsv( &h2, &s2, &v2 ); + TQColor c( h1, s1, ( v1 + v2 ) / 2, TQColor::Hsv ); #endif - backColor1 = new QColor( 250, 248, 235 ); - backColor2 = new QColor( 255, 255, 255 ); - selectedBack = new QColor( 230, 230, 230 ); + backColor1 = new TQColor( 250, 248, 235 ); + backColor2 = new TQColor( 255, 255, 255 ); + selectedBack = new TQColor( 230, 230, 230 ); } #endif diff --git a/python/pyqt/pyuic3/main.cpp b/python/pyqt/pyuic3/main.cpp index 265a536c..fa93b9e3 100644 --- a/python/pyqt/pyuic3/main.cpp +++ b/python/pyqt/pyuic3/main.cpp @@ -23,13 +23,13 @@ #include "parser.h" #include "widgetdatabase.h" #include "domtool.h" -#include -#include -#include -#include +#include +#include +#include +#include #define NO_STATIC_COLORS #include -#include +#include #include #include @@ -39,20 +39,20 @@ int main( int argc, char * argv[] ) bool testCode = FALSE, execCode = FALSE; bool subcl = FALSE; bool imagecollection = FALSE; - QStringList images; + TQStringList images; const char *error = 0; const char* fileName = 0; - QCString outputFile; + TQCString outputFile; const char* projectName = 0; const char* trmacro = 0; bool fix = FALSE; - QApplication app(argc, argv, FALSE); - QString className, uicClass; + TQApplication app(argc, argv, FALSE); + TQString className, uicClass; for ( int n = 1; n < argc && error == 0; n++ ) { - QCString arg = argv[n]; + TQCString arg = argv[n]; if ( arg[0] == '-' ) { // option - QCString opt = &arg[1]; + TQCString opt = &arg[1]; if ( opt[0] == 'o' ) { // output redirection if ( opt[1] == '\0' ) { if ( !(n < argc-1) ) { @@ -107,7 +107,7 @@ int main( int argc, char * argv[] ) error = "Missing Python indent"; break; } - tabstop = QCString(argv[++n]).toUInt(&ok); + tabstop = TQCString(argv[++n]).toUInt(&ok); } else tabstop = opt.mid(1).toUInt(&ok); @@ -150,7 +150,7 @@ int main( int argc, char * argv[] ) "Options:\n" "\t-o file\t\tWrite output to file rather than stdout\n" "\t-p indent\tSet the Python indent in spaces (0 to use a tab)\n" - "\t-tr func\tUse func() rather than QApplication.translate() for i18n\n" + "\t-tr func\tUse func() rather than TQApplication.translate() for i18n\n" "\t-x\t\tGenerate extra code to test and display the class\n" "\t-test\t\tGenerate extra code to test but not display the class\n" "\t-version\tDisplay version of pyuic\n" @@ -161,7 +161,7 @@ int main( int argc, char * argv[] ) Uic::setIndent(indent); - QFile fileOut; + TQFile fileOut; if ( !outputFile.isEmpty() ) { fileOut.setName( outputFile ); if (!fileOut.open( IO_WriteOnly ) ) @@ -169,30 +169,30 @@ int main( int argc, char * argv[] ) } else { fileOut.open( IO_WriteOnly, stdout ); } - QTextStream out( &fileOut ); + TQTextStream out( &fileOut ); if ( imagecollection ) { - out.setEncoding( QTextStream::Latin1 ); + out.setEncoding( TQTextStream::Latin1 ); out << "# -*- coding: latin-1 -*-\n\n"; Uic::embed( out, projectName, images ); return 0; } - out.setEncoding( QTextStream::UnicodeUTF8 ); - QFile file( fileName ); + out.setEncoding( TQTextStream::UnicodeUTF8 ); + TQFile file( fileName ); if ( !file.open( IO_ReadOnly ) ) qFatal( "pyuic: Could not open file '%s' ", fileName ); - QDomDocument doc; - QString errMsg; + TQDomDocument doc; + TQString errMsg; int errLine; if ( !doc.setContent( &file, &errMsg, &errLine ) ) - qFatal( QString("pyuic: Failed to parse %s: ") + errMsg + QString (" in line %d\n"), fileName, errLine ); + qFatal( TQString("pyuic: Failed to parse %s: ") + errMsg + TQString (" in line %d\n"), fileName, errLine ); - QDomElement e = doc.firstChild().toElement(); + TQDomElement e = doc.firstChild().toElement(); if ( e.hasAttribute("version") && e.attribute("version").toDouble() > 3.3 ) { - qWarning( QString("pyuic: File generated with too recent version of Qt Designer (%s vs. %s)"), + qWarning( TQString("pyuic: File generated with too recent version of Qt Designer (%s vs. %s)"), e.attribute("version").latin1(), QT_VERSION_STR ); return 1; } @@ -209,7 +209,7 @@ 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 << "# Created: " << TQDateTime::currentDateTime().toString() << endl; out << "# by: The PyQt User Interface Compiler (pyuic) " << PYQT_VERSION << endl; out << "#" << endl; out << "# WARNING! All changes made in this file will be lost!" << endl; @@ -228,8 +228,8 @@ int main( int argc, char * argv[] ) out << endl; out << indent << "if __name__ == \"__main__\":" << endl; ++indent; - out << indent << "a = QApplication(sys.argv)" << endl; - out << indent << "QObject.connect(a,SIGNAL(\"lastWindowClosed()\"),a,SLOT(\"quit()\"))" << endl; + out << indent << "a = TQApplication(sys.argv)" << endl; + out << indent << "TQObject.connect(a,TQT_SIGNAL(\"lastWindowClosed()\"),a,TQT_SLOT(\"quit()\"))" << endl; out << indent << "w = " << (subcl ? className : uicClass) << "()" << endl; out << indent << "a.setMainWidget(w)" << endl; diff --git a/python/pyqt/pyuic3/object.cpp b/python/pyqt/pyuic3/object.cpp index 834427f5..335bce9b 100644 --- a/python/pyqt/pyuic3/object.cpp +++ b/python/pyqt/pyuic3/object.cpp @@ -21,9 +21,9 @@ #include "uic.h" #include "parser.h" #include "domtool.h" -#include -#include -#include +#include +#include +#include #define NO_STATIC_COLORS #include @@ -38,17 +38,17 @@ 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 == "self" && isMainWindow ) { if ( !createdCentralWidget ) - out << indent << "self.setCentralWidget(QWidget(self,\"qt_central_widget\"))" << endl; + out << indent << "self.setCentralWidget(TQWidget(self,\"qt_central_widget\"))" << endl; createdCentralWidget = TRUE; parent = "self.centralWidget()"; } - QDomElement n; - QString objClass, objName, fullObjName; + TQDomElement n; + TQString objClass, objName, fullObjName; int numItems = 0; int numColumns = 0; int numRows = 0; @@ -61,7 +61,7 @@ QString Uic::createObjectImpl( const QDomElement &e, const QString& parentClass, return objName; objName = getObjectName( e ); - QString definedName = objName; + TQString definedName = objName; bool isTmpObject = objName.isEmpty() || objClass == "QLayoutWidget"; if ( isTmpObject ) { if ( objClass[0] == 'Q' ) @@ -72,17 +72,17 @@ QString Uic::createObjectImpl( const QDomElement &e, const QString& parentClass, bool isLine = objClass == "Line"; if ( isLine ) - objClass = "QFrame"; + objClass = "TQFrame"; out << endl; if ( objClass == "QLayoutWidget" ) { if ( layout.isEmpty() ) { // register the object and unify its name objName = registerObject( objName ); - out << indent << objName << " = QWidget(" << parent << ",\"" << definedName << "\")" << endl; + out << indent << objName << " = TQWidget(" << parent << ",\"" << definedName << "\")" << 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 ); @@ -92,7 +92,7 @@ QString Uic::createObjectImpl( const QDomElement &e, const QString& parentClass, // Layouts don't go into the class instance dictionary. fullObjName = objName; - } else if ( objClass != "QToolBar" && objClass != "QMenuBar" ) { + } else if ( objClass != "TQToolBar" && objClass != "TQMenuBar" ) { // register the object and unify its name objName = registerObject( objName ); @@ -105,7 +105,7 @@ QString Uic::createObjectImpl( const QDomElement &e, const QString& parentClass, fullObjName = "self." + objName; if ( objClass == "QAxWidget" ) { - QString controlId; + 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(); @@ -122,10 +122,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" ) @@ -139,35 +139,35 @@ QString Uic::createObjectImpl( const QDomElement &e, const QString& parentClass, if ( isLine && prop == "orientation" ) { prop = "frameShape"; if ( value.right(10) == "Horizontal" ) - value = "QFrame.HLine"; + value = "TQFrame.HLine"; else - value = "QFrame.VLine"; + value = "TQFrame.VLine"; if ( !hadFrameShadow ) { prop = "frameStyle"; - value += " | QFrame.Sunken"; + value += " | TQFrame.Sunken"; } } if ( prop == "buttonGroupId" ) { - if ( parentClass == "QButtonGroup" ) + if ( parentClass == "TQButtonGroup" ) out << indent << parent << ".insert( " << fullObjName << "," << value << ")" << endl; continue; } if ( prop == "frameworkCode" ) continue; - if ( objClass == "QMultiLineEdit" && - QRegExp("echoMode|hMargin|maxLength|maxLines|undoEnabled").exactMatch(prop) ) + if ( objClass == "TQMultiLineEdit" && + TQRegExp("echoMode|hMargin|maxLength|maxLines|undoEnabled").exactMatch(prop) ) continue; - QString call = fullObjName + "."; - QString tail; + TQString call = fullObjName + "."; + TQString tail; if ( stdset ) { call += mkStdSet( prop ) + "("; tail = ")"; } else { - call += "setProperty(\"" + prop + "\",QVariant("; + call += "setProperty(\"" + prop + "\",TQVariant("; tail = "))"; } if ( prop == "accel" ) { - call += "QKeySequence("; + call += "TQKeySequence("; tail += ")"; } call += value + tail; @@ -179,8 +179,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.contains( "ListBox" ) ) { call = createListBoxItemImpl( n, fullObjName ); @@ -204,7 +204,7 @@ QString Uic::createObjectImpl( const QDomElement &e, const QString& parentClass, trout << trindent << call << endl; } } else if ( objClass.contains( "ListView" ) ) { - call = createListViewItemImpl( n, fullObjName, QString::null ); + call = createListViewItemImpl( n, fullObjName, TQString::null ); if ( !call.isEmpty() ) { if ( numItems == 0 ) trout << trindent << fullObjName << ".clear()" << endl; @@ -214,8 +214,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.contains( "ListView" ) ) { call = createListViewColumnImpl( n, fullObjName, &value ); @@ -224,7 +224,7 @@ QString Uic::createObjectImpl( const QDomElement &e, const QString& parentClass, trout << trindent << fullObjName << ".header().setLabel(" << numColumns++ << "," << value << ")\n"; } - } else if ( objClass == "QTable" || objClass == "QDataTable" ) { + } else if ( objClass == "TQTable" || objClass == "TQDataTable" ) { bool isCols = ( n.tagName() == "column" ); call = createTableRowColumnImpl( n, fullObjName, &value ); if ( !call.isEmpty() ) { @@ -241,37 +241,37 @@ QString Uic::createObjectImpl( const QDomElement &e, const QString& parentClass, // create all children, some widgets have special requirements - if ( objClass == "QTabWidget" ) { + if ( objClass == "TQTabWidget" ) { for ( n = e.firstChild().toElement(); !n.isNull(); n = n.nextSibling().toElement() ) { if ( tags.contains( n.tagName() ) ) { - QString page = createObjectImpl( n, objClass, fullObjName ); - QString comment; - QString label = DomTool::readAttribute( n, "title", "", comment ).toString(); - out << indent << fullObjName << ".insertTab(" << page << ",QString.fromLatin1(\"\"))" << endl; + TQString page = createObjectImpl( n, objClass, fullObjName ); + TQString comment; + TQString label = DomTool::readAttribute( n, "title", "", comment ).toString(); + out << indent << fullObjName << ".insertTab(" << page << ",TQString.fromLatin1(\"\"))" << endl; trout << trindent << fullObjName << ".changeTab(" << page << "," << trcall( label, comment ) << ")" << endl; } } - } else if ( objClass == "QWidgetStack" ) { + } else if ( objClass == "TQWidgetStack" ) { for ( n = e.firstChild().toElement(); !n.isNull(); n = n.nextSibling().toElement() ) { if ( tags.contains( n.tagName() ) ) { - QString page = createObjectImpl( n, objClass, fullObjName ); + TQString page = createObjectImpl( n, objClass, fullObjName ); int id = DomTool::readAttribute( n, "id", "" ).toInt(); out << indent << fullObjName << ".addWidget(" << page << "," << id << ")" << endl; } } - } else if ( objClass == "QToolBox" ) { + } else if ( objClass == "TQToolBox" ) { for ( n = e.firstChild().toElement(); !n.isNull(); n = n.nextSibling().toElement() ) { if ( tags.contains( n.tagName() ) ) { - QString page = createObjectImpl( n, objClass, fullObjName ); - QString comment; - QString label = DomTool::readAttribute( n, "label", "", comment ).toString(); - out << indent << fullObjName << ".addItem(" << page << ",QString.fromLatin1(\"\"))" << endl; + TQString page = createObjectImpl( n, objClass, fullObjName ); + TQString comment; + TQString label = DomTool::readAttribute( n, "label", "", comment ).toString(); + out << indent << fullObjName << ".addItem(" << page << ",TQString.fromLatin1(\"\"))" << endl; trout << trindent << fullObjName << ".setItemLabel(" << fullObjName << ".indexOf(" << page << ")," << trcall( label, comment ) << ")" << endl; } } - } else if ( objClass != "QToolBar" && objClass != "QMenuBar" ) { // standard widgets + } else if ( objClass != "TQToolBar" && objClass != "TQMenuBar" ) { // standard widgets for ( n = e.firstChild().toElement(); !n.isNull(); n = n.nextSibling().toElement() ) { if ( tags.contains( n.tagName() ) ) createObjectImpl( n, objClass, fullObjName ); @@ -293,13 +293,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; @@ -309,55 +309,55 @@ 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; - out << indent << indent << objName << ".setProperty(\"" << prop << "\",QVariant(" << value << "))" << endl; + out << indent << indent << objName << ".setProperty(\"" << prop << "\",TQVariant(" << value << "))" << endl; } } } -/* Convert a QSizePolicy::SizeType to text. */ -static QString mapSizeType(QSizePolicy::SizeType st) +/* Convert a TQSizePolicy::SizeType to text. */ +static TQString mapSizeType(TQSizePolicy::SizeType st) { const char *txt; switch (st) { - case QSizePolicy::Fixed: - txt = "QSizePolicy.Fixed"; + case TQSizePolicy::Fixed: + txt = "TQSizePolicy.Fixed"; break; - case QSizePolicy::Minimum: - txt = "QSizePolicy.Minimum"; + case TQSizePolicy::Minimum: + txt = "TQSizePolicy.Minimum"; break; - case QSizePolicy::Maximum: - txt = "QSizePolicy.Maximum"; + case TQSizePolicy::Maximum: + txt = "TQSizePolicy.Maximum"; break; - case QSizePolicy::Preferred: - txt = "QSizePolicy.Preferred"; + case TQSizePolicy::Preferred: + txt = "TQSizePolicy.Preferred"; break; - case QSizePolicy::MinimumExpanding: - txt = "QSizePolicy.MinimumExpanding"; + case TQSizePolicy::MinimumExpanding: + txt = "TQSizePolicy.MinimumExpanding"; break; - case QSizePolicy::Expanding: - txt = "QSizePolicy.Expanding"; + case TQSizePolicy::Expanding: + txt = "TQSizePolicy.Expanding"; break; - case QSizePolicy::Ignored: - txt = "QSizePolicy.Ignored"; + case TQSizePolicy::Ignored: + txt = "TQSizePolicy.Ignored"; break; default: - txt = "Invalid QSizePolicy::SizeType"; + txt = "Invalid TQSizePolicy::SizeType"; } return txt; @@ -368,11 +368,11 @@ static QString mapSizeType(QSizePolicy::SizeType st) 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" ) @@ -385,11 +385,11 @@ QString Uic::setObjectProperty( const QString& objClass, const QString& obj, con h = n3.firstChild().toText().data().toInt(); n3 = n3.nextSibling().toElement(); } - v = "QRect(%1,%2,%3,%4)"; + v = "TQRect(%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" ) @@ -398,10 +398,10 @@ QString Uic::setObjectProperty( const QString& objClass, const QString& obj, con y = n3.firstChild().toText().data().toInt(); n3 = n3.nextSibling().toElement(); } - v = "QPoint(%1,%2)"; + v = "TQPoint(%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" ) @@ -410,10 +410,10 @@ QString Uic::setObjectProperty( const QString& objClass, const QString& obj, con h = n3.firstChild().toText().data().toInt(); n3 = n3.nextSibling().toElement(); } - v = "QSize(%1,%2)"; + v = "TQSize(%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" ) @@ -424,18 +424,18 @@ QString Uic::setObjectProperty( const QString& objClass, const QString& obj, con b = n3.firstChild().toText().data().toInt(); n3 = n3.nextSibling().toElement(); } - v = "QColor(%1,%2,%3)"; + v = "TQColor(%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 << fontname << " = QFont(self." << obj << ".font())" << endl; + out << indent << fontname << " = TQFont(self." << obj << ".font())" << endl; } else { fontname = registerObject( "f" ); - out << indent << fontname << " = QFont(self.font())" << endl; + out << indent << fontname << " = TQFont(self.font())" << endl; } while ( !n3.isNull() ) { if ( n3.tagName() == "family" ) @@ -462,22 +462,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 != "QAction" && objClass != "QActionGroup" ) { + if ( prop == "toolTip" && objClass != "TQAction" && objClass != "TQActionGroup" ) { if ( !obj.isEmpty() ) - trout << trindent << "QToolTip.add(self." << obj << "," + trout << trindent << "TQToolTip.add(self." << obj << "," << trcall( txt, com ) << ")" << endl; else - trout << trindent << "QToolTip.add(self," + trout << trindent << "TQToolTip.add(self," << trcall( txt, com ) << ")" << endl; - } else if ( prop == "whatsThis" && objClass != "QAction" && objClass != "QActionGroup" ) { + } else if ( prop == "whatsThis" && objClass != "TQAction" && objClass != "TQActionGroup" ) { if ( !obj.isEmpty() ) - trout << trindent << "QWhatsThis.add(self." << obj << "," + trout << trindent << "TQWhatsThis.add(self." << obj << "," << trcall( txt, com ) << ")" << endl; else - trout << trindent << "QWhatsThis.add(self," + trout << trindent << "TQWhatsThis.add(self," << trcall( txt, com ) << ")" << endl; } else { v = trcall( txt, com ); @@ -492,7 +492,7 @@ QString Uic::setObjectProperty( const QString& objClass, const QString& obj, con if ( stdset ) v = "%1"; else - v = "QVariant(%1,0)"; + v = "TQVariant(%1,0)"; v = v.arg( mkBool( e.firstChild().toText().data() ) ); } else if ( e.tagName() == "pixmap" ) { v = e.firstChild().toText().data(); @@ -500,19 +500,19 @@ QString Uic::setObjectProperty( const QString& objClass, const QString& obj, con if ( pixmapLoaderFunction.isEmpty() ) { v.prepend( "self." ); } else { - v.prepend( pixmapLoaderFunction + "(" + QString( externPixmaps ? "\"" : "" ) ); - v.append( QString( externPixmaps ? "\"" : "" ) + ")" ); + v.prepend( pixmapLoaderFunction + "(" + TQString( externPixmaps ? "\"" : "" ) ); + v.append( TQString( externPixmaps ? "\"" : "" ) + ")" ); } } } else if ( e.tagName() == "iconset" ) { - v = "QIconSet(%1)"; - QString s = e.firstChild().toText().data(); + v = "TQIconSet(%1)"; + TQString s = e.firstChild().toText().data(); if ( !s.isEmpty() ) { if ( pixmapLoaderFunction.isEmpty() ) { s.prepend( "self." ); } else { - s.prepend( pixmapLoaderFunction + "(" + QString( externPixmaps ? "\"" : "" ) ); - s.append( QString( externPixmaps ? "\"" : "" ) + ")" ); + s.prepend( pixmapLoaderFunction + "(" + TQString( externPixmaps ? "\"" : "" ) ); + s.append( TQString( externPixmaps ? "\"" : "" ) + ")" ); } } v = v.arg( s ); @@ -520,16 +520,16 @@ QString Uic::setObjectProperty( const QString& objClass, const QString& obj, con v = e.firstChild().toText().data() + ".convertToImage()"; } else if ( e.tagName() == "enum" ) { v = "%1.%2"; - QString oc = objClass; - QString ev = e.firstChild().toText().data(); - if ( oc == "QListView" && ev == "Manual" ) // #### workaround, rename QListView::Manual in 4.0 - oc = "QScrollView"; + TQString oc = objClass; + TQString ev = e.firstChild().toText().data(); + if ( oc == "TQListView" && ev == "Manual" ) // #### workaround, rename TQListView::Manual in 4.0 + oc = "TQScrollView"; v = v.arg( oc ).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 = ""; - QStringList::Iterator it = lst.begin(); + TQStringList::Iterator it = lst.begin(); while ( it != lst.end() ) { v += objClass + "." + *it; if ( it != lst.fromLast() ) @@ -537,32 +537,32 @@ QString Uic::setObjectProperty( const QString& objClass, const QString& obj, con ++it; } } 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 = "self."; + TQString tmp = "self."; if ( !obj.isEmpty() ) tmp += obj + "."; - v = "QSizePolicy(%1,%2,%3,%4," + tmp + "sizePolicy().hasHeightForWidth())"; + v = "TQSizePolicy(%1,%2,%3,%4," + tmp + "sizePolicy().hasHeightForWidth())"; v = v.arg( mapSizeType(sp.horData()) ).arg( mapSizeType(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 ); @@ -576,19 +576,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 = "QPalette(QColor(%1,%2,%3),QColor(%1,%2,%3))"; + if ( no_pixmaps && pal == TQPalette( pal.active().button(), pal.active().background() ) ) { + v = "TQPalette(TQColor(%1,%2,%3),TQColor(%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 << " = QPalette()" << endl; + out << indent << palette << " = TQPalette()" << endl; pal_used = TRUE; } - QString cg = "cg"; + TQString cg = "cg"; if ( !cg_used ) { - out << indent << cg << " = QColorGroup()" << endl; + out << indent << cg << " = TQColorGroup()" << endl; cg_used = TRUE; } n = e.firstChild().toElement(); @@ -611,10 +611,10 @@ QString Uic::setObjectProperty( const QString& objClass, const QString& obj, con v = palette; } } else if ( e.tagName() == "cursor" ) { - v = "QCursor(%1)"; + v = "TQCursor(%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() ) { @@ -626,10 +626,10 @@ QString Uic::setObjectProperty( const QString& objClass, const QString& obj, con d = n3.firstChild().toText().data().toInt(); n3 = n3.nextSibling().toElement(); } - v = "QDate(%1,%2,%3)"; + v = "TQDate(%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() ) { @@ -641,10 +641,10 @@ QString Uic::setObjectProperty( const QString& objClass, const QString& obj, con s = n3.firstChild().toText().data().toInt(); n3 = n3.nextSibling().toElement(); } - v = "QTime(%1,%2,%3)"; + v = "TQTime(%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() ) { @@ -662,18 +662,18 @@ QString Uic::setObjectProperty( const QString& objClass, const QString& obj, con d = n3.firstChild().toText().data().toInt(); n3 = n3.nextSibling().toElement(); } - v = "QDateTime(QDate(%1,%2,%3),QTime(%4,%5,%6))"; + v = "TQDateTime(TQDate(%1,%2,%3),TQTime(%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 = "l"; + TQStringList l; + TQDomElement n3 = e.firstChild().toElement(); + TQString listname = "l"; if ( !obj.isEmpty() ) { listname = obj + "_stringlist"; listname = registerObject( listname ); - out << indent << listname << " = QStringList()" << endl; + out << indent << listname << " = TQStringList()" << endl; } else { - out << indent << listname << " = QStringList()" << endl; + out << indent << listname << " = TQStringList()" << endl; } while ( !n3.isNull() ) { if ( n3.tagName() == "string" ) @@ -690,9 +690,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/python/pyqt/pyuic3/parser.cpp b/python/pyqt/pyuic3/parser.cpp index 4fc13c5f..15374aa5 100644 --- a/python/pyqt/pyuic3/parser.cpp +++ b/python/pyqt/pyuic3/parser.cpp @@ -19,28 +19,28 @@ **********************************************************************/ #include "parser.h" -#include -#include +#include +#include class NormalizeObject : public QObject { 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/python/pyqt/pyuic3/parser.h b/python/pyqt/pyuic3/parser.h index 5a5671ad..ace96d9e 100644 --- a/python/pyqt/pyuic3/parser.h +++ b/python/pyqt/pyuic3/parser.h @@ -21,12 +21,12 @@ #ifndef PARSER_H #define PARSER_H -#include +#include class Parser { public: - static QString cleanArgs( const QString &func ); + static TQString cleanArgs( const TQString &func ); }; diff --git a/python/pyqt/pyuic3/subclassing.cpp b/python/pyqt/pyuic3/subclassing.cpp index 299e0449..251d704f 100644 --- a/python/pyqt/pyuic3/subclassing.cpp +++ b/python/pyqt/pyuic3/subclassing.cpp @@ -22,12 +22,12 @@ #include "parser.h" #include "widgetdatabase.h" #include "domtool.h" -#include -#include -#include +#include +#include +#include #define NO_STATIC_COLORS #include -#include +#include #include #include @@ -38,17 +38,17 @@ \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; - QString supClsMod = fileName; + TQString supClsMod = fileName; int tail = supClsMod.findRev('.',-1); if (tail >= 0) supClsMod.truncate(tail); @@ -62,7 +62,7 @@ void Uic::createSubImpl( const QDomElement &e, const QString& subClass ) out << endl; // constructor - if ( objClass == "QDialog" || objClass == "QWizard" ) { + if ( objClass == "TQDialog" || objClass == "TQWizard" ) { out << indent << "def __init__(self,parent = None,name = None,modal = 0,fl = 0):" << endl; ++indent; out << indent << nameOfClass << ".__init__(self,parent,name,modal,fl)" << endl; @@ -74,12 +74,12 @@ void Uic::createSubImpl( const QDomElement &e, const QString& subClass ) --indent; // 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" ); for ( i = 0; i < (int) nl.length(); i++ ) { @@ -89,12 +89,12 @@ void Uic::createSubImpl( const QDomElement &e, const QString& subClass ) continue; if ( n.attribute( "language", "C++" ) != "C++" ) 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; @@ -117,12 +117,12 @@ void Uic::createSubImpl( const QDomElement &e, const QString& subClass ) continue; if ( n.attribute( "language", "C++" ) != "C++" ) 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; @@ -162,13 +162,13 @@ void Uic::createSubImpl( const QDomElement &e, const QString& subClass ) --indent; } -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 it, it2, it3; + TQValueListConstIterator 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/python/pyqt/pyuic3/uic.cpp b/python/pyqt/pyuic3/uic.cpp index d3593020..b9e046c5 100644 --- a/python/pyqt/pyuic3/uic.cpp +++ b/python/pyqt/pyuic3/uic.cpp @@ -23,12 +23,12 @@ #include "parser.h" #include "widgetdatabase.h" #include "domtool.h" -#include -#include -#include +#include +#include +#include #define NO_STATIC_COLORS #include -#include +#include #include #include @@ -52,36 +52,36 @@ 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 ) { #if QT_VERSION >= 0x030100 - QString s; + TQString s; if ( !encode ) { s = str; s.replace( "\\", "\\\\" ); @@ -89,7 +89,7 @@ QString Uic::fixString( const QString &str, bool encode ) s.replace( "\r", "" ); s.replace( "\n", "\\n\"\n\"" ); } else { - QCString utf8 = str.utf8(); + TQCString utf8 = str.utf8(); const int l = utf8.length(); for ( int i = 0; i < l; ++i ) { @@ -101,25 +101,25 @@ QString Uic::fixString( const QString &str, bool encode ) if (ch <= 0x0f) s += "0"; - s += QString::number( ch, 16 ); + s += TQString::number( ch, 16 ); } } } #else - QString s( str ); - s.replace( QRegExp( "\\\\" ), "\\\\" ); - s.replace( QRegExp( "\"" ), "\\\"" ); - s.replace( QRegExp( "\r?\n" ), "\\n\"\n\"" ); + TQString s( str ); + s.replace( TQRegExp( "\\\\" ), "\\\\" ); + s.replace( TQRegExp( "\"" ), "\\\"" ); + s.replace( TQRegExp( "\r?\n" ), "\\n\"\n\"" ); #endif 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.null"; + return "TQString.null"; - QString t = trmacro; + TQString t = trmacro; bool encode = FALSE; if ( t.isNull() ) { t = "self.__tr"; @@ -145,9 +145,9 @@ QString Uic::trcall( const QString& sourceText, const QString& comment ) } } -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); } @@ -158,9 +158,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, QString &uicClass ) +Uic::Uic( const TQString &fn, const char *outputFn, TQTextStream &outStream, + TQDomDocument doc, bool subcl, const TQString &trm, + const TQString& subClass, TQString &uicClass ) : out( outStream ), trout (&languageChangeBody ), outputFileName( outputFn ), trmacro( trm ), pyNeedTr(FALSE), pyNeedTrUtf8(FALSE) @@ -191,14 +191,14 @@ Uic::Uic( const QString &fn, const char *outputFn, QTextStream &outStream, return; // Extract any Python code in the comments. - QStringList comm = QStringList::split('\n',getComment(doc.firstChild())); + TQStringList comm = TQStringList::split('\n',getComment(doc.firstChild())); - for (QStringList::Iterator it = comm.begin(); it != comm.end(); ++it) + for (TQStringList::Iterator it = comm.begin(); it != comm.end(); ++it) if ((*it).startsWith("Python:")) pyCode += (*it).mid(7) + "\n"; - 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; @@ -213,13 +213,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( "()" ); } } @@ -232,7 +232,7 @@ Uic::Uic( const QString &fn, const char *outputFn, QTextStream &outStream, uicClass = nameOfClass; - namespaces = QStringList::split( "::", nameOfClass ); + namespaces = TQStringList::split( "::", nameOfClass ); bareNameOfClass = namespaces.last(); namespaces.remove( namespaces.fromLast() ); @@ -258,7 +258,7 @@ Uic::Uic( const QString &fn, const char *outputFn, QTextStream &outStream, out << "\n"; out << indent << "def __trUtf8(self,s,c = None):\n"; ++indent; - out << indent << "return qApp.translate(\"" << nameOfClass << "\",s,c,QApplication.UnicodeUTF8)\n"; + out << indent << "return qApp.translate(\"" << nameOfClass << "\",s,c,TQApplication.UnicodeUTF8)\n"; --indent; } @@ -267,26 +267,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] = '_'; @@ -298,24 +298,24 @@ QString Uic::getFormClassName( const QDomElement& e ) /*! Extracts a 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 = "QToolBar"; + s = "TQToolBar"; else if ( s.isEmpty() && e.tagName() == "menubar" ) - s = "QMenuBar"; + s = "TQMenuBar"; return s; } /*! 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; } @@ -323,38 +323,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). */ -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) != "QLayoutWidget" ) 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" ) @@ -364,65 +364,65 @@ 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; } /*! 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::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 << "self." << objName << " = QAction(" << parent << ",\"" << objName << "\")" << endl; + out << indent << "self." << objName << " = TQAction(" << parent << ",\"" << objName << "\")" << endl; else if ( ae.tagName() == "actiongroup" ) - out << indent << "self." << objName << " = QActionGroup(" << parent << ",\"" << objName << "\")" << endl; + out << indent << "self." << objName << " = TQActionGroup(" << parent << ",\"" << objName << "\")" << endl; else continue; bool subActionsDone = FALSE; #if QT_VERSION >= 0x030300 bool hasMenuText = FALSE; - QString actionText; + TQString actionText; #endif - 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( "QAction", objName, prop, n2.firstChild().toElement(), stdset ); + TQString value = setObjectProperty( "TQAction", objName, prop, n2.firstChild().toElement(), stdset ); if ( value.isEmpty() ) continue; - QString call = "self." + objName + "."; + TQString call = "self." + objName + "."; if ( stdset ) call += mkStdSet( prop ) + "(" + value + ")"; else - call += "setProperty(\"" + prop + "\",QVariant(" + value + "))"; + call += "setProperty(\"" + prop + "\",TQVariant(" + value + "))"; #if QT_VERSION >= 0x030300 if (prop == "menuText") @@ -442,14 +442,14 @@ void Uic::createActionImpl( const QDomElement &n, const QString &parent ) } } #if QT_VERSION >= 0x030300 - // workaround for loading pre-3.3 files expecting bogus QAction behavior + // workaround for loading pre-3.3 files expecting bogus TQAction behavior if (!hasMenuText && !actionText.isEmpty() && uiFileVersion < "3.3") trout << indent << "self." << objName << ".setMenuText(" << actionText << ")" << endl; #endif } } -QString get_dock( const QString &d ) +TQString get_dock( const TQString &d ) { if ( d == "0" ) return "Qt.DockUnmanaged"; @@ -468,27 +468,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 << "self." << objName << " = QToolBar(QString(\"\"),self," << dock << ")" << endl; + TQDomElement ae = nl.item( i ).toElement(); + TQString dock = get_dock( ae.attribute( "dock" ) ); + TQString objName = getObjectName( ae ); + out << indent << "self." << objName << " = TQToolBar(TQString(\"\"),self," << 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 << "self." << n2.attribute( "name" ) << ".addTo(self." << objName << ")" << endl; } else if ( n2.tagName() == "separator" ) { out << indent << "self." << objName << ".addSeparator()" << endl; } else if ( n2.tagName() == "widget" ) { if ( n2.attribute( "class" ) != "Spacer" ) { - createObjectImpl( n2, "QToolBar", "self." + objName ); + createObjectImpl( n2, "TQToolBar", "self." + objName ); } else { - QString child = createSpacerImpl( n2, parentClass, parent, objName ); - out << indent << "QApplication.sendPostedEvents(self." << objName - << ",QEvent.ChildInserted)" << endl; + TQString child = createSpacerImpl( n2, parentClass, parent, objName ); + out << indent << "TQApplication.sendPostedEvents(self." << objName + << ",TQEvent.ChildInserted)" << endl; out << indent << "self." << objName << ".boxLayout().addItem(" << child << ")" << endl; } } @@ -496,22 +496,22 @@ 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 << "self." << objName << " = QMenuBar(self,\"" << objName << "\")" << endl; + TQString objName = getObjectName( n ); + out << indent << "self." << objName << " = TQMenuBar(self,\"" << objName << "\")" << endl; createObjectImpl( n, parentClass, parent ); int i = 0; - QDomElement c = n.firstChild().toElement(); + TQDomElement c = n.firstChild().toElement(); while ( !c.isNull() ) { if ( c.tagName() == "item" ) { - QString itemName = "self." + c.attribute( "name" ); + TQString itemName = "self." + c.attribute( "name" ); out << endl; - out << indent << itemName << " = QPopupMenu(self)" << endl; + out << indent << itemName << " = TQPopupMenu(self)" << endl; createPopupMenuImpl( c, parentClass, itemName ); - out << indent << "self." << objName << ".insertItem(QString(\"\")," << itemName << "," << i << ")" << endl; - QString findItem("self." + objName + ".findItem(%1)"); + out << indent << "self." << objName << ".insertItem(TQString(\"\")," << itemName << "," << i << ")" << endl; + TQString findItem("self." + objName + ".findItem(%1)"); findItem = findItem.arg(i); trout << indent << "if " << findItem << ":" << endl; ++indent; @@ -526,16 +526,16 @@ 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 ) { int i = 0; - 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" ) { - QDomElement n2 = n.nextSibling().toElement(); + TQDomElement n2 = n.nextSibling().toElement(); if ( n2.tagName() == "item" ) { // the action has a sub menu - QString itemName = "self." + n2.attribute( "name" ); - QString itemText = n2.attribute( "text" ); - out << indent << itemName << " = QPopupMenu(self)" << endl; + TQString itemName = "self." + n2.attribute( "name" ); + TQString itemText = n2.attribute( "text" ); + out << indent << itemName << " = TQPopupMenu(self)" << endl; out << indent << parent << ".setAccel(" << trcall( n2.attribute( "accel" ) ) << ","; out << parent << ".insertItem(" << "self." << n.attribute( "name" ) << ".iconSet(),"; out << trcall( itemText ) << "," << itemName << "))" << endl; @@ -557,17 +557,17 @@ 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 ); @@ -577,8 +577,8 @@ QString Uic::createListBoxItemImpl( const QDomElement &e, const QString &parent if ( pixmapLoaderFunction.isEmpty() ) { pix.prepend( "self." ); } else { - pix.prepend( pixmapLoaderFunction + "( " + QString( externPixmaps ? "\"" : "self." ) ); - pix.append( QString( externPixmaps ? "\"" : "" ) + ")" ); + pix.prepend( pixmapLoaderFunction + "( " + TQString( externPixmaps ? "\"" : "self." ) ); + pix.append( TQString( externPixmaps ? "\"" : "" ) + ")" ); } } } @@ -599,16 +599,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 ); @@ -618,8 +618,8 @@ QString Uic::createIconViewItemImpl( const QDomElement &e, const QString &parent if ( pixmapLoaderFunction.isEmpty() ) { pix.prepend( "self." ); } else { - pix.prepend( pixmapLoaderFunction + "( " + QString( externPixmaps ? "\"" : "self." ) ); - pix.append( QString( externPixmaps ? "\"" : "" ) + ")" ); + pix.prepend( pixmapLoaderFunction + "( " + TQString( externPixmaps ? "\"" : "self." ) ); + pix.append( TQString( externPixmaps ? "\"" : "" ) + ")" ); } } } @@ -628,24 +628,24 @@ QString Uic::createIconViewItemImpl( const QDomElement &e, const QString &parent } if ( pix.isEmpty() ) - return "QIconViewItem(" + parent + "," + trcall( txt, com ) + ")"; + return "TQIconViewItem(" + parent + "," + trcall( txt, com ) + ")"; else - return "QIconViewItem(" + parent + "," + trcall( txt, com ) + "," + pix + ")"; + return "TQIconViewItem(" + 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" ); @@ -656,26 +656,26 @@ QString Uic::createListViewItemImpl( const QDomElement &e, const QString &parent s = trindent + item + " = "; if ( !parentItem.isEmpty() ) - s += "QListViewItem(" + parentItem + "," + lastItem + ")\n"; + s += "TQListViewItem(" + parentItem + "," + lastItem + ")\n"; else - s += "QListViewItem(" + parent + "," + lastItem + ")\n"; + s += "TQListViewItem(" + 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() ) { if ( pixmapLoaderFunction.isEmpty() ) { pix.prepend( "self." ); } else { - pix.prepend( pixmapLoaderFunction + "( " + QString( externPixmaps ? "\"" : "self." ) ); - pix.append( QString( externPixmaps ? "\"" : "" ) + ")" ); + pix.prepend( pixmapLoaderFunction + "( " + TQString( externPixmaps ? "\"" : "self." ) ); + pix.append( TQString( externPixmaps ? "\"" : "" ) + ")" ); } } pixmaps << pix; @@ -689,9 +689,9 @@ QString Uic::createListViewItemImpl( const QDomElement &e, const QString &parent for ( int i = 0; i < (int)texts.count(); ++i ) { if ( !texts[ i ].isEmpty() ) - s += trindent + item + ".setText(" + QString::number( i ) + "," + trcall( texts[ i ] ) + ")\n"; + s += trindent + item + ".setText(" + TQString::number( i ) + "," + trcall( texts[ i ] ) + ")\n"; if ( !pixmaps[ i ].isEmpty() ) - s += trindent + item + ".setPixmap(" + QString::number( i ) + "," + pixmaps[ i ] + ")\n"; + s += trindent + item + ".setPixmap(" + TQString::number( i ) + "," + pixmaps[ i ] + ")\n"; } lastItem = item; @@ -702,18 +702,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 ); @@ -723,8 +723,8 @@ QString Uic::createListViewColumnImpl( const QDomElement &e, const QString &pare if ( pixmapLoaderFunction.isEmpty() ) { pix.prepend( "self." ); } else { - pix.prepend( pixmapLoaderFunction + "( " + QString( externPixmaps ? "\"" : "self." ) ); - pix.append( QString( externPixmaps ? "\"" : "" ) + ")" ); + pix.prepend( pixmapLoaderFunction + "( " + TQString( externPixmaps ? "\"" : "self." ) ); + pix.append( TQString( externPixmaps ? "\"" : "" ) + ")" ); } } } else if ( attrib == "clickable" ) @@ -738,10 +738,10 @@ 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,QIconSet(" + pix + ")," + trcall( txt, com ) + ")\n"; + s += indent + parent + ".header().setLabel(" + parent + ".header().count() - 1,TQIconSet(" + pix + ")," + trcall( txt, com ) + ")\n"; if ( !clickable ) s += indent + parent + ".header().setClickEnabled(0," + parent + ".header().count() - 1)\n"; if ( !resizable ) @@ -749,20 +749,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 ); @@ -772,8 +772,8 @@ QString Uic::createTableRowColumnImpl( const QDomElement &e, const QString &pare if ( pixmapLoaderFunction.isEmpty() ) { pix.prepend( "self." ); } else { - pix.prepend( pixmapLoaderFunction + "( " + QString( externPixmaps ? "\"" : "self." ) ); - pix.append( QString( externPixmaps ? "\"" : "" ) + ")" ); + pix.prepend( pixmapLoaderFunction + "( " + TQString( externPixmaps ? "\"" : "self." ) ); + pix.append( TQString( externPixmaps ? "\"" : "" ) + ")" ); } } } else if ( attrib == "field" ) @@ -787,32 +787,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,QIconSet(" + s += indent + parent + ".verticalHeader().setLabel(" + parent + ".numRows() - 1,TQIconSet(" + pix + ")," + trcall( txt, com ) + ")\n"; } else { - if ( objClass == "QTable" ) { + if ( objClass == "TQTable" ) { 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,QIconSet(" + s += indent + parent + ".horizontalHeader().setLabel(" + parent + ".numCols() - 1,TQIconSet(" + pix + ")," + trcall( txt, com ) + ")\n"; - } else if ( objClass == "QDataTable" ) { + } else if ( objClass == "TQDataTable" ) { 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 ) << ",QIconSet(" << pix << "))" << endl; + out << indent << parent << ".addColumn(" << fixString( field ) << "," << trcall( txt, com ) << ",TQIconSet(" << pix << "))" << endl; } } } @@ -822,30 +822,30 @@ 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 = "QVBoxLayout"; + TQString qlayout = "TQVBoxLayout"; if ( objClass == "hbox" ) - qlayout = "QHBoxLayout"; + qlayout = "TQHBoxLayout"; else if ( objClass == "grid" ) - qlayout = "QGridLayout"; + qlayout = "TQGridLayout"; 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 == "QGroupBox" || parentClass == "QButtonGroup") && layout.isEmpty() ) { + if ( (parentClass == "TQGroupBox" || parentClass == "TQButtonGroup") && layout.isEmpty() ) { // special case for group box out << indent << parent << ".setColumnLayout(0,Qt.Vertical)" << endl; out << indent << parent << ".layout().setSpacing(" << spacing << ")" << endl; @@ -864,15 +864,15 @@ QString Uic::createLayoutImpl( const QDomElement &e, const QString& parentClass, out << "," << optcells << margin << "," << spacing << ",\"" << objName << "\")" << endl; } if ( !resizeMode.isEmpty() ) - out << indent << objName << ".setResizeMode(QLayout." << resizeMode << ")" << endl; + out << indent << objName << ".setResizeMode(TQLayout." << 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 @@ -881,7 +881,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(); @@ -891,7 +891,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; @@ -899,9 +899,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 ) @@ -919,31 +919,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( getObjectName( e ) ); - 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(); + TQRect geom = DomTool::readProperty( e, "geometry", TQRect(0,0,0,0) ).toRect(); size = geom.size(); } if ( isVspacer ) - out << indent << objName << " = QSpacerItem(" + out << indent << objName << " = TQSpacerItem(" << size.width() << "," << size.height() - << ",QSizePolicy.Minimum,QSizePolicy." << sizeType << ")" << endl; + << ",TQSizePolicy.Minimum,TQSizePolicy." << sizeType << ")" << endl; else - out << indent << objName << " = QSpacerItem(" + out << indent << objName << " = TQSpacerItem(" << size.width() << "," << size.height() - << ",QSizePolicy." << sizeType << ",QSizePolicy.Minimum)" << endl; + << ",TQSizePolicy." << sizeType << ",TQSizePolicy.Minimum)" << endl; return objName; } @@ -958,35 +958,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 = "QColor(%1,%2,%3)"; + TQColor col = DomTool::readColor( n ); + color = "TQColor(%1,%2,%3)"; color = color.arg( col.red() ).arg( col.green() ).arg( col.blue() ); if ( col == white ) color = "Qt.white"; else if ( col == black ) color = "Qt.black"; if ( n.nextSibling().toElement().tagName() != "pixmap" ) { - out << indent << name << ".setColor(QColorGroup." << ColorRole[r] << "," << color << ")" << endl; + out << indent << name << ".setColor(TQColorGroup." << ColorRole[r] << "," << color << ")" << endl; } } else if ( n.tagName() == "pixmap" ) { - QString pixmap = n.firstChild().toText().data(); + TQString pixmap = n.firstChild().toText().data(); if ( pixmapLoaderFunction.isEmpty() ) { pixmap.prepend( "self." ); } else { - pixmap.prepend( pixmapLoaderFunction + "(" + QString( externPixmaps ? "\"" : "self." ) ); - pixmap.append( QString( externPixmaps ? "\"" : "" ) + ")" ); + pixmap.prepend( pixmapLoaderFunction + "(" + TQString( externPixmaps ? "\"" : "self." ) ); + pixmap.append( TQString( externPixmaps ? "\"" : "" ) + ")" ); } - out << indent << name << ".setBrush(QColorGroup." - << ColorRole[r] << ",QBrush(" << color << "," << pixmap << "))" << endl; + out << indent << name << ".setBrush(TQColorGroup." + << ColorRole[r] << ",TQBrush(" << color << "," << pixmap << "))" << endl; } n = n.nextSibling().toElement(); } @@ -996,16 +996,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(); } @@ -1016,10 +1016,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; @@ -1029,17 +1029,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() ) { @@ -1059,7 +1059,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 @@ -1069,7 +1069,7 @@ QString Uic::registerObject( const QString& name ) objectNames += "pal"; } - QString result = name; + TQString result = name; int i; while ( ( i = result.find(' ' )) != -1 ) { result[i] = '_'; @@ -1077,10 +1077,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 ); @@ -1093,7 +1093,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; @@ -1103,22 +1103,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; } @@ -1130,7 +1130,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( 1 ) == "ComboBox" ) { @@ -1139,7 +1139,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/python/pyqt/pyuic3/uic.h b/python/pyqt/pyuic3/uic.h index ea52ac34..0fceff50 100644 --- a/python/pyqt/pyuic3/uic.h +++ b/python/pyqt/pyuic3/uic.h @@ -21,13 +21,13 @@ #ifndef UIC_H #define UIC_H -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include #define PYQT_VERSION "3.17.2" @@ -42,12 +42,12 @@ public: uint setIndent(uint i) {uint old = current; current = i; calc(); return old;} 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(); }; @@ -56,86 +56,86 @@ private: class Uic : public Qt { public: - Uic( const QString &fn, const char *outputFn, QTextStream& out, - QDomDocument doc, bool subcl, const QString &trm, - const QString& subclname, QString &uicClass ); + Uic( const TQString &fn, const char *outputFn, TQTextStream& out, + TQDomDocument doc, bool subcl, const TQString &trm, + const TQString& subclname, TQString &uicClass ); static void setIndent(const PyIndent &pyind) {indent = pyind; trindent = pyind;} - void createFormImpl( const QDomElement &e ); - - void createSubImpl( const QDomElement &e, const QString& subclname ); - - 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 ); + void createFormImpl( const TQDomElement &e ); + + void createSubImpl( const TQDomElement &e, const TQString& subclname ); + + 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 ); private: - QTextStream& out; - QTextOStream trout; - QString languageChangeBody; - QCString outputFileName; - QStringList objectNames; - QMap objectMapper; - QStringList tags; - QStringList layouts; - QString formName; - QString lastItem; - QString trmacro; + TQTextStream& out; + TQTextOStream trout; + TQString languageChangeBody; + TQCString outputFileName; + TQStringList objectNames; + TQMap objectMapper; + TQStringList tags; + TQStringList layouts; + TQString formName; + TQString lastItem; + TQString trmacro; static PyIndent indent, trindent; 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; + TQString header; + TQString location; }; - QValueList buddies; + TQValueList 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; @@ -144,39 +144,39 @@ private: uint externPixmaps : 1; #if QT_VERSION >= 0x030300 - QString uiFileVersion; + TQString uiFileVersion; #endif - 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 pySlot(QStringList::ConstIterator &it); + void pySlot(TQStringList::ConstIterator &it); - QString pyCode; + TQString pyCode; bool pyNeedTr, pyNeedTrUtf8; }; diff --git a/python/pyqt/pyuic3/widgetdatabase.cpp b/python/pyqt/pyuic3/widgetdatabase.cpp index 6c447d5b..79a2c8b8 100644 --- a/python/pyqt/pyuic3/widgetdatabase.cpp +++ b/python/pyqt/pyuic3/widgetdatabase.cpp @@ -27,15 +27,15 @@ #include "widgetdatabase.h" #include "widgetinterface.h" -#include +#include #define NO_STATIC_COLORS #include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include #include @@ -43,17 +43,17 @@ const int dbsize = 300; const int dbcustom = 200; const int dbdictsize = 211; static WidgetDatabaseRecord* db[ dbsize ]; -static QDict *className2Id = 0; +static TQDict *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 *widgetPluginManager = 0; static bool plugins_set_up = FALSE; static bool was_in_setup = FALSE; -QCleanupHandler > cleanup_manager; +TQCleanupHandler > cleanup_manager; WidgetDatabaseRecord::WidgetDatabaseRecord() { @@ -121,14 +121,14 @@ void WidgetDatabase::setupDataBase( int id ) invisibleGroups = new QStrList; invisibleGroups->append( "Forms" ); invisibleGroups->append( "Temp" ); - className2Id = new QDict( dbdictsize ); + className2Id = new TQDict( 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,7 +227,7 @@ 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"; @@ -236,7 +236,7 @@ void WidgetDatabase::setupDataBase( int id ) #if !defined(QT_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"; @@ -246,7 +246,7 @@ void WidgetDatabase::setupDataBase( int id ) #if !defined(QT_NO_TABLE) r = new WidgetDatabaseRecord; r->iconSet = "designer_table.png"; - r->name = "QTable"; + r->name = "TQTable"; r->group = widgetGroup( "Views" ); r->toolTip = "Table"; @@ -256,8 +256,8 @@ void WidgetDatabase::setupDataBase( int id ) #if !defined(QT_NO_SQL) r = new WidgetDatabaseRecord; r->iconSet = "designer_datatable.png"; - r->includeFile = "qdatatable.h"; - r->name = "QDataTable"; + r->includeFile = "tqdatatable.h"; + 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; @@ -287,7 +287,7 @@ void WidgetDatabase::setupDataBase( int id ) r->name = "QDateEdit"; r->group = widgetGroup( "Input" ); r->toolTip = "Date Edit"; - r->includeFile = "qdatetimeedit.h"; + r->includeFile = "tqdatetimeedit.h"; append( r ); @@ -296,7 +296,7 @@ void WidgetDatabase::setupDataBase( int id ) r->name = "QTimeEdit"; r->group = widgetGroup( "Input" ); r->toolTip = "Time Edit"; - r->includeFile = "qdatetimeedit.h"; + r->includeFile = "tqdatetimeedit.h"; append( r ); @@ -305,13 +305,13 @@ void WidgetDatabase::setupDataBase( int id ) r->name = "QDateTimeEdit"; r->group = widgetGroup( "Input" ); r->toolTip = "Date-Time Edit"; - r->includeFile = "qdatetimeedit.h"; + r->includeFile = "tqdatetimeedit.h"; append( r ); 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"; @@ -399,14 +399,14 @@ void WidgetDatabase::setupDataBase( int id ) r->name = "Line"; r->group = widgetGroup( "Display" ); r->toolTip = "Line"; - r->includeFile = "qframe.h"; + r->includeFile = "tqframe.h"; r->whatsThis = "The Line widget provides horizontal and vertical lines."; append( r ); 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,21 +438,21 @@ 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; @@ -474,9 +474,9 @@ 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->includeFile = "tqsplitter.h"; r->isContainer = TRUE; append( r ); @@ -507,8 +507,8 @@ void WidgetDatabase::setupDataBase( int id ) r = new WidgetDatabaseRecord; r->iconSet = ""; - r->name = "QMainWindow"; - r->includeFile = "qmainwindow.h"; + r->name = "TQMainWindow"; + r->includeFile = "tqmainwindow.h"; r->group = widgetGroup( "Temp" ); r->isContainer = TRUE; @@ -517,7 +517,7 @@ void WidgetDatabase::setupDataBase( int id ) r = new WidgetDatabaseRecord; r->iconSet = ""; r->name = "QDesignerAction"; - r->includeFile = "qaction.h"; + r->includeFile = "tqaction.h"; r->group = widgetGroup( "Temp" ); r->isContainer = FALSE; @@ -526,7 +526,7 @@ void WidgetDatabase::setupDataBase( int id ) r = new WidgetDatabaseRecord; r->iconSet = ""; r->name = "QDesignerActionGroup"; - r->includeFile = "qaction.h"; + r->includeFile = "tqaction.h"; r->group = widgetGroup( "Temp" ); r->isContainer = FALSE; @@ -534,8 +534,8 @@ void WidgetDatabase::setupDataBase( int id ) r = new WidgetDatabaseRecord; r->iconSet = ""; - r->name = "QScrollView"; - r->includeFile = "qscrollview.h"; + r->name = "TQScrollView"; + r->includeFile = "tqscrollview.h"; r->group = widgetGroup( "Temp" ); r->isContainer = TRUE; @@ -544,8 +544,8 @@ void WidgetDatabase::setupDataBase( int id ) #ifndef QT_NO_SQL r = new WidgetDatabaseRecord; r->iconSet = ""; - r->name = "QDataBrowser"; - r->includeFile = "qdatabrowser.h"; + r->name = "TQDataBrowser"; + r->includeFile = "tqdatabrowser.h"; r->group = widgetGroup( "Database" ); r->toolTip = "Data Browser"; r->iconSet = "designer_databrowser.png"; @@ -555,8 +555,8 @@ void WidgetDatabase::setupDataBase( int id ) r = new WidgetDatabaseRecord; r->iconSet = ""; - r->name = "QDataView"; - r->includeFile = "qdataview.h"; + r->name = "TQDataView"; + r->includeFile = "tqdataview.h"; r->group = widgetGroup( "Database" ); r->toolTip = "Data View"; r->iconSet = "designer_dataview.png"; @@ -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,10 +749,10 @@ bool WidgetDatabase::isCommon( int id ) return r->isCommon; } -QString WidgetDatabase::createWidgetName( int id ) +TQString WidgetDatabase::createWidgetName( int id ) { setupDataBase( id ); - QString n = className( id ); + TQString n = className( id ); if ( n == "QLayoutWidget" ) n = "Layout"; if ( n[ 0 ] == 'Q' && n[ 1 ].lower() != n[ 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() ) @@ -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; } @@ -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 ) @@ -923,27 +923,27 @@ void WidgetDatabase::loadWhatsThis( const QString &docPath ) // ### Qt 3.1: make these publically accessible via QWidgetDatabase 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 *widgetManager() { if ( !widgetPluginManager ) { - QString pluginDir = "/designer"; + TQString pluginDir = "/designer"; #if !defined(UIC) if ( qwf_plugin_dir ) pluginDir = *qwf_plugin_dir; #endif - widgetPluginManager = new QPluginManager( IID_Widget, QApplication::libraryPaths(), pluginDir ); + widgetPluginManager = new QPluginManager( 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/python/pyqt/pyuic3/widgetdatabase.h b/python/pyqt/pyuic3/widgetdatabase.h index b44ef885..c75c2a59 100644 --- a/python/pyqt/pyuic3/widgetdatabase.h +++ b/python/pyqt/pyuic3/widgetdatabase.h @@ -27,8 +27,8 @@ #ifndef WIDGETDATABASE_H #define WIDGETDATABASE_H -#include -#include +#include +#include #include "widgetinterface.h" // up here for GCC 2.7.* compatibility #include @@ -39,12 +39,12 @@ 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; }; @@ -58,38 +58,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 ); }; -- cgit v1.2.3