From 48d4a26399959121f33d2bc3bfe51c7827b654fc Mon Sep 17 00:00:00 2001 From: tpearson Date: Tue, 14 Jun 2011 16:45:05 +0000 Subject: TQt4 port kdevelop This enables compilation under both Qt3 and Qt4 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdevelop@1236710 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- kdevdesigner/designer/propertyeditor.cpp | 510 +++++++++++++++---------------- 1 file changed, 255 insertions(+), 255 deletions(-) (limited to 'kdevdesigner/designer/propertyeditor.cpp') diff --git a/kdevdesigner/designer/propertyeditor.cpp b/kdevdesigner/designer/propertyeditor.cpp index 3ef4d687..4294deb5 100644 --- a/kdevdesigner/designer/propertyeditor.cpp +++ b/kdevdesigner/designer/propertyeditor.cpp @@ -1,15 +1,15 @@ /********************************************************************** ** Copyright (C) 2000 Trolltech AS. All rights reserved. ** -** This file is part of Qt Designer. +** This file is part of TQt Designer. ** ** This file may be distributed and/or modified under the terms of the ** GNU General Public License version 2 as published by the Free Software ** Foundation and appearing in the file LICENSE.GPL included in the ** packaging of this file. ** -** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition -** licenses may use this file in accordance with the Qt Commercial License +** Licensees holding valid TQt Enterprise Edition or TQt Professional Edition +** licenses may use this file in accordance with the TQt Commercial License ** Agreement provided with the Software. ** ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE @@ -17,7 +17,7 @@ ** ** See http://www.trolltech.com/gpl/ for GPL licensing information. ** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for -** information about Qt Commercial License Agreements. +** information about TQt Commercial License Agreements. ** ** Contact info@trolltech.com if any conditions of this licensing are ** not clear to you. @@ -81,7 +81,7 @@ #include #include #include -#include +#include #include #include // FIXME: obsolete #include @@ -94,7 +94,7 @@ static TQFontDatabase *fontDataBase = 0; TQString assistantPath(); -#ifdef Q_WS_MAC +#ifdef TQ_WS_MAC #include static void setupStyle(TQWidget *w) { @@ -119,11 +119,11 @@ static TQStringList getFontList() fontDataBase = new TQFontDatabase; qAddPostRoutine( cleanupFontDatabase ); } - return fontDataBase->families(); + return fontDataBase->tqfamilies(); } -class PropertyWhatsThis : public QWhatsThis +class PropertyWhatsThis : public TQWhatsThis { public: PropertyWhatsThis( PropertyList *l ); @@ -148,7 +148,7 @@ TQString PropertyWhatsThis::text( const TQPoint &pos ) bool PropertyWhatsThis::clicked( const TQString& href ) { if ( !href.isEmpty() ) { - QAssistantClient *ac = MainWindow::self->assistantClient(); + TQAssistantClient *ac = MainWindow::self->assistantClient(); ac->showPage( TQString( qInstallPathDocs() ) + "/html/" + href ); } return FALSE; // do not hide window @@ -167,7 +167,7 @@ bool PropertyWhatsThis::clicked( const TQString& href ) */ /*! If this item should be a child of another property item, specify - \a prop as the parent item. + \a prop as the tqparent item. */ PropertyItem::PropertyItem( PropertyList *l, PropertyItem *after, PropertyItem *prop, const TQString &propName ) @@ -184,7 +184,7 @@ PropertyItem::PropertyItem( PropertyList *l, PropertyItem *after, PropertyItem * PropertyItem::~PropertyItem() { if ( resetButton ) - delete resetButton->parentWidget(); + delete resetButton->tqparentWidget(); resetButton = 0; } @@ -234,8 +234,8 @@ void PropertyItem::paintCell( TQPainter *p, const TQColorGroup &cg, int column, { TQColorGroup g( cg ); g.setColor( TQColorGroup::Base, backgroundColor() ); - g.setColor( TQColorGroup::Foreground, Qt::black ); - g.setColor( TQColorGroup::Text, Qt::black ); + g.setColor( TQColorGroup::Foreground, TQt::black ); + g.setColor( TQColorGroup::Text, TQt::black ); int indent = 0; if ( column == 0 ) { indent = 20 + ( property ? 20 : 0 ); @@ -294,7 +294,7 @@ void PropertyItem::paintBranches( TQPainter * p, const TQColorGroup & cg, void PropertyItem::paintFocus( TQPainter *p, const TQColorGroup &cg, const TQRect &r ) { p->save(); - TQApplication::style().drawPrimitive(TQStyle::PE_Panel, p, r, cg, + TQApplication::tqstyle().tqdrawPrimitive(TQStyle::PE_Panel, p, r, cg, TQStyle::Style_Sunken, TQStyleOption(1,1) ); p->restore(); } @@ -308,7 +308,7 @@ bool PropertyItem::hasSubItems() const return FALSE; } -/*! Returns the parent property item here if this is a child or 0 +/*! Returns the tqparent property item here if this is a child or 0 otherwise. */ @@ -329,17 +329,17 @@ void PropertyItem::setOpen( bool b ) open = b; if ( !open ) { - children.setAutoDelete( TRUE ); - children.clear(); - children.setAutoDelete( FALSE ); - qApp->processEvents(); + tqchildren.setAutoDelete( TRUE ); + tqchildren.clear(); + tqchildren.setAutoDelete( FALSE ); + tqApp->processEvents(); listview->updateEditorSize(); return; } createChildren(); initChildren(); - qApp->processEvents(); + tqApp->processEvents(); listview->updateEditorSize(); } @@ -349,7 +349,7 @@ void PropertyItem::setOpen( bool b ) void PropertyItem::showEditor() { createResetButton(); - resetButton->parentWidget()->show(); + resetButton->tqparentWidget()->show(); } /*! Subclasses have to hide the editor of the item here @@ -358,7 +358,7 @@ void PropertyItem::showEditor() void PropertyItem::hideEditor() { createResetButton(); - resetButton->parentWidget()->hide(); + resetButton->tqparentWidget()->hide(); } /*! This is called to init the value of the item. Reimplement in @@ -387,7 +387,7 @@ void PropertyItem::setChanged( bool b, bool updateDb ) if ( changed == b ) return; changed = b; - repaint(); + tqrepaint(); if ( updateDb ) { MetaDataBase::setPropertyChanged( listview->propertyEditor()->widget(), name(), changed ); } @@ -402,7 +402,7 @@ TQString PropertyItem::name() const void PropertyItem::createResetButton() { if ( resetButton ) { - resetButton->parentWidget()->lower(); + resetButton->tqparentWidget()->lower(); return; } const TQPixmap DesignerResetPix = SmallIcon( "designer_resetproperty.png" , KDevDesignerPartFactory::instance()); @@ -413,8 +413,8 @@ void PropertyItem::createResetButton() resetButton = new TQPushButton( hbox ); setupStyle( resetButton ); resetButton->setPixmap( DesignerResetPix ); - resetButton->setFixedWidth( resetButton->sizeHint().width() ); - hbox->layout()->setAlignment( Qt::AlignRight ); + resetButton->setFixedWidth( resetButton->tqsizeHint().width() ); + hbox->tqlayout()->tqsetAlignment( TQt::AlignRight ); listview->addChild( hbox ); hbox->hide(); TQObject::connect( resetButton, TQT_SIGNAL( clicked() ), @@ -441,13 +441,13 @@ void PropertyItem::updateResetButtonState() void PropertyItem::placeEditor( TQWidget *w ) { createResetButton(); - TQRect r = listview->itemRect( this ); + TQRect r = listview->tqitemRect( this ); if ( !r.size().isValid() ) { listview->ensureItemVisible( this ); -#if defined(Q_WS_WIN) - listview->repaintContents( FALSE ); +#if defined(TQ_WS_WIN) + listview->tqrepaintContents( FALSE ); #endif - r = listview->itemRect( this ); + r = listview->tqitemRect( this ); } r.setX( listview->header()->sectionPos( 1 ) ); r.setWidth( listview->header()->sectionSize( 1 ) - 1 ); @@ -455,9 +455,9 @@ void PropertyItem::placeEditor( TQWidget *w ) r = TQRect( listview->viewportToContents( r.topLeft() ), r.size() ); w->resize( r.size() ); listview->moveChild( w, r.x(), r.y() ); - resetButton->parentWidget()->resize( resetButton->sizeHint().width() + 10, r.height() ); - listview->moveChild( resetButton->parentWidget(), r.x() + r.width() - 8, r.y() ); - resetButton->setFixedHeight( QMAX( 0, r.height() - 3 ) ); + resetButton->tqparentWidget()->resize( resetButton->tqsizeHint().width() + 10, r.height() ); + listview->moveChild( resetButton->tqparentWidget(), r.x() + r.width() - 8, r.y() ); + resetButton->setFixedHeight( TQMAX( 0, r.height() - 3 ) ); } /*! This should be called by subclasses if the user changed the value @@ -491,18 +491,18 @@ void PropertyItem::childValueChanged( PropertyItem * ) void PropertyItem::addChild( PropertyItem *i ) { - children.append( i ); + tqchildren.append( i ); } int PropertyItem::childCount() const { - return children.count(); + return tqchildren.count(); } PropertyItem *PropertyItem::child( int i ) const { // ARRRRRRRRG - return ( (PropertyItem*)this )->children.at( i ); + return ( (PropertyItem*)this )->tqchildren.at( i ); } /*! If the contents of the item is not displayable with a text, but @@ -525,7 +525,7 @@ void PropertyItem::drawCustomContents( TQPainter *, const TQRect & ) TQString PropertyItem::currentItem() const { - return TQString::null; + return TQString(); } int PropertyItem::currentIntItem() const @@ -548,15 +548,15 @@ int PropertyItem::currentIntItemFromObject() const TQString PropertyItem::currentItemFromObject() const { - return TQString::null; + return TQString(); } void PropertyItem::setFocus( TQWidget *w ) { - if ( !qApp->focusWidget() || + if ( !tqApp->tqfocusWidget() || listview->propertyEditor()->formWindow() && - ( !MainWindow::self->isAFormWindowChild( qApp->focusWidget() ) && - !qApp->focusWidget()->inherits( "Editor" ) ) ) + ( !MainWindow::self->isAFormWindowChild( TQT_TQOBJECT(tqApp->tqfocusWidget()) ) && + !tqApp->tqfocusWidget()->inherits( "Editor" ) ) ) w->setFocus(); } @@ -564,7 +564,7 @@ void PropertyItem::setText( int col, const TQString &t ) { TQString txt( t ); if ( col == 1 ) - txt = txt.replace( "\n", " " ); + txt = txt.tqreplace( "\n", " " ); TQListViewItem::setText( col, txt ); } @@ -598,7 +598,7 @@ TQLineEdit *PropertyTextItem::lined() if ( asciiOnly ) { if ( PropertyItem::name() == "name" ) { - lin->setValidator( new AsciiValidator( TQString(":"), lin, "ascii_validator" ) ); + lin->setValidator( new AsciiValidator( TQString(":"), TQT_TQOBJECT(lin), "ascii_validator" ) ); if ( listview->propertyEditor()->formWindow()->isFake() ) lin->setEnabled( FALSE ); } else { @@ -606,7 +606,7 @@ TQLineEdit *PropertyTextItem::lined() "\xa1\xa2\xa3\xa4\xa5\xa6\xa7\xa8\xa9" "\xaa\xab\xac\xad\xae\xaf\xb1\xb2\xb3" "\xb4\xb5\xb6\xb7\xb8\xb9\xba\xbb\xbc" - "\xbd\xbe\xbf"), lin, "ascii_validator" ) ); + "\xbd\xbe\xbf"), TQT_TQOBJECT(lin), "ascii_validator" ) ); } } if ( !hasMultiLines ) { lin->hide(); @@ -753,7 +753,7 @@ void PropertyTextItem::setValue() void PropertyTextItem::getText() { - bool richText = !::qt_cast(listview->propertyEditor()->widget()) || + bool richText = !::tqqt_cast(listview->propertyEditor()->widget()) || ( text( 0 ) == "whatsThis" ); bool doWrap = FALSE; TQString txt = MultiLineEditor::getText( listview, value().toString(), richText, &doWrap ); @@ -781,7 +781,7 @@ TQLineEdit *PropertyDoubleItem::lined() if ( lin ) return lin; lin = new TQLineEdit( listview->viewport() ); - lin->setValidator( new TQDoubleValidator( lin, "double_validator" ) ); + lin->setValidator( new TQDoubleValidator( TQT_TQOBJECT(lin), "double_validator" ) ); connect( lin, TQT_SIGNAL( returnPressed() ), this, TQT_SLOT( setValue() ) ); @@ -856,11 +856,11 @@ PropertyDateItem::PropertyDateItem( PropertyList *l, PropertyItem *after, Proper lin = 0; } -QDateEdit *PropertyDateItem::lined() +TQDateEdit *PropertyDateItem::lined() { if ( lin ) return lin; - lin = new QDateEdit( listview->viewport() ); + lin = new TQDateEdit( listview->viewport() ); TQObjectList *l = lin->queryList( TQLINEEDIT_OBJECT_NAME_STRING ); for ( TQObject *o = l->first(); o; o = l->next() ) o->installEventFilter( listview ); @@ -872,7 +872,7 @@ QDateEdit *PropertyDateItem::lined() PropertyDateItem::~PropertyDateItem() { - delete (QDateEdit*)lin; + delete (TQDateEdit*)lin; lin = 0; } @@ -931,11 +931,11 @@ PropertyTimeItem::PropertyTimeItem( PropertyList *l, PropertyItem *after, Proper lin = 0; } -QTimeEdit *PropertyTimeItem::lined() +TQTimeEdit *PropertyTimeItem::lined() { if ( lin ) return lin; - lin = new QTimeEdit( listview->viewport() ); + lin = new TQTimeEdit( listview->viewport() ); connect( lin, TQT_SIGNAL( valueChanged( const TQTime & ) ), this, TQT_SLOT( setValue() ) ); TQObjectList *l = lin->queryList( TQLINEEDIT_OBJECT_NAME_STRING ); @@ -947,7 +947,7 @@ QTimeEdit *PropertyTimeItem::lined() PropertyTimeItem::~PropertyTimeItem() { - delete (QTimeEdit*)lin; + delete (TQTimeEdit*)lin; lin = 0; } @@ -1006,11 +1006,11 @@ PropertyDateTimeItem::PropertyDateTimeItem( PropertyList *l, PropertyItem *after lin = 0; } -QDateTimeEdit *PropertyDateTimeItem::lined() +TQDateTimeEdit *PropertyDateTimeItem::lined() { if ( lin ) return lin; - lin = new QDateTimeEdit( listview->viewport() ); + lin = new TQDateTimeEdit( listview->viewport() ); connect( lin, TQT_SIGNAL( valueChanged( const TQDateTime & ) ), this, TQT_SLOT( setValue() ) ); TQObjectList *l = lin->queryList( TQLINEEDIT_OBJECT_NAME_STRING ); @@ -1022,7 +1022,7 @@ QDateTimeEdit *PropertyDateTimeItem::lined() PropertyDateTimeItem::~PropertyDateTimeItem() { - delete (QDateTimeEdit*)lin; + delete (TQDateTimeEdit*)lin; lin = 0; } @@ -1635,8 +1635,8 @@ PropertyPixmapItem::PropertyPixmapItem( PropertyList *l, PropertyItem *after, Pr box = new TQHBox( listview->viewport() ); box->hide(); pixPrev = new TQLabel( box ); - pixPrev->setSizePolicy( TQSizePolicy( TQSizePolicy::Ignored, TQSizePolicy::Minimum ) ); - pixPrev->setBackgroundColor( pixPrev->colorGroup().color( TQColorGroup::Base ) ); + pixPrev->tqsetSizePolicy( TQSizePolicy( TQSizePolicy::Ignored, TQSizePolicy::Minimum ) ); + pixPrev->setBackgroundColor( pixPrev->tqcolorGroup().color( TQColorGroup::Base ) ); button = new TQPushButton( "...", box ); setupStyle( button ); button->setFixedWidth( 20 ); @@ -1679,7 +1679,7 @@ void PropertyPixmapItem::setValue( const TQVariant &v ) else pixPrev->setPixmap( v.toImage() ); PropertyItem::setValue( v ); - repaint(); + tqrepaint(); } void PropertyPixmapItem::getPixmap() @@ -1714,8 +1714,8 @@ void PropertyPixmapItem::drawCustomContents( TQPainter *p, const TQRect &r ) if ( !pix.isNull() ) { p->save(); - p->setClipRect( TQRect( TQPoint( (int)(p->worldMatrix().dx() + r.x()), - (int)(p->worldMatrix().dy() + r.y()) ), + p->setClipRect( TQRect( TQPoint( (int)(p->tqworldMatrix().dx() + r.x()), + (int)(p->tqworldMatrix().dy() + r.y()) ), r.size() ) ); p->drawPixmap( r.x(), r.y() + ( r.height() - pix.height() ) / 2, pix ); p->restore(); @@ -1726,8 +1726,8 @@ void PropertyPixmapItem::drawCustomContents( TQPainter *p, const TQRect &r ) // -------------------------------------------------------------- PropertyColorItem::PropertyColorItem( PropertyList *l, PropertyItem *after, PropertyItem *prop, - const TQString &propName, bool children ) - : PropertyItem( l, after, prop, propName ), withChildren( children ) + const TQString &propName, bool tqchildren ) + : PropertyItem( l, after, prop, propName ), withChildren( tqchildren ) { box = new TQHBox( listview->viewport() ); box->hide(); @@ -1829,7 +1829,7 @@ void PropertyColorItem::childValueChanged( PropertyItem *child ) void PropertyColorItem::getColor() { - TQColor c = QColorDialog::getColor( val.asColor(), listview ); + TQColor c = TQColorDialog::getColor( val.asColor(), listview ); if ( c.isValid() ) { setValue( c ); notifyValueChange(); @@ -1945,7 +1945,7 @@ void PropertyFontItem::setValue( const TQVariant &v ) void PropertyFontItem::getFont() { bool ok = FALSE; - TQFont f = QFontDialog::getFont( &ok, val.toFont(), listview ); + TQFont f = TQFontDialog::getFont( &ok, val.toFont(), listview ); if ( ok && f != val.toFont() ) { setValue( f ); notifyValueChange(); @@ -2013,7 +2013,7 @@ void PropertyDatabaseItem::createChildren() void PropertyDatabaseItem::initChildren() { -#ifndef QT_NO_SQL +#ifndef TQT_NO_SQL PropertyItem *item = 0; TQStringList lst = value().toStringList(); TQString conn, table; @@ -2026,13 +2026,13 @@ void PropertyDatabaseItem::initChildren() else if ( lst.count() > 0 ) item->setValue( TQStringList( lst[ 0 ] ) ); else if ( withField ) - item->setValue( TQStringList( MetaDataBase::fakeProperty( listview->propertyEditor()->formWindow()->mainContainer(), + item->setValue( TQStringList( MetaDataBase::fakeProperty( TQT_TQOBJECT(listview->propertyEditor()->formWindow()->mainContainer()), "database" ).toStringList()[ 0 ] ) ); if ( lst.count() > 0 && !lst[ 0 ].isEmpty() ) item->setCurrentItem( lst[ 0 ] ); else if ( !isChanged() && withField ) - item->setCurrentItem( MetaDataBase::fakeProperty( listview->propertyEditor()->formWindow()->mainContainer(), + item->setCurrentItem( MetaDataBase::fakeProperty( TQT_TQOBJECT(listview->propertyEditor()->formWindow()->mainContainer()), "database" ).toStringList()[ 0 ] ); else item->setCurrentItem( 0 ); @@ -2044,7 +2044,7 @@ void PropertyDatabaseItem::initChildren() else if ( lst.count() > 1 ) item->setValue( TQStringList( lst[ 1 ] ) ); else if ( withField ) { - TQStringList fakeLst = MetaDataBase::fakeProperty( listview->propertyEditor()->formWindow()->mainContainer(), "database" ).toStringList(); + TQStringList fakeLst = MetaDataBase::fakeProperty( TQT_TQOBJECT(listview->propertyEditor()->formWindow()->mainContainer()), "database" ).toStringList(); if ( fakeLst.count() > 1 ) item->setValue( fakeLst[ 1 ] ); } @@ -2052,7 +2052,7 @@ void PropertyDatabaseItem::initChildren() if ( lst.count() > 1 && !lst[ 1 ].isEmpty() ) item->setCurrentItem( lst[ 1 ] ); else if ( !isChanged() && withField ) { - TQStringList fakeLst = MetaDataBase::fakeProperty( listview->propertyEditor()->formWindow()->mainContainer(), "database" ).toStringList(); + TQStringList fakeLst = MetaDataBase::fakeProperty( TQT_TQOBJECT(listview->propertyEditor()->formWindow()->mainContainer()), "database" ).toStringList(); if ( fakeLst.count() > 1 ) item->setCurrentItem( fakeLst[ 1 ] ); else @@ -2115,7 +2115,7 @@ bool PropertyDatabaseItem::hasSubItems() const void PropertyDatabaseItem::childValueChanged( PropertyItem *c ) { -#ifndef QT_NO_SQL +#ifndef TQT_NO_SQL TQStringList lst; lst << ( (PropertyListItem*)PropertyItem::child( 0 ) )->currentItem() << ( (PropertyListItem*)PropertyItem::child( 1 ) )->currentItem(); @@ -2224,7 +2224,7 @@ void PropertySizePolicyItem::setValue( const TQVariant &v ) return; TQString s = i18n( "%1/%2/%3/%4" ); - s = s.arg( size_type_to_string( v.toSizePolicy().horData() ) ). + s = s.tqarg( size_type_to_string( v.toSizePolicy().horData() ) ). arg( size_type_to_string( v.toSizePolicy().verData() ) ). arg( v.toSizePolicy().horStretch() ). arg( v.toSizePolicy().verStretch() ); @@ -2298,7 +2298,7 @@ void PropertyPaletteItem::setValue( const TQVariant &v ) TQString s; palettePrev->setPalette( v.toPalette() ); PropertyItem::setValue( v ); - repaint(); + tqrepaint(); } void PropertyPaletteItem::getPalette() @@ -2307,11 +2307,11 @@ void PropertyPaletteItem::getPalette() return; bool ok = FALSE; TQWidget *w = (TQWidget*)listview->propertyEditor()->widget(); - if ( ::qt_cast(w) ) + if ( ::tqqt_cast(w) ) w = ( (TQScrollView*)w )->viewport(); TQPalette pal = PaletteEditor::getPalette( &ok, val.toPalette(), -#if defined(QT_NON_COMMERCIAL) - w->backgroundMode(), listview->topLevelWidget(), +#if defined(TQT_NON_COMMERCIAL) + w->backgroundMode(), listview->tqtopLevelWidget(), #else w->backgroundMode(), listview, #endif @@ -2331,8 +2331,8 @@ void PropertyPaletteItem::drawCustomContents( TQPainter *p, const TQRect &r ) { TQPalette pal( value().toPalette() ); p->save(); - p->setClipRect( TQRect( TQPoint( (int)(p->worldMatrix().dx() + r.x()), - (int)(p->worldMatrix().dy() + r.y()) ), + p->setClipRect( TQRect( TQPoint( (int)(p->tqworldMatrix().dx() + r.x()), + (int)(p->tqworldMatrix().dy() + r.y()) ), r.size() ) ); TQRect r2( r ); r2.setX( r2.x() + 2 ); @@ -2382,16 +2382,16 @@ TQComboBox *PropertyCursorItem::combo() comb->insertItem( CrossPix, i18n("Cross"), TQObject::CrossCursor ); comb->insertItem( WaitPix, i18n("Waiting"), TQObject::WaitCursor ); comb->insertItem( IBeamPix, i18n("iBeam"), TQObject::IbeamCursor ); - comb->insertItem( SizeVPix, i18n("Size Vertical"), TQObject::SizeVerCursor ); - comb->insertItem( SizeHPix, i18n("Size Horizontal"), TQObject::SizeHorCursor ); + comb->insertItem( SizeVPix, i18n("SizeQt::Vertical"), TQObject::SizeVerCursor ); + comb->insertItem( SizeHPix, i18n("SizeQt::Horizontal"), TQObject::SizeHorCursor ); comb->insertItem( SizeFPix, i18n("Size Slash"), TQObject::SizeBDiagCursor ); comb->insertItem( SizeBPix, i18n("Size Backslash"), TQObject::SizeFDiagCursor ); comb->insertItem( SizeAllPix, i18n("Size All"), TQObject::SizeAllCursor ); cur = TQBitmap( 25, 25, 1 ); cur.setMask( cur ); comb->insertItem( cur, i18n("Blank"), TQObject::BlankCursor ); - comb->insertItem( VSplitPix, i18n("Split Vertical"), TQObject::SplitVCursor ); - comb->insertItem( HSplitPix, i18n("Split Horizontal"), TQObject::SplitHCursor ); + comb->insertItem( VSplitPix, i18n("SplitQt::Vertical"), TQObject::SplitVCursor ); + comb->insertItem( HSplitPix, i18n("SplitQt::Horizontal"), TQObject::SplitHCursor ); comb->insertItem( HandPix, i18n("Pointing Hand"), TQObject::PointingHandCursor ); comb->insertItem( NoPix, i18n("Forbidden"), TQObject::ForbiddenCursor ); @@ -2411,7 +2411,7 @@ void PropertyCursorItem::showEditor() PropertyItem::showEditor(); if ( !comb ) { combo()->blockSignals( TRUE ); - combo()->setCurrentItem( (int)value().toCursor().shape() ); + combo()->setCurrentItem( (int)value().toCursor().tqshape() ); combo()->blockSignals( FALSE ); } placeEditor( combo() ); @@ -2434,7 +2434,7 @@ void PropertyCursorItem::setValue( const TQVariant &v ) return; combo()->blockSignals( TRUE ); - combo()->setCurrentItem( (int)v.toCursor().shape() ); + combo()->setCurrentItem( (int)v.toCursor().tqshape() ); combo()->blockSignals( FALSE ); setText( 1, combo()->currentText() ); PropertyItem::setValue( v ); @@ -2592,12 +2592,12 @@ void PropertyKeysequenceItem::setValue( const TQVariant &v ) // -------------------------------------------------------------- -EnumPopup::EnumPopup( TQWidget *parent, const char *name, WFlags f ) - : TQFrame( parent, name, f ) +EnumPopup::EnumPopup( TQWidget *tqparent, const char *name, WFlags f ) + : TQFrame( tqparent, name, f ) { setLineWidth( 1 ); setFrameStyle( Panel | Plain ); - setPaletteBackgroundColor( Qt::white ); + setPaletteBackgroundColor( TQt::white ); popLayout = new TQVBoxLayout( this, 3 ); checkBoxList.setAutoDelete( TRUE ); } @@ -2654,8 +2654,8 @@ TQValueList EnumPopup::enumList() const return itemList; } -EnumBox::EnumBox( TQWidget *parent, const char *name ) - : TQComboBox( parent, name ) +EnumBox::EnumBox( TQWidget *tqparent, const char *name ) + : TQComboBox( tqparent, name ) { pop = new EnumPopup( this, "popup", TQObject::WType_Popup ); connect( pop, TQT_SIGNAL( hidden() ), this, TQT_SLOT( popupHidden() ) ); @@ -2678,7 +2678,7 @@ void EnumBox::popupClosed() void EnumBox::paintEvent( TQPaintEvent * ) { TQPainter p( this ); - const TQColorGroup & g = colorGroup(); + const TQColorGroup & g = tqcolorGroup(); p.setPen(g.text()); TQStyle::SFlags flags = TQStyle::Style_Default; @@ -2692,15 +2692,15 @@ void EnumBox::paintEvent( TQPaintEvent * ) &g.brush( TQColorGroup::Button ) ); return; } - style().drawComplexControl( TQStyle::CC_ComboBox, &p, this, rect(), g, + tqstyle().tqdrawComplexControl( TQStyle::CC_ComboBox, &p, this, rect(), g, flags, TQStyle::SC_All, (arrowDown ? TQStyle::SC_ComboBoxArrow : TQStyle::SC_None )); - TQRect re = style().querySubControlMetrics( TQStyle::CC_ComboBox, this, + TQRect re = tqstyle().querySubControlMetrics( TQStyle::CC_ComboBox, this, TQStyle::SC_ComboBoxEditField ); - re = TQStyle::visualRect(re, this); + re = TQStyle::tqvisualRect(re, this); p.setClipRect( re ); if ( !str.isNull() ) { @@ -2730,7 +2730,7 @@ void EnumBox::popup() popupShown = FALSE; return; } - pop->move( ((TQWidget*)parent())->mapToGlobal( geometry().bottomLeft() ) ); + pop->move( ((TQWidget*)tqparent())->mapToGlobal( tqgeometry().bottomLeft() ) ); pop->setMinimumWidth( width() ); emit aboutToShowPopup(); pop->show(); @@ -2739,18 +2739,18 @@ void EnumBox::popup() void EnumBox::mousePressEvent( TQMouseEvent *e ) { - if ( e->button() != LeftButton ) + if ( e->button() != Qt::LeftButton ) return; - TQRect arrowRect = style().querySubControlMetrics( TQStyle::CC_ComboBox, this, + TQRect arrowRect = tqstyle().querySubControlMetrics( TQStyle::CC_ComboBox, this, TQStyle::SC_ComboBoxArrow); - arrowRect = TQStyle::visualRect(arrowRect, this); + arrowRect = TQStyle::tqvisualRect(arrowRect, this); - arrowRect.setHeight( QMAX( height() - (2 * arrowRect.y()), arrowRect.height() ) ); + arrowRect.setHeight( TQMAX( height() - (2 * arrowRect.y()), arrowRect.height() ) ); - if ( arrowRect.contains( e->pos() ) ) { + if ( arrowRect.tqcontains( e->pos() ) ) { arrowDown = TRUE; - repaint( FALSE ); + tqrepaint( FALSE ); } popup(); @@ -2770,13 +2770,13 @@ void EnumBox::keyPressEvent( TQKeyEvent *e ) void EnumBox::restoreArrow() { arrowDown = FALSE; - repaint( FALSE ); + tqrepaint( FALSE ); } void EnumBox::setText( const TQString &text ) { str = text; - repaint( FALSE ); + tqrepaint( FALSE ); } @@ -2847,7 +2847,7 @@ void PropertyEnumItem::setValue() enumString += "|" + (*it).key; } if ( !enumString.isEmpty() ) - enumString.replace( 0, 1, "" ); + enumString.tqreplace( 0, 1, "" ); box->setText( enumString ); setText( 1, enumString ); @@ -2870,7 +2870,7 @@ void PropertyEnumItem::setCurrentValues( TQStrList lst ) } } if ( !enumString.isEmpty() ) - enumString.replace( 0, 1, "" ); + enumString.tqreplace( 0, 1, "" ); box->setText( enumString ); setText( 1, enumString ); } @@ -2982,9 +2982,9 @@ static TQVariant::Type type_to_variant( const TQString &s ) if ( s == "Palette" ) return TQVariant::Palette; if ( s == "ColorGroup" ) - return TQVariant::ColorGroup; + return (QVariant::Type)TQVariant::ColorGroup; if ( s == "IconSet" ) - return TQVariant::IconSet; + return (QVariant::Type)TQVariant::IconSet; if ( s == "Point" ) return TQVariant::Point; if ( s == "Image" ) @@ -2998,9 +2998,9 @@ static TQVariant::Type type_to_variant( const TQString &s ) if ( s == "Double" ) return TQVariant::Double; if ( s == "CString" ) - return TQVariant::CString; + return (QVariant::Type)TQVariant::CString; if ( s == "PointArray" ) - return TQVariant::PointArray; + return (QVariant::Type)TQVariant::PointArray; if ( s == "Region" ) return TQVariant::Region; if ( s == "Bitmap" ) @@ -3018,14 +3018,14 @@ static TQVariant::Type type_to_variant( const TQString &s ) return TQVariant::Invalid; } -#ifndef QT_NO_SQL -static bool parent_is_data_aware( TQWidget *w ) +#ifndef TQT_NO_SQL +static bool tqparent_is_data_aware( TQWidget *w ) { - TQWidget *p = w ? w->parentWidget() : 0; + TQWidget *p = w ? w->tqparentWidget() : 0; while ( p && !p->isTopLevel() ) { - if ( ::qt_cast(p) || ::qt_cast(p) ) + if ( ::tqqt_cast(p) || ::tqqt_cast(p) ) return TRUE; - p = p->parentWidget(); + p = p->tqparentWidget(); } return FALSE; } @@ -3039,26 +3039,26 @@ void PropertyList::setupProperties() { if ( !editor->widget() ) return; - bool allProperties = !::qt_cast(editor->widget()); - TQStrList lst = editor->widget()->metaObject()->propertyNames( allProperties ); + bool allProperties = !::tqqt_cast(editor->widget()); + TQStrList lst = editor->widget()->tqmetaObject()->propertyNames( allProperties ); PropertyItem *item = 0; TQMap unique; TQObject *w = editor->widget(); TQStringList valueSet; - bool parentHasLayout = + bool tqparentHasLayout = w->isWidgetType() && - !editor->formWindow()->isMainContainer( (TQWidget*)w ) && ( (TQWidget*)w )->parentWidget() && - WidgetFactory::layoutType( ( (TQWidget*)w )->parentWidget() ) != WidgetFactory::NoLayout; + !editor->formWindow()->isMainContainer( TQT_TQOBJECT(w) ) && ( (TQWidget*)w )->tqparentWidget() && + WidgetFactory::tqlayoutType( ( (TQWidget*)w )->tqparentWidget() ) != WidgetFactory::NoLayout; for ( TQPtrListIterator it( lst ); it.current(); ++it ) { const TQMetaProperty* p = - editor->widget()->metaObject()-> - property( editor->widget()->metaObject()->findProperty( it.current(), allProperties), allProperties ); + editor->widget()->tqmetaObject()-> + property( editor->widget()->tqmetaObject()->tqfindProperty( it.current(), allProperties), allProperties ); if ( !p ) continue; - if ( unique.contains( TQString::fromLatin1( it.current() ) ) ) + if ( unique.tqcontains( TQString::tqfromLatin1( it.current() ) ) ) continue; - if ( ::qt_cast(editor->widget()) || - ::qt_cast(editor->widget()) ) { + if ( ::tqqt_cast(editor->widget()) || + ::tqqt_cast(editor->widget()) ) { if ( qstrcmp( p->name(), "minimumHeight" ) == 0 ) continue; if ( qstrcmp( p->name(), "minimumWidth" ) == 0 ) @@ -3071,14 +3071,14 @@ void PropertyList::setupProperties() continue; if ( qstrcmp( p->name(), "sizePolicy" ) == 0 ) continue; - if ( qstrcmp( p->name(), "minimumSize" ) == 0 ) + if ( qstrcmp( p->name(), "tqminimumSize" ) == 0 ) continue; - if ( qstrcmp( p->name(), "maximumSize" ) == 0 ) + if ( qstrcmp( p->name(), "tqmaximumSize" ) == 0 ) continue; } - unique.insert( TQString::fromLatin1( it.current() ), TRUE ); + unique.insert( TQString::tqfromLatin1( it.current() ), TRUE ); if ( editor->widget()->isWidgetType() && - editor->formWindow()->isMainContainer( (TQWidget*)editor->widget() ) ) { + editor->formWindow()->isMainContainer( TQT_TQOBJECT(editor->widget()) ) ) { if ( qstrcmp( p->name(), "geometry" ) == 0 ) continue; } else { // hide some toplevel-only stuff @@ -3092,9 +3092,9 @@ void PropertyList::setupProperties() continue; if ( qstrcmp( p->name(), "baseSize" ) == 0 ) continue; - if ( parentHasLayout && qstrcmp( p->name(), "geometry" ) == 0 ) + if ( tqparentHasLayout && qstrcmp( p->name(), "geometry" ) == 0 ) continue; - if ( ::qt_cast(w) || ::qt_cast(w) ) { + if ( ::tqqt_cast(w) || ::tqqt_cast(w) ) { if ( qstrcmp( p->name(), "sizePolicy" ) == 0 ) continue; if ( qstrcmp( p->name(), "minimumHeight" ) == 0 ) @@ -3107,9 +3107,9 @@ void PropertyList::setupProperties() continue; if ( qstrcmp( p->name(), "geometry" ) == 0 ) continue; - if ( qstrcmp( p->name(), "minimumSize" ) == 0 ) + if ( qstrcmp( p->name(), "tqminimumSize" ) == 0 ) continue; - if ( qstrcmp( p->name(), "maximumSize" ) == 0 ) + if ( qstrcmp( p->name(), "tqmaximumSize" ) == 0 ) continue; if ( qstrcmp( p->name(), "enabled" ) == 0 ) continue; @@ -3137,7 +3137,7 @@ void PropertyList::setupProperties() continue; } } - if ( ::qt_cast(w) ) { + if ( ::tqqt_cast(w) ) { if ( qstrcmp( p->name(), "usesDropDown" ) == 0 ) continue; if ( qstrcmp( p->name(), "toggleAction" ) == 0 ) @@ -3151,10 +3151,10 @@ void PropertyList::setupProperties() continue; if ( qstrcmp( p->name(), "maximumWidth" ) == 0 ) continue; - if ( qstrcmp( p->name(), "buttonGroupId" ) == 0 ) { // #### remove this when designable in Q_PROPERTY can take a function (isInButtonGroup() in this case) + if ( qstrcmp( p->name(), "buttonGroupId" ) == 0 ) { // #### remove this when designable in TQ_PROPERTY can take a function (isInButtonGroup() in this case) if ( !editor->widget()->isWidgetType() || - !editor->widget()->parent() || - !::qt_cast(editor->widget()->parent()) ) + !editor->widget()->tqparent() || + !::tqqt_cast(editor->widget()->tqparent()) ) continue; } @@ -3164,7 +3164,7 @@ void PropertyList::setupProperties() isPropertyObject && p->designable( ( (PropertyObject*)w )->widgetList().first() ) ) && ( !isPropertyObject || qstrcmp( p->name(), "name" ) != 0 ) ) { if ( p->isSetType() ) { - if ( TQString( p->name() ) == "alignment" ) { + if ( TQString( p->name() ) == "tqalignment" ) { TQStringList lst; lst << p->valueToKey( AlignAuto ) << p->valueToKey( AlignLeft ) @@ -3176,7 +3176,7 @@ void PropertyList::setupProperties() setPropertyValue( item ); if ( MetaDataBase::isPropertyChanged( editor->widget(), "hAlign" ) ) item->setChanged( TRUE, FALSE ); - if ( !::qt_cast(editor->widget()) ) { + if ( !::tqqt_cast(editor->widget()) ) { lst.clear(); lst << p->valueToKey( AlignTop ) << p->valueToKey( AlignVCenter ) @@ -3187,7 +3187,7 @@ void PropertyList::setupProperties() if ( MetaDataBase::isPropertyChanged( editor->widget(), "vAlign" ) ) item->setChanged( TRUE, FALSE ); item = new PropertyBoolItem( this, item, 0, "wordwrap" ); - if ( ::qt_cast(w) ) + if ( ::tqqt_cast(w) ) item->setVisible( FALSE ); setPropertyValue( item ); if ( MetaDataBase::isPropertyChanged( editor->widget(), "wordwrap" ) ) @@ -3212,7 +3212,7 @@ void PropertyList::setupProperties() TQStringList lst; for ( uint i = 0; i < l.count(); ++i ) { TQString k = l.at( i ); - // filter out enum-masks + // filter out enum-tqmasks if ( k[0] == 'M' && k[1].category() == TQChar::Letter_Uppercase ) continue; lst << k; @@ -3226,7 +3226,7 @@ void PropertyList::setupProperties() } } if ( item && !p->isSetType() ) { - if ( valueSet.findIndex( item->name() ) == -1 ) { + if ( valueSet.tqfindIndex( item->name() ) == -1 ) { setPropertyValue( item ); valueSet << item->name(); } @@ -3235,25 +3235,25 @@ void PropertyList::setupProperties() } } - if ( !::qt_cast(w) && !::qt_cast(w) && !::qt_cast(w) && - w->isWidgetType() && WidgetFactory::layoutType( (TQWidget*)w ) != WidgetFactory::NoLayout ) { - item = new PropertyLayoutItem( this, item, 0, "layoutSpacing" ); + if ( !::tqqt_cast(w) && !::tqqt_cast(w) && !::tqqt_cast(w) && + w->isWidgetType() && WidgetFactory::tqlayoutType( (TQWidget*)w ) != WidgetFactory::NoLayout ) { + item = new PropertyLayoutItem( this, item, 0, "tqlayoutSpacing" ); setPropertyValue( item ); - if ( MetaDataBase::isPropertyChanged( editor->widget(), "layoutSpacing" ) + if ( MetaDataBase::isPropertyChanged( editor->widget(), "tqlayoutSpacing" ) || MetaDataBase::spacing( editor->widget() ) != -1 ) - layoutInitValue( item, TRUE ); + tqlayoutInitValue( item, TRUE ); else - layoutInitValue( item ); - item = new PropertyLayoutItem( this, item, 0, "layoutMargin" ); + tqlayoutInitValue( item ); + item = new PropertyLayoutItem( this, item, 0, "tqlayoutMargin" ); setPropertyValue( item ); - if ( MetaDataBase::isPropertyChanged( editor->widget(), "layoutMargin" ) + if ( MetaDataBase::isPropertyChanged( editor->widget(), "tqlayoutMargin" ) || MetaDataBase::margin( editor->widget() ) != -1 ) - layoutInitValue( item, TRUE ); + tqlayoutInitValue( item, TRUE ); else - layoutInitValue( item ); + tqlayoutInitValue( item ); TQWidget *widget = (TQWidget*)w; - if ( ( !::qt_cast(widget) && - widget->parentWidget() && ::qt_cast(widget->parentWidget()) ) ) { + if ( ( !::tqqt_cast(widget) && + widget->tqparentWidget() && ::tqqt_cast(widget->tqparentWidget()) ) ) { item = new PropertyListItem( this, item, 0, "resizeMode", FALSE ); TQStringList lst; lst << "Auto" << "FreeResize" << "Minimum" << "Fixed"; @@ -3268,8 +3268,8 @@ void PropertyList::setupProperties() } } - if ( !::qt_cast(w) && !::qt_cast(w) && - !::qt_cast(w) && !::qt_cast(w) ) { + if ( !::tqqt_cast(w) && !::tqqt_cast(w) && + !::tqqt_cast(w) && !::tqqt_cast(w) ) { item = new PropertyTextItem( this, item, 0, "toolTip", TRUE, FALSE ); setPropertyValue( item ); if ( MetaDataBase::isPropertyChanged( editor->widget(), "toolTip" ) ) @@ -3280,17 +3280,17 @@ void PropertyList::setupProperties() item->setChanged( TRUE, FALSE ); } -#ifndef QT_NO_SQL - if ( !::qt_cast(editor->widget()) && !::qt_cast(editor->widget()) && - !::qt_cast(editor->widget()) && parent_is_data_aware( ::qt_cast(editor->widget()) ) ) { - item = new PropertyDatabaseItem( this, item, 0, "database", editor->formWindow()->mainContainer() != w ); +#ifndef TQT_NO_SQL + if ( !::tqqt_cast(editor->widget()) && !::tqqt_cast(editor->widget()) && + !::tqqt_cast(editor->widget()) && tqparent_is_data_aware( ::tqqt_cast(editor->widget()) ) ) { + item = new PropertyDatabaseItem( this, item, 0, "database", TQT_BASE_OBJECT(editor->formWindow()->mainContainer()) != TQT_BASE_OBJECT(w) ); setPropertyValue( item ); if ( MetaDataBase::isPropertyChanged( editor->widget(), "database" ) ) item->setChanged( TRUE, FALSE ); } - if ( ::qt_cast(editor->widget()) || ::qt_cast(editor->widget()) || - ::qt_cast(editor->widget()) ) { + if ( ::tqqt_cast(editor->widget()) || ::tqqt_cast(editor->widget()) || + ::tqqt_cast(editor->widget()) ) { item = new PropertyDatabaseItem( this, item, 0, "database", FALSE ); setPropertyValue( item ); if ( MetaDataBase::isPropertyChanged( editor->widget(), "database" ) ) @@ -3324,7 +3324,7 @@ void PropertyList::setupProperties() sort(); setSorting( -1 ); setCurrentItem( firstChild() ); - qApp->processEvents(); + tqApp->processEvents(); } updateEditorSize(); @@ -3339,7 +3339,7 @@ void PropertyList::setupCusWidgetProperties( MetaDataBase::CustomWidget *cw, for ( TQValueList::Iterator it = cw->lstProperties.begin(); it != cw->lstProperties.end(); ++it ) { - if ( unique.contains( TQString( (*it).property ) ) ) + if ( unique.tqcontains( TQString( (*it).property ) ) ) continue; unique.insert( TQString( (*it).property ), TRUE ); addPropertyItem( item, (*it).property, type_to_variant( (*it).type ) ); @@ -3359,7 +3359,7 @@ bool PropertyList::addPropertyItem( PropertyItem *&item, const TQCString &name, l << ""; while ( it.current() ) { if ( editor->formWindow()->canBeBuddy( it.current() ) ) { - if ( l.find( it.current()->name() ) == l.end() ) + if ( l.tqfind( it.current()->name() ) == l.end() ) l << it.current()->name(); } ++it; @@ -3373,14 +3373,14 @@ bool PropertyList::addPropertyItem( PropertyItem *&item, const TQCString &name, switch ( t ) { case TQVariant::String: item = new PropertyTextItem( this, item, 0, name, TRUE, - ::qt_cast(editor->widget()) || - ::qt_cast(editor->widget()) || - ::qt_cast(editor->widget()) ); + ::tqqt_cast(editor->widget()) || + ::tqqt_cast(editor->widget()) || + ::tqqt_cast(editor->widget()) ); break; case TQVariant::CString: item = new PropertyTextItem( this, item, 0, name, name == "name" && - editor->widget() == editor->formWindow()->mainContainer(), + TQT_BASE_OBJECT(editor->widget()) == TQT_BASE_OBJECT(editor->formWindow()->mainContainer()), FALSE, TRUE ); break; case TQVariant::Bool: @@ -3392,7 +3392,7 @@ bool PropertyList::addPropertyItem( PropertyItem *&item, const TQCString &name, case TQVariant::Int: if ( name == "accel" ) item = new PropertyTextItem( this, item, 0, name, FALSE, FALSE, FALSE, TRUE ); - else if ( name == "layoutSpacing" || name == "layoutMargin" ) + else if ( name == "tqlayoutSpacing" || name == "tqlayoutMargin" ) item = new PropertyLayoutItem( this, item, 0, name ); else if ( name == "resizeMode" ) item = new PropertyListItem( this, item, 0, name, TRUE ); @@ -3486,7 +3486,7 @@ void PropertyList::valueChanged( PropertyItem *i ) { if ( !editor->widget() ) return; - TQString pn( i18n( "Set '%1' of '%2'" ).arg( i->name() ).arg( editor->widget()->name() ) ); + TQString pn( i18n( "Set '%1' of '%2'" ).tqarg( i->name() ).tqarg( editor->widget()->name() ) ); SetPropertyCommand *cmd = new SetPropertyCommand( pn, editor->formWindow(), editor->widget(), editor, i->name(), WidgetFactory::property( editor->widget(), i->name() ), @@ -3496,11 +3496,11 @@ void PropertyList::valueChanged( PropertyItem *i ) editor->formWindow()->commandHistory()->addCommand( cmd, TRUE ); } -void PropertyList::layoutInitValue( PropertyItem *i, bool changed ) +void PropertyList::tqlayoutInitValue( PropertyItem *i, bool changed ) { if ( !editor->widget() ) return; - TQString pn( i18n( "Set '%1' of '%2'" ).arg( i->name() ).arg( editor->widget()->name() ) ); + TQString pn( i18n( "Set '%1' of '%2'" ).tqarg( i->name() ).tqarg( editor->widget()->name() ) ); SetPropertyCommand *cmd = new SetPropertyCommand( pn, editor->formWindow(), editor->widget(), editor, i->name(), WidgetFactory::property( editor->widget(), i->name() ), @@ -3546,15 +3546,15 @@ bool PropertyList::eventFilter( TQObject *o, TQEvent *e ) else if ( e->type() == TQEvent::MouseButtonPress ) theLastEvent = MouseEvent; - if ( o != this &&e->type() == TQEvent::KeyPress ) { + if ( TQT_BASE_OBJECT(o) != TQT_BASE_OBJECT(this) &&e->type() == TQEvent::KeyPress ) { TQKeyEvent *ke = (TQKeyEvent*)e; if ( ( ke->key() == Key_Up || ke->key() == Key_Down ) && - ( o != this || o != viewport() ) && + ( TQT_BASE_OBJECT(o) != TQT_BASE_OBJECT(this) || TQT_BASE_OBJECT(o) != TQT_BASE_OBJECT(viewport()) ) && !( ke->state() & ControlButton ) ) { TQApplication::sendEvent( this, (TQKeyEvent*)e ); return TRUE; - } else if ( ( !::qt_cast(o) || - ( ::qt_cast(o) && ( (TQLineEdit*)o )->isReadOnly() ) ) && + } else if ( ( !::tqqt_cast(o) || + ( ::tqqt_cast(o) && ( (TQLineEdit*)o )->isReadOnly() ) ) && i && i->hasSubItems() ) { if ( !i->isOpen() && ( ke->key() == Key_Plus || @@ -3564,21 +3564,21 @@ bool PropertyList::eventFilter( TQObject *o, TQEvent *e ) ( ke->key() == Key_Minus || ke->key() == Key_Left ) ) i->setOpen( FALSE ); - } else if ( ( ke->key() == Key_Return || ke->key() == Key_Enter ) && ::qt_cast(o) ) { + } else if ( ( ke->key() == Key_Return || ke->key() == Key_Enter ) && ::tqqt_cast(o) ) { TQKeyEvent ke2( TQEvent::KeyPress, Key_Space, 0, 0 ); TQApplication::sendEvent( o, &ke2 ); return TRUE; } - } else if ( e->type() == TQEvent::FocusOut && ::qt_cast(o) && editor->formWindow() ) { + } else if ( e->type() == TQEvent::FocusOut && ::tqqt_cast(o) && editor->formWindow() ) { TQTimer::singleShot( 100, editor->formWindow()->commandHistory(), TQT_SLOT( checkCompressedCommand() ) ); - } else if ( o == viewport() ) { + } else if ( TQT_BASE_OBJECT(o) == TQT_BASE_OBJECT(viewport()) ) { TQMouseEvent *me; PropertyListItem* i; switch ( e->type() ) { case TQEvent::MouseButtonPress: me = (TQMouseEvent*)e; i = (PropertyListItem*) itemAt( me->pos() ); - if ( i && ( ::qt_cast(i) || ::qt_cast(i) ) ) { + if ( i && ( ::tqqt_cast(i) || ::tqqt_cast(i) ) ) { pressItem = i; pressPos = me->pos(); mousePressed = TRUE; @@ -3586,13 +3586,13 @@ bool PropertyList::eventFilter( TQObject *o, TQEvent *e ) break; case TQEvent::MouseMove: me = (TQMouseEvent*)e; - if ( me && me->state() & LeftButton && mousePressed) { + if ( me && me->state() & Qt::LeftButton && mousePressed) { i = (PropertyListItem*) itemAt( me->pos() ); if ( i && i == pressItem ) { if (( pressPos - me->pos() ).manhattanLength() > TQApplication::startDragDistance() ){ - if ( ::qt_cast(i) ) { + if ( ::tqqt_cast(i) ) { TQColor col = i->value().asColor(); TQColorDrag *drg = new TQColorDrag( col, this ); TQPixmap pix( 25, 25 ); @@ -3604,7 +3604,7 @@ bool PropertyList::eventFilter( TQObject *o, TQEvent *e ) mousePressed = FALSE; drg->dragCopy(); } - else if ( ::qt_cast(i) ) { + else if ( ::tqqt_cast(i) ) { TQPixmap pix = i->value().asPixmap(); if( !pix.isNull() ) { TQImage img = pix.convertToImage(); @@ -3621,7 +3621,7 @@ bool PropertyList::eventFilter( TQObject *o, TQEvent *e ) default: break; } - } else if ( o == header() ) { + } else if ( TQT_BASE_OBJECT(o) == TQT_BASE_OBJECT(header()) ) { if ( e->type() == TQEvent::ContextMenu ) { ((TQContextMenuEvent *)e)->accept(); TQPopupMenu menu( 0 ); @@ -3663,7 +3663,7 @@ void PropertyList::refetchData() if ( i->hasSubItems() ) i->initChildren(); bool changed = MetaDataBase::isPropertyChanged( editor->widget(), i->name() ); - if ( ( i->name() == "layoutSpacing" || i->name() == "layoutMargin" ) ) { + if ( ( i->name() == "tqlayoutSpacing" || i->name() == "tqlayoutMargin" ) ) { if ( i->value().toString() != "-1" ) i->setChanged( TRUE, FALSE ); else @@ -3679,9 +3679,9 @@ static void clearAlignList( TQStrList &l ) { if ( l.count() == 1 ) return; - if ( l.find( "AlignAuto" ) != -1 ) + if ( l.tqfind( "AlignAuto" ) != -1 ) l.remove( "AlignAuto" ); - if ( l.find( "WordBreak" ) != -1 ) + if ( l.tqfind( "WordBreak" ) != -1 ) l.remove( "WordBreak" ); } @@ -3692,35 +3692,35 @@ static void clearAlignList( TQStrList &l ) void PropertyList::setPropertyValue( PropertyItem *i ) { const TQMetaProperty *p = - editor->widget()->metaObject()-> - property( editor->widget()->metaObject()->findProperty( i->name(), TRUE), TRUE ); + editor->widget()->tqmetaObject()-> + property( editor->widget()->tqmetaObject()->tqfindProperty( i->name(), TRUE), TRUE ); if ( !p ) { if ( i->name() == "hAlign" ) { - int align = editor->widget()->property( "alignment" ).toInt(); - p = editor->widget()->metaObject()-> - property( editor->widget()->metaObject()->findProperty( "alignment", TRUE ), TRUE ); + int align = editor->widget()->property( "tqalignment" ).toInt(); + p = editor->widget()->tqmetaObject()-> + property( editor->widget()->tqmetaObject()->tqfindProperty( "tqalignment", TRUE ), TRUE ); align &= ~AlignVertical_Mask; TQStrList l = p->valueToKeys( align ); clearAlignList( l ); ( (PropertyListItem*)i )->setCurrentItem( l.last() ); } else if ( i->name() == "vAlign" ) { - int align = editor->widget()->property( "alignment" ).toInt(); - p = editor->widget()->metaObject()-> - property( editor->widget()->metaObject()->findProperty( "alignment", TRUE ), TRUE ); + int align = editor->widget()->property( "tqalignment" ).toInt(); + p = editor->widget()->tqmetaObject()-> + property( editor->widget()->tqmetaObject()->tqfindProperty( "tqalignment", TRUE ), TRUE ); align &= ~AlignHorizontal_Mask; ( (PropertyListItem*)i )->setCurrentItem( p->valueToKeys( align ).last() ); } else if ( i->name() == "wordwrap" ) { - int align = editor->widget()->property( "alignment" ).toInt(); + int align = editor->widget()->property( "tqalignment" ).toInt(); if ( align & WordBreak ) i->setValue( TQVariant( TRUE, 0 ) ); else i->setValue( TQVariant( FALSE, 0 ) ); - } else if ( i->name() == "layoutSpacing" ) { - ( (PropertyLayoutItem*)i )->setValue( MetaDataBase::spacing( WidgetFactory::containerOfWidget( (TQWidget*)editor->widget() ) ) ); - } else if ( i->name() == "layoutMargin" ) { - ( (PropertyLayoutItem*)i )->setValue( MetaDataBase::margin( WidgetFactory::containerOfWidget( (TQWidget*)editor->widget() ) ) ); + } else if ( i->name() == "tqlayoutSpacing" ) { + ( (PropertyLayoutItem*)i )->setValue( MetaDataBase::spacing( TQT_TQOBJECT(WidgetFactory::containerOfWidget( TQT_TQWIDGET(editor->widget()) ) ) )); + } else if ( i->name() == "tqlayoutMargin" ) { + ( (PropertyLayoutItem*)i )->setValue( MetaDataBase::margin( TQT_TQOBJECT(WidgetFactory::containerOfWidget( TQT_TQWIDGET(editor->widget()) ) ) )); } else if ( i->name() == "resizeMode" ) { - ( (PropertyListItem*)i )->setCurrentItem( MetaDataBase::resizeMode( WidgetFactory::containerOfWidget( (TQWidget*)editor->widget() ) ) ); + ( (PropertyListItem*)i )->setCurrentItem( MetaDataBase::resizeMode( TQT_TQOBJECT(WidgetFactory::containerOfWidget( TQT_TQWIDGET(editor->widget()) ) )) ); } else if ( i->name() == "toolTip" || i->name() == "whatsThis" || i->name() == "database" || i->name() == "frameworkCode" ) { i->setValue( MetaDataBase::fakeProperty( editor->widget(), i->name() ) ); } else if ( editor->widget()->inherits( "CustomWidget" ) ) { @@ -3769,7 +3769,7 @@ void PropertyList::resetProperty() PropertyItem *i = (PropertyItem*)currentItem(); if ( !MetaDataBase::isPropertyChanged( editor->widget(), i->PropertyItem::name() ) ) return; - TQString pn( i18n( "Reset '%1' of '%2'" ).arg( i->name() ).arg( editor->widget()->name() ) ); + TQString pn( i18n( "Reset '%1' of '%2'" ).tqarg( i->name() ).tqarg( editor->widget()->name() ) ); SetPropertyCommand *cmd = new SetPropertyCommand( pn, editor->formWindow(), editor->widget(), editor, i->name(), i->value(), @@ -3790,9 +3790,9 @@ void PropertyList::viewportDragEnterEvent( TQDragEnterEvent *e ) return; } - if ( ::qt_cast(i) && TQColorDrag::canDecode( e ) ) + if ( ::tqqt_cast(i) && TQColorDrag::canDecode( e ) ) e->accept(); - else if ( ::qt_cast(i) && TQImageDrag::canDecode( e ) ) + else if ( ::tqqt_cast(i) && TQImageDrag::canDecode( e ) ) e->accept(); else e->ignore(); @@ -3806,9 +3806,9 @@ void PropertyList::viewportDragMoveEvent ( TQDragMoveEvent *e ) return; } - if ( ::qt_cast(i) && TQColorDrag::canDecode( e ) ) + if ( ::tqqt_cast(i) && TQColorDrag::canDecode( e ) ) e->accept(); - else if ( ::qt_cast(i) && TQImageDrag::canDecode( e ) ) + else if ( ::tqqt_cast(i) && TQImageDrag::canDecode( e ) ) e->accept(); else e->ignore(); @@ -3822,14 +3822,14 @@ void PropertyList::viewportDropEvent ( TQDropEvent *e ) return; } - if ( ::qt_cast(i) && TQColorDrag::canDecode( e ) ) { + if ( ::tqqt_cast(i) && TQColorDrag::canDecode( e ) ) { TQColor color; TQColorDrag::decode( e, color ); i->setValue( TQVariant( color ) ); valueChanged( i ); e->accept(); } - else if ( ::qt_cast(i) && TQImageDrag::canDecode( e ) ) { + else if ( ::tqqt_cast(i) && TQImageDrag::canDecode( e ) ) { TQImage img; TQImageDrag::decode( e, img ); TQPixmap pm; @@ -3859,24 +3859,24 @@ void PropertyList::showCurrentWhatsThis() TQString PropertyList::whatsThisText( TQListViewItem *i ) { if ( !i || !editor->widget() ) - return TQString::null; + return TQString(); readPropertyDocs(); if ( ( (PropertyItem*)i )->propertyParent() ) i = ( (PropertyItem*)i )->propertyParent(); - const TQMetaObject *mo = editor->widget()->metaObject(); + const TQMetaObject *mo = editor->widget()->tqmetaObject(); TQString prop = ( (PropertyItem*)i )->name(); while ( mo ) { TQString s; s = TQString( mo->className() ) + "::" + prop; TQMap::Iterator it; - if ( ( it = propertyDocs.find( s ) ) != propertyDocs.end() ) { + if ( ( it = propertyDocs.tqfind( s ) ) != propertyDocs.end() ) { return *it; } - mo = mo->superClass(); + mo = mo->tqsuperClass(); } - return i18n( "

TQWidget::%1

There is no documentation available for this property.

" ).arg( prop ); + return i18n( "

TQWidget::%1

There is no documentation available for this property.

" ).tqarg( prop ); } void PropertyList::readPropertyDocs() @@ -3916,8 +3916,8 @@ PropertyList::LastEventType PropertyList::lastEvent() } // ------------------------------------------------------------ -EventList::EventList( TQWidget *parent, FormWindow *fw, PropertyEditor *e ) - : HierarchyList( parent, fw, TRUE ), editor( e ) +EventList::EventList( TQWidget *tqparent, FormWindow *fw, PropertyEditor *e ) + : HierarchyList( tqparent, fw, TRUE ), editor( e ) { header()->hide(); removeColumn( 1 ); @@ -3929,15 +3929,15 @@ EventList::EventList( TQWidget *parent, FormWindow *fw, PropertyEditor *e ) TQString clean_arguments( const TQString &s ) { TQString slot = s; - TQString arg = slot.mid( slot.find( '(' ) + 1 ); - arg = arg.left( arg.findRev( ')' ) ); + TQString arg = slot.mid( slot.tqfind( '(' ) + 1 ); + arg = arg.left( arg.tqfindRev( ')' ) ); TQStringList args = TQStringList::split( ',', arg ); - slot = slot.left( slot.find( '(' ) + 1 ); + slot = slot.left( slot.tqfind( '(' ) + 1 ); int num = 0; for ( TQStringList::Iterator it = args.begin(); it != args.end(); ++it, ++num ) { TQString a = *it; int i; - if ( ( i =a.find( ':' ) ) == -1 ) + if ( ( i =a.tqfind( ':' ) ) == -1 ) slot += a.simplifyWhiteSpace(); else slot += a.mid( i + 1 ).simplifyWhiteSpace(); @@ -3967,10 +3967,10 @@ void EventList::setup() TQStrListIterator it( sigs ); while ( it.current() ) { HierarchyItem *eventItem = new HierarchyItem( HierarchyItem::Event, this, (HierarchyItem*)0, - it.current(), TQString::null, TQString::null ); + it.current(), TQString(), TQString() ); eventItem->setOpen( TRUE ); TQValueList conns = - MetaDataBase::connections( formWindow, editor->widget(), formWindow->mainContainer() ); + MetaDataBase::connections( TQT_TQOBJECT(formWindow), TQT_TQOBJECT(editor->widget()), TQT_TQOBJECT(formWindow->mainContainer()) ); HierarchyItem *item = 0; for ( TQValueList::Iterator cit = conns.begin(); cit != conns.end(); ++cit ) { @@ -3979,7 +3979,7 @@ void EventList::setup() MetaDataBase::normalizeFunction( clean_arguments( s ) ) ) continue; item = new HierarchyItem( HierarchyItem::EventFunction, eventItem, item, - (*cit).slot, TQString::null, TQString::null ); + (*cit).slot, TQString(), TQString() ); item->setPixmap( 0, DesignerEditSlotsPix ); } ++it; @@ -3991,12 +3991,12 @@ extern TQListViewItem *newItem; void EventList::contentsMouseDoubleClickEvent( TQMouseEvent *e ) { TQListViewItem *i = itemAt( contentsToViewport( e->pos() ) ); - if ( !i || i->parent() ) + if ( !i || i->tqparent() ) return; TQString s; if ( !formWindow->project()->isCpp() ) { TQString s1 = i->text( 0 ); - int pt = s1.find( "(" ); + int pt = s1.tqfind( "(" ); if ( pt != -1 ) s1 = s1.left( pt ); s = TQString( editor->widget()->name() ) + "_" + s1; @@ -4014,7 +4014,7 @@ void EventList::setCurrent( TQWidget * ) void EventList::objectClicked( TQListViewItem *i ) { - if ( !i || !i->parent() ) + if ( !i || !i->tqparent() ) return; // formWindow->clearSelection(false); formWindow->mainWindow()->part()->emitEditFunction(formWindow->fileName(), i->text( 0 )); @@ -4034,20 +4034,20 @@ void EventList::showRMBMenu( TQListViewItem *i, const TQPoint &pos ) if ( res == NEW_ITEM ) { TQString s; if ( !formWindow->project()->isCpp() ) { - TQString s1 = ( i->parent() ? i->parent() : i )->text( 0 ); - int pt = s1.find( "(" ); + TQString s1 = ( i->tqparent() ? i->tqparent() : i )->text( 0 ); + int pt = s1.tqfind( "(" ); if ( pt != -1 ) s1 = s1.left( pt ); s = TQString( editor->widget()->name() ) + "_" + s1; } else { - s = TQString( editor->widget()->name() ) + "_" + ( i->parent() ? i->parent() : i )->text( 0 ); + s = TQString( editor->widget()->name() ) + "_" + ( i->tqparent() ? i->tqparent() : i )->text( 0 ); } - insertEntry( i->parent() ? i->parent() : i, SmallIcon( "designer_editslots.png" , KDevDesignerPartFactory::instance()), s ); - } else if ( res == DEL_ITEM && i->parent() ) { + insertEntry( i->tqparent() ? i->tqparent() : i, SmallIcon( "designer_editslots.png" , KDevDesignerPartFactory::instance()), s ); + } else if ( res == DEL_ITEM && i->tqparent() ) { MetaDataBase::Connection conn; conn.sender = editor->widget(); - conn.receiver = formWindow->mainContainer(); - conn.signal = i->parent()->text( 0 ); + conn.receiver = TQT_TQOBJECT(formWindow->mainContainer()); + conn.signal = i->tqparent()->text( 0 ); conn.slot = i->text( 0 ); delete i; RemoveConnectionCommand *cmd = new RemoveConnectionCommand( i18n( "Remove Connection" ), @@ -4063,9 +4063,9 @@ void EventList::renamed( TQListViewItem *i ) { if ( newItem == i ) newItem = 0; - if ( !i->parent() ) + if ( !i->tqparent() ) return; - TQListViewItem *itm = i->parent()->firstChild(); + TQListViewItem *itm = i->tqparent()->firstChild(); bool del = FALSE; while ( itm ) { if ( itm != i && itm->text( 0 ) == i->text( 0 ) ) { @@ -4080,8 +4080,8 @@ void EventList::renamed( TQListViewItem *i ) } else { MetaDataBase::Connection conn; conn.sender = editor->widget(); - conn.receiver = formWindow->mainContainer(); - conn.signal = i->parent()->text( 0 ); + conn.receiver = TQT_TQOBJECT(formWindow->mainContainer()); + conn.signal = i->tqparent()->text( 0 ); conn.slot = i->text( 0 ); AddConnectionCommand *cmd = new AddConnectionCommand( i18n( "Add Connection" ), formWindow, @@ -4090,9 +4090,9 @@ void EventList::renamed( TQListViewItem *i ) // #### we should look if the specified slot already // exists and if we can connect to this one TQString funcname = i->text( 0 ).latin1(); - if ( funcname.find( '(' ) == -1 ) { // try to create a signature - TQString sig = i->parent()->text( 0 ); - sig = sig.mid( sig.find( '(' ) + 1 ); + if ( funcname.tqfind( '(' ) == -1 ) { // try to create a signature + TQString sig = i->tqparent()->text( 0 ); + sig = sig.mid( sig.tqfind( '(' ) + 1 ); sig.remove( (int)sig.length() - 1, 1 ); LanguageInterface *iface = MetaDataBase::languageInterface( formWindow->project()->language() ); if ( iface ) @@ -4110,7 +4110,7 @@ void EventList::renamed( TQListViewItem *i ) /* MetaDataBase::addFunction( formWindow, funcname.latin1(), "virtual", "public", "slot", formWindow->project()->language(), "void" ); editor->formWindow()->mainWindow()-> - editFunction( i->text( 0 ).left( i->text( 0 ).find( "(" ) ), TRUE );*/ + editFunction( i->text( 0 ).left( i->text( 0 ).tqfind( "(" ) ), TRUE );*/ cmd->execute(); cmd2->execute(); editor->formWindow()->mainWindow()->objectHierarchy()->updateFormDefinitionView(); @@ -4138,8 +4138,8 @@ void EventList::save( TQListViewItem *p ) listview for editing properties. */ -PropertyEditor::PropertyEditor( TQWidget *parent ) - : TQTabWidget( parent, 0, WStyle_Customize | WStyle_NormalBorder | WStyle_Title | +PropertyEditor::PropertyEditor( TQWidget *tqparent ) + : TQTabWidget( tqparent, 0, WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_StaysOnTop | WStyle_Tool |WStyle_MinMax | WStyle_SysMenu ) { setCaption( i18n( "Property Editor" ) ); @@ -4165,11 +4165,11 @@ void PropertyEditor::setWidget( TQObject *w, FormWindow *fw ) // if there is no properties displayed then we really should show them. // to do this check the number of properties in the list. bool ret = (listview->childCount() > 0) ? TRUE : FALSE; - if ( wid->isWidgetType() && WidgetFactory::layoutType( (TQWidget*)wid ) != WidgetFactory::NoLayout ) { + if ( wid->isWidgetType() && WidgetFactory::tqlayoutType( (TQWidget*)wid ) != WidgetFactory::NoLayout ) { TQListViewItemIterator it( listview ); ret = FALSE; while ( it.current() ) { - if ( it.current()->text( 0 ) == "layoutSpacing" || it.current()->text( 0 ) == "layoutMargin" ) { + if ( it.current()->text( 0 ) == "tqlayoutSpacing" || it.current()->text( 0 ) == "tqlayoutMargin" ) { ret = TRUE; break; } @@ -4190,7 +4190,7 @@ void PropertyEditor::setWidget( TQObject *w, FormWindow *fw ) wid = w; formwindow = fw; - setCaption( i18n( "Property Editor (%1)" ).arg( formwindow->name() ) ); + setCaption( i18n( "Property Editor (%1)" ).tqarg( formwindow->name() ) ); listview->viewport()->setUpdatesEnabled( FALSE ); listview->setUpdatesEnabled( FALSE ); clear(); @@ -4262,7 +4262,7 @@ FormWindow *PropertyEditor::formWindow() const TQString PropertyEditor::currentProperty() const { if ( !wid ) - return TQString::null; + return TQString(); if ( ( (PropertyItem*)listview->currentItem() )->propertyParent() ) return ( (PropertyItem*)listview->currentItem() )->propertyParent()->name(); return ( (PropertyItem*)listview->currentItem() )->name(); @@ -4271,24 +4271,24 @@ TQString PropertyEditor::currentProperty() const TQString PropertyEditor::classOfCurrentProperty() const { if ( !wid ) - return TQString::null; + return TQString(); TQObject *o = wid; TQString curr = currentProperty(); - TQMetaObject *mo = o->metaObject(); + TQMetaObject *mo = o->tqmetaObject(); while ( mo ) { TQStrList props = mo->propertyNames( FALSE ); - if ( props.find( curr.latin1() ) != -1 ) + if ( props.tqfind( curr.latin1() ) != -1 ) return mo->className(); - mo = mo->superClass(); + mo = mo->tqsuperClass(); } - return TQString::null; + return TQString(); } -TQMetaObject* PropertyEditor::metaObjectOfCurrentProperty() const +TQMetaObject* PropertyEditor::tqmetaObjectOfCurrentProperty() const { if ( !wid ) return 0; - return wid->metaObject(); + return wid->tqmetaObject(); } void PropertyEditor::resetFocus() @@ -4323,10 +4323,10 @@ void PropertyEditor::setSignalHandlersEnabled( bool b ) void PropertyEditor::updateWindow() { if ( isHidden() && count() ) { - parentWidget()->show(); - MainWindow::self->setAppropriate( (TQDockWindow*)parentWidget(), TRUE ); + tqparentWidget()->show(); + MainWindow::self->setAppropriate( (TQDockWindow*)tqparentWidget(), TRUE ); } else if ( isShown() && !count() ) { - parentWidget()->hide(); - MainWindow::self->setAppropriate( (TQDockWindow*)parentWidget(), FALSE ); + tqparentWidget()->hide(); + MainWindow::self->setAppropriate( (TQDockWindow*)tqparentWidget(), FALSE ); } } -- cgit v1.2.1