diff options
Diffstat (limited to 'kregexpeditor')
107 files changed, 998 insertions, 970 deletions
diff --git a/kregexpeditor/Comments b/kregexpeditor/Comments index 71f4470..bdd63dc 100644 --- a/kregexpeditor/Comments +++ b/kregexpeditor/Comments @@ -1,4 +1,4 @@ (1) If I do not resize the widget to be reparented then it will take up all - the size of its new parent, and the parent will never receive a - repaint event, and will thus never get a chance to resize its new child - to a proper size (This is namely done in repaintEvent() ). + the size of its new tqparent, and the tqparent will never receive a + tqrepaint event, and will thus never get a chance to resize its new child + to a proper size (This is namely done in tqrepaintEvent() ). diff --git a/kregexpeditor/KMultiFormListBox/ccp.cpp b/kregexpeditor/KMultiFormListBox/ccp.cpp index d868591..ff2d6c3 100644 --- a/kregexpeditor/KMultiFormListBox/ccp.cpp +++ b/kregexpeditor/KMultiFormListBox/ccp.cpp @@ -23,7 +23,7 @@ #include "ccp.h" #include <tqobjectlist.h> #include <tqpopupmenu.h> -#ifdef QT_ONLY +#ifdef TQT_ONLY #include "compat.h" #else #include <klocale.h> @@ -32,15 +32,15 @@ CCP::CCP(KMultiFormListBoxMultiVisible *ee_, KMultiFormListBoxEntry *eee_) : TQObject() { ee = ee_; eee = eee_; - install(eee); + install(TQT_TQOBJECT(eee)); } void CCP::install(TQObject *elm) { elm->installEventFilter(this); - const TQObjectList *children = elm->children(); - if (children) { - TQObjectListIt it = TQObjectListIt(*children); + const TQObjectList tqchildren = elm->childrenListObject(); + if (!tqchildren.isEmpty()) { + TQObjectListIt it = TQObjectListIt(tqchildren); while (TQObject *child=it.current()) { if (child->inherits("KMultiFormListBoxMultiVisible")) { @@ -58,7 +58,7 @@ void CCP::install(TQObject *elm) bool CCP::eventFilter(TQObject *, TQEvent *event) { if (event->type() != TQEvent::MouseButtonPress || - ((TQMouseEvent *) event)->button() != RightButton || + ((TQMouseEvent *) event)->button() != Qt::RightButton || ((TQMouseEvent *) event)->state() != TQEvent::ControlButton) { return false; } diff --git a/kregexpeditor/KMultiFormListBox/indexWindow.cpp b/kregexpeditor/KMultiFormListBox/indexWindow.cpp index dccb184..f81ea07 100644 --- a/kregexpeditor/KMultiFormListBox/indexWindow.cpp +++ b/kregexpeditor/KMultiFormListBox/indexWindow.cpp @@ -16,7 +16,7 @@ * Boston, MA 02110-1301, USA. **/ -#ifdef QT_ONLY +#ifdef TQT_ONLY #include "compat.h" #else #include "indexWindow.moc" @@ -46,7 +46,7 @@ void indexWindow::lbSelected(int index) void indexWindow::finish(int index) { itemSelected = index; - qApp->exit_loop(); + tqApp->exit_loop(); } @@ -71,7 +71,7 @@ int indexWindow::exec(const TQPoint & /*start*/, int /*width*/) // 23 Feb. 2003 11:28 -- Jesper K. Pedersen /* // calculate the height of all the elements together. - // I need to do it this way, as sizeHint doesn't report the correct size + // I need to do it this way, as tqsizeHint doesn't report the correct size // and itemHeight doesn't neither. int elm_h = lb->item(0)->height(lb) * lb->count(); elm_h += 2*lb->frameWidth(); @@ -79,17 +79,17 @@ int indexWindow::exec(const TQPoint & /*start*/, int /*width*/) TQWidget *desktop = TQApplication::desktop(); int desktop_h = desktop->height(); int rest_h = desktop_h - start.y(); - int below_h = QMAX(rest_h, 200); + int below_h = TQMAX(rest_h, 200); int start_y = start.y(); if (rest_h < 200 && elm_h > 200) { - start_y = desktop_h-QMIN(elm_h,200); + start_y = desktop_h-TQMIN(elm_h,200); } - setGeometry(start.x(), start_y, width, QMIN(elm_h, below_h)); + setGeometry(start.x(), start_y, width, TQMIN(elm_h, below_h)); show(); - qApp->enter_loop(); + tqApp->enter_loop(); return itemSelected; */ return 0; diff --git a/kregexpeditor/KMultiFormListBox/indexWindow.h b/kregexpeditor/KMultiFormListBox/indexWindow.h index ab20e73..833c789 100644 --- a/kregexpeditor/KMultiFormListBox/indexWindow.h +++ b/kregexpeditor/KMultiFormListBox/indexWindow.h @@ -38,9 +38,10 @@ @internal **/ -class indexWindow : public QWidget{ +class indexWindow : public TQWidget{ Q_OBJECT + TQ_OBJECT public: indexWindow(); diff --git a/kregexpeditor/KMultiFormListBox/kmultiformlistbox-multivisible.cpp b/kregexpeditor/KMultiFormListBox/kmultiformlistbox-multivisible.cpp index 4a740c5..0dfa991 100644 --- a/kregexpeditor/KMultiFormListBox/kmultiformlistbox-multivisible.cpp +++ b/kregexpeditor/KMultiFormListBox/kmultiformlistbox-multivisible.cpp @@ -16,7 +16,7 @@ * Boston, MA 02110-1301, USA. **/ -#ifdef QT_ONLY +#ifdef TQT_ONLY #include "compat.h" #include <tqmessagebox.h> #else @@ -38,8 +38,8 @@ const uchar indexButtonBits[] = { }; -KMultiFormListBoxMultiVisible::KMultiFormListBoxMultiVisible(KMultiFormListBoxFactory *fact, TQWidget *parent, const char *name) - : TQScrollView(parent, name) +KMultiFormListBoxMultiVisible::KMultiFormListBoxMultiVisible(KMultiFormListBoxFactory *fact, TQWidget *tqparent, const char *name) + : TQScrollView(tqparent, name) { factory = fact; @@ -94,9 +94,9 @@ void KMultiFormListBoxMultiVisible::updateClipperContent() // calculate the required size. for (TQWidget *child = elms->first(); child; child=elms->next()) { - maxWidth = QMAX(maxWidth, child->sizeHint().width()); + maxWidth = TQMAX(maxWidth, child->tqsizeHint().width()); if (strcmp(child->name(), "seperator") != 0) { - totalHeight += child->sizeHint().height(); + totalHeight += child->tqsizeHint().height(); count++; } else { @@ -116,7 +116,7 @@ void KMultiFormListBoxMultiVisible::updateClipperContent() for (TQWidget *child2 = elms->first(); child2; child2=elms->next()) { int h; if ( strcmp(child2->name(),"seperator") != 0) { - h = child2->sizeHint().height(); + h = child2->tqsizeHint().height(); h += extra; } else { @@ -154,7 +154,7 @@ void KMultiFormListBoxMultiVisible::append(KMultiFormListBoxEntry *elm) void KMultiFormListBoxMultiVisible::delElement(TQWidget *elm) { - int index = elms->find(elm); + int index = elms->tqfind(elm); TQWidget *next = elms->at(index+1); if (strcmp(next->name(),"seperator") != 0) { elms->removeRef(next); @@ -186,7 +186,7 @@ void KMultiFormListBoxMultiVisible::insertElmIntoWidget(KMultiFormListBoxEntry * // Find the location to insert the new element. int index = elms->count(); if (after) { - index = elms->findRef(after); + index = elms->tqfindRef(after); } // Now show the new element. @@ -266,14 +266,14 @@ void KMultiFormListBoxMultiVisible::cut(KMultiFormListBoxEntry *elm) } TQDataStream stream(clipboard, IO_WriteOnly); - factory->toStream( elm, stream ); + factory->toStream( TQT_TQOBJECT(elm), stream ); delElement(elm); } void KMultiFormListBoxMultiVisible::copy(KMultiFormListBoxEntry *elm) { TQDataStream stream(clipboard, IO_WriteOnly); - factory->toStream(elm, stream); + factory->toStream(TQT_TQOBJECT(elm), stream); } void KMultiFormListBoxMultiVisible::paste(KMultiFormListBoxEntry *oldElm) @@ -285,7 +285,7 @@ void KMultiFormListBoxMultiVisible::paste(KMultiFormListBoxEntry *oldElm) KMultiFormListBoxEntry *newElm = factory->create(viewport()); TQDataStream stream( clipboard, IO_ReadOnly ); - factory->fromStream(stream, newElm); + factory->fromStream(stream, TQT_TQOBJECT(newElm)); insertElmIntoWidget(newElm,oldElm); } diff --git a/kregexpeditor/KMultiFormListBox/kmultiformlistbox-multivisible.h b/kregexpeditor/KMultiFormListBox/kmultiformlistbox-multivisible.h index 309044a..f0e5d79 100644 --- a/kregexpeditor/KMultiFormListBox/kmultiformlistbox-multivisible.h +++ b/kregexpeditor/KMultiFormListBox/kmultiformlistbox-multivisible.h @@ -35,6 +35,7 @@ class KMultiFormListBoxMultiVisible :public TQScrollView, KMultiFormListBoxShower { Q_OBJECT + TQ_OBJECT friend class KMultiFormListBox; @@ -42,9 +43,9 @@ private: /** @param factory A factory used to generate the instances of KMultiFormListBoxEntry class which is repeated in the KMultiFormListBox - @param parent A pointer to the parent widget + @param tqparent A pointer to the tqparent widget */ - KMultiFormListBoxMultiVisible(KMultiFormListBoxFactory *factory, TQWidget *parent = 0, const char *name = 0); + KMultiFormListBoxMultiVisible(KMultiFormListBoxFactory *factory, TQWidget *tqparent = 0, const char *name = 0); /** @return The elements in the KMultiFormListBox diff --git a/kregexpeditor/KMultiFormListBox/kmultiformlistbox-windowed.cpp b/kregexpeditor/KMultiFormListBox/kmultiformlistbox-windowed.cpp index c0e6090..6f9246c 100644 --- a/kregexpeditor/KMultiFormListBox/kmultiformlistbox-windowed.cpp +++ b/kregexpeditor/KMultiFormListBox/kmultiformlistbox-windowed.cpp @@ -15,7 +15,7 @@ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. **/ -#ifdef QT_ONLY +#ifdef TQT_ONLY #include "compat.h" #else #include <kmessagebox.h> @@ -27,10 +27,10 @@ #include "widgetwindow.h" #include "windowlistboxitem.h" -KMultiFormListBoxWindowed::KMultiFormListBoxWindowed(KMultiFormListBoxFactory *factory, TQWidget *parent, +KMultiFormListBoxWindowed::KMultiFormListBoxWindowed(KMultiFormListBoxFactory *factory, TQWidget *tqparent, bool showUpDownButtons, bool showHelpButton, TQString addButtonText,const char *name) - : TQWidget( parent, name ) + : TQWidget( tqparent, name ) { _layout = new TQVBoxLayout(this); @@ -150,7 +150,7 @@ void KMultiFormListBoxWindowed::slotDeleteEntry() WindowListboxItem *item = selected(); if (item) { int answer = - KMessageBox::warningContinueCancel(0, i18n("Delete item \"%1\"?").arg(item->text()),i18n("Delete Item"),KStdGuiItem::del()); + KMessageBox::warningContinueCancel(0, i18n("Delete item \"%1\"?").tqarg(item->text()),i18n("Delete Item"),KStdGuiItem::del()); if (answer == KMessageBox::Continue) { delete item; slotUpdateButtonState(); diff --git a/kregexpeditor/KMultiFormListBox/kmultiformlistbox-windowed.h b/kregexpeditor/KMultiFormListBox/kmultiformlistbox-windowed.h index 873c406..ca3f8bf 100644 --- a/kregexpeditor/KMultiFormListBox/kmultiformlistbox-windowed.h +++ b/kregexpeditor/KMultiFormListBox/kmultiformlistbox-windowed.h @@ -18,7 +18,7 @@ #ifndef __kmultiformlistboxwindowed #define __kmultiformlistboxwindowed -#ifdef QT_ONLY +#ifdef TQT_ONLY #include "compat.h" #include <tqlistbox.h> #else @@ -38,11 +38,12 @@ class WindowListboxItem; class KMultiFormListBoxWindowed :public TQWidget, KMultiFormListBoxShower { Q_OBJECT + TQ_OBJECT friend class KMultiFormListBox; private: - KMultiFormListBoxWindowed(KMultiFormListBoxFactory *factory, TQWidget *parent, + KMultiFormListBoxWindowed(KMultiFormListBoxFactory *factory, TQWidget *tqparent, bool showUpDownButtons, bool showHelpButton, TQString addButtonText, const char *name); diff --git a/kregexpeditor/KMultiFormListBox/kmultiformlistbox.cpp b/kregexpeditor/KMultiFormListBox/kmultiformlistbox.cpp index 0aa384e..8ddb5c7 100644 --- a/kregexpeditor/KMultiFormListBox/kmultiformlistbox.cpp +++ b/kregexpeditor/KMultiFormListBox/kmultiformlistbox.cpp @@ -15,16 +15,16 @@ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. **/ -#ifndef QT_ONLY +#ifndef TQT_ONLY #include "kmultiformlistbox.moc" #endif #include "kmultiformlistbox-multivisible.h" #include "kmultiformlistbox-windowed.h" -KMultiFormListBox::KMultiFormListBox( KMultiFormListBoxFactory *factory, KMultiFormListBoxType tp, TQWidget *parent, +KMultiFormListBox::KMultiFormListBox( KMultiFormListBoxFactory *factory, KMultiFormListBoxType tp, TQWidget *tqparent, bool showUpDownButtons, bool showHelpButton, TQString addButtonText, - const char *name ) : TQWidget( parent, name ) + const char *name ) : TQWidget( tqparent, name ) { switch ( tp ) { @@ -40,9 +40,9 @@ KMultiFormListBox::KMultiFormListBox( KMultiFormListBoxFactory *factory, KMultiF TQWidget *widget = theWidget->qWidget(); - TQHBoxLayout *layout = new TQHBoxLayout( this ); + TQHBoxLayout *tqlayout = new TQHBoxLayout( this ); _factory = factory; - layout->addWidget( widget ); + tqlayout->addWidget( widget ); } void KMultiFormListBox::append( KMultiFormListBoxEntry *element ) @@ -77,7 +77,7 @@ void KMultiFormListBox::toStream( TQDataStream& stream ) const const KMultiFormListBoxEntryList elms = elements(); stream << elms.count(); for ( TQPtrListIterator<KMultiFormListBoxEntry> it(elms); *it; ++it) - _factory->toStream( *it, stream ); + _factory->toStream( TQT_TQOBJECT(*it), stream ); } void KMultiFormListBox::fromStream( TQDataStream& stream ) @@ -97,7 +97,7 @@ void KMultiFormListBox::fromStream( TQDataStream& stream ) KMultiFormListBoxEntryList elms = elements(); for (TQPtrListIterator<KMultiFormListBoxEntry> it(elms); *it; ++it) - _factory->fromStream( stream, *it ); + _factory->fromStream( stream, TQT_TQOBJECT(*it) ); } diff --git a/kregexpeditor/KMultiFormListBox/kmultiformlistbox.h b/kregexpeditor/KMultiFormListBox/kmultiformlistbox.h index fd11648..0a23863 100644 --- a/kregexpeditor/KMultiFormListBox/kmultiformlistbox.h +++ b/kregexpeditor/KMultiFormListBox/kmultiformlistbox.h @@ -25,7 +25,7 @@ #include <tqlayout.h> #include <tqscrollview.h> -#ifdef QT_ONLY +#ifdef TQT_ONLY #include "compat.h" #else #include <klocale.h> @@ -63,6 +63,7 @@ class KMultiFormListBoxMultiVisible; class KMultiFormListBox : public TQWidget { Q_OBJECT + TQ_OBJECT public: @@ -71,11 +72,11 @@ public: /** @param factory A factory used to generate the instances of KMultiFormListBoxEntry class which is repeated in the KMultiFormListBox - @param parent A pointer to the parent widget + @param tqparent A pointer to the tqparent widget **/ KMultiFormListBox(KMultiFormListBoxFactory *factory, KMultiFormListBoxType tp=Windowed, - TQWidget *parent = 0, bool showUpDownButtons = true, + TQWidget *tqparent = 0, bool showUpDownButtons = true, bool showHelpButton = true, TQString addButtonText = i18n("Add"), const char *name = 0); diff --git a/kregexpeditor/KMultiFormListBox/kmultiformlistboxentry.cpp b/kregexpeditor/KMultiFormListBox/kmultiformlistboxentry.cpp index e885c29..5631078 100644 --- a/kregexpeditor/KMultiFormListBox/kmultiformlistboxentry.cpp +++ b/kregexpeditor/KMultiFormListBox/kmultiformlistboxentry.cpp @@ -16,7 +16,7 @@ * Boston, MA 02110-1301, USA. **/ -#ifndef QT_ONLY +#ifndef TQT_ONLY #include "kmultiformlistboxentry.moc" #endif diff --git a/kregexpeditor/KMultiFormListBox/kmultiformlistboxentry.h b/kregexpeditor/KMultiFormListBox/kmultiformlistboxentry.h index 313f026..c51ac16 100644 --- a/kregexpeditor/KMultiFormListBox/kmultiformlistboxentry.h +++ b/kregexpeditor/KMultiFormListBox/kmultiformlistboxentry.h @@ -31,8 +31,8 @@ button. If you want to use this in you KMultiFormListBox, then you must do the following: @li Create a @ref TQPushButton as a sub-widget to your KMultiFormListBoxEntry. - @li Override the @ref indexButton method to return your QPushButton - @li Override the @ref idxString to return a @ref QString + @li Override the @ref indexButton method to return your TQPushButton + @li Override the @ref idxString to return a @ref TQString with a textual representation of the content in this KMultiFormListBoxEntry. This string will be used in the drop-down box which the user gets when he presses the Idx button. @@ -45,12 +45,13 @@ indexWindowPos method to return a start point for the drop down window and a width. **/ -class KMultiFormListBoxEntry : public QWidget +class KMultiFormListBoxEntry : public TQWidget { Q_OBJECT + TQ_OBJECT public: - KMultiFormListBoxEntry(TQWidget *parent, const char *name) : TQWidget(parent,name) {} + KMultiFormListBoxEntry(TQWidget *tqparent, const char *name) : TQWidget(tqparent,name) {} virtual TQPushButton *indexButton() { return 0; } virtual TQWidget *valueWidget() { return 0; } @@ -59,7 +60,7 @@ public: // This function must return a string representing the KMultiFormListBox. This is // used when showing the fast-search menu available from the `Idx' button. - virtual TQString idxString() { return TQString::fromLatin1(""); } + virtual TQString idxString() { return TQString::tqfromLatin1(""); } public slots: void acceptIndexButton(); diff --git a/kregexpeditor/KMultiFormListBox/kmultiformlistboxfactory.cpp b/kregexpeditor/KMultiFormListBox/kmultiformlistboxfactory.cpp index 08a800a..8432ccf 100644 --- a/kregexpeditor/KMultiFormListBox/kmultiformlistboxfactory.cpp +++ b/kregexpeditor/KMultiFormListBox/kmultiformlistboxfactory.cpp @@ -18,8 +18,8 @@ #include "kmultiformlistboxfactory.h" #include <tqframe.h> -TQWidget *KMultiFormListBoxFactory::separator(TQWidget *parent) { - TQFrame* sep = new TQFrame( parent ); +TQWidget *KMultiFormListBoxFactory::separator(TQWidget *tqparent) { + TQFrame* sep = new TQFrame( tqparent ); sep->setFrameStyle( TQFrame::HLine | TQFrame::Sunken); sep->setLineWidth(1); return sep; diff --git a/kregexpeditor/KMultiFormListBox/kmultiformlistboxfactory.h b/kregexpeditor/KMultiFormListBox/kmultiformlistboxfactory.h index dc0bcce..61a78aa 100644 --- a/kregexpeditor/KMultiFormListBox/kmultiformlistboxfactory.h +++ b/kregexpeditor/KMultiFormListBox/kmultiformlistboxfactory.h @@ -47,23 +47,23 @@ public: a subclass of this class. This instance will be owned by the caller of this function. - @param parent A pointer to the parent of this KMultiFormListBoxEntry widget + @param tqparent A pointer to the tqparent of this KMultiFormListBoxEntry widget returned. @return A fresh @ref KMultiFormListBoxEntry to be used in an instance of the @ref KMultiFormListBox class. **/ - virtual KMultiFormListBoxEntry *create(TQWidget *parent) = 0; + virtual KMultiFormListBoxEntry *create(TQWidget *tqparent) = 0; /** This method is used to get a separator between the elements in an @ref KMultiFormListBox. The widget returned from this method will be owned by the caller. - @param parent A pointer to the parent of the TQWidget returned. + @param tqparent A pointer to the tqparent of the TQWidget returned. @return A widget which must be used as a separator between the @ref KMultiFormListBoxEntry elements in an @ref KMultiFormListBox. **/ - virtual TQWidget *separator(TQWidget *parent); + virtual TQWidget *separator(TQWidget *tqparent); }; #endif /* kmultiformlistbox */ diff --git a/kregexpeditor/KMultiFormListBox/widgetwindow.cpp b/kregexpeditor/KMultiFormListBox/widgetwindow.cpp index e94210d..73bfcd6 100644 --- a/kregexpeditor/KMultiFormListBox/widgetwindow.cpp +++ b/kregexpeditor/KMultiFormListBox/widgetwindow.cpp @@ -47,7 +47,7 @@ void WidgetWindow::init(KMultiFormListBoxFactory *factory, KListBox *lb, KMultiF myWidget = factory->create(frame); } TQDataStream stream( _backup, IO_WriteOnly ); - myFact->toStream( myWidget, stream ); + myFact->toStream( TQT_TQOBJECT(myWidget), stream ); lay->addWidget(myWidget); @@ -86,7 +86,7 @@ void WidgetWindow::slotCancel() } else { TQDataStream stream( _backup, IO_ReadOnly ); - myFact->fromStream( stream, myWidget ); + myFact->fromStream( stream, TQT_TQOBJECT(myWidget) ); } KDialogBase::slotCancel(); } @@ -96,9 +96,9 @@ WidgetWindow *WidgetWindow::clone() WidgetWindow *item = new WidgetWindow(myFact, listbox); TQByteArray data; TQDataStream ws( data, IO_WriteOnly ); - myFact->toStream( myWidget, ws ); + myFact->toStream( TQT_TQOBJECT(myWidget), ws ); TQDataStream rs( data, IO_ReadOnly ); - myFact->fromStream( rs, item->myWidget ); + myFact->fromStream( rs, TQT_TQOBJECT(item->myWidget) ); item->slotOk(); return item; @@ -107,7 +107,7 @@ WidgetWindow *WidgetWindow::clone() void WidgetWindow::display() { TQDataStream stream( _backup, IO_WriteOnly); - myFact->toStream( myWidget, stream ); + myFact->toStream( TQT_TQOBJECT(myWidget), stream ); show(); } diff --git a/kregexpeditor/KMultiFormListBox/widgetwindow.h b/kregexpeditor/KMultiFormListBox/widgetwindow.h index 647b2ef..eea6500 100644 --- a/kregexpeditor/KMultiFormListBox/widgetwindow.h +++ b/kregexpeditor/KMultiFormListBox/widgetwindow.h @@ -18,7 +18,7 @@ #ifndef __configwindow #define __configwindow -#ifdef QT_ONLY +#ifdef TQT_ONLY #include "compat.h" #include <tqlistbox.h> #else diff --git a/kregexpeditor/KMultiFormListBox/windowlistboxitem.h b/kregexpeditor/KMultiFormListBox/windowlistboxitem.h index 5e9d0f6..6cad532 100644 --- a/kregexpeditor/KMultiFormListBox/windowlistboxitem.h +++ b/kregexpeditor/KMultiFormListBox/windowlistboxitem.h @@ -26,7 +26,7 @@ class KMultiFormListBoxEntry; /** @internal */ -class WindowListboxItem :public QListBoxText +class WindowListboxItem :public TQListBoxText { friend class WidgetWindow; friend class KMultiFormListBoxWindowed; diff --git a/kregexpeditor/KWidgetStreamer/kwidgetstreamer.cpp b/kregexpeditor/KWidgetStreamer/kwidgetstreamer.cpp index 113e3d1..31d7b5c 100644 --- a/kregexpeditor/KWidgetStreamer/kwidgetstreamer.cpp +++ b/kregexpeditor/KWidgetStreamer/kwidgetstreamer.cpp @@ -24,7 +24,7 @@ void KWidgetStreamer::toStream(const TQObject* from, TQDataStream& stream ) { if ( from->inherits("KMultiFormListBox") ) { - // Hmm, we'll trust Qt that this dynamic_cast won't fail! + // Hmm, we'll trust TQt that this dynamic_cast won't fail! dynamic_cast<const KMultiFormListBox*>(from)->toStream( stream ); } @@ -34,7 +34,7 @@ void KWidgetStreamer::toStream(const TQObject* from, TQDataStream& stream ) void KWidgetStreamer::fromStream( TQDataStream& stream, TQObject* to ) { if ( to->inherits("KMultiFormListBox") ) { - // Hmm, we'll trust Qt that this dynamic_cast won't fail! + // Hmm, we'll trust TQt that this dynamic_cast won't fail! dynamic_cast<KMultiFormListBox*>(to)->fromStream( stream ); } @@ -44,15 +44,15 @@ void KWidgetStreamer::fromStream( TQDataStream& stream, TQObject* to ) void KWidgetStreamer::propertyToStream( const TQObject* from, TQDataStream& stream ) { - // Only handle widgets. Alternatives to widgets are layouts, validators, timers, etc. + // Only handle widgets. Alternatives to widgets are tqlayouts, validators, timers, etc. if ( ! from->inherits(TQWIDGET_OBJECT_NAME_STRING) ) return; - // Serializing all the children (if any). - const TQObjectList* children = from->children(); - if ( children ) { - stream << children->count(); - for ( TQObjectListIt it = TQObjectListIt(*children); *it; ++it ) { + // Serializing all the tqchildren (if any). + const TQObjectList tqchildren = from->childrenListObject(); + if ( !tqchildren.isEmpty() ) { + stream << tqchildren.count(); + for ( TQObjectListIt it = TQObjectListIt(tqchildren); *it; ++it ) { toStream( *it, stream ); } } @@ -79,18 +79,18 @@ void KWidgetStreamer::propertyToStream( const TQObject* from, TQDataStream& stre void KWidgetStreamer::propertyFromStream( TQDataStream& stream, TQObject* to ) { - // Only handle widgets. Alternatives to widgets are layouts, validators, timers, etc. + // Only handle widgets. Alternatives to widgets are tqlayouts, validators, timers, etc. if ( ! to->inherits(TQWIDGET_OBJECT_NAME_STRING) ) return; - // Stream in all the children (if any) - const TQObjectList* children = to->children(); + // Stream in all the tqchildren (if any) + const TQObjectList tqchildren = to->childrenListObject(); unsigned int count; stream >> count; - if ( children ) { - Q_ASSERT( count == children->count() ); - for ( TQObjectListIt it = TQObjectListIt(*children); *it; ++it ) + if ( !tqchildren.isEmpty() ) { + Q_ASSERT( count == tqchildren.count() ); + for ( TQObjectListIt it = TQObjectListIt(tqchildren); *it; ++it ) fromStream( stream, *it ); } else { @@ -115,63 +115,63 @@ KWidgetStreamer::KWidgetStreamer () { TQStringList l; - // QCheckBox + // TQCheckBox l.clear(); - l << TQString::fromLatin1("enabled") - << TQString::fromLatin1("checked") << TQString::fromLatin1("tristate"); - _map.insert(TQString::fromLatin1(TQCHECKBOX_OBJECT_NAME_STRING), l); + l << TQString::tqfromLatin1("enabled") + << TQString::tqfromLatin1("checked") << TQString::tqfromLatin1("tristate"); + _map.insert(TQString::tqfromLatin1(TQCHECKBOX_OBJECT_NAME_STRING), l); - // QComboBox + // TQComboBox l.clear(); - l << TQString::fromLatin1("enabled") - << TQString::fromLatin1("editable") << TQString::fromLatin1("currentItem") - << TQString::fromLatin1("maxCount") << TQString::fromLatin1("insertionPolicy") - << TQString::fromLatin1("autoCompletion"); - _map.insert(TQString::fromLatin1(TQCOMBOBOX_OBJECT_NAME_STRING), l); + l << TQString::tqfromLatin1("enabled") + << TQString::tqfromLatin1("editable") << TQString::tqfromLatin1("currentItem") + << TQString::tqfromLatin1("maxCount") << TQString::tqfromLatin1("insertionPolicy") + << TQString::tqfromLatin1("autoCompletion"); + _map.insert(TQString::tqfromLatin1(TQCOMBOBOX_OBJECT_NAME_STRING), l); - // QDial + // TQDial l.clear(); - l << TQString::fromLatin1("enabled") - << TQString::fromLatin1("tracking") << TQString::fromLatin1("wrapping") - << TQString::fromLatin1("value"); - _map.insert(TQString::fromLatin1(TQDIAL_OBJECT_NAME_STRING), l); + l << TQString::tqfromLatin1("enabled") + << TQString::tqfromLatin1("tracking") << TQString::tqfromLatin1("wrapping") + << TQString::tqfromLatin1("value"); + _map.insert(TQString::tqfromLatin1(TQDIAL_OBJECT_NAME_STRING), l); - // QLCDNumber + // TQLCDNumber l.clear(); - l << TQString::fromLatin1("enabled") - << TQString::fromLatin1("numDigits") << TQString::fromLatin1("mode") - << TQString::fromLatin1("segmentStyle") << TQString::fromLatin1("value"); - _map.insert(TQString::fromLatin1(TQLCDNUMBER_OBJECT_NAME_STRING), l); + l << TQString::tqfromLatin1("enabled") + << TQString::tqfromLatin1("numDigits") << TQString::tqfromLatin1("mode") + << TQString::tqfromLatin1("segmentStyle") << TQString::tqfromLatin1("value"); + _map.insert(TQString::tqfromLatin1(TQLCDNUMBER_OBJECT_NAME_STRING), l); - // QLineEdit + // TQLineEdit l.clear(); - l << TQString::fromLatin1("enabled") - << TQString::fromLatin1("text") << TQString::fromLatin1("maxLength") - << TQString::fromLatin1("echoMode") << TQString::fromLatin1("alignment"); - _map.insert(TQString::fromLatin1(TQLINEEDIT_OBJECT_NAME_STRING), l); + l << TQString::tqfromLatin1("enabled") + << TQString::tqfromLatin1("text") << TQString::tqfromLatin1("maxLength") + << TQString::tqfromLatin1("echoMode") << TQString::tqfromLatin1("tqalignment"); + _map.insert(TQString::tqfromLatin1(TQLINEEDIT_OBJECT_NAME_STRING), l); - // QMultiLineEdit + // TQMultiLineEdit l.clear(); - l << TQString::fromLatin1("enabled") - << TQString::fromLatin1("text") - << TQString::fromLatin1("alignment"); - _map.insert(TQString::fromLatin1(TQTEXTEDIT_OBJECT_NAME_STRING), l); + l << TQString::tqfromLatin1("enabled") + << TQString::tqfromLatin1("text") + << TQString::tqfromLatin1("tqalignment"); + _map.insert(TQString::tqfromLatin1(TQTEXTEDIT_OBJECT_NAME_STRING), l); - // QRadioButton + // TQRadioButton l.clear(); - l << TQString::fromLatin1("enabled") - << TQString::fromLatin1("checked"); - _map.insert(TQString::fromLatin1(TQRADIOBUTTON_OBJECT_NAME_STRING), l); + l << TQString::tqfromLatin1("enabled") + << TQString::tqfromLatin1("checked"); + _map.insert(TQString::tqfromLatin1(TQRADIOBUTTON_OBJECT_NAME_STRING), l); - // QSlider + // TQSlider l.clear(); - l << TQString::fromLatin1("enabled") - << TQString::fromLatin1("value"); - _map.insert(TQString::fromLatin1(TQSLIDER_OBJECT_NAME_STRING), l); + l << TQString::tqfromLatin1("enabled") + << TQString::tqfromLatin1("value"); + _map.insert(TQString::tqfromLatin1(TQSLIDER_OBJECT_NAME_STRING), l); - // QSpinBox + // TQSpinBox l.clear(); - l << TQString::fromLatin1("enabled") - << TQString::fromLatin1("value"); - _map.insert(TQString::fromLatin1(TQSPINBOX_OBJECT_NAME_STRING), l); + l << TQString::tqfromLatin1("enabled") + << TQString::tqfromLatin1("value"); + _map.insert(TQString::tqfromLatin1(TQSPINBOX_OBJECT_NAME_STRING), l); } diff --git a/kregexpeditor/KWidgetStreamer/kwidgetstreamer.h b/kregexpeditor/KWidgetStreamer/kwidgetstreamer.h index 6ac3349..d04382f 100644 --- a/kregexpeditor/KWidgetStreamer/kwidgetstreamer.h +++ b/kregexpeditor/KWidgetStreamer/kwidgetstreamer.h @@ -37,7 +37,7 @@ <pre> KWidgetStreamer streamer; KWidgetStreamer::PropertyMap& map = streamer.propertyMap(); - KWidgetStreamer::PropertyList& list = *map.find("TQLCDNumber"); + KWidgetStreamer::PropertyList& list = *map.tqfind(TQLCDNUMBER_OBJECT_NAME_STRING); list.remove("numDigits"); </pre> **/ diff --git a/kregexpeditor/altnregexp.cpp b/kregexpeditor/altnregexp.cpp index ef8b8de..b9b01ec 100644 --- a/kregexpeditor/altnregexp.cpp +++ b/kregexpeditor/altnregexp.cpp @@ -29,7 +29,7 @@ void AltnRegExp::addRegExp( RegExp *elm ) addChild( elm ); } -RegExpList AltnRegExp::children() const +RegExpList AltnRegExp::tqchildren() const { return list; } diff --git a/kregexpeditor/altnregexp.h b/kregexpeditor/altnregexp.h index c126c5f..37614f1 100644 --- a/kregexpeditor/altnregexp.h +++ b/kregexpeditor/altnregexp.h @@ -30,7 +30,7 @@ public: AltnRegExp( bool selected ); void addRegExp( RegExp * ); - RegExpList children() const; + RegExpList tqchildren() const; virtual bool check( ErrorMap&, bool first, bool last ); virtual int precedence() const { return 1;} diff --git a/kregexpeditor/altnwidget.cpp b/kregexpeditor/altnwidget.cpp index d1855d4..ae13e43 100644 --- a/kregexpeditor/altnwidget.cpp +++ b/kregexpeditor/altnwidget.cpp @@ -15,7 +15,7 @@ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. **/ -#ifdef QT_ONLY +#ifdef TQT_ONLY #include "compat.h" #else #include <klocale.h> @@ -28,31 +28,31 @@ #include "altnregexp.h" #include <tqpainter.h> -AltnWidget::AltnWidget(RegExpEditorWindow* editorWindow, TQWidget *parent, +AltnWidget::AltnWidget(RegExpEditorWindow* editorWindow, TQWidget *tqparent, const char *name) - :MultiContainerWidget(editorWindow, parent, name == 0 ? "AltnWidget" : name) + :MultiContainerWidget(editorWindow, tqparent, name == 0 ? "AltnWidget" : name) { DragAccepter *accepter = new DragAccepter(editorWindow, this); accepter->resize(0,0); // See note (1) in Comments - _children.append(accepter); + _tqchildren.append(accepter); _text = i18n("Alternatives"); } AltnWidget::AltnWidget( AltnRegExp* regexp, RegExpEditorWindow* editorWindow, - TQWidget* parent, const char* name) - :MultiContainerWidget( editorWindow, parent, name ) + TQWidget* tqparent, const char* name) + :MultiContainerWidget( editorWindow, tqparent, name ) { DragAccepter *accepter = new DragAccepter(editorWindow, this); accepter->resize(0,0); // See note (1) in Comments - _children.append(accepter); + _tqchildren.append(accepter); _text = i18n("Alternatives"); - RegExpList list = regexp->children(); + RegExpList list = regexp->tqchildren(); for ( RegExpListIt it(list); *it; ++it ) { RegExpWidget* child = WidgetFactory::createWidget( *it, editorWindow, this ); ConcWidget* conc; if ( ! (conc = dynamic_cast<ConcWidget*>( child ) ) ) { - conc = new ConcWidget( editorWindow, child, parent ); + conc = new ConcWidget( editorWindow, child, tqparent ); } append( conc ); } @@ -65,12 +65,12 @@ void AltnWidget::addNewChild(DragAccepter *accepter, RegExpWidget *child) ConcWidget *conc = new ConcWidget(_editorWindow, child,this); MultiContainerWidget::addNewChild( accepter, conc ); updateDrawLineInfo(); - repaint(); + tqrepaint(); } void AltnWidget::setConcChild(ConcWidget *child) { - addNewConcChild( dynamic_cast<DragAccepter*>(_children.at(0)), child ); + addNewConcChild( dynamic_cast<DragAccepter*>(_tqchildren.at(0)), child ); } void AltnWidget::addNewConcChild(DragAccepter *accepter, ConcWidget *child) @@ -81,21 +81,21 @@ void AltnWidget::addNewConcChild(DragAccepter *accepter, ConcWidget *child) } -TQSize AltnWidget::sizeHint() const +TQSize AltnWidget::tqsizeHint() const { - TQPtrListIterator<RegExpWidget> it(_children); + TQPtrListIterator<RegExpWidget> it(_tqchildren); // Skip the first child, as we only need half of the size of the first and the // last drag accepter. Does, however, not apply when there only is onw child. - if ( _children.count() != 1 ) + if ( _tqchildren.count() != 1 ) ++it; - _childrenWidth = 0; - _childrenHeight = 0; + _tqchildrenWidth = 0; + _tqchildrenHeight = 0; for ( ; *it ; ++it) { - TQSize thisChildSize = (*it)->sizeHint(); - _childrenWidth = QMAX(_childrenWidth, thisChildSize.width()); - _childrenHeight += thisChildSize.height(); + TQSize thisChildSize = (*it)->tqsizeHint(); + _tqchildrenWidth = TQMAX(_tqchildrenWidth, thisChildSize.width()); + _tqchildrenHeight += thisChildSize.height(); } // Now add the size of the header @@ -104,21 +104,21 @@ TQSize AltnWidget::sizeHint() const int headerWidth = _textSize.width() + 2 * bdSize + 2; - _childrenWidth = QMAX(_childrenWidth, headerWidth); + _tqchildrenWidth = TQMAX(_tqchildrenWidth, headerWidth); - return TQSize(_childrenWidth + 2*pw, _childrenHeight + _textSize.height() + 1*pw ); + return TQSize(_tqchildrenWidth + 2*pw, _tqchildrenHeight + _textSize.height() + 1*pw ); } void AltnWidget::paintEvent( TQPaintEvent *e) { - Q_ASSERT( dynamic_cast<DragAccepter*>(_children.at(0)) ); + Q_ASSERT( dynamic_cast<DragAccepter*>(_tqchildren.at(0)) ); // if this fails, then I should check the location of the show() - Q_ASSERT( _children.count() == 1 || - ( _children.count() >=3 && - dynamic_cast<DragAccepter*>(_children.at(_children.count()-1)) ) ); + Q_ASSERT( _tqchildren.count() == 1 || + ( _tqchildren.count() >=3 && + dynamic_cast<DragAccepter*>(_tqchildren.at(_tqchildren.count()-1)) ) ); int offset = 0; - TQSize mySize = sizeHint(); + TQSize mySize = tqsizeHint(); TQPainter painter(this); drawPossibleSelection( painter, mySize ); @@ -136,27 +136,27 @@ void AltnWidget::paintEvent( TQPaintEvent *e) painter.drawLine(mySize.width()-pw, startY, mySize.width()-pw, mySize.height()); painter.drawLine(0,mySize.height()-pw, mySize.width()-pw, mySize.height()-pw); - //---- Run through all the children and place them at the correct location. + //---- Run through all the tqchildren and place them at the correct location. offset = _textSize.height(); xOffset = pw; - for (unsigned int i = 0; i < _children.count(); i++ ) { + for (unsigned int i = 0; i < _tqchildren.count(); i++ ) { - RegExpWidget* child = _children.at(i); + RegExpWidget* child = _tqchildren.at(i); - TQSize childSize = child->sizeHint(); + TQSize childSize = child->tqsizeHint(); TQSize curChildSize = child->size(); //-------------------------------------- place the child int x = xOffset; int y = offset; int h = childSize.height(); - if ( ( _children.count() != 1 ) && ( i == 0 || i == _children.count() -1 ) ) { + if ( ( _tqchildren.count() != 1 ) && ( i == 0 || i == _tqchildren.count() -1 ) ) { // first and last DragAccepter should only be half size. h /= 2; } - int w = _childrenWidth; + int w = _tqchildrenWidth; child->setGeometry( x, y, w, h ); if ( w != curChildSize.width() || h != curChildSize.height() ) { // I resized the child, so give it a chance to relect thus. @@ -172,7 +172,7 @@ RegExp* AltnWidget::regExp() const { AltnRegExp *regexp = new AltnRegExp( isSelected() ); - TQPtrListIterator<RegExpWidget> it(_children); + TQPtrListIterator<RegExpWidget> it(_tqchildren); ++it; // start with the second element for ( ; *it; it+=2 ) { regexp->addRegExp( (*it)->regExp() ); @@ -183,8 +183,8 @@ RegExp* AltnWidget::regExp() const void AltnWidget::applyRegExpToSelection( RegExpType type ) { - for ( unsigned int i=1; i < _children.count(); i += 2 ) { - RegExpWidget* child = _children.at( i ); + for ( unsigned int i=1; i < _tqchildren.count(); i += 2 ) { + RegExpWidget* child = _tqchildren.at( i ); if ( child->hasSelection() ) { child->applyRegExpToSelection( type ); } @@ -197,7 +197,7 @@ RegExp* AltnWidget::selection() const if ( isSelected() ) return regExp(); else { - TQPtrListIterator<RegExpWidget> it(_children); + TQPtrListIterator<RegExpWidget> it(_tqchildren); ++it; // Skip past DragAccepter for ( ; *it; it+=2 ) { if ( (*it)->hasSelection() ) { @@ -216,7 +216,7 @@ bool AltnWidget::validateSelection() const } bool foundASelection = false; - TQPtrListIterator<RegExpWidget> it(_children); + TQPtrListIterator<RegExpWidget> it(_tqchildren); ++it; // Skip past DragAccepter for ( ; *it; it+=2 ) { if ( (*it)->hasSelection() ) { @@ -238,9 +238,9 @@ bool AltnWidget::validateSelection() const void AltnWidget::updateDrawLineInfo() { - for ( unsigned int i=0; i < _children.count(); i+=2 ) { - bool line = ( i != 0 && i!= _children.count()-1 ); - DragAccepter *accepter = dynamic_cast<DragAccepter*>(_children.at(i)); + for ( unsigned int i=0; i < _tqchildren.count(); i+=2 ) { + bool line = ( i != 0 && i!= _tqchildren.count()-1 ); + DragAccepter *accepter = dynamic_cast<DragAccepter*>(_tqchildren.at(i)); if (accepter) accepter->setDrawLine( line ); } diff --git a/kregexpeditor/altnwidget.h b/kregexpeditor/altnwidget.h index 589726d..8b76a66 100644 --- a/kregexpeditor/altnwidget.h +++ b/kregexpeditor/altnwidget.h @@ -29,12 +29,12 @@ class AltnRegExp; class AltnWidget :public MultiContainerWidget { public: - AltnWidget( RegExpEditorWindow* editorWindow, TQWidget *parent, + AltnWidget( RegExpEditorWindow* editorWindow, TQWidget *tqparent, const char *label = 0); AltnWidget( AltnRegExp* regexp, RegExpEditorWindow* editorWindow, - TQWidget* parent, const char* name = 0); + TQWidget* tqparent, const char* name = 0); virtual void addNewChild(DragAccepter *accepter, RegExpWidget *child); - virtual TQSize sizeHint() const; + virtual TQSize tqsizeHint() const; virtual RegExp* regExp() const; virtual void applyRegExpToSelection( RegExpType type ); virtual RegExpType type() const { return ALTN; } @@ -58,8 +58,8 @@ private: mutable TQSize _textSize; mutable int _maxSelectedWidth; - mutable int _childrenWidth; - mutable int _childrenHeight; + mutable int _tqchildrenWidth; + mutable int _tqchildrenHeight; }; #endif // altnwidget diff --git a/kregexpeditor/auxbuttons.cpp b/kregexpeditor/auxbuttons.cpp index 0f30d80..d22d229 100644 --- a/kregexpeditor/auxbuttons.cpp +++ b/kregexpeditor/auxbuttons.cpp @@ -16,7 +16,7 @@ * Boston, MA 02110-1301, USA. **/ -#ifdef QT_ONLY +#ifdef TQT_ONLY #include "compat.h" #include "images.h" #else @@ -32,51 +32,51 @@ #include <tqtoolbutton.h> #include "util.h" -AuxButtons::AuxButtons( TQWidget* parent, const char* name = 0) - :TQDockWindow( TQDockWindow::InDock, parent, name) +AuxButtons::AuxButtons( TQWidget* tqparent, const char* name = 0) + :TQDockWindow( TQDockWindow::InDock, tqparent, name) { - TQBoxLayout* layout = boxLayout(); + TQBoxLayout* tqlayout = boxLayout(); _undo = new TQToolButton( this ); - _undo->setIconSet( Util::getSystemIconSet(TQString::fromLatin1("undo") ) ); - layout->addWidget( _undo ); + _undo->setIconSet( Util::getSystemIconSet(TQString::tqfromLatin1("undo") ) ); + tqlayout->addWidget( _undo ); connect( _undo, TQT_SIGNAL(clicked()), this, TQT_SIGNAL(undo()) ); TQToolTip::add( _undo, i18n( "Undo" ) ); _redo = new TQToolButton( this ); - _redo->setIconSet( Util::getSystemIconSet(TQString::fromLatin1("redo") ) ); - layout->addWidget( _redo ); + _redo->setIconSet( Util::getSystemIconSet(TQString::tqfromLatin1("redo") ) ); + tqlayout->addWidget( _redo ); connect( _redo, TQT_SIGNAL(clicked()), this, TQT_SIGNAL(redo()) ); TQToolTip::add( _redo, i18n( "Redo" ) ); _cut = new TQToolButton( this ); - _cut->setIconSet( Util::getSystemIconSet(TQString::fromLatin1("editcut") ) ); - layout->addWidget( _cut ); + _cut->setIconSet( Util::getSystemIconSet(TQString::tqfromLatin1("editcut") ) ); + tqlayout->addWidget( _cut ); connect( _cut, TQT_SIGNAL(clicked()), this, TQT_SIGNAL(cut()) ); TQToolTip::add( _cut, i18n( "Cut" ) ); _copy = new TQToolButton( this ); - _copy->setIconSet( Util::getSystemIconSet(TQString::fromLatin1("editcopy") ) ); - layout->addWidget( _copy ); + _copy->setIconSet( Util::getSystemIconSet(TQString::tqfromLatin1("editcopy") ) ); + tqlayout->addWidget( _copy ); connect( _copy, TQT_SIGNAL(clicked()), this, TQT_SIGNAL(copy()) ); TQToolTip::add( _copy, i18n( "Copy" ) ); _paste = new TQToolButton( this ); - _paste->setIconSet( Util::getSystemIconSet(TQString::fromLatin1("editpaste")) ); - layout->addWidget( _paste ); + _paste->setIconSet( Util::getSystemIconSet(TQString::tqfromLatin1("editpaste")) ); + tqlayout->addWidget( _paste ); connect( _paste, TQT_SIGNAL(clicked()), this, TQT_SIGNAL(paste()) ); TQToolTip::add( _paste, i18n( "Paste" ) ); _save = new TQToolButton( this ); - _save->setIconSet( Util::getSystemIconSet(TQString::fromLatin1("filesave")) ); - layout->addWidget( _save ); + _save->setIconSet( Util::getSystemIconSet(TQString::tqfromLatin1("filesave")) ); + tqlayout->addWidget( _save ); connect( _save, TQT_SIGNAL(clicked()), this, TQT_SIGNAL(save()) ); TQToolTip::add( _save, i18n( "Save" ) ); TQToolButton* button = new TQToolButton(this); - button->setPixmap( Util::getSystemIcon( TQString::fromLatin1("contexthelp") ) ); - layout->addWidget( button ); + button->setPixmap( Util::getSystemIcon( TQString::tqfromLatin1("contexthelp") ) ); + tqlayout->addWidget( button ); connect(button, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotEnterWhatsThis())); _undo->setEnabled( false ); diff --git a/kregexpeditor/auxbuttons.h b/kregexpeditor/auxbuttons.h index ef88ab5..a0ada03 100644 --- a/kregexpeditor/auxbuttons.h +++ b/kregexpeditor/auxbuttons.h @@ -23,12 +23,13 @@ class TQComboBox; class TQLabel; class TQToolButton; -class AuxButtons :public QDockWindow +class AuxButtons :public TQDockWindow { Q_OBJECT + TQ_OBJECT public: - AuxButtons( TQWidget* parent, const char* name ); + AuxButtons( TQWidget* tqparent, const char* name ); signals: void undo(); diff --git a/kregexpeditor/characterswidget.cpp b/kregexpeditor/characterswidget.cpp index e0de760..f8a6870 100644 --- a/kregexpeditor/characterswidget.cpp +++ b/kregexpeditor/characterswidget.cpp @@ -16,7 +16,7 @@ * Boston, MA 02110-1301, USA. **/ -#ifdef QT_ONLY +#ifdef TQT_ONLY #include "compat.h" #else #include <kdialogbase.h> @@ -39,16 +39,16 @@ CharacterEdits* CharactersWidget::_configWindow = 0; -CharactersWidget::CharactersWidget(RegExpEditorWindow* editorWindow, TQWidget *parent, +CharactersWidget::CharactersWidget(RegExpEditorWindow* editorWindow, TQWidget *tqparent, const char *name) - : RegExpWidget(editorWindow, parent, name) + : RegExpWidget(editorWindow, tqparent, name) { _regexp = new TextRangeRegExp( false /* not used */); } CharactersWidget::CharactersWidget( TextRangeRegExp* regexp, RegExpEditorWindow* editorWindow, - TQWidget* parent, const char* name ) - : RegExpWidget( editorWindow, parent, name ) + TQWidget* tqparent, const char* name ) + : RegExpWidget( editorWindow, tqparent, name ) { _regexp = dynamic_cast<TextRangeRegExp*>( regexp->clone() ); Q_ASSERT( _regexp ); @@ -60,7 +60,7 @@ CharactersWidget::~CharactersWidget() } -TQSize CharactersWidget::sizeHint() const +TQSize CharactersWidget::tqsizeHint() const { TQFontMetrics metrics = fontMetrics(); _textSize = HackCalculateFontSize(metrics, title()); @@ -72,13 +72,13 @@ TQSize CharactersWidget::sizeHint() const _contentSize = HackCalculateFontSize(metrics,text()); // _contentSize = metrics.size(0, text()); - return TQSize(QMAX(headerSize.width(), bdSize + _contentSize.width() + bdSize+ 2*pw), + return TQSize(TQMAX(headerSize.width(), bdSize + _contentSize.width() + bdSize+ 2*pw), headerSize.height() + bdSize + _contentSize.height() + bdSize + 2*pw); } void CharactersWidget::paintEvent(TQPaintEvent *e) { - TQSize mySize = sizeHint(); + TQSize mySize = tqsizeHint(); TQPainter painter(this); drawPossibleSelection( painter, mySize ); @@ -118,7 +118,7 @@ RegExp* CharactersWidget::regExp() const TQString CharactersWidget::text() const { - TQString res = TQString::fromLatin1(""); + TQString res = TQString::tqfromLatin1(""); if (_regexp->wordChar()) res += i18n("- A word character\n"); @@ -171,7 +171,7 @@ TQString CharactersWidget::title() const RegExpWidget* CharactersWidget::findWidgetToEdit( TQPoint globalPos ) { - if ( TQRect(mapToGlobal(TQPoint(0,0)), size()).contains( globalPos ) ) + if ( TQRect(mapToGlobal(TQPoint(0,0)), size()).tqcontains( globalPos ) ) return this; else return 0; @@ -181,13 +181,13 @@ int CharactersWidget::edit() { if ( _configWindow == 0 ) { TQApplication::setOverrideCursor( WaitCursor ); - // No parent here, as this window should continue to exists. + // No tqparent here, as this window should continue to exists. _configWindow = new CharacterEdits( 0, "CharactersWidget::_configWindow" ); TQApplication::restoreOverrideCursor(); } - _configWindow->move(TQCursor::pos() - TQPoint(_configWindow->sizeHint().width()/2, - _configWindow->sizeHint().height()/2)); + _configWindow->move(TQCursor::pos() - TQPoint(_configWindow->tqsizeHint().width()/2, + _configWindow->tqsizeHint().height()/2)); int ret = _configWindow->exec(_regexp ); if ( ret == TQDialog::Accepted ) { _editorWindow->updateContent( 0 ); @@ -282,8 +282,8 @@ int CharacterEdits::exec( TextRangeRegExp* regexp ) } -CharacterEdits::CharacterEdits( TQWidget *parent, const char *name) - : KDialogBase( parent, name == 0 ? "CharacterEdits" : name, true, +CharacterEdits::CharacterEdits( TQWidget *tqparent, const char *name) + : KDialogBase( tqparent, name == 0 ? "CharacterEdits" : name, true, i18n("Specify Characters"), KDialogBase::Ok | KDialogBase::Cancel) { @@ -377,13 +377,13 @@ void CharacterEdits::slotOK() } -SingleEntry::SingleEntry(TQWidget* parent, const char* name ) - :KMultiFormListBoxEntry( parent, name ) +SingleEntry::SingleEntry(TQWidget* tqparent, const char* name ) + :KMultiFormListBoxEntry( tqparent, name ) { - TQHBoxLayout* layout = new TQHBoxLayout( this, 3, 6 ); + TQHBoxLayout* tqlayout = new TQHBoxLayout( this, 3, 6 ); _selector = new CharSelector( this ); - layout->addWidget( _selector ); - layout->addStretch(1); + tqlayout->addWidget( _selector ); + tqlayout->addStretch(1); } TQString SingleEntry::text() const @@ -402,22 +402,22 @@ bool SingleEntry::isEmpty() const } -RangeEntry::RangeEntry(TQWidget* parent, const char* name ) - :KMultiFormListBoxEntry( parent, name ) +RangeEntry::RangeEntry(TQWidget* tqparent, const char* name ) + :KMultiFormListBoxEntry( tqparent, name ) { - TQHBoxLayout* layout = new TQHBoxLayout( this, 3, 6 ); + TQHBoxLayout* tqlayout = new TQHBoxLayout( this, 3, 6 ); TQLabel* label = new TQLabel(i18n("From:"), this ); _from = new CharSelector( this ); - layout->addWidget( label ); - layout->addWidget( _from ); + tqlayout->addWidget( label ); + tqlayout->addWidget( _from ); - layout->addStretch(1); + tqlayout->addStretch(1); label = new TQLabel(i18n("end of range","To:"), this ); _to = new CharSelector( this ); - layout->addWidget( label ); - layout->addWidget( _to ); + tqlayout->addWidget( label ); + tqlayout->addWidget( _to ); } TQString RangeEntry::fromText() const diff --git a/kregexpeditor/characterswidget.h b/kregexpeditor/characterswidget.h index faff294..f8cf390 100644 --- a/kregexpeditor/characterswidget.h +++ b/kregexpeditor/characterswidget.h @@ -18,7 +18,7 @@ #ifndef characterswidget #define characterswidget -#ifdef QT_ONLY +#ifdef TQT_ONLY #include "compat.h" #else #include <kdialogbase.h> @@ -41,12 +41,12 @@ class TQCheckBox; class CharactersWidget :public RegExpWidget { public: - CharactersWidget(RegExpEditorWindow* editorWindow, TQWidget *parent, + CharactersWidget(RegExpEditorWindow* editorWindow, TQWidget *tqparent, const char *label = 0); CharactersWidget( TextRangeRegExp* regexp, RegExpEditorWindow* editorWindow, - TQWidget* parent, const char* name = 0 ); + TQWidget* tqparent, const char* name = 0 ); ~CharactersWidget(); - virtual TQSize sizeHint() const; + virtual TQSize tqsizeHint() const; virtual RegExp* regExp() const; virtual RegExpType type() const { return CHARSET; } virtual RegExpWidget* findWidgetToEdit( TQPoint globalPos ); @@ -72,7 +72,7 @@ private: class SingleEntry :public KMultiFormListBoxEntry { public: - SingleEntry(TQWidget* parent, const char* name = 0 ); + SingleEntry(TQWidget* tqparent, const char* name = 0 ); TQString text() const; void setText( TQString text ); bool isEmpty() const; @@ -87,7 +87,7 @@ private: class RangeEntry :public KMultiFormListBoxEntry { public: - RangeEntry(TQWidget* parent, const char* name = 0 ); + RangeEntry(TQWidget* tqparent, const char* name = 0 ); TQString fromText() const; TQString toText() const; void setFrom( TQString text ); @@ -103,7 +103,7 @@ private: class SingleFactory :public KMultiFormListBoxFactory { public: - KMultiFormListBoxEntry *create(TQWidget *parent) { return new SingleEntry( parent ); } + KMultiFormListBoxEntry *create(TQWidget *tqparent) { return new SingleEntry( tqparent ); } TQWidget *separator( TQWidget* ) { return 0; } }; @@ -113,7 +113,7 @@ public: class RangeFactory :public KMultiFormListBoxFactory { public: - KMultiFormListBoxEntry *create(TQWidget *parent) { return new RangeEntry( parent ); } + KMultiFormListBoxEntry *create(TQWidget *tqparent) { return new RangeEntry( tqparent ); } TQWidget *separator( TQWidget* ) { return 0; } }; @@ -123,8 +123,9 @@ public: class CharacterEdits : public KDialogBase { Q_OBJECT + TQ_OBJECT public: - CharacterEdits(TQWidget *parent = 0, const char *name = 0); + CharacterEdits(TQWidget *tqparent = 0, const char *name = 0); public slots: int exec( TextRangeRegExp* regexp ); diff --git a/kregexpeditor/charselector.cpp b/kregexpeditor/charselector.cpp index a71c679..d5f0a07 100644 --- a/kregexpeditor/charselector.cpp +++ b/kregexpeditor/charselector.cpp @@ -16,7 +16,7 @@ * Boston, MA 02110-1301, USA. **/ -#ifdef QT_ONLY +#ifdef TQT_ONLY #include "compat.h" #else #include <klocale.h> @@ -38,40 +38,40 @@ class expects the widgets on the stack to take up all space. StackContainer fills in this gab. */ -class StackContainer :public QWidget +class StackContainer :public TQWidget { public: - StackContainer( TQWidget* child, TQWidget* parent ) : TQWidget( parent ) + StackContainer( TQWidget* child, TQWidget* tqparent ) : TQWidget( tqparent ) { - TQHBoxLayout* layout = new TQHBoxLayout( this ); + TQHBoxLayout* tqlayout = new TQHBoxLayout( this ); child->reparent( this, TQPoint(0,0), false ); - layout->addWidget( child ); - layout->addStretch( 1 ); + tqlayout->addWidget( child ); + tqlayout->addStretch( 1 ); } }; -CharSelector::CharSelector( TQWidget* parent, const char* name ) - :TQWidget( parent, name ), _oldIndex(0) +CharSelector::CharSelector( TQWidget* tqparent, const char* name ) + :TQWidget( tqparent, name ), _oldIndex(0) { TQStringList items; - TQHBoxLayout* layout = new TQHBoxLayout( this, 0, 6 ); + TQHBoxLayout* tqlayout = new TQHBoxLayout( this, 0, 6 ); _type = new TQComboBox( this, "_type" ); items << i18n("Normal Character") << i18n("Unicode Char in Hex.") << i18n("Unicode Char in Oct.") - << TQString::fromLatin1("----") + << TQString::tqfromLatin1("----") << i18n("The Bell Character (\\a)") << i18n("The Form Feed Character (\\f)") << i18n("The Line Feed Character (\\n)") << i18n("The Carriage Return Character (\\r)") - << i18n("The Horizontal Tab Character (\\t)") - << i18n("The Vertical Tab Character (\\v)"); + << i18n("TheQt::Horizontal Tab Character (\\t)") + << i18n("TheQt::Vertical Tab Character (\\v)"); _type->insertStringList( items ); - layout->addWidget( _type ); + tqlayout->addWidget( _type ); _stack = new TQWidgetStack( this, "_stack" ); - layout->addWidget( _stack ); + tqlayout->addWidget( _stack ); _normal = new LimitedCharLineEdit( LimitedCharLineEdit::NORMAL, 0, "_normal" ); _stack->addWidget( new StackContainer( _normal, _stack ), 0 ); @@ -169,17 +169,17 @@ TQString CharSelector::text() const case 3: // The seperator break; case 4: - return TQString::fromLatin1("\\a"); + return TQString::tqfromLatin1("\\a"); case 5: - return TQString::fromLatin1("\\f"); + return TQString::tqfromLatin1("\\f"); case 6: - return TQString::fromLatin1("\\n"); + return TQString::tqfromLatin1("\\n"); case 7: - return TQString::fromLatin1("\\r"); + return TQString::tqfromLatin1("\\r"); case 8: - return TQString::fromLatin1("\\t"); + return TQString::tqfromLatin1("\\t"); case 9: - return TQString::fromLatin1("\\v"); + return TQString::tqfromLatin1("\\v"); } - return TQString::null; + return TQString(); } diff --git a/kregexpeditor/charselector.h b/kregexpeditor/charselector.h index 4f34e67..5ba2a88 100644 --- a/kregexpeditor/charselector.h +++ b/kregexpeditor/charselector.h @@ -24,12 +24,13 @@ class TQComboBox; class TQWidgetStack; class LimitedCharLineEdit; -class CharSelector :public QWidget +class CharSelector :public TQWidget { Q_OBJECT + TQ_OBJECT public: - CharSelector( TQWidget* parent, const char* name = 0 ); + CharSelector( TQWidget* tqparent, const char* name = 0 ); TQString text() const; void setText( TQString text ); bool isEmpty() const; diff --git a/kregexpeditor/compoundregexp.cpp b/kregexpeditor/compoundregexp.cpp index 0c5e194..150ee97 100644 --- a/kregexpeditor/compoundregexp.cpp +++ b/kregexpeditor/compoundregexp.cpp @@ -16,7 +16,7 @@ * Boston, MA 02110-1301, USA. **/ -#ifdef QT_ONLY +#ifdef TQT_ONLY #include "compat.h" #else #include <klocale.h> diff --git a/kregexpeditor/compoundregexp.h b/kregexpeditor/compoundregexp.h index 6368359..a1038ab 100644 --- a/kregexpeditor/compoundregexp.h +++ b/kregexpeditor/compoundregexp.h @@ -26,8 +26,8 @@ class CompoundRegExp :public RegExp { public: - CompoundRegExp( bool selected, const TQString& title = TQString::null, - const TQString& description = TQString::null, + CompoundRegExp( bool selected, const TQString& title = TQString(), + const TQString& description = TQString(), bool hidden = false, bool allowReplace = false, RegExp* child = 0); virtual bool check( ErrorMap&, bool first, bool last ); diff --git a/kregexpeditor/compoundwidget.cpp b/kregexpeditor/compoundwidget.cpp index 441143f..e55d5fe 100644 --- a/kregexpeditor/compoundwidget.cpp +++ b/kregexpeditor/compoundwidget.cpp @@ -15,7 +15,7 @@ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. **/ -#ifdef QT_ONLY +#ifdef TQT_ONLY #include "compat.h" #include "images.h" #else @@ -37,11 +37,11 @@ //================================================================================ -CompoundDetailWindow::CompoundDetailWindow( TQWidget* parent, const char* name ) - :TQWidget( parent, name ) +CompoundDetailWindow::CompoundDetailWindow( TQWidget* tqparent, const char* name ) + :TQWidget( tqparent, name ) { - TQVBoxLayout* layout = new TQVBoxLayout( this ); - layout->setAutoAdd( true ); + TQVBoxLayout* tqlayout = new TQVBoxLayout( this ); + tqlayout->setAutoAdd( true ); TQLabel* label = new TQLabel( i18n("&Title:"), this); _title = new TQLineEdit( this ); @@ -93,17 +93,17 @@ void CompoundDetailWindow::setAllowReplace( bool b ) //================================================================================ -CompoundWidget::CompoundWidget( RegExpEditorWindow* editorWindow, TQWidget* parent, +CompoundWidget::CompoundWidget( RegExpEditorWindow* editorWindow, TQWidget* tqparent, const char* name ) - :SingleContainerWidget( editorWindow, parent, name == 0 ? "CompoundWidget" : name ) + :SingleContainerWidget( editorWindow, tqparent, name == 0 ? "CompoundWidget" : name ) { _child = new ConcWidget( editorWindow, this ); init(); } CompoundWidget::CompoundWidget( CompoundRegExp* regexp, RegExpEditorWindow* editorWindow, - TQWidget* parent, const char* name ) - : SingleContainerWidget( editorWindow, parent, name == 0 ? "CompoundWidget" : name ) + TQWidget* tqparent, const char* name ) + : SingleContainerWidget( editorWindow, tqparent, name == 0 ? "CompoundWidget" : name ) { init(); _content->setTitle( regexp->title() ); @@ -135,17 +135,17 @@ void CompoundWidget::init( ) _backRefId = -1; } -TQSize CompoundWidget::sizeHint() const +TQSize CompoundWidget::tqsizeHint() const { TQFontMetrics metrics = fontMetrics(); - _childSize = _child->sizeHint(); + _childSize = _child->tqsizeHint(); _textSize = metrics.size( 0, _content->title() ); int width, height; if ( _hidden ) { _pixmapSize = _up.size(); - width = 2*pw + QMAX( 2*bdSize+_textSize.width(), 2*bdSize+_pixmapSize.width()); + width = 2*pw + TQMAX( 2*bdSize+_textSize.width(), 2*bdSize+_pixmapSize.width()); height = _pixmapSize.height() + 2*bdSize + _textSize.height()+pw; } else { @@ -154,8 +154,8 @@ TQSize CompoundWidget::sizeHint() const if ( _textSize.width() != 0) headerLineWidth += 3*bdSize + _textSize.width(); - width = QMAX( 2*pw + _childSize.width(), headerLineWidth ); - height = QMAX( _textSize.height(), _pixmapSize.height() ) + + width = TQMAX( 2*pw + _childSize.width(), headerLineWidth ); + height = TQMAX( _textSize.height(), _pixmapSize.height() ) + 2*bdSize + _childSize.height() + pw; } return TQSize( width, height ); @@ -164,7 +164,7 @@ TQSize CompoundWidget::sizeHint() const void CompoundWidget::paintEvent( TQPaintEvent *e ) { - TQSize mySize = sizeHint(); + TQSize mySize = tqsizeHint(); TQPainter painter(this); drawPossibleSelection( painter, mySize); @@ -182,7 +182,7 @@ void CompoundWidget::paintEvent( TQPaintEvent *e ) painter.drawPixmap( _pixmapPos, _up ); } else { - int maxH = QMAX( _textSize.height(), _pixmapSize.height() ); + int maxH = TQMAX( _textSize.height(), _pixmapSize.height() ); int offset = 0; horLineY = maxH/2; childY = maxH+bdSize; @@ -220,8 +220,8 @@ void CompoundWidget::paintEvent( TQPaintEvent *e ) } else { TQSize curSize = _child->size(); - TQSize newSize = TQSize( QMAX( _child->sizeHint().width(), mySize.width()-2*pw), - _child->sizeHint().height()); + TQSize newSize = TQSize( TQMAX( _child->tqsizeHint().width(), mySize.width()-2*pw), + _child->tqsizeHint().height()); _child->move( pw, childY ); if ( curSize != newSize ) { @@ -246,8 +246,8 @@ void CompoundWidget::slotConfigCanceled() { TQDataStream stream( _backup, IO_ReadOnly ); KWidgetStreamer streamer; - streamer.fromStream( stream, _content ); - repaint(); + streamer.fromStream( stream, TQT_TQOBJECT(_content) ); + tqrepaint(); } RegExp* CompoundWidget::regExp() const @@ -258,8 +258,8 @@ RegExp* CompoundWidget::regExp() const void CompoundWidget::mousePressEvent( TQMouseEvent* event ) { - if ( event->button() == LeftButton && - TQRect( _pixmapPos, _pixmapSize ).contains( event->pos() ) ) { + if ( event->button() == Qt::LeftButton && + TQRect( _pixmapPos, _pixmapSize ).tqcontains( event->pos() ) ) { // Skip otherwise we will never see the mouse release // since it is eaten by Editor window. } @@ -269,38 +269,38 @@ void CompoundWidget::mousePressEvent( TQMouseEvent* event ) void CompoundWidget::mouseReleaseEvent( TQMouseEvent* event) { - if ( event->button() == LeftButton && - TQRect( _pixmapPos, _pixmapSize ).contains( event->pos() ) ) { + if ( event->button() == Qt::LeftButton && + TQRect( _pixmapPos, _pixmapSize ).tqcontains( event->pos() ) ) { _hidden = !_hidden; _editorWindow->updateContent( 0 ); - repaint(); // is this necesary? + tqrepaint(); // is this necesary? _editorWindow->emitChange(); } else SingleContainerWidget::mouseReleaseEvent( event ); } -bool CompoundWidget::updateSelection( bool parentSelected ) +bool CompoundWidget::updateSelection( bool tqparentSelected ) { if ( _hidden ) { - bool changed = RegExpWidget::updateSelection( parentSelected ); + bool changed = RegExpWidget::updateSelection( tqparentSelected ); _child->selectWidget( _isSelected ); if (changed) - repaint(); + tqrepaint(); return changed; } else { - return SingleContainerWidget::updateSelection( parentSelected ); + return SingleContainerWidget::updateSelection( tqparentSelected ); } } int CompoundWidget::edit() { - _configWindow->move(TQCursor::pos() - TQPoint(_configWindow->sizeHint().width()/2, - _configWindow->sizeHint().height()/2) ); + _configWindow->move(TQCursor::pos() - TQPoint(_configWindow->tqsizeHint().width()/2, + _configWindow->tqsizeHint().height()/2) ); TQDataStream stream( _backup, IO_WriteOnly ); KWidgetStreamer streamer; - streamer.toStream( _content, stream ); + streamer.toStream( TQT_TQOBJECT(_content), stream ); return _configWindow->exec(); } @@ -312,7 +312,7 @@ int nextId() TQPixmap CompoundWidget::getIcon( const TQString& name ) { -#ifdef QT_ONLY +#ifdef TQT_ONLY TQPixmap pix; pix.convertFromImage( qembed_findImage(name) ); return pix; diff --git a/kregexpeditor/compoundwidget.h b/kregexpeditor/compoundwidget.h index 07dc099..6cea5b5 100644 --- a/kregexpeditor/compoundwidget.h +++ b/kregexpeditor/compoundwidget.h @@ -29,10 +29,10 @@ class TQCheckBox; Widget containing configuration details for @ref CompoundWidget @internal */ -class CompoundDetailWindow :public QWidget +class CompoundDetailWindow :public TQWidget { public: - CompoundDetailWindow(TQWidget* parent, const char* name = 0); + CompoundDetailWindow(TQWidget* tqparent, const char* name = 0); TQString title() const; TQString description() const; bool allowReplace() const; @@ -60,15 +60,16 @@ private: class CompoundWidget :public SingleContainerWidget { Q_OBJECT + TQ_OBJECT public: - CompoundWidget( RegExpEditorWindow* editorWindow, TQWidget* parent, + CompoundWidget( RegExpEditorWindow* editorWindow, TQWidget* tqparent, const char* name = 0); CompoundWidget( CompoundRegExp* regexp, RegExpEditorWindow* editorWindow, - TQWidget* parent, const char* name = 0); + TQWidget* tqparent, const char* name = 0); - virtual bool updateSelection( bool parentSelected ); - virtual TQSize sizeHint() const; + virtual bool updateSelection( bool tqparentSelected ); + virtual TQSize tqsizeHint() const; virtual RegExp* regExp() const; virtual RegExpType type() const { return COMPOUND; } virtual int edit(); diff --git a/kregexpeditor/concregexp.cpp b/kregexpeditor/concregexp.cpp index cefbac4..1c8421d 100644 --- a/kregexpeditor/concregexp.cpp +++ b/kregexpeditor/concregexp.cpp @@ -29,7 +29,7 @@ void ConcRegExp::addRegExp( RegExp *regExp ) addChild( regExp ); } -RegExpList ConcRegExp::children() +RegExpList ConcRegExp::tqchildren() { return list; } diff --git a/kregexpeditor/concregexp.h b/kregexpeditor/concregexp.h index 47e3b26..15a0a66 100644 --- a/kregexpeditor/concregexp.h +++ b/kregexpeditor/concregexp.h @@ -31,7 +31,7 @@ public: ConcRegExp( bool selected ); void addRegExp( RegExp *); - RegExpList children(); + RegExpList tqchildren(); RegExp* lastRegExp(); virtual bool check( ErrorMap&, bool first, bool last ); diff --git a/kregexpeditor/concwidget.cpp b/kregexpeditor/concwidget.cpp index d76730f..fec2cc0 100644 --- a/kregexpeditor/concwidget.cpp +++ b/kregexpeditor/concwidget.cpp @@ -21,24 +21,24 @@ #include <tqpainter.h> -ConcWidget::ConcWidget(RegExpEditorWindow* editorWindow, TQWidget *parent, +ConcWidget::ConcWidget(RegExpEditorWindow* editorWindow, TQWidget *tqparent, const char *name) - :MultiContainerWidget(editorWindow, parent, name == 0 ? "concwidget" : name) + :MultiContainerWidget(editorWindow, tqparent, name == 0 ? "concwidget" : name) { init(); DragAccepter *accepter = new DragAccepter(editorWindow, this); accepter->show(); - _children.append(accepter); + _tqchildren.append(accepter); } ConcWidget::ConcWidget(RegExpEditorWindow* editorWindow, RegExpWidget *child, - TQWidget *parent, const char *name) - :MultiContainerWidget(editorWindow, parent, name == 0 ? "concwidget" : name) + TQWidget *tqparent, const char *name) + :MultiContainerWidget(editorWindow, tqparent, name == 0 ? "concwidget" : name) { init(); DragAccepter *accepter = new DragAccepter(editorWindow, this); - _children.append(accepter); + _tqchildren.append(accepter); child->reparent(this, TQPoint(0,0), false); addNewChild(accepter, child); } @@ -48,24 +48,24 @@ ConcWidget::ConcWidget( RegExpEditorWindow* editorWindow, ConcWidget* origConc, :MultiContainerWidget(editorWindow, 0, "Splitted ConcWidget") { init(); - _children.prepend( new DragAccepter(editorWindow, this) ); + _tqchildren.prepend( new DragAccepter(editorWindow, this) ); for (unsigned int i = end; i >= start; i--) { - RegExpWidget* child = origConc->_children.take( i ); - _children.prepend( child ); + RegExpWidget* child = origConc->_tqchildren.take( i ); + _tqchildren.prepend( child ); child->reparent( this, TQPoint(0,0), false); } - _children.prepend( new DragAccepter(editorWindow, this) ); + _tqchildren.prepend( new DragAccepter(editorWindow, this) ); } ConcWidget::ConcWidget( ConcRegExp* regexp, RegExpEditorWindow* editorWindow, - TQWidget* parent, const char* name ) - :MultiContainerWidget( editorWindow, parent, name == 0 ? "concwidget" : name ) + TQWidget* tqparent, const char* name ) + :MultiContainerWidget( editorWindow, tqparent, name == 0 ? "concwidget" : name ) { init(); DragAccepter *accepter = new DragAccepter(editorWindow, this); - _children.append(accepter); + _tqchildren.append(accepter); - RegExpList list = regexp->children(); + RegExpList list = regexp->tqchildren(); for ( RegExpListIt it(list); *it; ++it ) { RegExpWidget* child = WidgetFactory::createWidget( *it, editorWindow, this ); append( child ); @@ -78,37 +78,37 @@ void ConcWidget::init() } -TQSize ConcWidget::sizeHint() const +TQSize ConcWidget::tqsizeHint() const { - int childrenWidth = 0; - int childrenHeight = 0; - TQPtrListIterator<RegExpWidget> it(_children); + int tqchildrenWidth = 0; + int tqchildrenHeight = 0; + TQPtrListIterator<RegExpWidget> it(_tqchildren); for ( ; *it; ++it) { - TQSize thisChildSize = (*it)->sizeHint(); - childrenWidth += thisChildSize.width(); - childrenHeight = QMAX(childrenHeight, thisChildSize.height()); + TQSize thisChildSize = (*it)->tqsizeHint(); + tqchildrenWidth += thisChildSize.width(); + tqchildrenHeight = TQMAX(tqchildrenHeight, thisChildSize.height()); } - return TQSize(childrenWidth, childrenHeight); + return TQSize(tqchildrenWidth, tqchildrenHeight); } void ConcWidget::paintEvent( TQPaintEvent *e) { - Q_ASSERT( dynamic_cast<DragAccepter*>(_children.at(0)) ); + Q_ASSERT( dynamic_cast<DragAccepter*>(_tqchildren.at(0)) ); // if this fails, then I should check the location of the show() - Q_ASSERT( _children.count() == 1 || - ( _children.count() >=3 && - dynamic_cast<DragAccepter*>(_children.at(_children.count()-1)) ) ); + Q_ASSERT( _tqchildren.count() == 1 || + ( _tqchildren.count() >=3 && + dynamic_cast<DragAccepter*>(_tqchildren.at(_tqchildren.count()-1)) ) ); - if ( _children.count() == 1) { + if ( _tqchildren.count() == 1) { // There is only an accepter, lets give it all the space. - _children.at(0)->setGeometry( 0, 0, size().width(), size().height() ); + _tqchildren.at(0)->setGeometry( 0, 0, size().width(), size().height() ); } else { - TQSize myReqSize = sizeHint(); - TQSize mySize(QMAX(myReqSize.width(), size().width()), - QMAX(myReqSize.height(), size().height())); + TQSize myReqSize = tqsizeHint(); + TQSize mySize(TQMAX(myReqSize.width(), size().width()), + TQMAX(myReqSize.height(), size().height())); // If the widget needs less space than it can get then this space should // be given to the leftmost and rightmost accepter. So lets calculate @@ -125,20 +125,20 @@ void ConcWidget::paintEvent( TQPaintEvent *e) int lastHeight = 0; int offset = 0; - for (unsigned int i = 1; i < _children.count(); i += 2 ) { - DragAccepter* accepter = dynamic_cast<DragAccepter*>(_children.at(i-1)); + for (unsigned int i = 1; i < _tqchildren.count(); i += 2 ) { + DragAccepter* accepter = dynamic_cast<DragAccepter*>(_tqchildren.at(i-1)); if (!accepter) continue; - RegExpWidget* child = _children.at(i); + RegExpWidget* child = _tqchildren.at(i); - TQSize childSize = child->sizeHint(); + TQSize childSize = child->tqsizeHint(); TQSize curChildSize = child->size(); //----------------------------- first place the accepter int x = offset; - int w = accepter->sizeHint().width(); + int w = accepter->tqsizeHint().width(); if ( i == 1 ) w+= extra; - int h = QMAX( lastHeight, childSize.height() ); + int h = TQMAX( lastHeight, childSize.height() ); int y = (mySize.height() - h)/2; accepter->setGeometry( x, y, w, h ); @@ -176,11 +176,11 @@ void ConcWidget::paintEvent( TQPaintEvent *e) //---------------------- Finally place the last accepter. DragAccepter* accepter = - dynamic_cast<DragAccepter*>(_children.at(_children.count()-1)); + dynamic_cast<DragAccepter*>(_tqchildren.at(_tqchildren.count()-1)); // dynamic_cast is ASSERTed at top int x = offset; int h = lastHeight; - int w = accepter->sizeHint().width() + extra; + int w = accepter->tqsizeHint().width() + extra; int y = (mySize.height()-h)/2; accepter->setGeometry( x, y, w, h ); } @@ -189,7 +189,7 @@ void ConcWidget::paintEvent( TQPaintEvent *e) void ConcWidget::mousePressEvent ( TQMouseEvent* event ) { - if ( event->button() == RightButton ) { + if ( event->button() == Qt::RightButton ) { _editorWindow->showRMBMenu( _editorWindow->hasSelection() ); } else { @@ -212,10 +212,10 @@ void ConcWidget::sizeAccepter( DragAccepter* accepter, int height, int totHeight RegExp* ConcWidget::regExp() const { - TQPtrListIterator<RegExpWidget> it( _children ); + TQPtrListIterator<RegExpWidget> it( _tqchildren ); ++it; // start with the second element. - if ( _children.count() == 3 ) { + if ( _tqchildren.count() == 3 ) { // Exactly one child (and two drag accepters) return (*it)->regExp(); } @@ -229,24 +229,24 @@ RegExp* ConcWidget::regExp() const } } -bool ConcWidget::updateSelection(bool parentSelected) +bool ConcWidget::updateSelection(bool tqparentSelected) { bool isSel = _isSelected; - bool changed = MultiContainerWidget::updateSelection( parentSelected ); + bool changed = MultiContainerWidget::updateSelection( tqparentSelected ); _maxSelectedHeight = 0; - TQPtrListIterator<RegExpWidget> it(_children); + TQPtrListIterator<RegExpWidget> it(_tqchildren); ++it; // Skip past the first DragAccepter for ( ; *it; it +=2 ) { if ( (*it)->isSelected() ) { - _maxSelectedHeight = QMAX( _maxSelectedHeight, (*it)->sizeHint().height() ); + _maxSelectedHeight = TQMAX( _maxSelectedHeight, (*it)->tqsizeHint().height() ); } } changed = changed || isSel != _isSelected; if ( changed ) { - repaint(); + tqrepaint(); } return changed; @@ -259,8 +259,8 @@ void ConcWidget::getSelectionIndexes( int* start, int* end ) // Start with element at index 1, and skip every second element, as we // know they are dragAccepters. - for ( unsigned int index = 1; index< _children.count(); index += 2 ) { - RegExpWidget* child = _children.at(index); + for ( unsigned int index = 1; index< _tqchildren.count(); index += 2 ) { + RegExpWidget* child = _tqchildren.at(index); if ( child->isSelected() ) { // The child is selected at topmost level. @@ -276,7 +276,7 @@ void ConcWidget::getSelectionIndexes( int* start, int* end ) } if ( *start != -1 && *end == -1 ) - *end = _children.count() -2; + *end = _tqchildren.count() -2; } void ConcWidget::applyRegExpToSelection( RegExpType type ) @@ -287,7 +287,7 @@ void ConcWidget::applyRegExpToSelection( RegExpType type ) if ( start == -1 ) { // No item selected at top level - TQPtrListIterator<RegExpWidget> it(_children); + TQPtrListIterator<RegExpWidget> it(_tqchildren); ++it; // Skip past the first DragAccepter for ( ; *it ; it += 2 ) { if ( (*it)->hasSelection() ) { @@ -307,7 +307,7 @@ void ConcWidget::applyRegExpToSelection( RegExpType type ) subSequence->resize(0,0); // see note (1) subSequence->reparent( newElm, TQPoint(0,0), false); - _children.insert( start, newElm ); + _tqchildren.insert( start, newElm ); newElm->show(); } } @@ -318,7 +318,7 @@ bool ConcWidget::isSelected() const // A ConcWidget should be considered selected when all its elements has been selected // otherwise empty ConcWidgets may be left behind when for example selection is deleted. bool allSelected = true; - TQPtrListIterator<RegExpWidget> it(_children); + TQPtrListIterator<RegExpWidget> it(_tqchildren); ++it; // Skip past first DragAccepter. for ( ; *it && allSelected; it += 2 ) { allSelected = allSelected && (*it)->isSelected(); @@ -336,7 +336,7 @@ RegExp* ConcWidget::selection() const bool foundMoreThanOne = false; RegExp* regexp = 0; - TQPtrListIterator<RegExpWidget> it(_children); + TQPtrListIterator<RegExpWidget> it(_tqchildren); ++it; // Skip past the first DragAccepter for ( ; (*it) ; it += 2 ) { if ( (*it)->hasSelection() ) { @@ -363,21 +363,21 @@ RegExp* ConcWidget::selection() const void ConcWidget::addNewConcChild(DragAccepter *accepter, ConcWidget *other) { - for ( unsigned int i=0; i<_children.count(); i+= 2 ) { - RegExpWidget *ch = _children.at( i ); + for ( unsigned int i=0; i<_tqchildren.count(); i+= 2 ) { + RegExpWidget *ch = _tqchildren.at( i ); if ( ch == accepter ) { // Move all the element from the `child' ConcWidget to this one. // Do not copy the first one as this is a dragAccepter, and we place the widgets // after this drag accepter. // We must take them in pairs to avoid breaking the invariant for paintEvent, // namely that every second element is a dragAccepter - for ( unsigned int j = other->_children.count()-1; j > 0 ; j-=2 ) { - RegExpWidget* newChildA = other->_children.take(j); + for ( unsigned int j = other->_tqchildren.count()-1; j > 0 ; j-=2 ) { + RegExpWidget* newChildA = other->_tqchildren.take(j); newChildA->reparent( this, TQPoint(0,0), false); - _children.insert( i+1, newChildA ); - RegExpWidget* newChildB = other->_children.take(j-1); + _tqchildren.insert( i+1, newChildA ); + RegExpWidget* newChildB = other->_tqchildren.take(j-1); newChildB->reparent( this, TQPoint(0,0), false); - _children.insert( i+1, newChildB ); + _tqchildren.insert( i+1, newChildB ); newChildA->show(); newChildB->show(); } @@ -391,7 +391,7 @@ void ConcWidget::addNewConcChild(DragAccepter *accepter, ConcWidget *other) bool ConcWidget::validateSelection() const { bool cont = true; - TQPtrListIterator<RegExpWidget> it(_children); + TQPtrListIterator<RegExpWidget> it(_tqchildren); ++it; // skip past the DragAccepter. for ( ; *it && cont; it += 2 ) { cont = (*it)->validateSelection(); diff --git a/kregexpeditor/concwidget.h b/kregexpeditor/concwidget.h index 9a4820c..073ff6e 100644 --- a/kregexpeditor/concwidget.h +++ b/kregexpeditor/concwidget.h @@ -30,19 +30,19 @@ class ConcRegExp; class ConcWidget :public MultiContainerWidget { public: - ConcWidget(RegExpEditorWindow* editorWindow, TQWidget *parent, + ConcWidget(RegExpEditorWindow* editorWindow, TQWidget *tqparent, const char *name = 0); ConcWidget(RegExpEditorWindow* editorWindow, RegExpWidget *child, - TQWidget *parent, const char *name=0); + TQWidget *tqparent, const char *name=0); ConcWidget( RegExpEditorWindow* editorWindow, ConcWidget* origConc, unsigned int start, unsigned int end); ConcWidget( ConcRegExp* regexp, RegExpEditorWindow* editorWindow, - TQWidget* parent, const char* name = 0); + TQWidget* tqparent, const char* name = 0); void init(); - virtual TQSize sizeHint() const; + virtual TQSize tqsizeHint() const; virtual RegExp* regExp() const; - virtual bool updateSelection(bool parentSelected); + virtual bool updateSelection(bool tqparentSelected); virtual bool isSelected() const; virtual void applyRegExpToSelection( RegExpType type ); @@ -52,7 +52,7 @@ public: virtual bool validateSelection() const; virtual bool acceptWidgetInsert( RegExpType ) const { return false; } virtual bool acceptWidgetPaste() const { return false; } - bool hasAnyChildren() { return _children.count() > 1; } + bool hasAnyChildren() { return _tqchildren.count() > 1; } protected: virtual void paintEvent( TQPaintEvent *e ); diff --git a/kregexpeditor/dcbutton.cpp b/kregexpeditor/dcbutton.cpp index 4d714ca..770b101 100644 --- a/kregexpeditor/dcbutton.cpp +++ b/kregexpeditor/dcbutton.cpp @@ -15,7 +15,7 @@ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. **/ -#ifdef QT_ONLY +#ifdef TQT_ONLY #include "compat.h" #else #include "dcbutton.moc" @@ -23,8 +23,8 @@ #include "dcbutton.h" -DoubleClickButton::DoubleClickButton( TQPixmap pixmap, TQWidget* parent, const char* name ) - : TQToolButton( parent, name ? name : "DoubleClickButton" ) +DoubleClickButton::DoubleClickButton( TQPixmap pixmap, TQWidget* tqparent, const char* name ) + : TQToolButton( tqparent, name ? name : "DoubleClickButton" ) { setPixmap( pixmap ); } diff --git a/kregexpeditor/dcbutton.h b/kregexpeditor/dcbutton.h index 0e2b6cf..0bdd2ca 100644 --- a/kregexpeditor/dcbutton.h +++ b/kregexpeditor/dcbutton.h @@ -25,12 +25,13 @@ class TQMouseEvent; TQToolButton extended to emit a signal on double click. @internal */ -class DoubleClickButton :public QToolButton +class DoubleClickButton :public TQToolButton { Q_OBJECT + TQ_OBJECT public: - DoubleClickButton( TQPixmap pix, TQWidget* parent, const char* name = 0); + DoubleClickButton( TQPixmap pix, TQWidget* tqparent, const char* name = 0); protected: virtual void mouseDoubleClickEvent ( TQMouseEvent * ); diff --git a/kregexpeditor/drag.cpp b/kregexpeditor/drag.cpp index e17973c..51197a4 100644 --- a/kregexpeditor/drag.cpp +++ b/kregexpeditor/drag.cpp @@ -37,13 +37,13 @@ bool RegExpWidgetDrag::canDecode( TQDragMoveEvent* event ) } RegExpWidget* RegExpWidgetDrag::decode(TQDropEvent* event, RegExpEditorWindow* window, - TQWidget* parent) + TQWidget* tqparent) { - TQByteArray payload = event->encodedData("KRegExpEditor/widgetdrag" ); + TQByteArray payload = event->tqencodedData("KRegExpEditor/widgetdrag" ); TQTextStream stream( payload, IO_ReadOnly ); TQString str = stream.read(); RegExp* regexp = WidgetFactory::createRegExp( str ); - RegExpWidget* widget = WidgetFactory::createWidget( regexp, window, parent ); + RegExpWidget* widget = WidgetFactory::createWidget( regexp, window, tqparent ); delete regexp; return widget; } @@ -58,7 +58,7 @@ const char * RegExpWidgetDrag::format ( int i ) const return 0; } -TQByteArray RegExpWidgetDrag::encodedData ( const char* format ) const +TQByteArray RegExpWidgetDrag::tqencodedData ( const char* format ) const { TQByteArray data; TQTextStream stream( data, IO_WriteOnly ); diff --git a/kregexpeditor/drag.h b/kregexpeditor/drag.h index 1ec220b..7173444 100644 --- a/kregexpeditor/drag.h +++ b/kregexpeditor/drag.h @@ -28,16 +28,16 @@ class RegExpEditorWindow; Class used for drag and drop in the RegExp widget. @internal */ -class RegExpWidgetDrag :public QDragObject +class RegExpWidgetDrag :public TQDragObject { public: RegExpWidgetDrag( RegExp* regexp , TQWidget* dragSource); ~RegExpWidgetDrag(); virtual const char * format ( int i = 0 ) const; - virtual TQByteArray encodedData ( const char * ) const; + virtual TQByteArray tqencodedData ( const char * ) const; static bool canDecode(TQDragMoveEvent* event); static RegExpWidget* decode(TQDropEvent* event, RegExpEditorWindow* window, - TQWidget* parent); + TQWidget* tqparent); private: RegExp* _regexp; }; diff --git a/kregexpeditor/dragaccepter.cpp b/kregexpeditor/dragaccepter.cpp index bbbf538..676c851 100644 --- a/kregexpeditor/dragaccepter.cpp +++ b/kregexpeditor/dragaccepter.cpp @@ -20,15 +20,15 @@ #include <tqpainter.h> -DragAccepter::DragAccepter(RegExpEditorWindow* editorWindow, RegExpWidget *parent, +DragAccepter::DragAccepter(RegExpEditorWindow* editorWindow, RegExpWidget *tqparent, const char *name) - : RegExpWidget(editorWindow, parent, name == 0 ? "dragaccepter" : name ), + : RegExpWidget(editorWindow, tqparent, name == 0 ? "dragaccepter" : name ), _drawLine( false ) { setAcceptDrops(TRUE); } -TQSize DragAccepter::sizeHint() const +TQSize DragAccepter::tqsizeHint() const { return TQSize(10,10); } @@ -46,7 +46,7 @@ void DragAccepter::paintEvent(TQPaintEvent *e) void DragAccepter::mousePressEvent ( TQMouseEvent* event ) { - if ( event->button() == RightButton ) { + if ( event->button() == Qt::RightButton ) { _editorWindow->showRMBMenu( _editorWindow->hasSelection() ); } else { @@ -56,7 +56,7 @@ void DragAccepter::mousePressEvent ( TQMouseEvent* event ) void DragAccepter::mouseReleaseEvent( TQMouseEvent* event ) { - if ( _editorWindow->isPasteing() && event->button() == LeftButton ) { + if ( _editorWindow->isPasteing() && event->button() == Qt::LeftButton ) { RegExp* regexp = _editorWindow->pasteData(); RegExpWidget *newElm = WidgetFactory::createWidget( regexp, _editorWindow, 0 ); @@ -68,24 +68,24 @@ void DragAccepter::mouseReleaseEvent( TQMouseEvent* event ) Q_ASSERT( elm ); - RegExpWidget *w = dynamic_cast<RegExpWidget*>(parent()); + RegExpWidget *w = dynamic_cast<RegExpWidget*>(tqparent()); if (w) w->addNewConcChild(this, elm); _editorWindow->updateContent( this ); _editorWindow->clearSelection( true ); } } - else if ( _editorWindow->isInserting() && event->button() == LeftButton ) { + else if ( _editorWindow->isInserting() && event->button() == Qt::LeftButton ) { if ( WidgetFactory::isContainer( _editorWindow->insertType() ) && _editorWindow->pointSelected( mapToGlobal( event->pos() ) ) ) { RegExpWidget::mouseReleaseEvent( event ); } else { RegExpWidget *child = WidgetFactory::createWidget( _editorWindow, - dynamic_cast<TQWidget*>(parent()), + dynamic_cast<TQWidget*>(tqparent()), _editorWindow->insertType() ); if ( child ) { - RegExpWidget *w = dynamic_cast<RegExpWidget*>(parent()); + RegExpWidget *w = dynamic_cast<RegExpWidget*>(tqparent()); if (w) w->addNewChild(this, child); _editorWindow->updateContent( child ); @@ -100,14 +100,14 @@ void DragAccepter::mouseReleaseEvent( TQMouseEvent* event ) void DragAccepter::dragEnterEvent(TQDragEnterEvent *event) { - bool selfDrag = ( event->source() && event->source()->topLevelWidget() == topLevelWidget() && _isSelected ); + bool selfDrag = ( event->source() && event->source()->tqtopLevelWidget() == tqtopLevelWidget() && _isSelected ); event->accept(RegExpWidgetDrag::canDecode( event ) && !selfDrag ); } void DragAccepter::dropEvent(TQDropEvent *event) { // The widget will be reparent afterward or part of it will, so no need to give - // it a parent here. + // it a tqparent here. RegExpWidget *newElm = RegExpWidgetDrag::decode( event, _editorWindow, 0 ); ConcWidget* elm; if ( !(elm = dynamic_cast<ConcWidget*>( newElm ) ) ) { @@ -116,15 +116,15 @@ void DragAccepter::dropEvent(TQDropEvent *event) Q_ASSERT( elm ); - RegExpWidget *rew = dynamic_cast<RegExpWidget*>(parent()); + RegExpWidget *rew = dynamic_cast<RegExpWidget*>(tqparent()); if (rew) rew->addNewConcChild(this, elm); - TQWidget *w = dynamic_cast<TQWidget*>(parent()); + TQWidget *w = dynamic_cast<TQWidget*>(tqparent()); if (w) w->update(); _editorWindow->updateContent( this ); - bool selfDrag = ( event->source() && event->source()->topLevelWidget() == topLevelWidget() ); + bool selfDrag = ( event->source() && event->source()->tqtopLevelWidget() == tqtopLevelWidget() ); if ( ! selfDrag ) _editorWindow->clearSelection( true ); else { diff --git a/kregexpeditor/dragaccepter.h b/kregexpeditor/dragaccepter.h index c9c6fd8..cead17f 100644 --- a/kregexpeditor/dragaccepter.h +++ b/kregexpeditor/dragaccepter.h @@ -30,9 +30,9 @@ class DragAccepter :public RegExpWidget friend class MultiContainerWidget; public: - DragAccepter(RegExpEditorWindow* editorWindow, RegExpWidget *parent, + DragAccepter(RegExpEditorWindow* editorWindow, RegExpWidget *tqparent, const char *name = 0); - TQSize sizeHint() const; + TQSize tqsizeHint() const; virtual RegExp* regExp() const; virtual RegExpType type() const { return DRAGACCEPTER; } void setDrawLine( bool drawLine ) { _drawLine = drawLine; } diff --git a/kregexpeditor/editorwindow.cpp b/kregexpeditor/editorwindow.cpp index fedd0a9..a7b793e 100644 --- a/kregexpeditor/editorwindow.cpp +++ b/kregexpeditor/editorwindow.cpp @@ -16,7 +16,7 @@ * Boston, MA 02110-1301, USA. **/ -#ifdef QT_ONLY +#ifdef TQT_ONLY #include "compat.h" #include "images.h" #else @@ -41,8 +41,8 @@ #include "userdefinedregexps.h" #include <tqfileinfo.h> -RegExpEditorWindow::RegExpEditorWindow( TQWidget *parent, const char *name) - : TQWidget(parent, name, Qt::WPaintUnclipped) +RegExpEditorWindow::RegExpEditorWindow( TQWidget *tqparent, const char *name) + : TQWidget(tqparent, name, TQt::WPaintUnclipped) { _top = new ConcWidget(this, this); _layout = new TQHBoxLayout( this); @@ -95,7 +95,7 @@ void RegExpEditorWindow::mousePressEvent ( TQMouseEvent* event ) bool RegExpEditorWindow::pointSelected( TQPoint p ) const { TQRect rect = _top->selectionRect(); - return rect.contains(p); + return rect.tqcontains(p); } void RegExpEditorWindow::mouseMoveEvent ( TQMouseEvent* event ) @@ -121,8 +121,8 @@ void RegExpEditorWindow::mouseMoveEvent ( TQMouseEvent* event ) } else { TQPainter p( this ); - p.setRasterOp( Qt::NotROP ); - p.setPen( Qt::DotLine ); + p.setRasterOp( TQt::NotROP ); + p.setPen( TQt::DotLine ); // remove last selection rectangle if ( ! _lastPoint.isNull() && _undrawSelection ) { @@ -151,8 +151,8 @@ void RegExpEditorWindow::mouseReleaseEvent( TQMouseEvent *event) // remove last selection rectangle TQPainter p( this ); - p.setRasterOp( Qt::NotROP ); - p.setPen( Qt::DotLine ); + p.setRasterOp( TQt::NotROP ); + p.setPen( TQt::DotLine ); if ( ! _lastPoint.isNull() ) { p.drawRect(TQRect(_start, _lastPoint)); } @@ -168,7 +168,7 @@ bool RegExpEditorWindow::selectionOverlap( TQPoint pos, TQSize size ) const { TQRect child(pos, size); - return (_selection.intersects(child) && ! child.contains(_selection)); + return (_selection.intersects(child) && ! child.tqcontains(_selection)); } bool RegExpEditorWindow::hasSelection() const @@ -209,8 +209,8 @@ void RegExpEditorWindow::slotDoSelect() _pasteInAction = false; _insertInAction = false; - // I need to update the cursor recursively, as a repaint may not have been issued yet - // when this method is invoked. This means that when the repaint comes, the cursor may + // I need to update the cursor recursively, as a tqrepaint may not have been issued yet + // when this method is invoked. This means that when the tqrepaint comes, the cursor may // move to an other widget. _top->updateCursorRecursively(); } @@ -236,9 +236,9 @@ void RegExpEditorWindow::updateContent( TQWidget* focusChild) emit contentChanged( p ); } -TQSize RegExpEditorWindow::sizeHint() const +TQSize RegExpEditorWindow::tqsizeHint() const { - return _top->sizeHint(); + return _top->tqsizeHint(); } void RegExpEditorWindow::paintEvent( TQPaintEvent* event ) @@ -289,7 +289,7 @@ void RegExpEditorWindow::cutCopyAux( TQPoint pos ) RegExpWidgetDrag *clipboardData = new RegExpWidgetDrag( regexp, this ); delete regexp; - QClipboard* clipboard = qApp->clipboard(); + TQClipboard* clipboard = tqApp->tqclipboard(); clipboard->setData( clipboardData ); emit anythingOnClipboard( true ); emit canSave( _top->hasAnyChildren() ); @@ -298,7 +298,7 @@ void RegExpEditorWindow::cutCopyAux( TQPoint pos ) void RegExpEditorWindow::slotStartPasteAction() { - TQByteArray data = qApp->clipboard()->data()->encodedData( "KRegExpEditor/widgetdrag" ); + TQByteArray data = tqApp->tqclipboard()->data()->tqencodedData( "KRegExpEditor/widgetdrag" ); TQTextStream stream( data, IO_ReadOnly ); TQString str = stream.read(); @@ -335,7 +335,7 @@ void RegExpEditorWindow::showRMBMenu( bool enableCutCopy ) _menu->setItemEnabled( CUT, enableCutCopy ); _menu->setItemEnabled( COPY, enableCutCopy ); - if ( ! qApp->clipboard()->data()->provides( "KRegExpEditor/widgetdrag" ) ) + if ( ! tqApp->tqclipboard()->data()->provides( "KRegExpEditor/widgetdrag" ) ) _menu->setItemEnabled( PASTE, false ); else _menu->setItemEnabled( PASTE, true ); @@ -369,12 +369,12 @@ void RegExpEditorWindow::slotSave() TQString dir = WidgetWinItem::path(); TQString txt; -#ifdef QT_ONLY - txt = QInputDialog::getText( tr("Name for regexp"), tr("Enter name:") ); +#ifdef TQT_ONLY + txt = TQInputDialog::getText( tr("Name for regexp"), tr("Enter name:") ); if ( txt.isNull() ) return; #else - KLineEditDlg dlg(i18n("Enter name:"), TQString::null, this); + KLineEditDlg dlg(i18n("Enter name:"), TQString(), this); dlg.setCaption(i18n("Name for Regular Expression")); if (!dlg.exec()) return; txt = dlg.text(); @@ -383,14 +383,14 @@ void RegExpEditorWindow::slotSave() TQString fileName = dir + TQString::fromLocal8Bit("/") + txt + TQString::fromLocal8Bit(".regexp"); TQFileInfo finfo( fileName ); if ( finfo.exists() ) { - int answer = KMessageBox::warningContinueCancel( this, i18n("<p>Overwrite named regular expression <b>%1</b></p>").arg(txt), TQString::null, i18n("Overwrite")); + int answer = KMessageBox::warningContinueCancel( this, i18n("<p>Overwrite named regular expression <b>%1</b></p>").tqarg(txt), TQString(), i18n("Overwrite")); if ( answer != KMessageBox::Continue ) return; } TQFile file( fileName ); if ( ! file.open(IO_WriteOnly) ) { - KMessageBox::sorry( this, i18n("Could not open file for writing: %1").arg(fileName) ); + KMessageBox::sorry( this, i18n("Could not open file for writing: %1").tqarg(fileName) ); return; } @@ -411,7 +411,7 @@ void RegExpEditorWindow::slotSetRegExp( RegExp* regexp ) { // I have no clue why the following line is necesarry, but if it is not here // then the editor area is messed up when calling slotSetRegExp before starting the eventloop. - qApp->processEvents(); + tqApp->processEvents(); delete _top; RegExpWidget* widget = WidgetFactory::createWidget( regexp, this, this ); @@ -431,7 +431,7 @@ void RegExpEditorWindow::updateCursorUnderPoint() { RegExpWidget* widget = _top->widgetUnderPoint( TQCursor::pos(), false ); if ( widget ) - widget->updateCursorShape(); + widget->updatetqCursorShape(); } void RegExpEditorWindow::emitVerifyRegExp() @@ -442,7 +442,7 @@ void RegExpEditorWindow::emitVerifyRegExp() TQIconSet RegExpEditorWindow::getIcon( const TQString& name ) { -#ifdef QT_ONLY +#ifdef TQT_ONLY TQPixmap pix; pix.convertFromImage( qembed_findImage( name ) ); return pix; diff --git a/kregexpeditor/editorwindow.h b/kregexpeditor/editorwindow.h index 7eb565e..f1484f1 100644 --- a/kregexpeditor/editorwindow.h +++ b/kregexpeditor/editorwindow.h @@ -43,12 +43,13 @@ class TQHBoxLayout; RegExpEditorWindow which the widget is a child of. They use this pointer to start operations like rubber band selection, cut/paste etc. */ -class RegExpEditorWindow :public QWidget +class RegExpEditorWindow :public TQWidget { Q_OBJECT + TQ_OBJECT public: - RegExpEditorWindow(TQWidget *parent, const char *name = 0); + RegExpEditorWindow(TQWidget *tqparent, const char *name = 0); /** Returns an object which represent the regular expression "drawn" in @@ -109,7 +110,7 @@ public: */ void showRMBMenu( bool enableCutCopy ); - virtual TQSize sizeHint() const; + virtual TQSize tqsizeHint() const; public slots: @@ -231,7 +232,7 @@ private: /** This points to the top @ref RegExpWidget in the editor window. */ ConcWidget *_top; - /** This points to the layout manager for the editor window */ + /** This points to the tqlayout manager for the editor window */ TQHBoxLayout* _layout; /** Start point and last point draw. Used when doing rubber band selection */ diff --git a/kregexpeditor/emacsregexpconverter.cpp b/kregexpeditor/emacsregexpconverter.cpp index 7d24454..0d0f6d4 100644 --- a/kregexpeditor/emacsregexpconverter.cpp +++ b/kregexpeditor/emacsregexpconverter.cpp @@ -40,10 +40,10 @@ TQString EmacsRegExpConverter::toString( AltnRegExp* regexp, bool markSelection TQString res; bool first = true; - RegExpList list = regexp->children(); + RegExpList list = regexp->tqchildren(); for ( RegExpListIt it(list); *it; ++it ) { if ( !first ) { - res += TQString::fromLatin1("\\|"); + res += TQString::tqfromLatin1("\\|"); } first = false; res += toStr( *it, markSelection ); @@ -56,13 +56,13 @@ TQString EmacsRegExpConverter::toString( ConcRegExp* regexp, bool markSelection { TQString res; - RegExpList list = regexp->children(); + RegExpList list = regexp->tqchildren(); for ( RegExpListIt it(list); *it; ++it ) { TQString startPar = TQString::fromLocal8Bit(""); TQString endPar = TQString::fromLocal8Bit(""); if ( (*it)->precedence() < regexp->precedence() ) { - startPar = TQString::fromLatin1( "\\(" ); - endPar = TQString::fromLatin1( "\\)" ); + startPar = TQString::tqfromLatin1( "\\(" ); + endPar = TQString::tqfromLatin1( "\\)" ); } res += startPar + toStr( *it, markSelection ) + endPar; @@ -80,7 +80,7 @@ TQString EmacsRegExpConverter::toString( LookAheadRegExp* /*regexp*/, bool /*mar haveWarned = true; } - return TQString::null; + return TQString(); } TQString EmacsRegExpConverter::toString( TextRangeRegExp* regexp, bool /*markSelection*/ ) @@ -112,7 +112,7 @@ TQString EmacsRegExpConverter::toString( TextRangeRegExp* regexp, bool /*markSel // Now insert the ranges. TQPtrList<StringPair> ranges = regexp->range(); for ( TQPtrListIterator<StringPair> it(ranges); *it; ++it ) { - txt.append((*it)->first()+ TQString::fromLatin1("-")+ (*it)->second()); + txt.append((*it)->first()+ TQString::tqfromLatin1("-")+ (*it)->second()); } // Ok, its time to build each part of the regexp, here comes the rule: @@ -122,20 +122,20 @@ TQString EmacsRegExpConverter::toString( TextRangeRegExp* regexp, bool /*markSel // finally if '^' is one of the characters, then it must not be the first // one! - TQString res = TQString::fromLatin1("["); + TQString res = TQString::tqfromLatin1("["); if ( regexp->negate() ) - res.append(TQString::fromLatin1("^")); + res.append(TQString::tqfromLatin1("^")); // a ']' must be the first character in teh range. if ( foundParenthesis ) { - res.append(TQString::fromLatin1("]")); + res.append(TQString::tqfromLatin1("]")); } // a '-' must be the first character ( only coming after a ']') if ( foundDash ) { - res.append(TQString::fromLatin1("-")); + res.append(TQString::tqfromLatin1("-")); } res += txt; @@ -153,7 +153,7 @@ TQString EmacsRegExpConverter::toString( TextRangeRegExp* regexp, bool /*markSel res.append( TQChar( '^' ) ); } - res.append(TQString::fromLatin1("]")); + res.append(TQString::tqfromLatin1("]")); return res; } @@ -165,7 +165,7 @@ TQString EmacsRegExpConverter::toString( CompoundRegExp* regexp, bool markSelect TQString EmacsRegExpConverter::toString( DotRegExp* /*regexp*/, bool /*markSelection*/ ) { - return TQString::fromLatin1( "." ); + return TQString::tqfromLatin1( "." ); } TQString EmacsRegExpConverter::toString( PositionRegExp* regexp, bool /*markSelection*/ ) @@ -173,18 +173,18 @@ TQString EmacsRegExpConverter::toString( PositionRegExp* regexp, bool /*markSele static bool haveWarned = false; switch ( regexp->position()) { case PositionRegExp::BEGLINE: - return TQString::fromLatin1("^"); + return TQString::tqfromLatin1("^"); case PositionRegExp::ENDLINE: - return TQString::fromLatin1("$"); + return TQString::tqfromLatin1("$"); case PositionRegExp::WORDBOUNDARY: case PositionRegExp::NONWORDBOUNDARY: if ( ! haveWarned ) { KMessageBox::sorry( 0, i18n( "Word boundary and non word boundary is not supported in Emacs syntax" ) ); haveWarned = true; - return TQString::fromLatin1(""); + return TQString::tqfromLatin1(""); } } - return TQString::fromLatin1(""); + return TQString::tqfromLatin1(""); } TQString EmacsRegExpConverter::toString( RepeatRegExp* regexp, bool markSelection ) @@ -195,8 +195,8 @@ TQString EmacsRegExpConverter::toString( RepeatRegExp* regexp, bool markSelectio TQString endPar; if ( child->precedence() < regexp->precedence() ) { - startPar = TQString::fromLatin1( "\\(" ); - endPar = TQString::fromLatin1( "\\)" ); + startPar = TQString::tqfromLatin1( "\\(" ); + endPar = TQString::tqfromLatin1( "\\)" ); } if (regexp->min() == 0 && regexp->max() == -1) { @@ -209,17 +209,17 @@ TQString EmacsRegExpConverter::toString( RepeatRegExp* regexp, bool markSelectio return startPar + cText + endPar + TQString::fromLocal8Bit("+"); } else { - TQString res = TQString::fromLatin1(""); + TQString res = TQString::tqfromLatin1(""); for ( int i = 0; i < regexp->min(); ++i ) { - res += TQString::fromLatin1( "\\(" ) + cText + TQString::fromLatin1( "\\)" ); + res += TQString::tqfromLatin1( "\\(" ) + cText + TQString::tqfromLatin1( "\\)" ); } if ( regexp->max() != -1 ) { for ( int i = regexp->min(); i < regexp->max(); ++i ) { - res += TQString::fromLatin1("\\(") + cText + TQString::fromLatin1("\\)?"); + res += TQString::tqfromLatin1("\\(") + cText + TQString::tqfromLatin1("\\)?"); } } else - res += TQString::fromLatin1("+"); + res += TQString::tqfromLatin1("+"); return res; } @@ -244,7 +244,7 @@ TQString EmacsRegExpConverter::toString( TextRegExp* regexp, bool /*markSelectio TQString EmacsRegExpConverter::name() { - return TQString::fromLatin1( "Emacs" ); + return TQString::tqfromLatin1( "Emacs" ); } int EmacsRegExpConverter::features() diff --git a/kregexpeditor/errormap.cpp b/kregexpeditor/errormap.cpp index ecf2866..41a8c00 100644 --- a/kregexpeditor/errormap.cpp +++ b/kregexpeditor/errormap.cpp @@ -16,7 +16,7 @@ * Boston, MA 02110-1301, USA. **/ -#ifdef QT_ONLY +#ifdef TQT_ONLY #include "compat.h" #else #include <kmessagebox.h> @@ -47,7 +47,7 @@ void ErrorMap::lineStartError() { if ( ! _prevLineStartError ) { KMessageBox::information( 0, i18n("Your regular expression is invalid, due to something preceding a 'line start'."), - i18n("Regular Expression Error"), TQString::fromLatin1("KRegExpEditorLineStartError") ); + i18n("Regular Expression Error"), TQString::tqfromLatin1("KRegExpEditorLineStartError") ); } _lineStartError = true; } @@ -56,7 +56,7 @@ void ErrorMap::lineEndError() { if ( !_prevLineEndError ) { KMessageBox::information( 0, i18n("Your regular expression is invalid, due to something following a 'line end'."), - i18n("Regular Expression Error"), TQString::fromLatin1("KRegExpEditorLineEndError") ); + i18n("Regular Expression Error"), TQString::tqfromLatin1("KRegExpEditorLineEndError") ); } _lineEndError = true; } @@ -66,7 +66,7 @@ void ErrorMap::lookAheadError() { if ( !_prevLookAHeadError ) { KMessageBox::information( 0, i18n("Your regular expression is invalid. 'Look Ahead' regular expression must be the last sub expression."), - i18n("Regular Expression Error"), TQString::fromLatin1("KRegExpEditorLookAHeadError") ); + i18n("Regular Expression Error"), TQString::tqfromLatin1("KRegExpEditorLookAHeadError") ); } _lookAHeadError = true; } diff --git a/kregexpeditor/gen_qregexplexer.cpp b/kregexpeditor/gen_qregexplexer.cpp index c349dcc..12dade3 100644 --- a/kregexpeditor/gen_qregexplexer.cpp +++ b/kregexpeditor/gen_qregexplexer.cpp @@ -454,7 +454,7 @@ char *yytext; #include <tqstring.h> #include "textrangeregexp.h" #include "gen_qregexpparser.hh" -#ifdef QT_ONLY +#ifdef TQT_ONLY #include "compat.h" #endif void parseRange( char* txt, int* min, int* max ); diff --git a/kregexpeditor/gen_qregexpparser.cc b/kregexpeditor/gen_qregexpparser.cc index 9f8d0a0..8a7b5bf 100644 --- a/kregexpeditor/gen_qregexpparser.cc +++ b/kregexpeditor/gen_qregexpparser.cc @@ -100,7 +100,7 @@ /* Copy the first part of user declarations. */ #line 18 "qregexpparser.y" -#ifdef QT_ONLY +#ifdef TQT_ONLY #include "compat.h" #else #include <klocale.h> @@ -125,7 +125,7 @@ extern void setParseData( TQString str ); int yyerror (const char *); void setParseResult( RegExp* ); - RegExp* parseQtRegExp( TQString qstr, bool* ok ); + RegExp* parseTQtRegExp( TQString qstr, bool* ok ); static RegExp* parseResult; static int _index; @@ -1049,7 +1049,7 @@ yyreduce: yyval.regexp = new AltnRegExp( false ); dynamic_cast<AltnRegExp*>( yyval.regexp )->addRegExp( yyvsp[-1].regexp ); } - dynamic_cast<AltnRegExp*>( yyval.regexp )->addRegExp( new TextRegExp( false, TQString::fromLatin1("") ) ); + dynamic_cast<AltnRegExp*>( yyval.regexp )->addRegExp( new TextRegExp( false, TQString::tqfromLatin1("") ) ); } break; @@ -1057,7 +1057,7 @@ yyreduce: #line 107 "qregexpparser.y" { yyval.regexp = new AltnRegExp( false ); - dynamic_cast<AltnRegExp*>( yyval.regexp )->addRegExp( new TextRegExp( false, TQString::fromLatin1("") ) ); + dynamic_cast<AltnRegExp*>( yyval.regexp )->addRegExp( new TextRegExp( false, TQString::tqfromLatin1("") ) ); dynamic_cast<AltnRegExp*>( yyval.regexp )->addRegExp( yyvsp[0].regexp ); } break; @@ -1160,7 +1160,7 @@ yyreduce: case 23: #line 157 "qregexpparser.y" { - TQString match = TQString::fromLocal8Bit("\\%1").arg( yyvsp[0].backRef ); + TQString match = TQString(TQString::fromLocal8Bit("\\%1")).tqarg( yyvsp[0].backRef ); yyval.regexp = new TextRegExp( false, match ); KMessageBox::information(0,i18n("<qt>Back reference regular expressions are not supported.<p>" "<tt>\\1</tt>, <tt>\\2</tt>, ... are <i>back references</i>, meaning they refer to " @@ -1170,7 +1170,7 @@ yyreduce: "just a workaround to ensure that the application handles the regexp at all. " "Therefore, as soon as you edit the regular expression in the graphical area, " "the back reference will be replaced by matching the text <b>%2</b> literally.") - .arg( match ).arg( match ), + .tqarg( match ).tqarg( match ), i18n("Back reference regular expressions not supported"), TQString::fromLocal8Bit("backReferenceNotSupported") ); } @@ -1192,13 +1192,13 @@ yyreduce: if ( yyvsp[0].ch == '{' || yyvsp[0].ch == '}' || yyvsp[0].ch == '[' || yyvsp[0].ch == ']' || yyvsp[0].ch == '\\' ) { yyerror( "illigal character - needs escaping" ); } - yyval.regexp = new TextRegExp( false, TQString::fromLocal8Bit("%1").arg(yyvsp[0].ch)); + yyval.regexp = new TextRegExp( false, TQString(TQString::fromLocal8Bit("%1")).tqarg(yyvsp[0].ch)); } break; case 27: #line 182 "qregexpparser.y" - { yyval.regexp = new TextRegExp( false, TQString::fromLocal8Bit("%1").arg(yyvsp[0].ch)); } + { yyval.regexp = new TextRegExp( false, TQString(TQString::fromLocal8Bit("%1")).tqarg(yyvsp[0].ch)); } break; @@ -1427,7 +1427,7 @@ yyreturn: #line 185 "qregexpparser.y" -RegExp* parseQtRegExp( TQString qstr, bool* ok ) { +RegExp* parseTQtRegExp( TQString qstr, bool* ok ) { _index = 0; parseResult = 0; setParseData( qstr ); diff --git a/kregexpeditor/gen_qregexpparser.hh b/kregexpeditor/gen_qregexpparser.hh index 19b2558..9e75892 100644 --- a/kregexpeditor/gen_qregexpparser.hh +++ b/kregexpeditor/gen_qregexpparser.hh @@ -23,8 +23,8 @@ This special exception was added by the Free Software Foundation in version 1.24 of Bison. */ -#ifndef BISON_GEN_QREGEXPPARSER_HH -# define BISON_GEN_QREGEXPPARSER_HH +#ifndef BISON_GEN_TQREGEXPPARSER_HH +# define BISON_GEN_TQREGEXPPARSER_HH /* Tokens. */ #ifndef YYTOKENTYPE @@ -89,5 +89,5 @@ typedef union { extern YYSTYPE qregexplval; -#endif /* not BISON_GEN_QREGEXPPARSER_HH */ +#endif /* not BISON_GEN_TQREGEXPPARSER_HH */ diff --git a/kregexpeditor/infopage.cpp b/kregexpeditor/infopage.cpp index e467c4b..90ff202 100644 --- a/kregexpeditor/infopage.cpp +++ b/kregexpeditor/infopage.cpp @@ -15,7 +15,7 @@ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. **/ -#ifdef QT_ONLY +#ifdef TQT_ONLY #include "compat.h" #else #include <klocale.h> @@ -24,11 +24,11 @@ #include "infopage.h" -InfoPage::InfoPage( TQWidget* parent, const char* name ) - :KTextBrowser( parent, name ) +InfoPage::InfoPage( TQWidget* tqparent, const char* name ) + :KTextBrowser( tqparent, name ) { TQString txt = - TQString::fromLatin1( "<qt>" ) + + TQString::tqfromLatin1( "<qt>" ) + i18n( "Translators, feel free to add yourself in the text below, asking for a postcard ;-), " "also feel free to add a section saying <h2>Translators</h2>. " "Kind regards, and thanks for your work - Jesper.", @@ -58,14 +58,14 @@ InfoPage::InfoPage( TQWidget* parent, const char* name ) "<h2>Author</h2>" "<a href=\"http://www.blackie.dk/\">Jesper K. Pedersen</a> <<a href=\"mailto:blackie@kde.org\">blackie@kde.org</a>>") - + TQString::fromLatin1( "</qt>" ); + + TQString::tqfromLatin1( "</qt>" ); setText( txt ); } void InfoPage::setSource ( const TQString& name ) { -#ifdef QT_ONLY - mimeSourceFactory()->setFilePath( TQStringList() << TQString::fromLatin1("manual/")); +#ifdef TQT_ONLY + mimeSourceFactory()->setFilePath( TQStringList() << TQString::tqfromLatin1("manual/")); TQString nm = name; if ( nm.endsWith("/") ) nm = nm.left( nm.length()-1); diff --git a/kregexpeditor/infopage.h b/kregexpeditor/infopage.h index cada15d..6367cda 100644 --- a/kregexpeditor/infopage.h +++ b/kregexpeditor/infopage.h @@ -18,7 +18,7 @@ #ifndef infopage_h #define infopage_h -#ifdef QT_ONLY +#ifdef TQT_ONLY #include "compat.h" #include <tqtextbrowser.h> #else @@ -28,7 +28,7 @@ class InfoPage :public KTextBrowser { public: - InfoPage( TQWidget* parent, const char* name ); + InfoPage( TQWidget* tqparent, const char* name ); virtual void setSource ( const TQString& name ); }; diff --git a/kregexpeditor/kregexpeditorfactory.cpp b/kregexpeditor/kregexpeditorfactory.cpp index bcddd63..f3d538b 100644 --- a/kregexpeditor/kregexpeditorfactory.cpp +++ b/kregexpeditor/kregexpeditorfactory.cpp @@ -16,7 +16,7 @@ * Boston, MA 02110-1301, USA. **/ -#ifndef QT_ONLY +#ifndef TQT_ONLY #include <kgenericfactory.h> #include "kregexpeditorgui.h" typedef K_TYPELIST_2( KRegExpEditorGUI, KRegExpEditorGUIDialog ) Products; diff --git a/kregexpeditor/kregexpeditorgui.cpp b/kregexpeditor/kregexpeditorgui.cpp index bbf06be..11a0264 100644 --- a/kregexpeditor/kregexpeditorgui.cpp +++ b/kregexpeditor/kregexpeditorgui.cpp @@ -16,7 +16,7 @@ * Boston, MA 02110-1301, USA. **/ -#ifdef QT_ONLY +#ifdef TQT_ONLY #include "compat.h" #else #include <klocale.h> @@ -34,13 +34,13 @@ const TQString KRegExpEditorGUI::version = TQString::fromLocal8Bit("1.0"); -KRegExpEditorGUI::KRegExpEditorGUI(TQWidget *parent, const char *name, +KRegExpEditorGUI::KRegExpEditorGUI(TQWidget *tqparent, const char *name, const TQStringList & ) - : TQWidget( parent, name) + : TQWidget( tqparent, name) { - TQHBoxLayout* layout = new TQHBoxLayout( this, 6 ); + TQHBoxLayout* tqlayout = new TQHBoxLayout( this, 6 ); _editor = new KRegExpEditorPrivate( this, "_editor" ); - layout->addWidget( _editor ); + tqlayout->addWidget( _editor ); connect( _editor, TQT_SIGNAL( canUndo(bool) ), this, TQT_SIGNAL( canUndo(bool) ) ); connect( _editor, TQT_SIGNAL( canRedo(bool) ), this, TQT_SIGNAL( canRedo(bool) ) ); connect( _editor, TQT_SIGNAL( changes(bool) ), this, TQT_SIGNAL( changes(bool) ) ); @@ -66,16 +66,16 @@ void KRegExpEditorGUI::setRegExp( const TQString ®exp ) _editor->slotSetRegexp( regexp ); } -KRegExpEditorGUIDialog::KRegExpEditorGUIDialog( TQWidget *parent, +KRegExpEditorGUIDialog::KRegExpEditorGUIDialog( TQWidget *tqparent, const char *name, const TQStringList & ) : KDialogBase( KDialogBase::Plain, i18n("Regular Expression Editor"), KDialogBase::Ok | KDialogBase::Cancel | KDialogBase::Help, KDialogBase::Ok, - parent, name ? name : "KRegExpDialog" ) + tqparent, name ? name : "KRegExpDialog" ) { TQFrame* frame = plainPage(); - TQVBoxLayout* layout = new TQVBoxLayout( frame, 6 ); - layout->setAutoAdd( true ); + TQVBoxLayout* tqlayout = new TQVBoxLayout( frame, 6 ); + tqlayout->setAutoAdd( true ); _editor = new KRegExpEditorGUI( frame ); connect( _editor, TQT_SIGNAL( canUndo(bool) ), this, TQT_SIGNAL( canUndo(bool) ) ); @@ -83,8 +83,8 @@ KRegExpEditorGUIDialog::KRegExpEditorGUIDialog( TQWidget *parent, connect( _editor, TQT_SIGNAL( changes(bool) ), this, TQT_SIGNAL( changes(bool) ) ); resize( 640, 400 ); - setHelp( TQString::null, TQString::fromLocal8Bit( "KRegExpEditor" ) ); -#ifdef QT_ONLY + setHelp( TQString(), TQString::fromLocal8Bit( "KRegExpEditor" ) ); +#ifdef TQT_ONLY connect( this, TQT_SIGNAL( helpClicked() ), _editor, TQT_SLOT( showHelp() ) ); #endif } @@ -117,20 +117,20 @@ void KRegExpEditorGUIDialog::doSomething( TQString method, void* arguments ) void KRegExpEditorGUI::doSomething( TQString method, void* arguments ) { - if ( method == TQString::fromLatin1( "setCaseSensitive" ) ) { + if ( method == TQString::tqfromLatin1( "setCaseSensitive" ) ) { _editor->setCaseSensitive( (bool) arguments ); } - else if ( method == TQString::fromLatin1("setMinimal") ) { + else if ( method == TQString::tqfromLatin1("setMinimal") ) { _editor->setMinimal( (bool) arguments ); } - else if ( method == TQString::fromLatin1("setSyntax") ) { + else if ( method == TQString::tqfromLatin1("setSyntax") ) { _editor->setSyntax( *((TQString*) arguments) ); } - else if ( method == TQString::fromLatin1("setAllowNonQtSyntax") ) { - _editor->setAllowNonQtSyntax( (bool) arguments ); + else if ( method == TQString::tqfromLatin1("setAllowNonTQtSyntax") ) { + _editor->setAllowNonTQtSyntax( (bool) arguments ); } else { - qFatal( "%s", tr("Method '%1' is not valid!").arg(method).latin1() ); + qFatal( "%s", tqtr("Method '%1' is not valid!").tqarg(method).latin1() ); } } @@ -147,14 +147,14 @@ void KRegExpEditorGUI::setMatchText( const TQString& txt ) void KRegExpEditorGUI::showHelp() { -#ifdef QT_ONLY +#ifdef TQT_ONLY _editor->showHelp(); #else - kapp->invokeHelp( TQString::null, TQString::fromLocal8Bit( "KRegExpEditor" ) ); + kapp->invokeHelp( TQString(), TQString::fromLocal8Bit( "KRegExpEditor" ) ); #endif } -#ifndef QT_ONLY +#ifndef TQT_ONLY typedef K_TYPELIST_2( KRegExpEditorGUI, KRegExpEditorGUIDialog ) Products; K_EXPORT_COMPONENT_FACTORY( libkregexpeditorgui, KGenericFactory<Products>( "kregexpeditor" ) ) diff --git a/kregexpeditor/kregexpeditorgui.h b/kregexpeditor/kregexpeditorgui.h index 48545d8..96eb234 100644 --- a/kregexpeditor/kregexpeditorgui.h +++ b/kregexpeditor/kregexpeditorgui.h @@ -18,7 +18,7 @@ #ifndef kregexpeditorgui_h #define kregexpeditorgui_h -#ifdef QT_ONLY +#ifdef TQT_ONLY #include "compat.h" #else #include <kdialogbase.h> @@ -37,9 +37,10 @@ class KRegExpEditorPrivate; class KDE_EXPORT KRegExpEditorGUI :public TQWidget, public KRegExpEditorInterface { Q_OBJECT - Q_PROPERTY( TQString regexp READ regExp WRITE setRegExp ) + TQ_OBJECT + TQ_PROPERTY( TQString regexp READ regExp WRITE setRegExp ) public: - KRegExpEditorGUI( TQWidget *parent, const char *name = 0, + KRegExpEditorGUI( TQWidget *tqparent, const char *name = 0, const TQStringList & = TQStringList() ); virtual TQString regExp() const; @@ -66,9 +67,10 @@ private: class KDE_EXPORT KRegExpEditorGUIDialog : public KDialogBase, public KRegExpEditorInterface { Q_OBJECT - Q_PROPERTY( TQString regexp READ regExp WRITE setRegExp ) + TQ_OBJECT + TQ_PROPERTY( TQString regexp READ regExp WRITE setRegExp ) public: - KRegExpEditorGUIDialog( TQWidget *parent, const char *name, const TQStringList &args ); + KRegExpEditorGUIDialog( TQWidget *tqparent, const char *name, const TQStringList &args ); virtual TQString regExp() const; diff --git a/kregexpeditor/kregexpeditorprivate.cpp b/kregexpeditor/kregexpeditorprivate.cpp index fad06f9..2150293 100644 --- a/kregexpeditor/kregexpeditorprivate.cpp +++ b/kregexpeditor/kregexpeditorprivate.cpp @@ -16,7 +16,7 @@ * Boston, MA 02110-1301, USA. **/ -#ifdef QT_ONLY +#ifdef TQT_ONLY #include "compat.h" #else #include <klocale.h> @@ -46,15 +46,15 @@ #include "verifybuttons.h" #include <tqwhatsthis.h> -KRegExpEditorPrivate::KRegExpEditorPrivate(TQWidget *parent, const char *name) - : TQWidget(parent, name), _updating( false ), _autoVerify( true ) +KRegExpEditorPrivate::KRegExpEditorPrivate(TQWidget *tqparent, const char *name) + : TQWidget(tqparent, name), _updating( false ), _autoVerify( true ) { setMinimumSize(730,300); - TQDockArea* area = new TQDockArea( Horizontal, TQDockArea::Normal, this ); + TQDockArea* area = new TQDockArea(Qt::Horizontal, TQDockArea::Normal, this ); area->setMinimumSize(2,2); - TQDockArea* verArea1 = new TQDockArea( Vertical, TQDockArea::Normal, this ); + TQDockArea* verArea1 = new TQDockArea(Qt::Vertical, TQDockArea::Normal, this ); verArea1->setMinimumSize(2,2); - TQDockArea* verArea2 = new TQDockArea( Vertical, TQDockArea::Reverse, this ); + TQDockArea* verArea2 = new TQDockArea(Qt::Vertical, TQDockArea::Reverse, this ); verArea2->setMinimumSize(2,2); // The DockWindows. @@ -67,7 +67,7 @@ KRegExpEditorPrivate::KRegExpEditorPrivate(TQWidget *parent, const char *name) "you have developed and saved, and regular expressions shipped with the system." )); // Editor window - _editor = new TQSplitter( Vertical, this, "KRegExpEditorPrivate::_editor" ); + _editor = new TQSplitter(Qt::Vertical, this, "KRegExpEditorPrivate::_editor" ); _scrolledEditorWindow = new RegExpScrolledEditorWindow( _editor, "KRegExpEditorPrivate::_scrolledEditorWindow" ); @@ -138,7 +138,7 @@ KRegExpEditorPrivate::KRegExpEditorPrivate(TQWidget *parent, const char *name) // connect( _verifier, TQT_SIGNAL( countChanged( int ) ), _verifyButtons, TQT_SLOT( setMatchCount( int ) ) ); - // Qt anchors do not work for <pre>...</pre>, thefore scrolling to next/prev match + // TQt anchors do not work for <pre>...</pre>, thefore scrolling to next/prev match // do not work. Enable this when they work. // connect( _verifyButtons, TQT_SIGNAL( gotoFirst() ), _verifier, TQT_SLOT( gotoFirst() ) ); // connect( _verifyButtons, TQT_SIGNAL( gotoPrev() ), _verifier, TQT_SLOT( gotoPrev() ) ); @@ -154,31 +154,31 @@ KRegExpEditorPrivate::KRegExpEditorPrivate(TQWidget *parent, const char *name) // Line Edit - TQHBoxLayout* layout = new TQHBoxLayout( topLayout, 6 ); + TQHBoxLayout* tqlayout = new TQHBoxLayout( topLayout, 6 ); TQLabel* label = new TQLabel( i18n("ASCII syntax:"), this ); - layout->addWidget( label ); + tqlayout->addWidget( label ); clearButton = new TQToolButton( this ); - const TQString icon( TQString::fromLatin1( TQApplication::reverseLayout() ? "clear_left" : "locationbar_erase" ) ); + const TQString icon( TQString::tqfromLatin1( TQApplication::reverseLayout() ? "clear_left" : "locationbar_erase" ) ); TQIconSet clearIcon = SmallIconSet( icon ); clearButton->setIconSet( clearIcon ); - layout->addWidget( clearButton ); + tqlayout->addWidget( clearButton ); TQToolTip::add( clearButton, i18n("Clear expression") ); _regexpEdit = new TQLineEdit( this ); - layout->addWidget( _regexpEdit ); + tqlayout->addWidget( _regexpEdit ); TQWhatsThis::add( _regexpEdit, i18n( "This is the regular expression in ASCII syntax. You are likely only " "to be interested in this if you are a programmer, and need to " "develop a regular expression using TQRegExp.<p>" "You may develop your regular expression both by using the graphical " "editor, and by typing the regular expression in this line edit.") ); -#ifdef QT_ONLY +#ifdef TQT_ONLY TQPixmap pix( "icons/error.png" ); #else - TQPixmap pix = KGlobal::iconLoader()->loadIcon(locate("data", TQString::fromLatin1("kregexpeditor/pics/error.png") ), KIcon::Toolbar ); + TQPixmap pix = KGlobal::iconLoader()->loadIcon(locate("data", TQString::tqfromLatin1("kregexpeditor/pics/error.png") ), KIcon::Toolbar ); #endif _error = new TQLabel( this ); _error->setPixmap( pix ); - layout->addWidget( _error ); + tqlayout->addWidget( _error ); _error->hide(); _timer = new TQTimer(this); @@ -196,7 +196,7 @@ KRegExpEditorPrivate::KRegExpEditorPrivate(TQWidget *parent, const char *name) accel->connectItem( accel->insertItem( CTRL+Key_Z ), this, TQT_SLOT( slotUndo() ) ); accel->connectItem( accel->insertItem( CTRL+Key_R ), this, TQT_SLOT( slotRedo() ) ); - setSyntax( TQString::fromLatin1( "Qt" ) ); + setSyntax( TQString::tqfromLatin1( "TQt" ) ); } TQString KRegExpEditorPrivate::regexp() @@ -371,7 +371,7 @@ void KRegExpEditorPrivate::setVerifyText( const TQString& fileName ) _autoVerify = false; TQFile file( fileName ); if ( !file.open( IO_ReadOnly ) ) { - KMessageBox::sorry(0, i18n("Could not open file '%1' for reading").arg( fileName ) ); + KMessageBox::sorry(0, i18n("Could not open file '%1' for reading").tqarg( fileName ) ); } else { TQTextStream s( &file ); @@ -401,11 +401,11 @@ void KRegExpEditorPrivate::setSyntax( const TQString& syntax ) RegExpConverter::setCurrent( converter ); if ( converter->canParse() ) { _regexpEdit->setReadOnly( false ); - _regexpEdit->setBackgroundMode( Qt::PaletteBase ); + _regexpEdit->setBackgroundMode( TQt::PaletteBase ); } else { _regexpEdit->setReadOnly( true ); - _regexpEdit->setBackgroundMode( Qt::PaletteBackground ); + _regexpEdit->setBackgroundMode( TQt::PaletteBackground ); } _regExpButtons->setFeatures( converter->features() ); _verifier->setHighlighter( converter->highlighter(_verifier) ); @@ -418,7 +418,7 @@ void KRegExpEditorPrivate::showHelp() _editor->hide(); } -void KRegExpEditorPrivate::setAllowNonQtSyntax( bool b ) +void KRegExpEditorPrivate::setAllowNonTQtSyntax( bool b ) { - _verifyButtons->setAllowNonQtSyntax( b ); + _verifyButtons->setAllowNonTQtSyntax( b ); } diff --git a/kregexpeditor/kregexpeditorprivate.h b/kregexpeditor/kregexpeditorprivate.h index 369334e..effbdd7 100644 --- a/kregexpeditor/kregexpeditorprivate.h +++ b/kregexpeditor/kregexpeditorprivate.h @@ -43,16 +43,17 @@ class TQToolButton; @author Jesper K. Pedersen <blackie@kde.org> @version 0.1 **/ -class KRegExpEditorPrivate :public QWidget +class KRegExpEditorPrivate :public TQWidget { Q_OBJECT + TQ_OBJECT public: - KRegExpEditorPrivate( TQWidget *parent, const char *name = 0 ); + KRegExpEditorPrivate( TQWidget *tqparent, const char *name = 0 ); TQString regexp(); void setMinimal( bool ); void setCaseSensitive( bool ); - void setAllowNonQtSyntax( bool ); + void setAllowNonTQtSyntax( bool ); protected slots: void slotUpdateEditor( const TQString & ); diff --git a/kregexpeditor/limitedcharlineedit.cpp b/kregexpeditor/limitedcharlineedit.cpp index 6322016..7137b5e 100644 --- a/kregexpeditor/limitedcharlineedit.cpp +++ b/kregexpeditor/limitedcharlineedit.cpp @@ -22,11 +22,11 @@ @internal A Validator for the @ref LimitedCharLineEdit */ -class Validator :public QValidator +class Validator :public TQValidator { public: - Validator( LimitedCharLineEdit::Mode mode, TQWidget* parent ) - :TQValidator( parent, "Validator" ), _mode(mode) + Validator( LimitedCharLineEdit::Mode mode, TQWidget* tqparent ) + :TQValidator( TQT_TQOBJECT(tqparent), "Validator" ), _mode(mode) { } @@ -56,8 +56,8 @@ void LimitedCharLineEdit::keyPressEvent ( TQKeyEvent *event ) focusNextPrevChild(true); } -LimitedCharLineEdit::LimitedCharLineEdit( Mode mode, TQWidget* parent, const char* name ) - :TQLineEdit( parent, name ), _mode(mode) +LimitedCharLineEdit::LimitedCharLineEdit( Mode mode, TQWidget* tqparent, const char* name ) + :TQLineEdit( tqparent, name ), _mode(mode) { if ( mode == NORMAL ) _count = 1; @@ -67,7 +67,7 @@ LimitedCharLineEdit::LimitedCharLineEdit( Mode mode, TQWidget* parent, const cha _count = 4; setMaxLength( _count ); - setFixedSize( fontMetrics().width('A')*5+5, sizeHint().height()); + setFixedSize( fontMetrics().width('A')*5+5, tqsizeHint().height()); setValidator( new Validator( mode, this ) ); } diff --git a/kregexpeditor/limitedcharlineedit.h b/kregexpeditor/limitedcharlineedit.h index 13026cc..4b76250 100644 --- a/kregexpeditor/limitedcharlineedit.h +++ b/kregexpeditor/limitedcharlineedit.h @@ -24,12 +24,12 @@ TQLineEdit which only accepts a prespecified number of character. @internal */ -class LimitedCharLineEdit :public QLineEdit +class LimitedCharLineEdit :public TQLineEdit { public: enum Mode { NORMAL = 0, HEX = 1, OCT = 2 }; - LimitedCharLineEdit(Mode mode, TQWidget* parent, const char *name = 0); + LimitedCharLineEdit(Mode mode, TQWidget* tqparent, const char *name = 0); protected: virtual void keyPressEvent ( TQKeyEvent * ); diff --git a/kregexpeditor/lookaheadwidget.cpp b/kregexpeditor/lookaheadwidget.cpp index aa9f873..95e9c5c 100644 --- a/kregexpeditor/lookaheadwidget.cpp +++ b/kregexpeditor/lookaheadwidget.cpp @@ -16,7 +16,7 @@ * Boston, MA 02110-1301, USA. **/ -#ifdef QT_ONLY +#ifdef TQT_ONLY #include "compat.h" #else #include <klocale.h> @@ -28,16 +28,16 @@ #include "concwidget.h" #include <tqpainter.h> -LookAheadWidget::LookAheadWidget( RegExpEditorWindow* editorWindow, RegExpType tp, TQWidget* parent, const char* name ) - :SingleContainerWidget(editorWindow, parent, name ? name : "LookAheadWidget" ), _tp(tp) +LookAheadWidget::LookAheadWidget( RegExpEditorWindow* editorWindow, RegExpType tp, TQWidget* tqparent, const char* name ) + :SingleContainerWidget(editorWindow, tqparent, name ? name : "LookAheadWidget" ), _tp(tp) { _child = new ConcWidget( editorWindow, this ); init(); } LookAheadWidget::LookAheadWidget( LookAheadRegExp* regexp, RegExpEditorWindow* editorWindow, RegExpType tp, - TQWidget* parent, const char* name ) - :SingleContainerWidget( editorWindow, parent, name ? name : "LookAheadWidget" ), _tp(tp) + TQWidget* tqparent, const char* name ) + :SingleContainerWidget( editorWindow, tqparent, name ? name : "LookAheadWidget" ), _tp(tp) { RegExpWidget* child = WidgetFactory::createWidget( regexp->child(), editorWindow, this ); if ( ! (_child = dynamic_cast<ConcWidget*>( child ) ) ) @@ -60,23 +60,23 @@ RegExp* LookAheadWidget::regExp() const _child->regExp() ); } -TQSize LookAheadWidget::sizeHint() const +TQSize LookAheadWidget::tqsizeHint() const { - // TODO: Merge with RepeatWidget::sizeHint + // TODO: Merge with RepeatWidget::tqsizeHint TQFontMetrics metrics = fontMetrics(); _textSize = metrics.size( 0, _text ); - _childSize = _child->sizeHint(); + _childSize = _child->tqsizeHint(); int height = _textSize.height() + bdSize + _childSize.height() + bdSize + 2*pw; - int width = 2 * pw + QMAX(_childSize.width(), 4*bdSize + _textSize.width()); + int width = 2 * pw + TQMAX(_childSize.width(), 4*bdSize + _textSize.width()); return TQSize(width,height); } void LookAheadWidget::paintEvent( TQPaintEvent *e ) { // TODO: Merge with RepeatWidget::paintEvent - TQSize mySize = sizeHint(); + TQSize mySize = tqsizeHint(); TQPainter painter(this); drawPossibleSelection( painter, mySize ); diff --git a/kregexpeditor/lookaheadwidget.h b/kregexpeditor/lookaheadwidget.h index 022e419..e5825b8 100644 --- a/kregexpeditor/lookaheadwidget.h +++ b/kregexpeditor/lookaheadwidget.h @@ -24,14 +24,15 @@ class LookAheadRegExp; class LookAheadWidget :public SingleContainerWidget { Q_OBJECT + TQ_OBJECT public: - LookAheadWidget( RegExpEditorWindow* editorWindow, RegExpType tp, TQWidget* parent, const char* name = 0 ); + LookAheadWidget( RegExpEditorWindow* editorWindow, RegExpType tp, TQWidget* tqparent, const char* name = 0 ); LookAheadWidget( LookAheadRegExp* regexp, RegExpEditorWindow* editorWindow, RegExpType tp, - TQWidget* parent, const char* name = 0); + TQWidget* tqparent, const char* name = 0); virtual RegExp* regExp() const; virtual RegExpType type() const { return _tp; } - virtual TQSize sizeHint() const; + virtual TQSize tqsizeHint() const; virtual RegExpWidget* findWidgetToEdit( TQPoint globalPos ); diff --git a/kregexpeditor/main.cpp b/kregexpeditor/main.cpp index 04fd3a3..58c569d 100644 --- a/kregexpeditor/main.cpp +++ b/kregexpeditor/main.cpp @@ -16,7 +16,7 @@ * Boston, MA 02110-1301, USA. **/ -#ifdef QT_ONLY +#ifdef TQT_ONLY #include "compat.h" #include <tqapplication.h> #else @@ -32,7 +32,7 @@ int main( int argc, char* argv[] ) { -#ifdef QT_ONLY +#ifdef TQT_ONLY TQApplication myapp( argc, argv ); #else KAboutData aboutData( "kregexpeditor", I18N_NOOP("RegExp Editor"), @@ -47,7 +47,7 @@ int main( int argc, char* argv[] ) TQVBoxLayout* lay = new TQVBoxLayout( top, 6 ); KRegExpEditorGUI* iface = new KRegExpEditorGUI( top, "_editor", TQStringList() ); - iface->doSomething( TQString::fromLatin1("setAllowNonQtSyntax"), (bool*) true ); + iface->doSomething( TQString::tqfromLatin1("setAllowNonTQtSyntax"), (bool*) true ); lay->addWidget( iface ); TQHBoxLayout* lay2 = new TQHBoxLayout( lay, 6 ); @@ -59,10 +59,10 @@ int main( int argc, char* argv[] ) lay2->addWidget( quit ); TQObject::connect( help, TQT_SIGNAL( clicked() ), iface, TQT_SLOT( showHelp() ) ); - TQObject::connect( quit, TQT_SIGNAL( clicked() ), qApp, TQT_SLOT( quit() ) ); + TQObject::connect( quit, TQT_SIGNAL( clicked() ), tqApp, TQT_SLOT( quit() ) ); top->show(); - TQObject::connect( qApp, TQT_SIGNAL( lastWindowClosed() ), qApp, TQT_SLOT( quit() ) ); + TQObject::connect( tqApp, TQT_SIGNAL( lastWindowClosed() ), tqApp, TQT_SLOT( quit() ) ); myapp.exec(); } diff --git a/kregexpeditor/multicontainerwidget.cpp b/kregexpeditor/multicontainerwidget.cpp index cf4403a..e493b86 100644 --- a/kregexpeditor/multicontainerwidget.cpp +++ b/kregexpeditor/multicontainerwidget.cpp @@ -19,16 +19,16 @@ #include "dragaccepter.h" MultiContainerWidget::MultiContainerWidget( RegExpEditorWindow* editorWindow, - TQWidget* parent, const char* name) - :RegExpWidget( editorWindow, parent, name ) + TQWidget* tqparent, const char* name) + :RegExpWidget( editorWindow, tqparent, name ) { } void MultiContainerWidget::append( RegExpWidget* child ) { child->reparent( this, TQPoint(0,0), false ); - _children.append( child ); - _children.append( new DragAccepter( _editorWindow, this ) ); + _tqchildren.append( child ); + _tqchildren.append( new DragAccepter( _editorWindow, this ) ); } bool MultiContainerWidget::hasSelection() const @@ -36,7 +36,7 @@ bool MultiContainerWidget::hasSelection() const if ( _isSelected ) return true; - TQPtrListIterator<RegExpWidget> it(_children); + TQPtrListIterator<RegExpWidget> it(_tqchildren); ++it; // Move past the first dragAccepter for ( ; *it; it += 2 ) { if ( (*it)->hasSelection() ) { @@ -49,8 +49,8 @@ bool MultiContainerWidget::hasSelection() const void MultiContainerWidget::clearSelection() { _isSelected = false; - for ( unsigned int i = 0; i< _children.count(); i++ ) { - _children.at(i)->clearSelection(); + for ( unsigned int i = 0; i< _tqchildren.count(); i++ ) { + _tqchildren.at(i)->clearSelection(); } } @@ -58,15 +58,15 @@ void MultiContainerWidget::clearSelection() void MultiContainerWidget::deleteSelection() { // run from the back to the front (which we do since we delete items on the run) - // When deleting children, delete the drag accepter to its right. - for ( int i = (int) _children.count()-2; i > 0; i -=2 ) { + // When deleting tqchildren, delete the drag accepter to its right. + for ( int i = (int) _tqchildren.count()-2; i > 0; i -=2 ) { - RegExpWidget* child = _children.at( i ); + RegExpWidget* child = _tqchildren.at( i ); if ( child->isSelected() ) { - delete _children.at( i+1 ); - _children.remove( i+1 ); + delete _tqchildren.at( i+1 ); + _tqchildren.remove( i+1 ); delete child; - _children.remove(i); + _tqchildren.remove(i); } else if ( child->hasSelection() ) { child->deleteSelection(); @@ -78,16 +78,16 @@ void MultiContainerWidget::deleteSelection() void MultiContainerWidget::addNewChild(DragAccepter *accepter, RegExpWidget *child) { - for ( unsigned int i=0; i<_children.count(); i+= 2 ) { - RegExpWidget *ch = _children.at( i ); + for ( unsigned int i=0; i<_tqchildren.count(); i+= 2 ) { + RegExpWidget *ch = _tqchildren.at( i ); if ( ch == accepter ) { // Insert the new child - _children.insert( i+1, child ); + _tqchildren.insert( i+1, child ); // Insert an accepter as the next element. DragAccepter *accepter = new DragAccepter( _editorWindow, this ); - _children.insert( i+2, accepter ); + _tqchildren.insert( i+2, accepter ); // These two show's must come here otherwise a paintevent // will be invoked, where the invariant, that a accepter is located at @@ -103,25 +103,25 @@ void MultiContainerWidget::addNewChild(DragAccepter *accepter, RegExpWidget *chi qFatal("Accepter not found in list"); } -bool MultiContainerWidget::updateSelection(bool parentSelected) +bool MultiContainerWidget::updateSelection(bool tqparentSelected) { bool changed = false; bool isSel = _isSelected; - TQMemArray<bool> oldState(_children.count()); - TQMemArray<bool> newState(_children.count()); + TQMemArray<bool> oldState(_tqchildren.count()); + TQMemArray<bool> newState(_tqchildren.count()); - for (int i = 0; i< (int)_children.count();i++) { - oldState[i] = _children.at(i)->isSelected(); + for (int i = 0; i< (int)_tqchildren.count();i++) { + oldState[i] = _tqchildren.at(i)->isSelected(); } - RegExpWidget::updateSelection( parentSelected ); + RegExpWidget::updateSelection( tqparentSelected ); int first; int last; // scan for the first selected item. - for (first = 1; first < (int) _children.count(); first+= 2 ) { - RegExpWidget* child = _children.at(first); + for (first = 1; first < (int) _tqchildren.count(); first+= 2 ) { + RegExpWidget* child = _tqchildren.at(first); changed = child->updateSelection( _isSelected ) || changed; newState[first] = child->isSelected(); if ( child->isSelected() ) @@ -129,8 +129,8 @@ bool MultiContainerWidget::updateSelection(bool parentSelected) } // scan for the last selected item - for (last = _children.count()-2; last>first; last -= 2) { - RegExpWidget* child = _children.at(last); + for (last = _tqchildren.count()-2; last>first; last -= 2) { + RegExpWidget* child = _tqchildren.at(last); changed = child->updateSelection( _isSelected ) || changed; newState[last] = child->isSelected(); if ( child->isSelected() ) @@ -139,18 +139,18 @@ bool MultiContainerWidget::updateSelection(bool parentSelected) // everything between first and last must be selected. for (int j = first+2; j<last; j+=2) { - RegExpWidget* child = _children.at(j); + RegExpWidget* child = _tqchildren.at(j); changed = child->updateSelection( true ) || changed; newState[j] = true; } // update drag accepters. - for (int k = 0; k< (int) _children.count(); k+=2) { - RegExpWidget* child = _children.at(k); + for (int k = 0; k< (int) _tqchildren.count(); k+=2) { + RegExpWidget* child = _tqchildren.at(k); bool select; - if ( k == 0 || k == (int)_children.count()-1) { - // The elements at the border is only selected if the parent is selected. + if ( k == 0 || k == (int)_tqchildren.count()-1) { + // The elements at the border is only selected if the tqparent is selected. select = _isSelected; } else { @@ -164,12 +164,12 @@ bool MultiContainerWidget::updateSelection(bool parentSelected) if (accepter) accepter->_isSelected = select; if ( select != isChildSel ) - child->repaint(); + child->tqrepaint(); } changed = changed || isSel != _isSelected; if ( changed ) { - repaint(); + tqrepaint(); } return changed; @@ -183,7 +183,7 @@ TQRect MultiContainerWidget::selectionRect() const return TQRect( mapToGlobal( TQPoint(0,0) ), size() ); else { TQRect res; - TQPtrListIterator<RegExpWidget> it(_children); + TQPtrListIterator<RegExpWidget> it(_tqchildren); ++it; // Move past the first dragAccepter for ( ; *it; it +=2 ) { if ( (*it)->hasSelection() ) { @@ -192,10 +192,10 @@ TQRect MultiContainerWidget::selectionRect() const res = childSel; else { TQRect newRes; - newRes.setLeft( QMIN( res.left(), childSel.left() ) ); - newRes.setTop( QMIN( res.top(), childSel.top() ) ); - newRes.setRight( QMAX( res.right(), childSel.right() ) ); - newRes.setBottom( QMAX( res.bottom(), childSel.bottom() ) ); + newRes.setLeft( TQMIN( res.left(), childSel.left() ) ); + newRes.setTop( TQMIN( res.top(), childSel.top() ) ); + newRes.setRight( TQMAX( res.right(), childSel.right() ) ); + newRes.setBottom( TQMAX( res.bottom(), childSel.bottom() ) ); res = newRes; } } @@ -216,8 +216,8 @@ RegExpWidget* MultiContainerWidget::widgetUnderPoint( TQPoint globalPos, bool ju incr = 1; } - for ( unsigned int i = start; i < _children.count(); i+=incr ) { - RegExpWidget* wid = _children.at(i)->widgetUnderPoint( globalPos, justVisibleWidgets ); + for ( unsigned int i = start; i < _tqchildren.count(); i+=incr ) { + RegExpWidget* wid = _tqchildren.at(i)->widgetUnderPoint( globalPos, justVisibleWidgets ); if ( wid ) return wid; } @@ -230,8 +230,8 @@ RegExpWidget* MultiContainerWidget::widgetUnderPoint( TQPoint globalPos, bool ju RegExpWidget* MultiContainerWidget::findWidgetToEdit( TQPoint globalPos ) { - for ( unsigned int i = 1; i < _children.count(); i+=2 ) { - RegExpWidget* wid = _children.at(i)->findWidgetToEdit( globalPos ); + for ( unsigned int i = 1; i < _tqchildren.count(); i+=2 ) { + RegExpWidget* wid = _tqchildren.at(i)->findWidgetToEdit( globalPos ); if ( wid ) return wid; } @@ -241,7 +241,7 @@ RegExpWidget* MultiContainerWidget::findWidgetToEdit( TQPoint globalPos ) void MultiContainerWidget::selectWidget( bool sel ) { RegExpWidget::selectWidget( sel ); - TQPtrListIterator<RegExpWidget> it(_children); + TQPtrListIterator<RegExpWidget> it(_tqchildren); for ( ; *it ; ++it ) { (*it)->selectWidget( sel ); } @@ -250,7 +250,7 @@ void MultiContainerWidget::selectWidget( bool sel ) void MultiContainerWidget::updateAll() { - for ( TQPtrListIterator<RegExpWidget> it(_children); *it ; ++it ) { + for ( TQPtrListIterator<RegExpWidget> it(_tqchildren); *it ; ++it ) { (*it)->updateAll(); } RegExpWidget::updateAll(); @@ -258,8 +258,8 @@ void MultiContainerWidget::updateAll() void MultiContainerWidget::updateCursorRecursively() { - for ( TQPtrListIterator<RegExpWidget> it(_children); *it ; ++it ) { + for ( TQPtrListIterator<RegExpWidget> it(_tqchildren); *it ; ++it ) { (*it)->updateCursorRecursively(); } - updateCursorShape(); + updatetqCursorShape(); } diff --git a/kregexpeditor/multicontainerwidget.h b/kregexpeditor/multicontainerwidget.h index 4dd6a58..9cd9eaa 100644 --- a/kregexpeditor/multicontainerwidget.h +++ b/kregexpeditor/multicontainerwidget.h @@ -21,19 +21,19 @@ #include "regexpwidget.h" /** - Abstract RegExp widget class representing widgets having multible children. + Abstract RegExp widget class representing widgets having multible tqchildren. @internal */ class MultiContainerWidget :public RegExpWidget { public: - MultiContainerWidget( RegExpEditorWindow* editorWindow, TQWidget* parent = 0, + MultiContainerWidget( RegExpEditorWindow* editorWindow, TQWidget* tqparent = 0, const char* name = 0); virtual bool hasSelection() const; virtual void clearSelection(); virtual void deleteSelection(); virtual void addNewChild(DragAccepter *accepter, RegExpWidget *child); - virtual bool updateSelection(bool parentSelected); + virtual bool updateSelection(bool tqparentSelected); virtual TQRect selectionRect() const; virtual RegExpWidget* widgetUnderPoint( TQPoint globalPos, bool justVisibleWidgets ); virtual RegExpWidget* findWidgetToEdit( TQPoint globalPos ); @@ -43,7 +43,7 @@ public: protected: void append( RegExpWidget* child ); - TQPtrList<RegExpWidget> _children; + TQPtrList<RegExpWidget> _tqchildren; }; diff --git a/kregexpeditor/myfontmetrics.cpp b/kregexpeditor/myfontmetrics.cpp index f405c69..38eb7dd 100644 --- a/kregexpeditor/myfontmetrics.cpp +++ b/kregexpeditor/myfontmetrics.cpp @@ -19,12 +19,12 @@ TQSize HackCalculateFontSize(TQFontMetrics fm, TQString str ) { - TQStringList list = TQStringList::split( TQString::fromLatin1("\n"), str ); + TQStringList list = TQStringList::split( TQString::tqfromLatin1("\n"), str ); int maxWidth = 0; int height = 0; for ( TQStringList::Iterator it = list.begin(); it != list.end(); ++it ) { TQSize size = fm.size( 0, *it ); - maxWidth = QMAX( maxWidth, size.width() ); + maxWidth = TQMAX( maxWidth, size.width() ); height += size.height(); } return TQSize( maxWidth, height ); diff --git a/kregexpeditor/qregexpparser.y b/kregexpeditor/qregexpparser.y index 0faaf98..6e9dc5e 100644 --- a/kregexpeditor/qregexpparser.y +++ b/kregexpeditor/qregexpparser.y @@ -102,11 +102,11 @@ expression : expression TOK_Bar term { $<regexp>$ = new AltnRegExp( false ); dynamic_cast<AltnRegExp*>( $<regexp>$ )->addRegExp( $<regexp>1 ); } - dynamic_cast<AltnRegExp*>( $<regexp>$ )->addRegExp( new TextRegExp( false, QString::fromLatin1("") ) ); + dynamic_cast<AltnRegExp*>( $<regexp>$ )->addRegExp( new TextRegExp( false, QString::tqfromLatin1("") ) ); } | TOK_Bar term { $<regexp>$ = new AltnRegExp( false ); - dynamic_cast<AltnRegExp*>( $<regexp>$ )->addRegExp( new TextRegExp( false, QString::fromLatin1("") ) ); + dynamic_cast<AltnRegExp*>( $<regexp>$ )->addRegExp( new TextRegExp( false, QString::tqfromLatin1("") ) ); dynamic_cast<AltnRegExp*>( $<regexp>$ )->addRegExp( $<regexp>2 ); } | TOK_Bar { $<regexp>$ = new AltnRegExp( false ); } @@ -155,7 +155,7 @@ atom : TOK_LeftParen expression TOK_RightParent { | TOK_Carat { $<regexp>$ = new PositionRegExp( false, PositionRegExp::BEGLINE ); } | TOK_Dot { $<regexp>$ = new DotRegExp( false ); } | TOK_BackRef { - QString match = QString::fromLocal8Bit("\\%1").arg( $<backRef>1 ); + QString match = TQString(TQString::fromLocal8Bit("\\%1")).tqarg( $<backRef>1 ); $<regexp>$ = new TextRegExp( false, match ); KMessageBox::information(0,i18n("<qt>Back reference regular expressions are not supported.<p>" "<tt>\\1</tt>, <tt>\\2</tt>, ... are <i>back references</i>, meaning they refer to " @@ -165,7 +165,7 @@ atom : TOK_LeftParen expression TOK_RightParent { "just a workaround to ensure that the application handles the regexp at all. " "Therefore, as soon as you edit the regular expression in the graphical area, " "the back reference will be replaced by matching the text <b>%2</b> literally.") - .arg( match ).arg( match ), + .tqarg( match ).tqarg( match ), i18n("Back reference regular expressions not supported"), QString::fromLocal8Bit("backReferenceNotSupported") ); } @@ -177,9 +177,9 @@ char : TOK_Char { if ( $<ch>1 == '{' || $<ch>1 == '}' || $<ch>1 == '[' || $<ch>1 == ']' || $<ch>1 == '\\' ) { yyerror( "illigal character - needs escaping" ); } - $<regexp>$ = new TextRegExp( false, QString::fromLocal8Bit("%1").arg($<ch>1)); + $<regexp>$ = new TextRegExp( false, TQString(TQString::fromLocal8Bit("%1")).tqarg($<ch>1)); } - | TOK_EscapeChar { $<regexp>$ = new TextRegExp( false, QString::fromLocal8Bit("%1").arg($<ch>1)); } + | TOK_EscapeChar { $<regexp>$ = new TextRegExp( false, TQString(TQString::fromLocal8Bit("%1")).tqarg($<ch>1)); } ; %% diff --git a/kregexpeditor/qt-only/clean b/kregexpeditor/qt-only/clean index 57e9a6d..c594401 100755 --- a/kregexpeditor/qt-only/clean +++ b/kregexpeditor/qt-only/clean @@ -5,8 +5,8 @@ rm -rf manual rm -rf predefined rm -rf icons rm unistd.h -find -lname \* -maxdepth 1 | xargs rm -rm moc_* +tqfind -lname \* -maxdepth 1 | xargs rm +rm tqmoc_* rm images.h rm gen_* rm -rf kregexpeditor* diff --git a/kregexpeditor/qt-only/compat.cpp b/kregexpeditor/qt-only/compat.cpp index a7a5d12..528099e 100644 --- a/kregexpeditor/qt-only/compat.cpp +++ b/kregexpeditor/qt-only/compat.cpp @@ -27,16 +27,16 @@ TQString i18n( const TQString& a, const TQString& b) { } KDialogBase::KDialogBase( int /*dialogFace*/, const TQString &caption, int buttonMask, - ButtonCode defaultButton, TQWidget *parent, const char *name, + ButtonCode defaultButton, TQWidget *tqparent, const char *name, bool modal ) - :TQDialog( parent, name, modal ) + :TQDialog( tqparent, name, modal ) { init( buttonMask, defaultButton, caption ); } -KDialogBase::KDialogBase( TQWidget* parent, const char* name, bool modal, +KDialogBase::KDialogBase( TQWidget* tqparent, const char* name, bool modal, const TQString& caption, int buttonMask ) - : TQDialog( parent, name, modal ) + : TQDialog( tqparent, name, modal ) { init( buttonMask, Ok, caption ); } @@ -92,24 +92,24 @@ void KDialogBase::slotCancel() emit finished(); } -int KMessageBox::warningYesNo(TQWidget *parent, const TQString &text, const TQString &caption ) +int KMessageBox::warningYesNo(TQWidget *tqparent, const TQString &text, const TQString &caption ) { - int code = warning( parent, caption, text, tr("No"), tr("Yes") ); + int code = warning( tqparent, caption, text, tr("No"), tr("Yes") ); if ( code == 0 ) return Yes; else return No; } -int KMessageBox::information( TQWidget* parent, const TQString& text, const TQString& caption, +int KMessageBox::information( TQWidget* tqparent, const TQString& text, const TQString& caption, const TQString& /*dontShowAgainName*/ ) { - return TQMessageBox::information( parent, caption, text ); + return TQMessageBox::information( tqparent, caption, text ); } -int KMessageBox::sorry( TQWidget* parent, const TQString& text, const TQString& caption ) +int KMessageBox::sorry( TQWidget* tqparent, const TQString& text, const TQString& caption ) { - return TQMessageBox::information( parent, caption, text ); + return TQMessageBox::information( tqparent, caption, text ); } diff --git a/kregexpeditor/qt-only/compat.h b/kregexpeditor/qt-only/compat.h index 5afa317..f09cbbf 100644 --- a/kregexpeditor/qt-only/compat.h +++ b/kregexpeditor/qt-only/compat.h @@ -29,14 +29,15 @@ TQString i18n( const TQString& a); TQString i18n( const TQString& a, const TQString& b); #define isatty(x) 0 -#define KTextBrowser QTextBrowser -#define KListBox QListBox -#define KFileDialog QFileDialog -#define KPushButton QPushButton +#define KTextBrowser TQTextBrowser +#define KListBox TQListBox +#define KFileDialog TQFileDialog +#define KPushButton TQPushButton -class KDialogBase :public QDialog +class KDialogBase :public TQDialog { Q_OBJECT + TQ_OBJECT public: enum ButtonCode {Ok = 1, Cancel, Help}; @@ -44,10 +45,10 @@ public: KDialogBase ( int dialogFace, const TQString &caption, int buttonMask, ButtonCode defaultButton, - TQWidget *parent=0, const char *name=0, bool modal=true ); + TQWidget *tqparent=0, const char *name=0, bool modal=true ); - KDialogBase( TQWidget* parent, const char* name = 0, bool modal = true, - const TQString& caption = TQString::null, + KDialogBase( TQWidget* tqparent, const char* name = 0, bool modal = true, + const TQString& caption = TQString(), int buttonMask = 0 ); void init( int buttonMask, ButtonCode /*defaultButton*/, const TQString& caption ); @@ -69,16 +70,17 @@ private: TQVBoxLayout* _layout; }; -class KMessageBox :public QMessageBox +class KMessageBox :public TQMessageBox { Q_OBJECT + TQ_OBJECT public: enum ButtonCode { Ok = 1, Cancel = 2, Yes = 3, No = 4, Continue = 5 }; - static int warningYesNo (TQWidget *parent, const TQString &text, - const TQString &caption = TQString::null ); - static int information( TQWidget* parent, const TQString& text, const TQString& caption = TQString::null, - const TQString& /*dontShowAgainName*/ = TQString::null ); - static int sorry( TQWidget* parent, const TQString& text, const TQString& caption = TQString::null ); + static int warningYesNo (TQWidget *tqparent, const TQString &text, + const TQString &caption = TQString() ); + static int information( TQWidget* tqparent, const TQString& text, const TQString& caption = TQString(), + const TQString& /*dontShowAgainName*/ = TQString() ); + static int sorry( TQWidget* tqparent, const TQString& text, const TQString& caption = TQString() ); }; #endif /* COMPAT_H */ diff --git a/kregexpeditor/qtregexpconverter.cpp b/kregexpeditor/qtregexpconverter.cpp index 6098097..72f9290 100644 --- a/kregexpeditor/qtregexpconverter.cpp +++ b/kregexpeditor/qtregexpconverter.cpp @@ -29,33 +29,33 @@ #include "positionregexp.h" #include "repeatregexp.h" -extern RegExp* parseQtRegExp( TQString str, bool *ok ); -extern RegExp* parseDataQtRegExp(); +extern RegExp* parseTQtRegExp( TQString str, bool *ok ); +extern RegExp* parseDataTQtRegExp(); -bool QtRegExpConverter::canParse() +bool TQtRegExpConverter::canParse() { return true; } -RegExp* QtRegExpConverter::parse( const TQString& txt, bool* ok ) +RegExp* TQtRegExpConverter::parse( const TQString& txt, bool* ok ) { - return parseQtRegExp( txt, ok ); + return parseTQtRegExp( txt, ok ); } -TQString QtRegExpConverter::toString( AltnRegExp* regexp, bool markSelection ) +TQString TQtRegExpConverter::toString( AltnRegExp* regexp, bool markSelection ) { TQString res; bool first = true; - RegExpList list = regexp->children(); + RegExpList list = regexp->tqchildren(); for ( RegExpListIt it(list); *it; ++it ) { if ( !first ) { - res += TQString::fromLatin1( "|" ); + res += TQString::tqfromLatin1( "|" ); } first = false; if ( markSelection && !regexp->isSelected() && (*it)->isSelected() ) { - res += TQString::fromLatin1("(") + toStr( *it, markSelection ) + TQString::fromLatin1(")"); + res += TQString::tqfromLatin1("(") + toStr( *it, markSelection ) + TQString::tqfromLatin1(")"); } else { res += toStr( *it, markSelection ); @@ -64,12 +64,12 @@ TQString QtRegExpConverter::toString( AltnRegExp* regexp, bool markSelection ) return res; } -TQString QtRegExpConverter::toString( ConcRegExp* regexp, bool markSelection ) +TQString TQtRegExpConverter::toString( ConcRegExp* regexp, bool markSelection ) { TQString res; bool childSelected = false; - RegExpList list = regexp->children(); + RegExpList list = regexp->tqchildren(); for ( RegExpListIt it(list); *it; ++it ) { TQString startPar = TQString::fromLocal8Bit(""); TQString endPar = TQString::fromLocal8Bit(""); @@ -77,38 +77,38 @@ TQString QtRegExpConverter::toString( ConcRegExp* regexp, bool markSelection ) if ( markSelection ) startPar = TQString::fromLocal8Bit("(?:"); else - startPar = TQString::fromLatin1( "(" ); - endPar = TQString::fromLatin1( ")" ); + startPar = TQString::tqfromLatin1( "(" ); + endPar = TQString::tqfromLatin1( ")" ); } // Note these two have different tests! They are activated in each their iteration of the loop. if ( markSelection && !childSelected && !regexp->isSelected() && (*it)->isSelected() ) { - res += TQString::fromLatin1("("); + res += TQString::tqfromLatin1("("); childSelected = true; } if ( markSelection && childSelected && !regexp->isSelected() && !(*it)->isSelected() ) { - res += TQString::fromLatin1(")"); + res += TQString::tqfromLatin1(")"); childSelected= false; } res += startPar + toStr( *it, markSelection ) + endPar; } if ( markSelection && childSelected && !regexp->isSelected() ) { - res += TQString::fromLatin1(")"); + res += TQString::tqfromLatin1(")"); } return res; } -TQString QtRegExpConverter::toString( LookAheadRegExp* regexp, bool markSelection ) +TQString TQtRegExpConverter::toString( LookAheadRegExp* regexp, bool markSelection ) { if ( regexp->lookAheadType() == LookAheadRegExp::POSITIVE ) - return TQString::fromLatin1( "(?=" ) + toStr( regexp->child(), markSelection ) + TQString::fromLocal8Bit( ")" ); + return TQString::tqfromLatin1( "(?=" ) + toStr( regexp->child(), markSelection ) + TQString::fromLocal8Bit( ")" ); else - return TQString::fromLatin1( "(?!" ) + toStr( regexp->child(), markSelection ) + TQString::fromLocal8Bit( ")" ); + return TQString::tqfromLatin1( "(?!" ) + toStr( regexp->child(), markSelection ) + TQString::fromLocal8Bit( ")" ); } -TQString QtRegExpConverter::toString( TextRangeRegExp* regexp, bool /*markSelection*/ ) +TQString TQtRegExpConverter::toString( TextRangeRegExp* regexp, bool /*markSelection*/ ) { TQString txt; @@ -137,7 +137,7 @@ TQString QtRegExpConverter::toString( TextRangeRegExp* regexp, bool /*markSelect // Now insert the ranges. TQPtrList<StringPair> ranges = regexp->range(); for ( TQPtrListIterator<StringPair> it(ranges); *it; ++it ) { - txt.append((*it)->first()+ TQString::fromLatin1("-")+ (*it)->second()); + txt.append((*it)->first()+ TQString::tqfromLatin1("-")+ (*it)->second()); } // Ok, its time to build each part of the regexp, here comes the rule: @@ -147,20 +147,20 @@ TQString QtRegExpConverter::toString( TextRangeRegExp* regexp, bool /*markSelect // finally if '^' is one of the characters, then it must not be the first // one! - TQString res = TQString::fromLatin1("["); + TQString res = TQString::tqfromLatin1("["); if ( regexp->negate() ) - res.append(TQString::fromLatin1("^")); + res.append(TQString::tqfromLatin1("^")); // a ']' must be the first character in teh range. if ( foundParenthesis ) { - res.append(TQString::fromLatin1("]")); + res.append(TQString::tqfromLatin1("]")); } // a '-' must be the first character ( only coming after a ']') if ( foundDash ) { - res.append(TQString::fromLatin1("-")); + res.append(TQString::tqfromLatin1("-")); } res += txt; @@ -184,41 +184,41 @@ TQString QtRegExpConverter::toString( TextRangeRegExp* regexp, bool /*markSelect res.append( TQChar( '^' ) ); } - res.append(TQString::fromLatin1("]")); + res.append(TQString::tqfromLatin1("]")); return res; } -TQString QtRegExpConverter::toString( CompoundRegExp* regexp, bool markSelection ) +TQString TQtRegExpConverter::toString( CompoundRegExp* regexp, bool markSelection ) { if ( markSelection && !regexp->isSelected() && regexp->child()->isSelected() ) - return TQString::fromLatin1( "(" ) + toStr( regexp->child(), markSelection ) + TQString::fromLatin1( ")" ); + return TQString::tqfromLatin1( "(" ) + toStr( regexp->child(), markSelection ) + TQString::tqfromLatin1( ")" ); else return toStr( regexp->child(), markSelection ); } -TQString QtRegExpConverter::toString( DotRegExp* /*regexp*/, bool /*markSelection*/ ) +TQString TQtRegExpConverter::toString( DotRegExp* /*regexp*/, bool /*markSelection*/ ) { - return TQString::fromLatin1( "." ); + return TQString::tqfromLatin1( "." ); } -TQString QtRegExpConverter::toString( PositionRegExp* regexp, bool /*markSelection*/ ) +TQString TQtRegExpConverter::toString( PositionRegExp* regexp, bool /*markSelection*/ ) { switch (regexp->position()) { case PositionRegExp::BEGLINE: - return TQString::fromLatin1("^"); + return TQString::tqfromLatin1("^"); case PositionRegExp::ENDLINE: - return TQString::fromLatin1("$"); + return TQString::tqfromLatin1("$"); case PositionRegExp::WORDBOUNDARY: - return TQString::fromLatin1("\\b"); + return TQString::tqfromLatin1("\\b"); case PositionRegExp::NONWORDBOUNDARY: - return TQString::fromLatin1("\\B"); + return TQString::tqfromLatin1("\\B"); } Q_ASSERT( false ); - return TQString::fromLatin1(""); + return TQString::tqfromLatin1(""); } -TQString QtRegExpConverter::toString( RepeatRegExp* regexp, bool markSelection ) +TQString TQtRegExpConverter::toString( RepeatRegExp* regexp, bool markSelection ) { RegExp* child = regexp->child(); TQString cText = toStr( child, markSelection ); @@ -227,17 +227,17 @@ TQString QtRegExpConverter::toString( RepeatRegExp* regexp, bool markSelection ) if ( markSelection ) { if ( !regexp->isSelected() && child->isSelected()) { - startPar = TQString::fromLatin1( "(" ); - endPar = TQString::fromLatin1( ")" ); + startPar = TQString::tqfromLatin1( "(" ); + endPar = TQString::tqfromLatin1( ")" ); } else if ( child->precedence() < regexp->precedence() ) { - startPar = TQString::fromLatin1( "(?:" ); - endPar = TQString::fromLatin1( ")" ); + startPar = TQString::tqfromLatin1( "(?:" ); + endPar = TQString::tqfromLatin1( ")" ); } } else if ( child->precedence() < regexp->precedence() ) { - startPar = TQString::fromLatin1( "(" ); - endPar = TQString::fromLatin1( ")" ); + startPar = TQString::tqfromLatin1( "(" ); + endPar = TQString::tqfromLatin1( ")" ); } if ( regexp->min() == 0 && regexp->max() == -1) { @@ -261,7 +261,7 @@ TQString QtRegExpConverter::toString( RepeatRegExp* regexp, bool markSelection ) } } -TQString QtRegExpConverter::toString( TextRegExp* regexp, bool /*markSelection*/ ) +TQString TQtRegExpConverter::toString( TextRegExp* regexp, bool /*markSelection*/ ) { TQValueList<TQChar> list; list << TQChar('$') @@ -283,17 +283,17 @@ TQString QtRegExpConverter::toString( TextRegExp* regexp, bool /*markSelection*/ return res; } -TQString QtRegExpConverter::name() +TQString TQtRegExpConverter::name() { - return TQString::fromLatin1( "Qt" ); + return TQString::tqfromLatin1( "TQt" ); } -int QtRegExpConverter::features() +int TQtRegExpConverter::features() { return WordBoundary | NonWordBoundary | PosLookAhead | NegLookAhead | CharacterRangeNonItems | ExtRange; } -RegexpHighlighter* QtRegExpConverter::highlighter( TQTextEdit* edit ) +RegexpHighlighter* TQtRegExpConverter::highlighter( TQTextEdit* edit ) { return new QtRegexpHighlighter( edit ); } diff --git a/kregexpeditor/qtregexpconverter.h b/kregexpeditor/qtregexpconverter.h index d00120c..1c48bb8 100644 --- a/kregexpeditor/qtregexpconverter.h +++ b/kregexpeditor/qtregexpconverter.h @@ -16,11 +16,11 @@ * Boston, MA 02110-1301, USA. **/ -#ifndef QTREGEXPCONVERTER_H -#define QTREGEXPCONVERTER_H +#ifndef TQTREGEXPCONVERTER_H +#define TQTREGEXPCONVERTER_H #include "regexpconverter.h" -class QtRegExpConverter :public RegExpConverter +class TQtRegExpConverter :public RegExpConverter { public: virtual bool canParse(); @@ -39,5 +39,5 @@ public: RegexpHighlighter* highlighter( TQTextEdit* edit ); }; -#endif /* QTREGEXPCONVERTER_H */ +#endif /* TQTREGEXPCONVERTER_H */ diff --git a/kregexpeditor/qtregexphighlighter.cpp b/kregexpeditor/qtregexphighlighter.cpp index fdf3a81..431797f 100644 --- a/kregexpeditor/qtregexphighlighter.cpp +++ b/kregexpeditor/qtregexphighlighter.cpp @@ -28,14 +28,14 @@ int QtRegexpHighlighter::highlightParagraph( const TQString & text, int endState regexp.setCaseSensitive( _caseSensitive ); regexp.setMinimal( _minimal ); - setFormat( 0, text.length(), _editor->font(), Qt::black ); + setFormat( 0, text.length(), _editor->font(), TQt::black ); if ( !regexp.isValid() || regexp.isEmpty() ) { return 0; } // ------------------------------ Process with the regular expression. - TQColor colors[] = { Qt::red, Qt::blue }; + TQColor colors[] = { TQt::red, TQt::blue }; int color = endStateOfLastPara; if ( color < 0 || color > 1 ) color = 0; @@ -63,7 +63,7 @@ int QtRegexpHighlighter::highlightParagraph( const TQString & text, int endState if ( length + (start-index) != regexp.matchedLength() ) setFormat( start+length, regexp.matchedLength()-length-(start-index), colors[color] ); - index += QMAX( 1, regexp.matchedLength() ); // ensure progress when matching for example ^ or \b + index += TQMAX( 1, regexp.matchedLength() ); // ensure progress when matching for example ^ or \b color = (color+1)%2; } return color; diff --git a/kregexpeditor/qtregexphighlighter.h b/kregexpeditor/qtregexphighlighter.h index c160ca2..8bf1c55 100644 --- a/kregexpeditor/qtregexphighlighter.h +++ b/kregexpeditor/qtregexphighlighter.h @@ -15,8 +15,8 @@ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. **/ -#ifndef QTREGEXPHIGHLIGHTER_H -#define QTREGEXPHIGHLIGHTER_H +#ifndef TQTREGEXPHIGHLIGHTER_H +#define TQTREGEXPHIGHLIGHTER_H #include "regexphighlighter.h" #include <tqtextedit.h> @@ -30,5 +30,5 @@ private: TQTextEdit* _editor; }; -#endif /* QTREGEXPHIGHLIGHTER_H */ +#endif /* TQTREGEXPHIGHLIGHTER_H */ diff --git a/kregexpeditor/regexp.cpp b/kregexpeditor/regexp.cpp index 0b583d7..c5961a3 100644 --- a/kregexpeditor/regexp.cpp +++ b/kregexpeditor/regexp.cpp @@ -28,7 +28,7 @@ RegExp::RegExp( bool selected ) : _parent(0), _destructing( false ), _selected( RegExp::~RegExp() { _destructing = true; - for ( TQPtrListIterator<RegExp> it(_children); *it; ++it ) { + for ( TQPtrListIterator<RegExp> it(_tqchildren); *it; ++it ) { delete *it; } if ( _parent ) @@ -38,20 +38,20 @@ RegExp::~RegExp() void RegExp::addChild( RegExp* child ) { - _children.append( child ); + _tqchildren.append( child ); child->setParent( this ); } void RegExp::removeChild( RegExp* child ) { if ( ! _destructing ) { - _children.remove( child ); + _tqchildren.remove( child ); } } -void RegExp::setParent( RegExp* parent ) +void RegExp::setParent( RegExp* tqparent ) { - _parent = parent; + _parent = tqparent; } RegExp* RegExp::readRegExp( TQDomElement top, const TQString& version ) @@ -68,7 +68,7 @@ RegExp* RegExp::readRegExp( TQDomElement top, const TQString& version ) TQString RegExp::toXmlString() const { TQDomDocument doc; - doc.setContent( TQString::fromLatin1( "<RegularExpression/>" ) ); + doc.setContent( TQString::tqfromLatin1( "<RegularExpression/>" ) ); TQDomNode top = doc.documentElement(); top.toElement().setAttribute(TQString::fromLocal8Bit("version"), KRegExpEditorGUI::version); diff --git a/kregexpeditor/regexp.h b/kregexpeditor/regexp.h index 5b2bcae..ba828bb 100644 --- a/kregexpeditor/regexp.h +++ b/kregexpeditor/regexp.h @@ -44,7 +44,7 @@ public: void addChild( RegExp* child ); void removeChild( RegExp* child ); - void setParent( RegExp* parent ); + void setParent( RegExp* tqparent ); RegExp* clone() const; virtual bool operator==( const RegExp& other ) const { return ( type() == other.type() ); } @@ -59,7 +59,7 @@ protected: private: RegExp() {} // disable - TQPtrList<RegExp> _children; + TQPtrList<RegExp> _tqchildren; RegExp* _parent; bool _destructing; bool _selected; diff --git a/kregexpeditor/regexpbuttons.cpp b/kregexpeditor/regexpbuttons.cpp index 88e581e..f854f21 100644 --- a/kregexpeditor/regexpbuttons.cpp +++ b/kregexpeditor/regexpbuttons.cpp @@ -15,7 +15,7 @@ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. **/ -#ifdef QT_ONLY +#ifdef TQT_ONLY #include "compat.h" #include "images.h" #else @@ -34,30 +34,30 @@ #include <tqsignalmapper.h> #include "regexpconverter.h" -RegExpButtons::RegExpButtons( TQWidget *parent, const char *name ) - : TQDockWindow( TQDockWindow::InDock, parent, name), _keepMode(false) +RegExpButtons::RegExpButtons( TQWidget *tqparent, const char *name ) + : TQDockWindow( TQDockWindow::InDock, tqparent, name), _keepMode(false) { - TQBoxLayout *layout = boxLayout(); + TQBoxLayout *tqlayout = boxLayout(); _grp = new TQButtonGroup(this); _grp->hide(); _grp->setExclusive( true ); - _mapper = new TQSignalMapper( this, "RegExpButtons::_mapper" ); + _mapper = new TQSignalMapper( TQT_TQOBJECT(this), "RegExpButtons::_mapper" ); connect( _mapper, TQT_SIGNAL( mapped(int) ), this, TQT_SIGNAL( clicked(int) ) ); // The "select" button. _selectBut = new TQToolButton( this); -#ifdef QT_ONLY +#ifdef TQT_ONLY TQPixmap pix; pix.convertFromImage( qembed_findImage( "select" ) ); #else - TQPixmap pix = KGlobal::iconLoader()->loadIcon(locate("data", TQString::fromLatin1("kregexpeditor/pics/select.png") ), KIcon::Toolbar ); + TQPixmap pix = KGlobal::iconLoader()->loadIcon(locate("data", TQString::tqfromLatin1("kregexpeditor/pics/select.png") ), KIcon::Toolbar ); #endif _selectBut->setPixmap( pix ); - layout->addWidget( _selectBut ); + tqlayout->addWidget( _selectBut ); _grp->insert(_selectBut); _selectBut->setToggleButton( true ); connect( _selectBut, TQT_SIGNAL(clicked()), TQT_SIGNAL(doSelect())); @@ -76,19 +76,19 @@ RegExpButtons::RegExpButtons( TQWidget *parent, const char *name ) but = insert(TEXT, "text", i18n("Text"), i18n( "<qt>This will insert a text field, where you may write text. The text you write will " "be matched literally. (i.e. you do not need to escape any characters)</qt>" ) ); - layout->addWidget( but ); + tqlayout->addWidget( but ); but = insert(CHARSET, "characters", i18n("A single character specified in a range"), i18n("<qt>This will match a single character from a predefined range.<p>" "When you insert this widget a dialog box will appear, which lets you specify " "which characters this <i>regexp item</i> will match.</qt>") ); - layout->addWidget( but ); + tqlayout->addWidget( but ); but = insert(DOT, "anychar", i18n("Any character"), i18n("<qt>This will match any single character</qt>") ); - layout->addWidget( but ); + tqlayout->addWidget( but ); but = insert(REPEAT, "repeat", i18n("Repeated content"), @@ -102,14 +102,14 @@ RegExpButtons::RegExpButtons( TQWidget *parent, const char *name ) "is <tt>abc</tt>, then this <i>regexp item</i> will match the empty string, " "the string <tt>abc</tt>, the string <tt>abcabc</tt>, the string <tt>abcabcabcabc</tt>, " "etc.</qt>") ); - layout->addWidget( but ); + tqlayout->addWidget( but ); but = insert(ALTN, "altn", i18n("Alternatives"), i18n("<qt>This <i>regexp item</i> will match any of its alternatives.</p>" "You specify alternatives by placing <i>regexp items</i> on top of " "each other inside this widget.</qt>") ); - layout->addWidget( but ); + tqlayout->addWidget( but ); but = insert(COMPOUND, "compound", i18n("Compound regexp"), @@ -118,53 +118,53 @@ RegExpButtons::RegExpButtons( TQWidget *parent, const char *name ) "a small box. This makes it easier for you to get an overview of large " "<i>regexp items</i>. This is especially useful if you load a predefined <i>regexp item</i> " "you perhaps don't care about the inner workings of.") ); - layout->addWidget( but ); + tqlayout->addWidget( but ); but = insert(BEGLINE, "begline", i18n("Beginning of line"), i18n("<qt>This will match the beginning of a line.</qt>") ); - layout->addWidget( but ); + tqlayout->addWidget( but ); but = insert(ENDLINE, "endline", i18n("End of line"), i18n("<qt>This will match the end of a line.</qt>") ); - layout->addWidget( but ); + tqlayout->addWidget( but ); _wordBoundary = insert(WORDBOUNDARY, "wordboundary", i18n("Word boundary"), i18n("<qt>This asserts a word boundary (This part does not actually match any characters)</qt>") ); - layout->addWidget( _wordBoundary ); + tqlayout->addWidget( _wordBoundary ); _nonWordBoundary = insert(NONWORDBOUNDARY, "nonwordboundary", i18n("Non Word boundary"), i18n("<qt>This asserts a non-word boundary " "(This part does not actually match any characters)</qt>") ); - layout->addWidget( _nonWordBoundary ); + tqlayout->addWidget( _nonWordBoundary ); _posLookAhead = insert(POSLOOKAHEAD, "poslookahead", i18n("Positive Look Ahead"), i18n("<qt>This asserts a regular expression (This part does not actually match any characters). " "You can only use this at the end of a regular expression.</qt>") ); - layout->addWidget( _posLookAhead ); + tqlayout->addWidget( _posLookAhead ); _negLookAhead = insert(NEGLOOKAHEAD, "neglookahead", i18n("Negative Look Ahead"), i18n("<qt>This asserts a regular expression that must not match " "(This part does not actually match any characters). " "You can only use this at the end of a regular expression.</qt>") ); - layout->addWidget( _negLookAhead ); + tqlayout->addWidget( _negLookAhead ); } DoubleClickButton* RegExpButtons::insert(RegExpType tp, const char* name, TQString tooltip, TQString whatsthis) { -#ifdef QT_ONLY +#ifdef TQT_ONLY TQPixmap pix; - pix.convertFromImage( qembed_findImage( TQString::fromLatin1( name ) ) ); + pix.convertFromImage( qembed_findImage( TQString::tqfromLatin1( name ) ) ); #else - TQPixmap pix = KGlobal::iconLoader()->loadIcon(locate("data", TQString::fromLatin1("kregexpeditor/pics/")+TQString::fromLatin1(name) + - TQString::fromLatin1(".png") ), KIcon::Toolbar ); + TQPixmap pix = KGlobal::iconLoader()->loadIcon(locate("data", TQString::tqfromLatin1("kregexpeditor/pics/")+TQString::tqfromLatin1(name) + + TQString::tqfromLatin1(".png") ), KIcon::Toolbar ); #endif DoubleClickButton* but = new DoubleClickButton( pix, this, "RegExpButtons::but"); - _mapper->setMapping( but, tp ); + _mapper->setMapping( TQT_TQOBJECT(but), tp ); connect( but, TQT_SIGNAL( clicked() ), _mapper, TQT_SLOT( map() ) ); connect( but, TQT_SIGNAL( clicked() ), this, TQT_SLOT( slotSetNonKeepMode() ) ); diff --git a/kregexpeditor/regexpbuttons.h b/kregexpeditor/regexpbuttons.h index 6565746..6219422 100644 --- a/kregexpeditor/regexpbuttons.h +++ b/kregexpeditor/regexpbuttons.h @@ -26,12 +26,13 @@ class TQToolButton; class TQSignalMapper; -class RegExpButtons :public QDockWindow +class RegExpButtons :public TQDockWindow { Q_OBJECT + TQ_OBJECT public: - RegExpButtons( TQWidget *parent, const char *name = 0 ); + RegExpButtons( TQWidget *tqparent, const char *name = 0 ); void setFeatures( int features ); protected: diff --git a/kregexpeditor/regexpconverter.cpp b/kregexpeditor/regexpconverter.cpp index 2678591..951f0d7 100644 --- a/kregexpeditor/regexpconverter.cpp +++ b/kregexpeditor/regexpconverter.cpp @@ -53,7 +53,7 @@ TQString RegExpConverter::toStr( RegExp* regexp, bool markSelection ) case RegExp::TEXTRANGE: return toString( static_cast<TextRangeRegExp*>( regexp ), markSelection ); } qWarning("We shouldn't get here!"); - return TQString::fromLatin1( "" ); + return TQString::tqfromLatin1( "" ); } diff --git a/kregexpeditor/regexphighlighter.h b/kregexpeditor/regexphighlighter.h index 9a8003c..02537b6 100644 --- a/kregexpeditor/regexphighlighter.h +++ b/kregexpeditor/regexphighlighter.h @@ -20,7 +20,7 @@ #define REGEXPHIGHLIGHTER_H #include <tqsyntaxhighlighter.h> -class RegexpHighlighter :public QSyntaxHighlighter +class RegexpHighlighter :public TQSyntaxHighlighter { public: RegexpHighlighter( TQTextEdit* edit ); diff --git a/kregexpeditor/regexpwidget.cpp b/kregexpeditor/regexpwidget.cpp index a64b0c4..ec3c846 100644 --- a/kregexpeditor/regexpwidget.cpp +++ b/kregexpeditor/regexpwidget.cpp @@ -16,7 +16,7 @@ * Boston, MA 02110-1301, USA. **/ -#ifdef QT_ONLY +#ifdef TQT_ONLY #include "compat.h" #else #include "regexpwidget.moc" @@ -33,9 +33,9 @@ const int RegExpWidget::pw = 1; const int RegExpWidget::bdSize = 5; const int RegExpWidget::space = 5; -RegExpWidget::RegExpWidget(RegExpEditorWindow* editorWindow, TQWidget *parent, +RegExpWidget::RegExpWidget(RegExpEditorWindow* editorWindow, TQWidget *tqparent, const char *name) - : TQWidget(parent, name ? name : "RegExpWidget", WNoMousePropagation ), + : TQWidget(tqparent, name ? name : "RegExpWidget", WNoMousePropagation ), _editorWindow( editorWindow ), _isSelected( false ), _isToplevel( false ) { } @@ -43,29 +43,29 @@ RegExpWidget::RegExpWidget(RegExpEditorWindow* editorWindow, TQWidget *parent, void RegExpWidget::addNewChild(DragAccepter *, RegExpWidget *) { - qFatal("This widget should not expect any children"); + qFatal("This widget should not expect any tqchildren"); } void RegExpWidget::addNewConcChild(DragAccepter *, ConcWidget *) { - qFatal("This widget should not expect any children"); + qFatal("This widget should not expect any tqchildren"); } void RegExpWidget::setConcChild(ConcWidget *) { - qFatal("This widget should not expect any children"); + qFatal("This widget should not expect any tqchildren"); } -bool RegExpWidget::updateSelection(bool parentSelected) +bool RegExpWidget::updateSelection(bool tqparentSelected) { - bool selected = ( parentSelected || + bool selected = ( tqparentSelected || _editorWindow->selectionOverlap( mapToGlobal( TQPoint(0,0) ), size() ) ) && !_isToplevel; if ( _isSelected != selected ) { // Selection state changed _isSelected = selected; - repaint(); + tqrepaint(); return true; } return false; @@ -119,7 +119,7 @@ void RegExpWidget::mousePressEvent ( TQMouseEvent* event ) if ( _editorWindow->isPasteing() || _editorWindow->isInserting() ) return; - if ( event->button() == LeftButton ) { + if ( event->button() == Qt::LeftButton ) { if ( ! _editorWindow->pointSelected( TQCursor::pos() ) ) { _editorWindow->clearSelection( true ); if ( dynamic_cast<DragAccepter*>(this) == 0 && dynamic_cast<ConcWidget*>(this) == 0 ) { @@ -131,12 +131,12 @@ void RegExpWidget::mousePressEvent ( TQMouseEvent* event ) event->button(), event->state()); TQApplication::sendEvent( _editorWindow, &ev ); } - else if ( event->button() == RightButton ) { + else if ( event->button() == Qt::RightButton ) { _editorWindow->showRMBMenu( true ); } - // currently (Qt3.0) it seems like qt do not accept that the accept flag is set, - // and thus sends the event to the parent - given that the following line is in. + // currently (TQt3.0) it seems like qt do not accept that the accept flag is set, + // and thus sends the event to the tqparent - given that the following line is in. // It doesn't make any change to leave it out. // 25 Oct. 2001 19:03 -- Jesper K. Pedersen // TQWidget::mousePressEvent( event ); @@ -164,10 +164,10 @@ TQRect RegExpWidget::selectionRect() const void RegExpWidget::enterEvent( TQEvent * ) { - updateCursorShape(); + updatetqCursorShape(); } -void RegExpWidget::updateCursorShape() +void RegExpWidget::updatetqCursorShape() { TQCursor cursor; @@ -191,7 +191,7 @@ void RegExpWidget::updateCursorShape() void RegExpWidget::updateCursorRecursively() { - updateCursorShape(); + updatetqCursorShape(); } @@ -207,7 +207,7 @@ bool RegExpWidget::acceptWidgetInsert( RegExpType tp ) const RegExpWidget* RegExpWidget::widgetUnderPoint( TQPoint globalPos, bool ) { - if ( TQRect(mapToGlobal( TQPoint(0,0) ), size() ).contains( globalPos ) ) + if ( TQRect(mapToGlobal( TQPoint(0,0) ), size() ).tqcontains( globalPos ) ) return this; else return 0; diff --git a/kregexpeditor/regexpwidget.h b/kregexpeditor/regexpwidget.h index b6e44cd..27a57d1 100644 --- a/kregexpeditor/regexpwidget.h +++ b/kregexpeditor/regexpwidget.h @@ -29,26 +29,27 @@ class RegExpEditorWindow; Base class for all regular expression widgets. @internal */ -class RegExpWidget :public QWidget +class RegExpWidget :public TQWidget { Q_OBJECT + TQ_OBJECT public: - RegExpWidget(RegExpEditorWindow* editorWindow, TQWidget *parent, + RegExpWidget(RegExpEditorWindow* editorWindow, TQWidget *tqparent, const char *label = 0); /*====================================================================== Construction, child management ======================================================================*/ /** - Add `child' to the parent of this widget in place of `accepter' + Add `child' to the tqparent of this widget in place of `accepter' This method only applies to container widgets (see @ref SingleContainerWidget, and @ref MultiContainerWidget). */ virtual void addNewChild(DragAccepter *accepter, RegExpWidget *child); /** - Inserts all the children of `child' into this widget in place of + Inserts all the tqchildren of `child' into this widget in place of `accepter'. This method only applies to container widgets (see @ref SingleContainerWidget, and @ref MultiContainerWidget). @@ -82,7 +83,7 @@ public: virtual bool isSelected() const; /** - Returns true if this widget or one of its children is selected. + Returns true if this widget or one of its tqchildren is selected. */ virtual bool hasSelection() const; @@ -90,15 +91,15 @@ public: /** Update selection information for this widget. - @param parentSelected indicates whether the parent is selected. + @param tqparentSelected indicates whether the tqparent is selected. @return true if the selection state has changed for the widget since - the last time the widget was painted. `repaint' is invoked on the widget if + the last time the widget was painted. `tqrepaint' is invoked on the widget if selection state is changed, to ensure that selection is visible. */ - virtual bool updateSelection(bool parentSelected); + virtual bool updateSelection(bool tqparentSelected); /** - Clears the selection and repaints the widget if `update' is true. + Clears the selection and tqrepaints the widget if `update' is true. */ virtual void clearSelection(); @@ -147,7 +148,7 @@ public: @li accept cursor for insert/paste @li reject cursor for insert/paste */ - void updateCursorShape(); + void updatetqCursorShape(); virtual void updateCursorRecursively(); diff --git a/kregexpeditor/repeatregexp.cpp b/kregexpeditor/repeatregexp.cpp index e037016..3a03e90 100644 --- a/kregexpeditor/repeatregexp.cpp +++ b/kregexpeditor/repeatregexp.cpp @@ -15,7 +15,7 @@ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. **/ -#ifdef QT_ONLY +#ifdef TQT_ONLY #include "compat.h" #else #include "kmessagebox.h" @@ -58,7 +58,7 @@ bool RepeatRegExp::load( TQDomElement top, const TQString& version ) if ( !ok ) { KMessageBox::sorry( 0, i18n("<p>Value for attribute <b>%1</b> was not an integer for element " "<b>%2</b></p><p>It contained the value <b>%3</b></p>") - .arg(TQString::fromLatin1("lower")).arg(TQString::fromLatin1("Repeat")).arg(lower), + .tqarg(TQString::tqfromLatin1("lower")).tqarg(TQString::tqfromLatin1("Repeat")).tqarg(lower), i18n("Error While Loading From XML File") ) ; _lower = 0; } @@ -66,7 +66,7 @@ bool RepeatRegExp::load( TQDomElement top, const TQString& version ) if ( !ok ) { KMessageBox::sorry( 0, i18n("<p>Value for attribute <b>%1</b> was not an integer for element " "<b>%2</b></p><p>It contained the value <b>%3</b></p>") - .arg(TQString::fromLatin1("upper")).arg(TQString::fromLatin1("Repeat")).arg(upper), + .tqarg(TQString::tqfromLatin1("upper")).tqarg(TQString::tqfromLatin1("Repeat")).tqarg(upper), i18n("Error While Loading From XML File") ) ; _upper = -1; } diff --git a/kregexpeditor/repeatwidget.cpp b/kregexpeditor/repeatwidget.cpp index 80fa2ab..e284895 100644 --- a/kregexpeditor/repeatwidget.cpp +++ b/kregexpeditor/repeatwidget.cpp @@ -15,7 +15,7 @@ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. **/ -#ifdef QT_ONLY +#ifdef TQT_ONLY #include "compat.h" #else #include <klocale.h> @@ -35,17 +35,17 @@ #include <tqvbuttongroup.h> #include "kwidgetstreamer.h" -RepeatWidget::RepeatWidget(RegExpEditorWindow* editorWindow, TQWidget *parent, +RepeatWidget::RepeatWidget(RegExpEditorWindow* editorWindow, TQWidget *tqparent, const char *name) - : SingleContainerWidget(editorWindow, parent, name ? name : "RepeatWidget") + : SingleContainerWidget(editorWindow, tqparent, name ? name : "RepeatWidget") { _child = new ConcWidget(editorWindow, this); init(); } RepeatWidget::RepeatWidget( RepeatRegExp* regexp, RegExpEditorWindow* editorWindow, - TQWidget* parent, const char* name ) - :SingleContainerWidget( editorWindow, parent, name ) + TQWidget* tqparent, const char* name ) + :SingleContainerWidget( editorWindow, tqparent, name ) { init(); RegExpWidget* child = WidgetFactory::createWidget( regexp->child(), editorWindow, this ); @@ -85,23 +85,23 @@ void RepeatWidget::init() } -TQSize RepeatWidget::sizeHint() const +TQSize RepeatWidget::tqsizeHint() const { - // TODO: Merge with LookAheadWidget::sizeHint + // TODO: Merge with LookAheadWidget::tqsizeHint TQFontMetrics metrics = fontMetrics(); _textSize = metrics.size( 0, _content->text() ); - _childSize = _child->sizeHint(); + _childSize = _child->tqsizeHint(); int height = _textSize.height() + bdSize + _childSize.height() + bdSize + 2*pw; - int width = 2 * pw + QMAX(_childSize.width(), 4*bdSize + _textSize.width()); + int width = 2 * pw + TQMAX(_childSize.width(), 4*bdSize + _textSize.width()); return TQSize(width,height); } void RepeatWidget::paintEvent( TQPaintEvent *e ) { // TODO: Merge with LookAheadWidget::paintEvent - TQSize mySize = sizeHint(); + TQSize mySize = tqsizeHint(); TQPainter painter(this); drawPossibleSelection( painter, mySize ); @@ -151,24 +151,24 @@ void RepeatWidget::slotConfigCanceled() { TQDataStream stream( _backup, IO_ReadOnly ); KWidgetStreamer streamer; - streamer.fromStream( stream, _content ); - repaint(); + streamer.fromStream( stream, TQT_TQOBJECT(_content) ); + tqrepaint(); } int RepeatWidget::edit() { - _configWindow->move(TQCursor::pos() - TQPoint(_configWindow->sizeHint().width()/2, - _configWindow->sizeHint().height()/2) ); + _configWindow->move(TQCursor::pos() - TQPoint(_configWindow->tqsizeHint().width()/2, + _configWindow->tqsizeHint().height()/2) ); TQDataStream stream( _backup, IO_WriteOnly ); KWidgetStreamer streamer; - streamer.toStream( _content, stream ); + streamer.toStream( TQT_TQOBJECT(_content), stream ); return _configWindow->exec(); } //-------------------------------------------------------------------------------- -RepeatRangeWindow::RepeatRangeWindow( TQWidget* parent, const char* name ) - : TQVBox( parent, name ? name : "RepeatRangeWindow" ) +RepeatRangeWindow::RepeatRangeWindow( TQWidget* tqparent, const char* name ) + : TQVBox( tqparent, name ? name : "RepeatRangeWindow" ) { setSpacing( 6 ); @@ -218,14 +218,14 @@ RepeatRangeWindow::RepeatRangeWindow( TQWidget* parent, const char* name ) } -void RepeatRangeWindow::createLine( TQWidget* parent, TQString text, TQSpinBox** spin, REPEATTYPE tp ) +void RepeatRangeWindow::createLine( TQWidget* tqparent, TQString text, TQSpinBox** spin, REPEATTYPE tp ) { - TQRadioButton* radioBut = new TQRadioButton(text, parent); - *spin = new TQSpinBox( 1, 999, 1, parent); + TQRadioButton* radioBut = new TQRadioButton(text, tqparent); + *spin = new TQSpinBox( 1, 999, 1, tqparent); (*spin)->setValue(1); - (void) new TQLabel(i18n("time(s)"), parent); + (void) new TQLabel(i18n("time(s)"), tqparent); _group->insert(radioBut, tp); } @@ -271,7 +271,7 @@ TQString RepeatRangeWindow::text() case ATMOST: return i18n("Repeated at Most 1 Time", "Repeated at Most %n Times", _mostTimes->value() ); case EXACTLY: return i18n("Repeated Exactly 1 Time", "Repeated Exactly %n Times", _exactlyTimes->value() ); case MINMAX: return i18n("Repeated From %1 to %2 Times") - .arg( _rangeFrom->value() ).arg( _rangeTo->value() ); + .tqarg( _rangeFrom->value() ).tqarg( _rangeTo->value() ); } qFatal("Fall through!"); return TQString::fromLocal8Bit(""); diff --git a/kregexpeditor/repeatwidget.h b/kregexpeditor/repeatwidget.h index e150cac..14b3dec 100644 --- a/kregexpeditor/repeatwidget.h +++ b/kregexpeditor/repeatwidget.h @@ -30,14 +30,15 @@ class RepeatRegExp; Widget containging the configuration for a @ref RepeatWidget @internal */ -class RepeatRangeWindow :public QVBox +class RepeatRangeWindow :public TQVBox { Q_OBJECT + TQ_OBJECT public: enum REPEATTYPE {ANY, ATLEAST, ATMOST, EXACTLY, MINMAX}; - RepeatRangeWindow( TQWidget* parent, const char* name = 0 ); + RepeatRangeWindow( TQWidget* tqparent, const char* name = 0 ); TQString text(); int min(); int max(); @@ -50,7 +51,7 @@ protected slots: private: - void createLine( TQWidget* parent, TQString text, TQSpinBox** spin, REPEATTYPE tp ); + void createLine( TQWidget* tqparent, TQString text, TQSpinBox** spin, REPEATTYPE tp ); TQSpinBox* _leastTimes; TQSpinBox* _mostTimes; @@ -71,14 +72,15 @@ private: class RepeatWidget :public SingleContainerWidget { Q_OBJECT + TQ_OBJECT public: - RepeatWidget( RegExpEditorWindow* editorWindow, TQWidget *parent, + RepeatWidget( RegExpEditorWindow* editorWindow, TQWidget *tqparent, const char *name = 0); RepeatWidget( RepeatRegExp* regexp, RegExpEditorWindow* editorWindow, - TQWidget* parent, const char* name = 0); + TQWidget* tqparent, const char* name = 0); void init(); - virtual TQSize sizeHint() const; + virtual TQSize tqsizeHint() const; virtual RegExp* regExp() const; virtual RegExpType type() const { return REPEAT; } virtual int edit(); diff --git a/kregexpeditor/scrollededitorwindow.cpp b/kregexpeditor/scrollededitorwindow.cpp index eddd293..cd88321 100644 --- a/kregexpeditor/scrollededitorwindow.cpp +++ b/kregexpeditor/scrollededitorwindow.cpp @@ -15,15 +15,15 @@ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. **/ -#ifndef QT_ONLY +#ifndef TQT_ONLY #include "scrollededitorwindow.moc" #endif #include "scrollededitorwindow.h" #include "editorwindow.h" -RegExpScrolledEditorWindow::RegExpScrolledEditorWindow( TQWidget* parent, const char* name) - : TQWidget(parent, name) +RegExpScrolledEditorWindow::RegExpScrolledEditorWindow( TQWidget* tqparent, const char* name) + : TQWidget(tqparent, name) { _scrollView = new TQScrollView( this ); _editorWindow = new RegExpEditorWindow( _scrollView->viewport()); @@ -106,7 +106,7 @@ void RegExpScrolledEditorWindow::resizeEvent( TQResizeEvent *event ) void RegExpScrolledEditorWindow::slotUpdateContentSize( TQPoint focusPoint ) { - TQSize childSize = _editorWindow->sizeHint(); + TQSize childSize = _editorWindow->tqsizeHint(); TQSize vpSize = _scrollView->viewportSize(10,10); bool change = false; diff --git a/kregexpeditor/scrollededitorwindow.h b/kregexpeditor/scrollededitorwindow.h index 35aa14e..e49940e 100644 --- a/kregexpeditor/scrollededitorwindow.h +++ b/kregexpeditor/scrollededitorwindow.h @@ -27,11 +27,12 @@ class RegExp; /** Regular Expression editor window. */ -class RegExpScrolledEditorWindow :public QWidget +class RegExpScrolledEditorWindow :public TQWidget { Q_OBJECT + TQ_OBJECT public: - RegExpScrolledEditorWindow( TQWidget *parent = 0, const char* name = 0); + RegExpScrolledEditorWindow( TQWidget *tqparent = 0, const char* name = 0); RegExp* regExp(); private: diff --git a/kregexpeditor/selectablelineedit.cpp b/kregexpeditor/selectablelineedit.cpp index 3620fc3..c9ed250 100644 --- a/kregexpeditor/selectablelineedit.cpp +++ b/kregexpeditor/selectablelineedit.cpp @@ -16,14 +16,14 @@ * Boston, MA 02110-1301, USA. **/ -#ifndef QT_ONLY +#ifndef TQT_ONLY #include "selectablelineedit.moc" #endif #include "selectablelineedit.h" -SelectableLineEdit::SelectableLineEdit( RegExpWidget* owner, TQWidget* parent, const char* name) - : TQLineEdit( parent, name ), _owner(owner) +SelectableLineEdit::SelectableLineEdit( RegExpWidget* owner, TQWidget* tqparent, const char* name) + : TQLineEdit( tqparent, name ), _owner(owner) { connect( this, TQT_SIGNAL( textChanged( const TQString & ) ), this, TQT_SLOT( slotKeyPressed() ) ); @@ -33,29 +33,29 @@ SelectableLineEdit::SelectableLineEdit( RegExpWidget* owner, TQWidget* parent, c void SelectableLineEdit::setSelected( bool selected ) { if ( selected ) { - TQPalette pal = palette().copy(); + TQPalette pal = TQPalette(tqpalette()); pal.setBrush( TQColorGroup::Base, gray ); setPalette( pal ); } else { unsetPalette(); } - repaint(); + tqrepaint(); } -TQSize SelectableLineEdit::sizeHint() const +TQSize SelectableLineEdit::tqsizeHint() const { int frameWidth = frame() ? 8 : 4; // from TQLineEdit source TQFontMetrics metrics = fontMetrics(); int actualSize = metrics.width( text() ); int charWidth = metrics.maxWidth(); - int height = TQLineEdit::sizeHint().height(); + int height = TQLineEdit::tqsizeHint().height(); int width; if ( hasFocus() ) width = actualSize+6*charWidth + frameWidth; else - width = QMAX(actualSize, charWidth) + frameWidth; + width = TQMAX(actualSize, charWidth) + frameWidth; return TQSize( width , height ); } @@ -67,7 +67,7 @@ void SelectableLineEdit::slotKeyPressed() int actualSize = metrics.width( text() ); if ( actualSize > size().width()-frameWidth ) { - repaint(); - emit parentPleaseUpdate(); + tqrepaint(); + emit tqparentPleaseUpdate(); } } diff --git a/kregexpeditor/selectablelineedit.h b/kregexpeditor/selectablelineedit.h index dfe356a..b50af86 100644 --- a/kregexpeditor/selectablelineedit.h +++ b/kregexpeditor/selectablelineedit.h @@ -31,20 +31,21 @@ class RegExpWidget; @internal */ -class SelectableLineEdit :public QLineEdit +class SelectableLineEdit :public TQLineEdit { Q_OBJECT + TQ_OBJECT public: - SelectableLineEdit( RegExpWidget* owner, TQWidget* parent = 0, const char* name = 0); + SelectableLineEdit( RegExpWidget* owner, TQWidget* tqparent = 0, const char* name = 0); void setSelected( bool selected ); - virtual TQSize sizeHint() const; + virtual TQSize tqsizeHint() const; protected slots: void slotKeyPressed(); signals: - void parentPleaseUpdate(); + void tqparentPleaseUpdate(); private: RegExpWidget* _owner; diff --git a/kregexpeditor/singlecontainerwidget.cpp b/kregexpeditor/singlecontainerwidget.cpp index 68b5612..2c2707c 100644 --- a/kregexpeditor/singlecontainerwidget.cpp +++ b/kregexpeditor/singlecontainerwidget.cpp @@ -15,7 +15,7 @@ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. **/ -#ifndef QT_ONLY +#ifndef TQT_ONLY #include "singlecontainerwidget.moc" #endif @@ -23,17 +23,17 @@ #include "concwidget.h" SingleContainerWidget::SingleContainerWidget(RegExpEditorWindow* editorWindow, - TQWidget* parent, const char* name) - : RegExpWidget( editorWindow, parent, name ) + TQWidget* tqparent, const char* name) + : RegExpWidget( editorWindow, tqparent, name ) { } -bool SingleContainerWidget::updateSelection( bool parentSelected ) +bool SingleContainerWidget::updateSelection( bool tqparentSelected ) { - bool changed = RegExpWidget::updateSelection( parentSelected ); + bool changed = RegExpWidget::updateSelection( tqparentSelected ); changed = _child->updateSelection( _isSelected ) && changed; if (changed) - repaint(); + tqrepaint(); return changed; } @@ -98,7 +98,7 @@ RegExpWidget* SingleContainerWidget::findWidgetToEdit( TQPoint globalPos ) RegExpWidget* wid = _child->findWidgetToEdit( globalPos ); if ( wid ) return wid; - else if ( TQRect(mapToGlobal(TQPoint(0,0)), size()).contains( globalPos ) ) + else if ( TQRect(mapToGlobal(TQPoint(0,0)), size()).tqcontains( globalPos ) ) return this; else return 0; @@ -126,7 +126,7 @@ void SingleContainerWidget::updateAll() void SingleContainerWidget::updateCursorRecursively() { _child->updateCursorRecursively(); - updateCursorShape(); + updatetqCursorShape(); } diff --git a/kregexpeditor/singlecontainerwidget.h b/kregexpeditor/singlecontainerwidget.h index 7578ce4..7a88a62 100644 --- a/kregexpeditor/singlecontainerwidget.h +++ b/kregexpeditor/singlecontainerwidget.h @@ -25,12 +25,13 @@ class SingleContainerWidget :public RegExpWidget { Q_OBJECT + TQ_OBJECT public: - SingleContainerWidget( RegExpEditorWindow* editorWindow, TQWidget* parent, + SingleContainerWidget( RegExpEditorWindow* editorWindow, TQWidget* tqparent, const char* name = 0); - virtual bool updateSelection( bool parentSelected ); + virtual bool updateSelection( bool tqparentSelected ); virtual bool hasSelection() const; virtual void clearSelection(); virtual void deleteSelection(); diff --git a/kregexpeditor/test-without-dl/main.cpp b/kregexpeditor/test-without-dl/main.cpp index a66355f..5b0fe14 100644 --- a/kregexpeditor/test-without-dl/main.cpp +++ b/kregexpeditor/test-without-dl/main.cpp @@ -19,13 +19,13 @@ #include <kcmdlineargs.h> #include <tqfile.h> #include "../kregexpeditorgui.h" -class ShootABug :public QObject +class ShootABug :public TQObject { public: virtual bool eventFilter( TQObject* recv, TQEvent* event ) { if ( event->type() == TQEvent::MouseButtonPress && - dynamic_cast<TQMouseEvent*>(event)->state() == Qt::ControlButton ) { + dynamic_cast<TQMouseEvent*>(event)->state() == TQt::ControlButton ) { // Ctrl + left mouse click. qDebug("----------------------------------------------------"); @@ -47,12 +47,12 @@ int main( int argc, char* argv[] ) KCmdLineArgs::init(argc, argv, "RegExp Example","",""); KApplication myapp( argc, argv ); - qApp->installEventFilter( new ShootABug() ); + tqApp->installEventFilter( new ShootABug() ); KRegExpEditorGUIDialog* iface = new KRegExpEditorGUIDialog( 0, "_editor", TQStringList() ); - iface->setRegExp( TQString::fromLatin1( "#include" ) ); + iface->setRegExp( TQString::tqfromLatin1( "#include" ) ); iface->doSomething( "setMinimal", (void*) false ); - iface->doSomething( "setSyntax", (void*) new TQString( TQString::fromLatin1( "Emacs" ) ) ); + iface->doSomething( "setSyntax", (void*) new TQString( TQString::tqfromLatin1( "Emacs" ) ) ); iface->doSomething( "setShowSyntaxCombo", (bool*) true ); TQFile file("/packages/kde-src/kdeutils/kregexpeditor/test/main.cpp"); diff --git a/kregexpeditor/textrangeregexp.cpp b/kregexpeditor/textrangeregexp.cpp index 0f80964..78c2696 100644 --- a/kregexpeditor/textrangeregexp.cpp +++ b/kregexpeditor/textrangeregexp.cpp @@ -15,7 +15,7 @@ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. **/ -#ifdef QT_ONLY +#ifdef TQT_ONLY #include "compat.h" #else #include <klocale.h> @@ -127,7 +127,7 @@ bool TextRangeRegExp::load( TQDomElement top, const TQString& /*version*/ ) addRange( from, to ); } else { - KMessageBox::sorry( 0, i18n("<p>Invalid sub element to element <b>TextRange</b>. Tag was <b>%1</b></p>").arg(child.tagName()), + KMessageBox::sorry( 0, i18n("<p>Invalid sub element to element <b>TextRange</b>. Tag was <b>%1</b></p>").tqarg(child.tagName()), i18n("Error While Loading From XML File") ) ; return false; } diff --git a/kregexpeditor/textregexp.cpp b/kregexpeditor/textregexp.cpp index e9b493f..d53d916 100644 --- a/kregexpeditor/textregexp.cpp +++ b/kregexpeditor/textregexp.cpp @@ -15,7 +15,7 @@ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. **/ -#ifdef QT_ONLY +#ifdef TQT_ONLY #include "compat.h" #else #include <kmessagebox.h> @@ -62,7 +62,7 @@ bool TextRegExp::load( TQDomElement top, const TQString& /*version*/) _text = txtNode.data(); } else { - _text = TQString::fromLatin1( "" ); + _text = TQString::tqfromLatin1( "" ); } return true; diff --git a/kregexpeditor/textregexp.h b/kregexpeditor/textregexp.h index 1dd222e..51a7158 100644 --- a/kregexpeditor/textregexp.h +++ b/kregexpeditor/textregexp.h @@ -27,7 +27,7 @@ class TextRegExp :public RegExp { public: - TextRegExp( bool selected, TQString text = TQString::null); + TextRegExp( bool selected, TQString text = TQString()); virtual bool check( ErrorMap&, bool first, bool last ); virtual int precedence() const { diff --git a/kregexpeditor/textwidget.cpp b/kregexpeditor/textwidget.cpp index 3ca0d28..4f5045e 100644 --- a/kregexpeditor/textwidget.cpp +++ b/kregexpeditor/textwidget.cpp @@ -15,7 +15,7 @@ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. **/ -#ifndef QT_ONLY +#ifndef TQT_ONLY #include "textwidget.moc" #endif @@ -24,16 +24,16 @@ #include "selectablelineedit.h" #include <tqlayout.h> -TextWidget::TextWidget(RegExpEditorWindow* editorWindow, TQWidget *parent, +TextWidget::TextWidget(RegExpEditorWindow* editorWindow, TQWidget *tqparent, const char *name) - :RegExpWidget(editorWindow, parent, name) + :RegExpWidget(editorWindow, tqparent, name) { init( TQString::fromLocal8Bit("") ); } TextWidget::TextWidget( TextRegExp* regexp, RegExpEditorWindow* editorWindow, - TQWidget* parent, const char* name ) - : RegExpWidget( editorWindow, parent, name ) + TQWidget* tqparent, const char* name ) + : RegExpWidget( editorWindow, tqparent, name ) { init(regexp->text()); } @@ -47,7 +47,7 @@ void TextWidget::init( const TQString& txt ) _edit->setText( txt ); - connect( _edit, TQT_SIGNAL( parentPleaseUpdate() ), this, TQT_SLOT(slotUpdate()) ); + connect( _edit, TQT_SIGNAL( tqparentPleaseUpdate() ), this, TQT_SLOT(slotUpdate()) ); setFocusProxy( _edit ); _edit->installEventFilter( this ); connect( _edit, TQT_SIGNAL( textChanged( const TQString & ) ), _editorWindow, TQT_SLOT( emitChange() ) ); @@ -56,19 +56,19 @@ void TextWidget::init( const TQString& txt ) void TextWidget::slotUpdate() { - // I need to force the parent to repaint, as the size change of this - // widget may not be enough for the parent to change size, and in that - // case the parent would not repaint, and the text widget would not be + // I need to force the tqparent to tqrepaint, as the size change of this + // widget may not be enough for the tqparent to change size, and in that + // case the tqparent would not tqrepaint, and the text widget would not be // resized. - TQWidget *p = static_cast<TQWidget*>(parent()); + TQWidget *p = TQT_TQWIDGET(tqparent()); if (p) - p->repaint(); + p->tqrepaint(); _editorWindow->updateContent( this ); } -TQSize TextWidget::sizeHint() const +TQSize TextWidget::tqsizeHint() const { - return _edit->sizeHint(); + return _edit->tqsizeHint(); } void TextWidget::paintEvent( TQPaintEvent *e) @@ -81,9 +81,9 @@ void TextWidget::selectWidget( bool sel ) _edit->setSelected( sel ); } -bool TextWidget::updateSelection(bool parentSelected) +bool TextWidget::updateSelection(bool tqparentSelected) { - bool changed = RegExpWidget::updateSelection( parentSelected ); + bool changed = RegExpWidget::updateSelection( tqparentSelected ); // I need to call this function all the time, else the rubber band will // not be correctly deleted in the line edit. @@ -114,7 +114,7 @@ bool TextWidget::eventFilter( TQObject*, TQEvent* event) if ( event->type() == TQEvent::MouseButtonRelease ) { if ( _editorWindow->isInserting() ) { if ( acceptWidgetInsert( _editorWindow->insertType() ) ) { - mouseReleaseEvent( static_cast<TQMouseEvent*>(event) ); + mouseReleaseEvent( TQT_TQMOUSEEVENT(event) ); } return true; } @@ -124,7 +124,7 @@ bool TextWidget::eventFilter( TQObject*, TQEvent* event) return true; } else if ( isSelected() ) { - TQMouseEvent* e = static_cast<TQMouseEvent*>( event ); + TQMouseEvent* e = TQT_TQMOUSEEVENT( event ); TQMouseEvent ev( event->type(), mapTo(_editorWindow, e->pos()), e->button(), e->state()); TQApplication::sendEvent( _editorWindow, &ev ); diff --git a/kregexpeditor/textwidget.h b/kregexpeditor/textwidget.h index 054dbd8..973369c 100644 --- a/kregexpeditor/textwidget.h +++ b/kregexpeditor/textwidget.h @@ -30,13 +30,14 @@ class TextRegExp; class TextWidget : public RegExpWidget { Q_OBJECT + TQ_OBJECT public: - TextWidget(RegExpEditorWindow* editorWindow, TQWidget *parent, + TextWidget(RegExpEditorWindow* editorWindow, TQWidget *tqparent, const char *name = 0); TextWidget( TextRegExp* regexp, RegExpEditorWindow* editorWindow, - TQWidget* parent, const char* name = 0); - virtual TQSize sizeHint() const; + TQWidget* tqparent, const char* name = 0); + virtual TQSize tqsizeHint() const; virtual RegExp* regExp() const; virtual RegExpType type() const { return TEXT; } virtual void updateAll(); @@ -45,7 +46,7 @@ public: protected: void init( const TQString& text ); virtual void paintEvent( TQPaintEvent *e ); - virtual bool updateSelection( bool parentSelected ); + virtual bool updateSelection( bool tqparentSelected ); virtual void clearSelection(); virtual bool eventFilter( TQObject*, TQEvent* ); diff --git a/kregexpeditor/userdefinedregexps.cpp b/kregexpeditor/userdefinedregexps.cpp index 10c97b0..b251295 100644 --- a/kregexpeditor/userdefinedregexps.cpp +++ b/kregexpeditor/userdefinedregexps.cpp @@ -15,7 +15,7 @@ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. **/ -#ifdef QT_ONLY +#ifdef TQT_ONLY #include "compat.h" #else #include <klineeditdlg.h> @@ -35,8 +35,8 @@ #include <tqlayout.h> #include <tqlabel.h> -UserDefinedRegExps::UserDefinedRegExps( TQWidget *parent, const char *name ) - : TQDockWindow( TQDockWindow::InDock, parent, name) +UserDefinedRegExps::UserDefinedRegExps( TQWidget *tqparent, const char *name ) + : TQDockWindow( TQDockWindow::InDock, tqparent, name) { TQWidget* top = new TQWidget( this ); TQVBoxLayout* lay = new TQVBoxLayout( top, 6 ); @@ -48,7 +48,7 @@ UserDefinedRegExps::UserDefinedRegExps( TQWidget *parent, const char *name ) label->setMinimumSize(1,0); _userDefined = new TQListView( top, "UserDefinedRegExps::_userDefined" ); - _userDefined->addColumn( TQString::null ); + _userDefined->addColumn( TQString() ); _userDefined->header()->hide(); // _userDefined->setRootIsDecorated( true ); setWidget( top ); @@ -66,15 +66,15 @@ void UserDefinedRegExps::slotPopulateUserRegexps() createItems( i18n("User Defined"), WidgetWinItem::path(), true ); -#ifdef QT_ONLY +#ifdef TQT_ONLY TQStringList dirs; - dirs << TQString::fromLatin1( "predefined" ); + dirs << TQString::tqfromLatin1( "predefined" ); #else TQStringList dirs = KGlobal::dirs()->findDirs( "data", TQString::fromLocal8Bit("kregexpeditor/predefined/") ); #endif for ( TQStringList::iterator it1 = dirs.begin(); it1 != dirs.end(); ++it1 ) { - TQDir dir( *it1, TQString::null, TQDir::Name, TQDir::Dirs ); + TQDir dir( *it1, TQString(), TQDir::Name, TQDir::Dirs ); TQStringList subdirs = dir.entryList(); for ( TQStringList::iterator it2 = subdirs.begin(); it2 != subdirs.end(); ++it2 ) { if ( *it2 == TQString::fromLocal8Bit(".") || *it2 == TQString::fromLocal8Bit("..") ) @@ -88,7 +88,7 @@ void UserDefinedRegExps::slotPopulateUserRegexps() void UserDefinedRegExps::createItems( const TQString& _title, const TQString& dir, bool usersRegExp ) { TQString title = _title; - if (_title == TQString::fromLatin1("general")) + if (_title == TQString::tqfromLatin1("general")) title = i18n("General"); TQListViewItem* lvItem = new TQListViewItem( _userDefined, title ); @@ -101,7 +101,7 @@ void UserDefinedRegExps::createItems( const TQString& _title, const TQString& di TQFile file( fileName ); if ( ! file.open(IO_ReadOnly) ) { - KMessageBox::sorry( this, i18n("Could not open file for reading: %1").arg(fileName) ); + KMessageBox::sorry( this, i18n("Could not open file for reading: %1").tqarg(fileName) ); continue; } @@ -111,7 +111,7 @@ void UserDefinedRegExps::createItems( const TQString& _title, const TQString& di RegExp* regexp = WidgetFactory::createRegExp( data ); if ( ! regexp ) { - KMessageBox::sorry( this, i18n("File %1 containing user defined regular expression contained an error").arg( fileName ) ); + KMessageBox::sorry( this, i18n("File %1 containing user defined regular expression contained an error").tqarg( fileName ) ); continue; } @@ -187,8 +187,8 @@ void UserDefinedRegExps::slotEdit( TQListViewItem* item, const TQPoint& pos ) TQString oldName = winItem->name(); TQString txt; -#ifdef QT_ONLY - txt = QInputDialog::getText( tr("Rename Regular Expression"), tr("New name:") ); +#ifdef TQT_ONLY + txt = TQInputDialog::getText( tr("Rename Regular Expression"), tr("New name:") ); #else KLineEditDlg dlg(i18n("New name:"), oldName, this); dlg.setCaption(i18n("Rename Item")); @@ -200,7 +200,7 @@ void UserDefinedRegExps::slotEdit( TQListViewItem* item, const TQPoint& pos ) TQString fileName = WidgetWinItem::path() + TQString::fromLocal8Bit("/") + txt + TQString::fromLocal8Bit(".regexp"); TQFileInfo finfo( fileName ); if ( finfo.exists() ) { - int answer = KMessageBox::warningYesNo( this, i18n("<p>Overwrite named regular expression <b>%1</b>?</p>").arg(txt), TQString::null, i18n("Overwrite"), i18n("Do Not Overwrite") ); + int answer = KMessageBox::warningYesNo( this, i18n("<p>Overwrite named regular expression <b>%1</b>?</p>").tqarg(txt), TQString(), i18n("Overwrite"), i18n("Do Not Overwrite") ); if ( answer != KMessageBox::Yes ) return; @@ -223,10 +223,10 @@ void UserDefinedRegExps::slotSelectNewAction() slotUnSelect(); } -WidgetWinItem::WidgetWinItem( TQString fileName, RegExp* regexp, bool usersRegExp, TQListViewItem* parent ) - :TQListViewItem( parent ), _regexp( regexp ), _usersRegExp ( usersRegExp ) +WidgetWinItem::WidgetWinItem( TQString fileName, RegExp* regexp, bool usersRegExp, TQListViewItem* tqparent ) + :TQListViewItem( tqparent ), _regexp( regexp ), _usersRegExp ( usersRegExp ) { - int index = fileName.findRev(TQString::fromLocal8Bit(".regexp")); + int index = fileName.tqfindRev(TQString::fromLocal8Bit(".regexp")); _name = fileName.left(index); setText( 0, _name ); @@ -255,8 +255,8 @@ void WidgetWinItem::setName( const TQString& nm ) TQString WidgetWinItem::path() { -#ifdef QT_ONLY - return TQString::fromLatin1( "predefined" ); +#ifdef TQT_ONLY + return TQString::tqfromLatin1( "predefined" ); #else return locateLocal("data", TQString::fromLocal8Bit("KRegExpEditor/")); #endif diff --git a/kregexpeditor/userdefinedregexps.h b/kregexpeditor/userdefinedregexps.h index 30fe777..e6062ca 100644 --- a/kregexpeditor/userdefinedregexps.h +++ b/kregexpeditor/userdefinedregexps.h @@ -25,12 +25,13 @@ class TQPoint; class RegExp; -class UserDefinedRegExps :public QDockWindow +class UserDefinedRegExps :public TQDockWindow { Q_OBJECT + TQ_OBJECT public: - UserDefinedRegExps( TQWidget *parent, const char *name = 0 ); + UserDefinedRegExps( TQWidget *tqparent, const char *name = 0 ); const TQPtrList<CompoundRegExp> regExps() const; public slots: @@ -53,10 +54,10 @@ private: TQPtrList<CompoundRegExp> _regExps; }; -class WidgetWinItem :public QListViewItem +class WidgetWinItem :public TQListViewItem { public: - WidgetWinItem( TQString name, RegExp* regexp, bool users, TQListViewItem* parent ); + WidgetWinItem( TQString name, RegExp* regexp, bool users, TQListViewItem* tqparent ); static TQString path(); TQString fileName() const; diff --git a/kregexpeditor/util.cpp b/kregexpeditor/util.cpp index d770488..b6cf4c6 100644 --- a/kregexpeditor/util.cpp +++ b/kregexpeditor/util.cpp @@ -21,19 +21,19 @@ #include <kstandarddirs.h> TQPixmap Util::getKRegExpEditorIcon( const TQString& name ) { -#ifdef QT_ONLY +#ifdef TQT_ONLY TQPixmap pix; pix.convertFromImage( qembed_findImage(name) ); return pix; #else - return KGlobal::iconLoader()->loadIcon(locate("data", TQString::fromLatin1("kregexpeditor/pics/") +name ), + return KGlobal::iconLoader()->loadIcon(locate("data", TQString::tqfromLatin1("kregexpeditor/pics/") +name ), KIcon::Toolbar ); #endif } TQPixmap Util::getSystemIcon( const TQString& name ) { -#ifdef QT_ONLY +#ifdef TQT_ONLY TQPixmap pix; pix.convertFromImage( qembed_findImage( name ) ); return pix; @@ -46,7 +46,7 @@ TQPixmap Util::getSystemIcon( const TQString& name ) TQIconSet Util::getSystemIconSet( const TQString& name ) { -#ifdef QT_ONLY +#ifdef TQT_ONLY TQPixmap pix; pix.convertFromImage( qembed_findImage( name ) ); return TQIconSet( pix ); diff --git a/kregexpeditor/verifier.cpp b/kregexpeditor/verifier.cpp index 26c1a21..00b75be 100644 --- a/kregexpeditor/verifier.cpp +++ b/kregexpeditor/verifier.cpp @@ -15,7 +15,7 @@ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. **/ -#ifdef QT_ONLY +#ifdef TQT_ONLY #include "compat.h" #else #include <klocale.h> @@ -24,8 +24,8 @@ #include "verifier.h" -Verifier::Verifier( TQWidget* parent, const char* name ) : TQTextEdit( parent, name ) - /* QT_ANCHOR_DO_NOT_WORK: ,_current( 0 ) */ +Verifier::Verifier( TQWidget* tqparent, const char* name ) : TQTextEdit( tqparent, name ) + /* TQT_ANCHOR_DO_NOT_WORK: ,_current( 0 ) */ { _highlighter = 0; setMinimumSize(1,1); @@ -49,7 +49,7 @@ void Verifier::verify( const TQString& reg ) void Verifier::clearRegexp() { if ( _highlighter ) { - _highlighter->setRegExp( TQString::null ); + _highlighter->setRegExp( TQString() ); _highlighter->rehighlight(); } } @@ -73,7 +73,7 @@ void Verifier::setMinimal( bool b ) _highlighter->setMinimal( b ); } -// Qt anchors do not work for <pre>...</pre>, thefore scrolling to next/prev match +// TQt anchors do not work for <pre>...</pre>, thefore scrolling to next/prev match // do not work. Enable this when they work. // void Verifier::gotoFirst() // { @@ -97,7 +97,7 @@ void Verifier::setMinimal( bool b ) // // void Verifier::gotoNum( int which ) // { -// TQString anchor = TQString::fromLatin1("match%1").arg(which); +// TQString anchor = TQString::tqfromLatin1("match%1").tqarg(which); // scrollToAnchor( anchor ); // _current = which; // emit currentChanged( _current ); diff --git a/kregexpeditor/verifier.h b/kregexpeditor/verifier.h index c22c27a..4d204de 100644 --- a/kregexpeditor/verifier.h +++ b/kregexpeditor/verifier.h @@ -23,11 +23,12 @@ class TQTimer; class TQProgressDialog; class TQLabel; class SyntaxHighlighter; -class Verifier :public QTextEdit +class Verifier :public TQTextEdit { Q_OBJECT + TQ_OBJECT public: - Verifier( TQWidget* parent, const char* name = 0 ); + Verifier( TQWidget* tqparent, const char* name = 0 ); void setHighlighter( RegexpHighlighter* ); public slots: diff --git a/kregexpeditor/verifybuttons.cpp b/kregexpeditor/verifybuttons.cpp index d7ed66a..05b0fb7 100644 --- a/kregexpeditor/verifybuttons.cpp +++ b/kregexpeditor/verifybuttons.cpp @@ -15,7 +15,7 @@ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. **/ -#ifdef QT_ONLY +#ifdef TQT_ONLY #include "compat.h" #include <tqfiledialog.h> #include "images.h" @@ -39,59 +39,59 @@ #include <tqpopupmenu.h> #include <tqaction.h> -VerifyButtons::VerifyButtons( TQWidget* parent, const char* name ) - :TQDockWindow( TQDockWindow::InDock, parent, name ), _configMenu( 0 ) +VerifyButtons::VerifyButtons( TQWidget* tqparent, const char* name ) + :TQDockWindow( TQDockWindow::InDock, tqparent, name ), _configMenu( 0 ) { - TQBoxLayout* layout = boxLayout(); + TQBoxLayout* tqlayout = boxLayout(); _verify = new TQToolButton(this); - TQIconSet icon = Util::getSystemIconSet( TQString::fromLatin1("spellcheck")); + TQIconSet icon = Util::getSystemIconSet( TQString::tqfromLatin1("spellcheck")); _verify->setIconSet( icon ); TQToolTip::add( _verify, i18n( "Verify regular expression" ) ); TQWhatsThis::add( _verify, i18n("Shows what part of the regular expression is being matched in the <i>verifier window</i>." "(The window below the graphical editor window).")); - layout->addWidget( _verify ); + tqlayout->addWidget( _verify ); connect( _verify, TQT_SIGNAL( clicked() ), this, TQT_SIGNAL( verify() ) ); TQToolButton* button = new TQToolButton(this); - button->setPixmap( Util::getSystemIcon( TQString::fromLatin1("fileopen")) ); - layout->addWidget( button ); + button->setPixmap( Util::getSystemIcon( TQString::tqfromLatin1("fileopen")) ); + tqlayout->addWidget( button ); connect(button, TQT_SIGNAL(clicked()), this, TQT_SLOT(loadText())); TQToolTip::add( button, i18n("Load text in the verifier window") ); button = new TQToolButton(this); - button->setPixmap( Util::getSystemIcon( TQString::fromLatin1("package_settings")) ); - layout->addWidget( button ); + button->setPixmap( Util::getSystemIcon( TQString::tqfromLatin1("package_settings")) ); + tqlayout->addWidget( button ); connect(button, TQT_SIGNAL(clicked()), this, TQT_SLOT(configure())); TQToolTip::add( button, i18n("Settings") ); // It is currently not possible to ask for the paragraph being highlighted, thefore scrolling to next/prev match // do not work. Enable this when they work. - // _first = new TQToolButton( TQString::fromLatin1("<<"), this); - // layout->addWidget( _first ); + // _first = new TQToolButton( TQString::tqfromLatin1("<<"), this); + // tqlayout->addWidget( _first ); // connect(_first, TQT_SIGNAL(clicked()), this, TQT_SIGNAL( gotoFirst())); // _first->setFixedWidth( 25 ); // - // _prev = new TQToolButton(TQString::fromLatin1("<"), this); - // layout->addWidget( _prev ); + // _prev = new TQToolButton(TQString::tqfromLatin1("<"), this); + // tqlayout->addWidget( _prev ); // connect(_prev, TQT_SIGNAL(clicked()), this, TQT_SIGNAL( gotoPrev())); // _prev->setFixedWidth( 20 ); // - // _next = new TQToolButton(TQString::fromLatin1(">"), this); - // layout->addWidget( _next ); + // _next = new TQToolButton(TQString::tqfromLatin1(">"), this); + // tqlayout->addWidget( _next ); // connect(_next, TQT_SIGNAL(clicked()), this, TQT_SIGNAL( gotoNext())); // _next->setFixedWidth( 20 ); // - // _last = new TQToolButton(TQString::fromLatin1(">>"), this); - // layout->addWidget( _last ); + // _last = new TQToolButton(TQString::tqfromLatin1(">>"), this); + // tqlayout->addWidget( _last ); // connect(_last, TQT_SIGNAL(clicked()), this, TQT_SIGNAL( gotoLast())); // _last->setFixedWidth( 25 ); // Same as above // TQLabel* label = new TQLabel( i18n("Matches: "), this ); -// layout->addWidget( label ); +// tqlayout->addWidget( label ); // _matches = new TQLabel(i18n("-"), this ); -// layout->addWidget( _matches ); +// tqlayout->addWidget( _matches ); // TQString txt = i18n( "Shows number of times regular expression matches the text in the verifier window"); // TQToolTip::add( label, txt ); // TQToolTip::add( _matches, txt ); @@ -100,14 +100,14 @@ VerifyButtons::VerifyButtons( TQWidget* parent, const char* name ) // -------------------------------------------------- RegExp Converters - // Qt - RegExpConverter* converter = new QtRegExpConverter(); - _converters.append( qMakePair( converter, static_cast<TQAction*>( 0 ) ) ); + // TQt + RegExpConverter* converter = new TQtRegExpConverter(); + _converters.append( tqMakePair( converter, static_cast<TQAction*>( 0 ) ) ); TQString qtConverterName = converter->name(); // Emacs converter = new EmacsRegExpConverter(); - _converters.append( qMakePair( converter, static_cast<TQAction*>( 0 ) ) ); + _converters.append( tqMakePair( converter, static_cast<TQAction*>( 0 ) ) ); // -------------------------------------------------- Initialize the config menu @@ -130,7 +130,7 @@ VerifyButtons::VerifyButtons( TQWidget* parent, const char* name ) _languageId = _configMenu->insertItem( i18n("RegExp Language"), languages ); TQActionGroup* grp = new TQActionGroup( this ); - for( TQValueList< QPair<RegExpConverter*,TQAction*> >::Iterator it = _converters.begin(); it != _converters.end(); ++it ) { + for( TQValueList< TQPair<RegExpConverter*,TQAction*> >::Iterator it = _converters.begin(); it != _converters.end(); ++it ) { TQString name = (*it).first->name(); TQAction* action = new TQAction( name, 0, this ); action->setToggleAction( true ); @@ -141,7 +141,7 @@ VerifyButtons::VerifyButtons( TQWidget* parent, const char* name ) connect( grp, TQT_SIGNAL( selected( TQAction* ) ), this, TQT_SLOT( slotChangeSyntax( TQAction* ) ) ); _configMenu->setItemEnabled( _languageId, false ); - // Select the Qt converter by default + // Select the TQt converter by default setSyntax( qtConverterName ); } @@ -154,13 +154,13 @@ void VerifyButtons::updateVerifyButton( bool b ) void VerifyButtons::loadText() { - TQString fileName = KFileDialog::getOpenFileName(TQString::null, TQString::null, this); + TQString fileName = KFileDialog::getOpenFileName(TQString(), TQString(), this); if ( !fileName.isNull() ) { emit loadVerifyText( fileName ); } } -// Qt anchors do not work for <pre>...</pre>, thefore scrolling to next/prev match +// TQt anchors do not work for <pre>...</pre>, thefore scrolling to next/prev match // do not work. Enable this when they work. // void VerifyButtons::enableBackwardButtons( bool b ) // { @@ -176,10 +176,10 @@ void VerifyButtons::loadText() void VerifyButtons::setMatchCount( int /*count*/ ) { -// currently this is not possible due to limitation in QSyntaxHighlighter +// currently this is not possible due to limitation in TQSyntaxHighlighter /* if ( count == -1 ) - _matches->setText( TQString::fromLatin1("-") ); + _matches->setText( TQString::tqfromLatin1("-") ); else _matches->setText( TQString::number( count ) ); */ @@ -192,7 +192,7 @@ void VerifyButtons::slotChangeSyntax( TQAction* action ) RegExpConverter* VerifyButtons::setSyntax( const TQString& which) { - for( TQValueList< QPair<RegExpConverter*, TQAction*> >::Iterator it = _converters.begin(); it != _converters.end(); ++it ) { + for( TQValueList< TQPair<RegExpConverter*, TQAction*> >::Iterator it = _converters.begin(); it != _converters.end(); ++it ) { TQString name = (*it).first->name(); if ( name == which ) { (*it).second->setOn( true ); @@ -208,7 +208,7 @@ void VerifyButtons::configure() _configMenu->exec( TQCursor::pos() ); } -void VerifyButtons::setAllowNonQtSyntax( bool b ) +void VerifyButtons::setAllowNonTQtSyntax( bool b ) { _configMenu->setItemEnabled( _languageId, b ); } diff --git a/kregexpeditor/verifybuttons.h b/kregexpeditor/verifybuttons.h index abebe90..1298573 100644 --- a/kregexpeditor/verifybuttons.h +++ b/kregexpeditor/verifybuttons.h @@ -25,21 +25,22 @@ class TQLabel; class TQAction; class TQPopupMenu; -class VerifyButtons :public QDockWindow +class VerifyButtons :public TQDockWindow { Q_OBJECT + TQ_OBJECT public: - VerifyButtons( TQWidget* parent, const char* name ); + VerifyButtons( TQWidget* tqparent, const char* name ); RegExpConverter* setSyntax( const TQString& ); - void setAllowNonQtSyntax( bool ); + void setAllowNonTQtSyntax( bool ); signals: void verify(); void autoVerify( bool ); void loadVerifyText( const TQString& ); - // Qt anchors do not work for <pre>...</pre>, thefore scrolling to next/prev match + // TQt anchors do not work for <pre>...</pre>, thefore scrolling to next/prev match // do not work. Enable this when they work. // void gotoFirst(); // void gotoPrev(); @@ -65,14 +66,14 @@ private: TQPopupMenu* _configMenu; int _languageId; - // Qt anchors do not work for <pre>...</pre>, thefore scrolling to next/prev match + // TQt anchors do not work for <pre>...</pre>, thefore scrolling to next/prev match // do not work. Enable this when they work. // TQToolButton* _first; // TQToolButton* _prev; // TQToolButton* _next; // TQToolButton* _last; - TQValueList< QPair<RegExpConverter*,TQAction*> > _converters; + TQValueList< TQPair<RegExpConverter*,TQAction*> > _converters; }; diff --git a/kregexpeditor/widgetfactory.cpp b/kregexpeditor/widgetfactory.cpp index a5a7a78..4bbc2b9 100644 --- a/kregexpeditor/widgetfactory.cpp +++ b/kregexpeditor/widgetfactory.cpp @@ -15,7 +15,7 @@ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. **/ -#ifdef QT_ONLY +#ifdef TQT_ONLY #include "compat.h" #else #include <kmessagebox.h> @@ -46,35 +46,35 @@ bool WidgetFactory::isContainer( RegExpType tp ) return ( tp == REPEAT || tp == ALTN || tp == COMPOUND ); } -RegExpWidget* WidgetFactory::createWidget( RegExpEditorWindow* win, TQWidget* parent, +RegExpWidget* WidgetFactory::createWidget( RegExpEditorWindow* win, TQWidget* tqparent, RegExpType type ) { RegExpWidget* widget = 0; switch (type) { case TEXT: - return new TextWidget( win, parent ); break; + return new TextWidget( win, tqparent ); break; case ALTN: - return new AltnWidget( win, parent ); break; + return new AltnWidget( win, tqparent ); break; case DOT: - return new AnyCharWidget( win, parent ); break; + return new AnyCharWidget( win, tqparent ); break; case BEGLINE: - return new BegLineWidget( win, parent ); break; + return new BegLineWidget( win, tqparent ); break; case ENDLINE: - return new EndLineWidget( win, parent ); break; + return new EndLineWidget( win, tqparent ); break; case WORDBOUNDARY: - return new WordBoundaryWidget( win, parent ); break; + return new WordBoundaryWidget( win, tqparent ); break; case NONWORDBOUNDARY: - return new NonWordBoundaryWidget( win, parent ); break; + return new NonWordBoundaryWidget( win, tqparent ); break; case POSLOOKAHEAD: case NEGLOOKAHEAD: - return new LookAheadWidget( win, type, parent ); break; + return new LookAheadWidget( win, type, tqparent ); break; case REPEAT: - widget = new RepeatWidget( win, parent ); break; + widget = new RepeatWidget( win, tqparent ); break; case CHARSET: - widget = new CharactersWidget( win, parent ); break; + widget = new CharactersWidget( win, tqparent ); break; case COMPOUND: - widget = new CompoundWidget( win, parent ); break; + widget = new CompoundWidget( win, tqparent ); break; default: qFatal("It should not be possible to get here!"); return 0; @@ -88,43 +88,43 @@ RegExpWidget* WidgetFactory::createWidget( RegExpEditorWindow* win, TQWidget* pa } RegExpWidget* WidgetFactory::createWidget( RegExp* regexp, RegExpEditorWindow* editorWindow, - TQWidget* parent ) + TQWidget* tqparent ) { if ( regexp == 0 ) { qFatal("%s:%d Regexp is 0", __FILE__, __LINE__ ); } else if ( TextRegExp* reg = dynamic_cast<TextRegExp*>( regexp ) ) - return new TextWidget( reg, editorWindow, parent ); + return new TextWidget( reg, editorWindow, tqparent ); else if ( TextRangeRegExp* reg = dynamic_cast<TextRangeRegExp*>( regexp ) ) - return new CharactersWidget( reg, editorWindow, parent ); + return new CharactersWidget( reg, editorWindow, tqparent ); else if ( RepeatRegExp* reg = dynamic_cast<RepeatRegExp*>( regexp ) ) - return new RepeatWidget( reg, editorWindow, parent ); + return new RepeatWidget( reg, editorWindow, tqparent ); else if ( LookAheadRegExp* reg = dynamic_cast<LookAheadRegExp*>( regexp ) ) { if ( reg->lookAheadType() == LookAheadRegExp::POSITIVE ) - return new LookAheadWidget( reg, editorWindow, POSLOOKAHEAD, parent ); + return new LookAheadWidget( reg, editorWindow, POSLOOKAHEAD, tqparent ); else - return new LookAheadWidget( reg, editorWindow, NEGLOOKAHEAD, parent ); + return new LookAheadWidget( reg, editorWindow, NEGLOOKAHEAD, tqparent ); } else if ( ConcRegExp* reg = dynamic_cast<ConcRegExp*>( regexp ) ) - return new ConcWidget( reg, editorWindow, parent ); + return new ConcWidget( reg, editorWindow, tqparent ); else if ( AltnRegExp* reg = dynamic_cast<AltnRegExp*>( regexp ) ) - return new AltnWidget( reg, editorWindow, parent ); + return new AltnWidget( reg, editorWindow, tqparent ); else if ( PositionRegExp* reg = dynamic_cast<PositionRegExp*>( regexp ) ) { switch ( reg->position() ) { case PositionRegExp::BEGLINE: - return new BegLineWidget( editorWindow, parent ); + return new BegLineWidget( editorWindow, tqparent ); case PositionRegExp::ENDLINE: - return new EndLineWidget( editorWindow, parent ); + return new EndLineWidget( editorWindow, tqparent ); case PositionRegExp::WORDBOUNDARY: - return new WordBoundaryWidget( editorWindow, parent ); + return new WordBoundaryWidget( editorWindow, tqparent ); case PositionRegExp::NONWORDBOUNDARY: - return new NonWordBoundaryWidget( editorWindow, parent ); + return new NonWordBoundaryWidget( editorWindow, tqparent ); } } else if ( dynamic_cast<DotRegExp*>( regexp ) ) - return new AnyCharWidget( editorWindow, parent ); + return new AnyCharWidget( editorWindow, tqparent ); else if ( CompoundRegExp* reg = dynamic_cast<CompoundRegExp*>( regexp ) ) - return new CompoundWidget( reg, editorWindow, parent ); + return new CompoundWidget( reg, editorWindow, tqparent ); else { qFatal("%s:%d Internal Error: Unknown RegExp type", __FILE__, __LINE__); } @@ -162,7 +162,7 @@ RegExp* WidgetFactory::createRegExp( TQDomElement node, const TQString& version else if ( tag == TQString::fromLocal8Bit( "Repeat" ) ) regexp = new RepeatRegExp( false ); else { - KMessageBox::sorry( 0, i18n("<p>Unknown tag while reading XML. Tag was <b>%1</b></p>").arg(tag), + KMessageBox::sorry( 0, i18n("<p>Unknown tag while reading XML. Tag was <b>%1</b></p>").tqarg(tag), i18n("Error While Loading From XML File") ) ; return 0; @@ -191,14 +191,14 @@ RegExp* WidgetFactory::createRegExp( TQString str ) // Read the RegularExpression element, and extract the version. TQDomElement top = doc.documentElement(); if (! (top.tagName() == TQString::fromLocal8Bit("RegularExpression")) ) { - KMessageBox::sorry( 0, i18n("<p>XML file did not contain a <b>%1</b> tag.</p>").arg(TQString::fromLatin1("RegularExpression")), + KMessageBox::sorry( 0, i18n("<p>XML file did not contain a <b>%1</b> tag.</p>").tqarg(TQString::tqfromLatin1("RegularExpression")), i18n("Error While Loading From XML File") ) ; } TQString version = top.attribute( TQString::fromLocal8Bit("version"), KRegExpEditorGUI::version ); TQDomNode child = top.firstChild(); if ( ! child.isElement() ) { KMessageBox::sorry( 0, i18n("<p>Error while reading XML file. The element just below the tag " - "<b>%1</b> was not an element.</p>").arg(TQString::fromLatin1("RegularExpression")), + "<b>%1</b> was not an element.</p>").tqarg(TQString::tqfromLatin1("RegularExpression")), i18n("Error While Loading From XML File") ) ; } diff --git a/kregexpeditor/widgetfactory.h b/kregexpeditor/widgetfactory.h index 2ef7233..836ee12 100644 --- a/kregexpeditor/widgetfactory.h +++ b/kregexpeditor/widgetfactory.h @@ -47,10 +47,10 @@ enum RegExpType { class WidgetFactory { public: - static RegExpWidget* createWidget( RegExpEditorWindow* editorWindow, TQWidget* parent, + static RegExpWidget* createWidget( RegExpEditorWindow* editorWindow, TQWidget* tqparent, RegExpType type ); static RegExpWidget* createWidget( RegExp* regexp, RegExpEditorWindow* editorWindow, - TQWidget* parent ); + TQWidget* tqparent ); static RegExp* createRegExp( TQDomElement node, const TQString& version ); static RegExp* createRegExp( TQString str ); static bool isContainer( RegExpType ); diff --git a/kregexpeditor/zerowidgets.cpp b/kregexpeditor/zerowidgets.cpp index f9de296..ede99cb 100644 --- a/kregexpeditor/zerowidgets.cpp +++ b/kregexpeditor/zerowidgets.cpp @@ -16,7 +16,7 @@ * Boston, MA 02110-1301, USA. **/ -#ifdef QT_ONLY +#ifdef TQT_ONLY #include "compat.h" #else #include <klocale.h> @@ -31,18 +31,18 @@ // ZeroWidget //-------------------------------------------------------------------------------- ZeroWidget::ZeroWidget(TQString txt, RegExpEditorWindow* editorWindow, - TQWidget *parent, const char *name) - : RegExpWidget(editorWindow, parent, name ? name : "ZeroWidget" ) + TQWidget *tqparent, const char *name) + : RegExpWidget(editorWindow, tqparent, name ? name : "ZeroWidget" ) { _text = txt; } void ZeroWidget::addNewChild(DragAccepter *, RegExpWidget *) { - qFatal("No children should be added to this widget!"); + qFatal("No tqchildren should be added to this widget!"); } -TQSize ZeroWidget::sizeHint() const +TQSize ZeroWidget::tqsizeHint() const { TQFontMetrics metrics = fontMetrics(); _textSize = HackCalculateFontSize( metrics, _text ); @@ -54,7 +54,7 @@ TQSize ZeroWidget::sizeHint() const void ZeroWidget::paintEvent( TQPaintEvent *e) { // So what is my Size? - TQSize mySize = sizeHint(); + TQSize mySize = tqsizeHint(); TQPainter painter(this); drawPossibleSelection( painter, mySize); @@ -70,9 +70,9 @@ void ZeroWidget::paintEvent( TQPaintEvent *e) //-------------------------------------------------------------------------------- // AnyCharWidget //-------------------------------------------------------------------------------- -AnyCharWidget::AnyCharWidget(RegExpEditorWindow* editorWindow, TQWidget *parent, +AnyCharWidget::AnyCharWidget(RegExpEditorWindow* editorWindow, TQWidget *tqparent, const char *name) - : ZeroWidget(i18n("Any\nCharacter"), editorWindow, parent, + : ZeroWidget(i18n("Any\nCharacter"), editorWindow, tqparent, name ? name : "AnyCharWidget") { } @@ -86,9 +86,9 @@ RegExp* AnyCharWidget::regExp() const //-------------------------------------------------------------------------------- // BegLineWidget //-------------------------------------------------------------------------------- -BegLineWidget::BegLineWidget(RegExpEditorWindow* editorWindow, TQWidget *parent, +BegLineWidget::BegLineWidget(RegExpEditorWindow* editorWindow, TQWidget *tqparent, const char *name) - : ZeroWidget(i18n("Line\nStart"), editorWindow, parent, + : ZeroWidget(i18n("Line\nStart"), editorWindow, tqparent, name ? name : "BegLineWidget") { } @@ -102,9 +102,9 @@ RegExp* BegLineWidget::regExp() const //-------------------------------------------------------------------------------- // EndLineWidget //-------------------------------------------------------------------------------- -EndLineWidget::EndLineWidget(RegExpEditorWindow* editorWindow, TQWidget *parent, +EndLineWidget::EndLineWidget(RegExpEditorWindow* editorWindow, TQWidget *tqparent, const char *name) - : ZeroWidget(i18n("Line\nEnd"), editorWindow, parent, name) + : ZeroWidget(i18n("Line\nEnd"), editorWindow, tqparent, name) { } @@ -116,9 +116,9 @@ RegExp* EndLineWidget::regExp() const //-------------------------------------------------------------------------------- // WordBoundaryWidget //-------------------------------------------------------------------------------- -WordBoundaryWidget::WordBoundaryWidget(RegExpEditorWindow* editorWindow, TQWidget *parent, +WordBoundaryWidget::WordBoundaryWidget(RegExpEditorWindow* editorWindow, TQWidget *tqparent, const char *name) - : ZeroWidget(i18n("Word\nBoundary"), editorWindow, parent, + : ZeroWidget(i18n("Word\nBoundary"), editorWindow, tqparent, name ? name : "WordBoundaryWidget" ) { } @@ -131,9 +131,9 @@ RegExp* WordBoundaryWidget::regExp() const //-------------------------------------------------------------------------------- // NonWordBoundaryWidget //-------------------------------------------------------------------------------- -NonWordBoundaryWidget::NonWordBoundaryWidget(RegExpEditorWindow* editorWindow, TQWidget *parent, +NonWordBoundaryWidget::NonWordBoundaryWidget(RegExpEditorWindow* editorWindow, TQWidget *tqparent, const char *name) - : ZeroWidget(i18n("Non-word\nBoundary"), editorWindow, parent, + : ZeroWidget(i18n("Non-word\nBoundary"), editorWindow, tqparent, name ? name : "NonWordBoundaryWidget" ) { } diff --git a/kregexpeditor/zerowidgets.h b/kregexpeditor/zerowidgets.h index 04dd5c7..f418988 100644 --- a/kregexpeditor/zerowidgets.h +++ b/kregexpeditor/zerowidgets.h @@ -27,10 +27,10 @@ class ZeroWidget :public RegExpWidget { public: - ZeroWidget(TQString text, RegExpEditorWindow* editorWindow, TQWidget *parent, + ZeroWidget(TQString text, RegExpEditorWindow* editorWindow, TQWidget *tqparent, const char *name = 0); virtual void addNewChild(DragAccepter *accepter, RegExpWidget *child); - virtual TQSize sizeHint() const; + virtual TQSize tqsizeHint() const; protected: virtual void paintEvent( TQPaintEvent *e ); @@ -51,7 +51,7 @@ private: class AnyCharWidget :public ZeroWidget { public: - AnyCharWidget(RegExpEditorWindow* editorWindow, TQWidget *parent, + AnyCharWidget(RegExpEditorWindow* editorWindow, TQWidget *tqparent, const char *label = 0); virtual RegExp* regExp() const; @@ -68,7 +68,7 @@ public: class BegLineWidget : public ZeroWidget { public: - BegLineWidget(RegExpEditorWindow* editorWindow, TQWidget *parent, + BegLineWidget(RegExpEditorWindow* editorWindow, TQWidget *tqparent, const char *name = 0); virtual RegExp* regExp() const; virtual RegExpType type() const { return BEGLINE; } @@ -84,7 +84,7 @@ public: class EndLineWidget : public ZeroWidget { public: - EndLineWidget(RegExpEditorWindow* editorWindow, TQWidget *parent, + EndLineWidget(RegExpEditorWindow* editorWindow, TQWidget *tqparent, const char *name = 0); virtual RegExp* regExp() const; virtual RegExpType type() const { return ENDLINE; } @@ -99,7 +99,7 @@ public: class WordBoundaryWidget : public ZeroWidget { public: - WordBoundaryWidget(RegExpEditorWindow* editorWindow, TQWidget *parent, + WordBoundaryWidget(RegExpEditorWindow* editorWindow, TQWidget *tqparent, const char *name = 0); virtual RegExp* regExp() const; virtual RegExpType type() const { return WORDBOUNDARY; } @@ -115,7 +115,7 @@ public: class NonWordBoundaryWidget : public ZeroWidget { public: - NonWordBoundaryWidget(RegExpEditorWindow* editorWindow, TQWidget *parent, + NonWordBoundaryWidget(RegExpEditorWindow* editorWindow, TQWidget *tqparent, const char *name = 0); virtual RegExp* regExp() const; virtual RegExpType type() const { return NONWORDBOUNDARY; } |