diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-06-14 16:45:05 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-06-14 16:45:05 +0000 |
commit | 48d4a26399959121f33d2bc3bfe51c7827b654fc (patch) | |
tree | 5ae5e6e00d3ba330b7b8be9bc097154b6bc739e8 /kdevdesigner/designer/popupmenueditor.cpp | |
parent | 7e701ace6592d09e1f2c0cf28c7d6d872d78f4f5 (diff) | |
download | tdevelop-48d4a26399959121f33d2bc3bfe51c7827b654fc.tar.gz tdevelop-48d4a26399959121f33d2bc3bfe51c7827b654fc.zip |
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
Diffstat (limited to 'kdevdesigner/designer/popupmenueditor.cpp')
-rw-r--r-- | kdevdesigner/designer/popupmenueditor.cpp | 274 |
1 files changed, 137 insertions, 137 deletions
diff --git a/kdevdesigner/designer/popupmenueditor.cpp b/kdevdesigner/designer/popupmenueditor.cpp index 6e208de1..b106c3db 100644 --- a/kdevdesigner/designer/popupmenueditor.cpp +++ b/kdevdesigner/designer/popupmenueditor.cpp @@ -1,15 +1,15 @@ /********************************************************************** ** Copyright (C) 2003 Trolltech AS. All rights reserved. ** -** This file is part of Qt Designer. +** This file is part of TQt Designer. ** ** This file may be distributed and/or modified under the terms of the ** GNU General Public License version 2 as published by the Free Software ** Foundation and appearing in the file LICENSE.GPL included in the ** packaging of this file. ** -** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition -** licenses may use this file in accordance with the Qt Commercial License +** Licensees holding valid TQt Enterprise Edition or TQt Professional Edition +** licenses may use this file in accordance with the TQt Commercial License ** Agreement provided with the Software. ** ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE @@ -17,7 +17,7 @@ ** ** See http://www.trolltech.com/gpl/ for GPL licensing information. ** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for -** information about Qt Commercial License Agreements. +** information about TQt Commercial License Agreements. ** ** Contact info@trolltech.com if any conditions of this licensing are ** not clear to you. @@ -51,10 +51,10 @@ // Drag Object Declaration ------------------------------------------- -class PopupMenuEditorItemPtrDrag : public QStoredDrag +class PopupMenuEditorItemPtrDrag : public TQStoredDrag { public: - PopupMenuEditorItemPtrDrag( PopupMenuEditorItem * item, TQWidget * parent = 0, + PopupMenuEditorItemPtrDrag( PopupMenuEditorItem * item, TQWidget * tqparent = 0, const char * name = 0 ); ~PopupMenuEditorItemPtrDrag() {}; static bool canDecode( TQDragMoveEvent * e ); @@ -64,12 +64,12 @@ public: // Drag Object Implementation --------------------------------------- PopupMenuEditorItemPtrDrag::PopupMenuEditorItemPtrDrag( PopupMenuEditorItem * item, - TQWidget * parent, const char * name ) - : TQStoredDrag( "qt/popupmenueditoritemptr", parent, name ) + TQWidget * tqparent, const char * name ) + : TQStoredDrag( "qt/popupmenueditoritemptr", tqparent, name ) { - TQByteArray data( sizeof( Q_LONG ) ); + TQByteArray data( sizeof( TQ_LONG ) ); TQDataStream stream( data, IO_WriteOnly ); - stream << ( Q_LONG ) item; + stream << ( TQ_LONG ) item; setEncodedData( data ); } @@ -80,13 +80,13 @@ bool PopupMenuEditorItemPtrDrag::canDecode( TQDragMoveEvent * e ) bool PopupMenuEditorItemPtrDrag::decode( TQDropEvent * e, PopupMenuEditorItem ** i ) { - TQByteArray data = e->encodedData( "qt/popupmenueditoritemptr" ); + TQByteArray data = e->tqencodedData( "qt/popupmenueditoritemptr" ); TQDataStream stream( data, IO_ReadOnly ); if ( !data.size() ) return FALSE; - Q_LONG p = 0; + TQ_LONG p = 0; stream >> p; *i = ( PopupMenuEditorItem *) p; @@ -95,8 +95,8 @@ bool PopupMenuEditorItemPtrDrag::decode( TQDropEvent * e, PopupMenuEditorItem ** // PopupMenuEditorItem Implementation ----------------------------------- -PopupMenuEditorItem::PopupMenuEditorItem( PopupMenuEditor * menu, TQObject * parent, const char * name ) - : TQObject( parent, name ), +PopupMenuEditorItem::PopupMenuEditorItem( PopupMenuEditor * menu, TQObject * tqparent, const char * name ) + : TQObject( tqparent, name ), a( 0 ), s( 0 ), m( menu ), @@ -110,8 +110,8 @@ PopupMenuEditorItem::PopupMenuEditorItem( PopupMenuEditor * menu, TQObject * par PopupMenuEditorItem::PopupMenuEditorItem( TQAction * action, PopupMenuEditor * menu, - TQObject * parent, const char * name ) - : TQObject( parent, name ), + TQObject * tqparent, const char * name ) + : TQObject( tqparent, name ), a( action ), s( 0 ), m( menu ), @@ -119,15 +119,15 @@ PopupMenuEditorItem::PopupMenuEditorItem( TQAction * action, PopupMenuEditor * m removable( TRUE ) { init(); - if ( /*a->name() == "qt_separator_action" ||*/ ::qt_cast<QSeparatorAction*>(a) ) + if ( /*a->name() == "qt_separator_action" ||*/ ::tqqt_cast<TQSeparatorAction*>(a) ) separator = TRUE; - if ( a && a->children() ) + if ( a && !a->childrenListObject().isEmpty() ) a->installEventFilter( this ); } PopupMenuEditorItem::PopupMenuEditorItem( PopupMenuEditorItem * item, PopupMenuEditor * menu, - TQObject * parent, const char * name ) - : TQObject( parent, name ), + TQObject * tqparent, const char * name ) + : TQObject( tqparent, name ), a( item->a ), s( 0 ), m( menu ), @@ -135,7 +135,7 @@ PopupMenuEditorItem::PopupMenuEditorItem( PopupMenuEditorItem * item, PopupMenuE removable( item->removable ) { init(); - if ( ::qt_cast<TQActionGroup*>(a) ) + if ( ::tqqt_cast<TQActionGroup*>(a) ) a->installEventFilter( this ); } @@ -151,9 +151,9 @@ void PopupMenuEditorItem::init() if ( m && !isSeparator() ) { s = new PopupMenuEditor( m->formWindow(), m ); TQString n = "PopupMenuEditor"; - m->formWindow()->unify( s, n, TRUE ); + m->formWindow()->unify( TQT_TQOBJECT(s), n, TRUE ); s->setName( n ); - MetaDataBase::addEntry( s ); + MetaDataBase::addEntry( TQT_TQOBJECT(s) ); } } } @@ -170,12 +170,12 @@ PopupMenuEditorItem::ItemType PopupMenuEditorItem::type() const void PopupMenuEditorItem::setVisible( bool enable ) { if ( a ) - a->setVisible( enable ); + a->tqsetVisible( enable ); } bool PopupMenuEditorItem::isVisible() const { - TQActionGroup *g = ::qt_cast<TQActionGroup*>(a); + TQActionGroup *g = ::tqqt_cast<TQActionGroup*>(a); if ( g ) return ( g->isVisible() && g->usesDropDown() ); else if ( a ) @@ -212,25 +212,25 @@ int PopupMenuEditorItem::count() const { if ( s ) { return s->count(); - } else if ( ::qt_cast<TQActionGroup*>(a) ) { - const TQObjectList * l = a->children(); - if ( l ) - return l->count(); + } else if ( ::tqqt_cast<TQActionGroup*>(a) ) { + const TQObjectList l = a->childrenListObject(); + if ( !l.isEmpty() ) + return l.count(); } return 0; } bool PopupMenuEditorItem::eventFilter( TQObject * o, TQEvent * event ) { - if ( ! ::qt_cast<TQActionGroup*>( o ) ) + if ( ! ::tqqt_cast<TQActionGroup*>( o ) ) return FALSE; if ( event->type() == TQEvent::ChildInserted ) { TQChildEvent * ce = ( TQChildEvent * ) event; - TQObject * c = ce->child(); - TQAction * action = ::qt_cast<TQAction*>( c ); - if ( s->find( action ) != -1 ) // avoid duplicates + TQObject * c = TQT_TQOBJECT(ce->child()); + TQAction * action = ::tqqt_cast<TQAction*>( c ); + if ( s->tqfind( action ) != -1 ) // avoid duplicates return FALSE; - TQActionGroup * actionGroup = ::qt_cast<TQActionGroup*>( c ); + TQActionGroup * actionGroup = ::tqqt_cast<TQActionGroup*>( c ); if ( actionGroup ) s->insert( actionGroup ); else if ( action ) @@ -242,7 +242,7 @@ bool PopupMenuEditorItem::eventFilter( TQObject * o, TQEvent * event ) void PopupMenuEditorItem::selfDestruct() { hideMenu(); - int i = m->find( s ); + int i = m->tqfind( s ); if ( i != -1 && i < m->count() ) m->remove( i ); // remove this item a = 0; // the selfDestruct call was caused by the deletion of the action @@ -255,10 +255,10 @@ PopupMenuEditorItem * PopupMenuEditor::draggedItem = 0; int PopupMenuEditor::clipboardOperation = 0; PopupMenuEditorItem * PopupMenuEditor::clipboardItem = 0; -PopupMenuEditor::PopupMenuEditor( FormWindow * fw, TQWidget * parent, const char * name ) +PopupMenuEditor::PopupMenuEditor( FormWindow * fw, TQWidget * tqparent, const char * name ) : TQWidget( 0, name, WStyle_Customize | WStyle_NoBorder | WRepaintNoErase | WResizeNoErase ), formWnd( fw ), - parentMenu( parent ), + tqparentMenu( tqparent ), iconWidth( 0 ), textWidth( 0 ), accelWidth( 0 ), @@ -271,10 +271,10 @@ PopupMenuEditor::PopupMenuEditor( FormWindow * fw, TQWidget * parent, const char } PopupMenuEditor::PopupMenuEditor( FormWindow * fw, PopupMenuEditor * menu, - TQWidget * parent, const char * name ) + TQWidget * tqparent, const char * name ) : TQWidget( 0, name, WStyle_Customize | WStyle_NoBorder | WRepaintNoErase ), formWnd( fw ), - parentMenu( parent ), + tqparentMenu( tqparent ), iconWidth( menu->iconWidth ), textWidth( menu->textWidth ), accelWidth( menu->accelWidth ), @@ -304,7 +304,7 @@ void PopupMenuEditor::init() addSeparator.action()->setMenuText( i18n("new separator") ); setAcceptDrops( TRUE ); - setFocusPolicy( StrongFocus ); + setFocusPolicy( TQ_StrongFocus ); lineEdit = new TQLineEdit( this ); lineEdit->hide(); @@ -314,8 +314,8 @@ void PopupMenuEditor::init() lineEdit->setBackgroundMode(PaletteButton); lineEdit->installEventFilter( this ); - dropLine = new TQWidget( this, 0, Qt::WStyle_NoBorder | WStyle_StaysOnTop ); - dropLine->setBackgroundColor( Qt::red ); + dropLine = new TQWidget( this, 0, TQt::WStyle_NoBorder | WStyle_StaysOnTop ); + dropLine->setBackgroundColor( TQt::red ); dropLine->hide(); hide(); @@ -335,10 +335,10 @@ void PopupMenuEditor::insert( PopupMenuEditorItem * item, int index ) currentIndex = index; } item->m = this; - item->s->parentMenu = this; + item->s->tqparentMenu = this; resizeToContents(); - if ( isVisible() && parentMenu ) - parentMenu->update(); // draw arrow in parent menu + if ( isVisible() && tqparentMenu ) + tqparentMenu->update(); // draw arrow in tqparent menu emit inserted( item->action() ); } @@ -361,7 +361,7 @@ void PopupMenuEditor::insert( TQActionGroup * actionGroup, int index ) TQObjectListIterator it( *l ); insert( i, index ); for ( ; it.current(); ++it ) { - g = ::qt_cast<TQActionGroup*>(it.current()); + g = ::tqqt_cast<TQActionGroup*>(it.current()); if ( g ) { if ( dropdown ) i->s->insert( g ); @@ -374,7 +374,7 @@ void PopupMenuEditor::insert( TQActionGroup * actionGroup, int index ) delete l; } -int PopupMenuEditor::find( const TQAction * action ) +int PopupMenuEditor::tqfind( const TQAction * action ) { PopupMenuEditorItem * i = itemList.first(); while ( i ) { @@ -385,7 +385,7 @@ int PopupMenuEditor::find( const TQAction * action ) return -1; } -int PopupMenuEditor::find( PopupMenuEditor * menu ) +int PopupMenuEditor::tqfind( PopupMenuEditor * menu ) { PopupMenuEditorItem * i = itemList.first(); while ( i ) { @@ -414,8 +414,8 @@ void PopupMenuEditor::exchange( int a, int b ) ia == &addItem || ia == &addSeparator || ib == &addItem || ib == &addSeparator ) return; // do nothing - itemList.replace( b, ia ); - itemList.replace( a, ib ); + itemList.tqreplace( b, ia ); + itemList.tqreplace( a, ib ); } void PopupMenuEditor::cut( int index ) @@ -532,17 +532,17 @@ void PopupMenuEditor::showLineEdit( int index ) lineEdit->setFocus(); } -void PopupMenuEditor::setAccelerator( int key, Qt::ButtonState state, int index ) +void PopupMenuEditor::setAccelerator( int key, TQt::ButtonState state, int index ) { // FIXME: make this a command int idx = ( index == -1 ? currentIndex : index ); - if ( key == Qt::Key_Shift || - key == Qt::Key_Control || - key == Qt::Key_Alt || - key == Qt::Key_Meta || - key == Qt::Key_unknown ) + if ( key == TQt::Key_Shift || + key == TQt::Key_Control || + key == TQt::Key_Alt || + key == TQt::Key_Meta || + key == TQt::Key_unknown ) return; // ignore these keys when they are pressed PopupMenuEditorItem * i = 0; @@ -552,10 +552,10 @@ void PopupMenuEditor::setAccelerator( int key, Qt::ButtonState state, int index else i = itemList.at( idx ); - int shift = ( state & Qt::ShiftButton ? Qt::SHIFT : 0 ); - int ctrl = ( state & Qt::ControlButton ? Qt::CTRL : 0 ); - int alt = ( state & Qt::AltButton ? Qt::ALT : 0 ); - int meta = ( state & Qt::MetaButton ? Qt::META : 0 ); + int shift = ( state & TQt::ShiftButton ? TQt::SHIFT : 0 ); + int ctrl = ( state & TQt::ControlButton ? TQt::CTRL : 0 ); + int alt = ( state & TQt::AltButton ? TQt::ALT : 0 ); + int meta = ( state & TQt::MetaButton ? TQt::META : 0 ); TQAction * a = i->action(); TQKeySequence ks = a->accel(); @@ -644,8 +644,8 @@ void PopupMenuEditor::removeItem( int index ) idx ); formWnd->commandHistory()->addCommand( cmd ); cmd->execute(); - if ( itemList.count() == 0 && parentMenu ) - parentMenu->update(); + if ( itemList.count() == 0 && tqparentMenu ) + tqparentMenu->update(); resizeToContents(); } } @@ -714,7 +714,7 @@ void PopupMenuEditor::setFocusAt( const TQPoint & pos ) bool PopupMenuEditor::eventFilter( TQObject * o, TQEvent * e ) { - if ( o == lineEdit && e->type() == TQEvent::FocusOut ) { + if ( TQT_BASE_OBJECT(o) == TQT_BASE_OBJECT(lineEdit) && e->type() == TQEvent::FocusOut ) { leaveEditMode( 0 ); update(); } @@ -730,7 +730,7 @@ void PopupMenuEditor::paintEvent( TQPaintEvent * ) rect().width() - borderSize * 2, rect().height() - borderSize * 2 ); reg -= mid; p.setClipRegion( reg ); - style().drawPrimitive( TQStyle::PE_PanelPopup, &p, rect(), colorGroup() ); + tqstyle().tqdrawPrimitive( TQStyle::PE_PanelPopup, &p, rect(), tqcolorGroup() ); p.restore(); drawItems( &p ); } @@ -747,7 +747,7 @@ void PopupMenuEditor::mouseDoubleClickEvent( TQMouseEvent * ) { setFocusAt( mousePressPos ); if ( currentItem() == &addSeparator ) { - PopupMenuEditorItem * i = createItem( new QSeparatorAction( 0 ) ); + PopupMenuEditorItem * i = createItem( new TQSeparatorAction( 0 ) ); i->setSeparator( TRUE ); return; } @@ -771,7 +771,7 @@ void PopupMenuEditor::mouseMoveEvent( TQMouseEvent * e ) cmd.execute(); // FIXME: start rename after drop } else if ( draggedItem == &addSeparator ) { - draggedItem = createItem( new QSeparatorAction( 0 ) ); + draggedItem = createItem( new TQSeparatorAction( 0 ) ); draggedItem->setSeparator( TRUE ); } @@ -786,7 +786,7 @@ void PopupMenuEditor::mouseMoveEvent( TQMouseEvent * e ) // If the item is dropped in the same list, // we will have two instances of the same pointer // in the list. We use node instead. - int idx = itemList.find( draggedItem ); + int idx = itemList.tqfind( draggedItem ); TQLNode * node = itemList.currentNode(); d->dragCopy(); // dragevents and stuff happens @@ -857,7 +857,7 @@ void PopupMenuEditor::dropEvent( TQDropEvent * e ) PopupMenuEditorItemPtrDrag::decode( e, &i ); } else { if ( e->provides( "application/x-designer-actiongroup" ) ) { - TQActionGroup * g = ::qt_cast<QDesignerActionGroup*>(ActionDrag::action()); + TQActionGroup * g = ::tqqt_cast<TQDesignerActionGroup*>(ActionDrag::action()); if ( g->usesDropDown() ) { i = new PopupMenuEditorItem( g, this ); TQString n = TQString( g->name() ) + "Item"; @@ -866,7 +866,7 @@ void PopupMenuEditor::dropEvent( TQDropEvent * e ) TQObjectList *l = g->queryList( TQACTION_OBJECT_NAME_STRING, 0, FALSE, FALSE ); TQObjectListIterator it( *l ); for ( ; it.current(); ++it ) { - g = ::qt_cast<TQActionGroup*>(it.current()); + g = ::tqqt_cast<TQActionGroup*>(it.current()); if ( g ) i->s->insert( g ); else @@ -877,7 +877,7 @@ void PopupMenuEditor::dropEvent( TQDropEvent * e ) dropInPlace( g, e->pos().y() ); } } else if ( e->provides( "application/x-designer-actions" ) ) { - TQAction *a = ::qt_cast<QDesignerAction*>(ActionDrag::action()); + TQAction *a = ::tqqt_cast<TQDesignerAction*>(ActionDrag::action()); i = new PopupMenuEditorItem( a, this ); } } @@ -899,65 +899,65 @@ void PopupMenuEditor::keyPressEvent( TQKeyEvent * e ) switch ( e->key() ) { - case Qt::Key_Delete: + case TQt::Key_Delete: hideSubMenu(); removeItem(); showSubMenu(); break; - case Qt::Key_Backspace: + case TQt::Key_Backspace: clearCurrentField(); break; - case Qt::Key_Up: - navigateUp( e->state() & Qt::ControlButton ); + case TQt::Key_Up: + navigateUp( e->state() & TQt::ControlButton ); break; - case Qt::Key_Down: - navigateDown( e->state() & Qt::ControlButton ); + case TQt::Key_Down: + navigateDown( e->state() & TQt::ControlButton ); break; - case Qt::Key_Left: + case TQt::Key_Left: navigateLeft(); break; - case Qt::Key_Right: + case TQt::Key_Right: navigateRight(); break; - case Qt::Key_PageUp: + case TQt::Key_PageUp: currentIndex = 0; break; - case Qt::Key_PageDown: + case TQt::Key_PageDown: currentIndex = itemList.count(); break; - case Qt::Key_Enter: - case Qt::Key_Return: - case Qt::Key_F2: + case TQt::Key_Enter: + case TQt::Key_Return: + case TQt::Key_F2: enterEditMode( e ); // move on - case Qt::Key_Alt: - case Qt::Key_Shift: - case Qt::Key_Control: + case TQt::Key_Alt: + case TQt::Key_Shift: + case TQt::Key_Control: // do nothing return; - case Qt::Key_Escape: + case TQt::Key_Escape: currentField = 0; navigateLeft(); break; - case Qt::Key_C: - if ( e->state() & Qt::ControlButton && + case TQt::Key_C: + if ( e->state() & TQt::ControlButton && currentIndex < (int)itemList.count() ) { copy( currentIndex ); break; } - case Qt::Key_X: - if ( e->state() & Qt::ControlButton && + case TQt::Key_X: + if ( e->state() & TQt::ControlButton && currentIndex < (int)itemList.count() ) { hideSubMenu(); cut( currentIndex ); @@ -965,8 +965,8 @@ void PopupMenuEditor::keyPressEvent( TQKeyEvent * e ) break; } - case Qt::Key_V: - if ( e->state() & Qt::ControlButton ) { + case TQt::Key_V: + if ( e->state() & TQt::ControlButton ) { hideSubMenu(); paste( currentIndex < (int)itemList.count() ? currentIndex + 1: itemList.count() ); showSubMenu(); @@ -991,9 +991,9 @@ void PopupMenuEditor::keyPressEvent( TQKeyEvent * e ) } else { // In edit mode switch ( e->key() ) { - case Qt::Key_Enter: - case Qt::Key_Return: - case Qt::Key_Escape: + case TQt::Key_Enter: + case TQt::Key_Return: + case TQt::Key_Escape: leaveEditMode( e ); e->accept(); return; @@ -1006,20 +1006,20 @@ void PopupMenuEditor::focusInEvent( TQFocusEvent * ) { showSubMenu(); update(); - parentMenu->update(); + tqparentMenu->update(); } void PopupMenuEditor::focusOutEvent( TQFocusEvent * ) { - TQWidget * fw = qApp->focusWidget(); - if ( !fw || ( !::qt_cast<PopupMenuEditor*>(fw) && fw != lineEdit ) ) { + TQWidget * fw = tqApp->tqfocusWidget(); + if ( !fw || ( !::tqqt_cast<PopupMenuEditor*>(fw) && fw != lineEdit ) ) { hideSubMenu(); - if ( fw && ::qt_cast<MenuBarEditor*>(fw) ) + if ( fw && ::tqqt_cast<MenuBarEditor*>(fw) ) return; TQWidget * w = this; - while ( w && w != fw && ::qt_cast<PopupMenuEditor*>(w) ) { // hide all popups + while ( w && w != fw && ::tqqt_cast<PopupMenuEditor*>(w) ) { // hide all popups w->hide(); - w = ((PopupMenuEditor *)w)->parentEditor(); + w = ((PopupMenuEditor *)w)->tqparentEditor(); } } } @@ -1031,20 +1031,20 @@ void PopupMenuEditor::drawItem( TQPainter * p, PopupMenuEditorItem * i, int y = r.y(); int h = r.height(); - p->fillRect( r, colorGroup().brush( TQColorGroup::Background ) ); + p->fillRect( r, tqcolorGroup().brush( TQColorGroup::Background ) ); if ( i->isSeparator() ) { - style().drawPrimitive( TQStyle::PE_Separator, p, + tqstyle().tqdrawPrimitive( TQStyle::PE_Separator, p, TQRect( r.x(), r.y() + 2, r.width(), 1 ), - colorGroup(), TQStyle::Style_Sunken | f ); + tqcolorGroup(), TQStyle::Style_Sunken | f ); return; } const TQAction * a = i->action(); if ( a->isToggleAction() && a->isOn() ) { - style().drawPrimitive( TQStyle::PE_CheckMark, p, + tqstyle().tqdrawPrimitive( TQStyle::PE_CheckMark, p, TQRect( x , y, iconWidth, h ), - colorGroup(), f ); + tqcolorGroup(), f ); } else { TQPixmap icon = a->iconSet().pixmap( TQIconSet::Automatic, TQIconSet::Normal ); p->drawPixmap( x + ( iconWidth - icon.width() ) / 2, @@ -1055,8 +1055,8 @@ void PopupMenuEditor::drawItem( TQPainter * p, PopupMenuEditorItem * i, p->drawText( x, y, textWidth, h, TQPainter::AlignLeft | TQPainter::AlignVCenter | - Qt::ShowPrefix | - Qt::SingleLine, + TQt::ShowPrefix | + TQt::SingleLine, a->menuText() ); x += textWidth + borderSize * 3; @@ -1064,9 +1064,9 @@ void PopupMenuEditor::drawItem( TQPainter * p, PopupMenuEditorItem * i, TQPainter::AlignLeft | TQPainter::AlignVCenter, a->accel() ); if ( i->count() ) // Item has submenu - style().drawPrimitive( TQStyle::PE_ArrowRight, p, + tqstyle().tqdrawPrimitive( TQStyle::PE_ArrowRight, p, TQRect( r.width() - arrowWidth, r.y(), arrowWidth, r.height() ), - colorGroup(), f ); + tqcolorGroup(), f ); } void PopupMenuEditor::drawWinFocusRect( TQPainter * p, const TQRect & r ) const @@ -1092,8 +1092,8 @@ void PopupMenuEditor::drawItems( TQPainter * p ) int flags = 0; int idx = 0; - TQColorGroup enabled = colorGroup(); - TQColorGroup disabled = palette().disabled(); + TQColorGroup enabled = tqcolorGroup(); + TQColorGroup disabled = tqpalette().disabled(); TQRect focus; TQRect rect( borderSize, borderSize, width() - borderSize * 2, 0 ); @@ -1152,11 +1152,11 @@ TQSize PopupMenuEditor::contentsSize() a = i->action(); w = a->iconSet().pixmap( TQIconSet::Automatic, TQIconSet::Normal ).rect().width() + borderSize; // padding - iconWidth = QMAX( iconWidth, w ); + iconWidth = TQMAX( iconWidth, w ); w = fontMetrics().boundingRect( a->menuText() ).width(); - textWidth = QMAX( textWidth, w ); + textWidth = TQMAX( textWidth, w ); w = fontMetrics().boundingRect( a->accel() ).width() + 2; // added padding? - accelWidth = QMAX( accelWidth, w ); + accelWidth = TQMAX( accelWidth, w ); } h += itemHeight( i ); } @@ -1176,8 +1176,8 @@ int PopupMenuEditor::itemHeight( const PopupMenuEditorItem * item ) const int padding = + borderSize * 6; TQAction * a = item->action(); int h = a->iconSet().pixmap( TQIconSet::Automatic, TQIconSet::Normal ).rect().height(); - h = QMAX( h, fontMetrics().boundingRect( a->menuText() ).height() + padding ); - h = QMAX( h, fontMetrics().boundingRect( a->accel() ).height() + padding ); + h = TQMAX( h, fontMetrics().boundingRect( a->menuText() ).height() + padding ); + h = TQMAX( h, fontMetrics().boundingRect( a->accel() ).height() + padding ); return h; } @@ -1229,7 +1229,7 @@ void PopupMenuEditor::dropInPlace( PopupMenuEditorItem * i, int y ) idx++; n = itemList.next(); } - int same = itemList.findRef( i ); + int same = itemList.tqfindRef( i ); AddActionToPopupCommand * cmd = new AddActionToPopupCommand( i18n( "Drop Item" ), formWnd, this, i, idx ); formWnd->commandHistory()->addCommand( cmd ); cmd->execute(); @@ -1239,12 +1239,12 @@ void PopupMenuEditor::dropInPlace( PopupMenuEditorItem * i, int y ) void PopupMenuEditor::dropInPlace( TQActionGroup * g, int y ) { - if (!g->children()) + TQObjectList l = g->childrenListObject(); + if (l.isEmpty()) return; - TQObjectList l = *g->children(); for ( int i = 0; i < (int)l.count(); ++i ) { - TQAction *a = ::qt_cast<TQAction*>(l.at(i)); - TQActionGroup *g = ::qt_cast<TQActionGroup*>(l.at(i)); + TQAction *a = ::tqqt_cast<TQAction*>(l.at(i)); + TQActionGroup *g = ::tqqt_cast<TQActionGroup*>(l.at(i)); if ( g ) dropInPlace( g, y ); else if ( a ) @@ -1259,8 +1259,8 @@ void PopupMenuEditor::safeDec() } while ( currentIndex > 0 && !currentItem()->isVisible() ); if ( currentIndex == 0 && !currentItem()->isVisible() && - parentMenu ) { - parentMenu->setFocus(); + tqparentMenu ) { + tqparentMenu->setFocus(); } } @@ -1317,9 +1317,9 @@ void PopupMenuEditor::navigateUp( bool ctrl ) safeDec(); } showSubMenu(); - } else if ( parentMenu ) { - parentMenu->setFocus(); - parentMenu->update(); + } else if ( tqparentMenu ) { + tqparentMenu->setFocus(); + tqparentMenu->update(); } } @@ -1351,9 +1351,9 @@ void PopupMenuEditor::navigateLeft() if ( currentItem()->isSeparator() || currentIndex >= (int)itemList.count() || currentField == 0 ) { - if ( parentMenu ) { + if ( tqparentMenu ) { hideSubMenu(); - parentMenu->setFocus(); + tqparentMenu->setFocus(); } else if ( !currentItem()->isSeparator() ) { currentField = 2; } @@ -1380,7 +1380,7 @@ void PopupMenuEditor::enterEditMode( TQKeyEvent * e ) PopupMenuEditorItem * i = currentItem(); if ( i == &addSeparator ) { - i = createItem( new QSeparatorAction( 0 ) ); + i = createItem( new TQSeparatorAction( 0 ) ); } else if ( i->isSeparator() ) { return; } else if ( currentField == 0 ) { @@ -1401,7 +1401,7 @@ void PopupMenuEditor::leaveEditMode( TQKeyEvent * e ) lineEdit->hide(); PopupMenuEditorItem * i = 0; - if ( e && e->key() == Qt::Key_Escape ) { + if ( e && e->key() == TQt::Key_Escape ) { update(); return; } @@ -1410,7 +1410,7 @@ void PopupMenuEditor::leaveEditMode( TQKeyEvent * e ) // new item was created TQAction * a = formWnd->mainWindow()->actioneditor()->newActionEx(); TQString actionText = lineEdit->text(); - actionText.replace("&&", "&"); + actionText.tqreplace("&&", "&"); TQString menuText = lineEdit->text(); a->setText( actionText ); a->setMenuText( menuText ); @@ -1448,14 +1448,14 @@ TQString PopupMenuEditor::constructName( PopupMenuEditorItem *item ) { TQString s; TQString name = item->action()->menuText(); - TQWidget *e = parentEditor(); - PopupMenuEditor *p = ::qt_cast<PopupMenuEditor*>(e); + TQWidget *e = tqparentEditor(); + PopupMenuEditor *p = ::tqqt_cast<PopupMenuEditor*>(e); if ( p ) { - int idx = p->find( item->m ); + int idx = p->tqfind( item->m ); PopupMenuEditorItem * i = ( idx > -1 ? p->at( idx ) : 0 ); s = ( i ? TQString( i->action()->name() ).remove( "Action" ) : TQString( "" ) ); } else { - MenuBarEditor *b = ::qt_cast<MenuBarEditor*>(e); + MenuBarEditor *b = ::tqqt_cast<MenuBarEditor*>(e); if ( b ) { int idx = b->findItem( item->m ); MenuBarEditorItem * i = ( idx > -1 ? b->item( idx ) : 0 ); |