diff options
Diffstat (limited to 'kdevdesigner/designer/popupmenueditor.cpp')
-rw-r--r-- | kdevdesigner/designer/popupmenueditor.cpp | 72 |
1 files changed, 36 insertions, 36 deletions
diff --git a/kdevdesigner/designer/popupmenueditor.cpp b/kdevdesigner/designer/popupmenueditor.cpp index da6289dd..bf60b215 100644 --- a/kdevdesigner/designer/popupmenueditor.cpp +++ b/kdevdesigner/designer/popupmenueditor.cpp @@ -105,7 +105,7 @@ PopupMenuEditorItem::PopupMenuEditorItem( PopupMenuEditor * menu, TQObject * par { init(); a = new TQAction( this ); - TQObject::connect( a, TQT_SIGNAL( destroyed() ), this, TQT_SLOT( selfDestruct() ) ); + TQObject::connect( a, TQ_SIGNAL( destroyed() ), this, TQ_SLOT( selfDestruct() ) ); } @@ -119,7 +119,7 @@ PopupMenuEditorItem::PopupMenuEditorItem( TQAction * action, PopupMenuEditor * m removable( TRUE ) { init(); - if ( /*a->name() == "qt_separator_action" ||*/ ::tqqt_cast<QSeparatorAction*>(a) ) + if ( /*a->name() == "qt_separator_action" ||*/ ::tqt_cast<QSeparatorAction*>(a) ) separator = TRUE; if ( a && !a->childrenListObject().isEmpty() ) a->installEventFilter( this ); @@ -135,7 +135,7 @@ PopupMenuEditorItem::PopupMenuEditorItem( PopupMenuEditorItem * item, PopupMenuE removable( item->removable ) { init(); - if ( ::tqqt_cast<TQActionGroup*>(a) ) + if ( ::tqt_cast<TQActionGroup*>(a) ) a->installEventFilter( this ); } @@ -147,13 +147,13 @@ PopupMenuEditorItem::~PopupMenuEditorItem() void PopupMenuEditorItem::init() { if ( a ) { - TQObject::connect( a, TQT_SIGNAL( destroyed() ), this, TQT_SLOT( selfDestruct() ) ); + TQObject::connect( a, TQ_SIGNAL( destroyed() ), this, TQ_SLOT( selfDestruct() ) ); if ( m && !isSeparator() ) { s = new PopupMenuEditor( m->formWindow(), m ); TQString n = "PopupMenuEditor"; - m->formWindow()->unify( TQT_TQOBJECT(s), n, TRUE ); + m->formWindow()->unify( s, n, TRUE ); s->setName( n ); - MetaDataBase::addEntry( TQT_TQOBJECT(s) ); + MetaDataBase::addEntry( s ); } } } @@ -175,7 +175,7 @@ void PopupMenuEditorItem::setVisible( bool enable ) bool PopupMenuEditorItem::isVisible() const { - TQActionGroup *g = ::tqqt_cast<TQActionGroup*>(a); + TQActionGroup *g = ::tqt_cast<TQActionGroup*>(a); if ( g ) return ( g->isVisible() && g->usesDropDown() ); else if ( a ) @@ -212,7 +212,7 @@ int PopupMenuEditorItem::count() const { if ( s ) { return s->count(); - } else if ( ::tqqt_cast<TQActionGroup*>(a) ) { + } else if ( ::tqt_cast<TQActionGroup*>(a) ) { const TQObjectList l = a->childrenListObject(); if ( !l.isEmpty() ) return l.count(); @@ -222,15 +222,15 @@ int PopupMenuEditorItem::count() const bool PopupMenuEditorItem::eventFilter( TQObject * o, TQEvent * event ) { - if ( ! ::tqqt_cast<TQActionGroup*>( o ) ) + if ( ! ::tqt_cast<TQActionGroup*>( o ) ) return FALSE; if ( event->type() == TQEvent::ChildInserted ) { TQChildEvent * ce = ( TQChildEvent * ) event; - TQObject * c = TQT_TQOBJECT(ce->child()); - TQAction * action = ::tqqt_cast<TQAction*>( c ); + TQObject * c = ce->child(); + TQAction * action = ::tqt_cast<TQAction*>( c ); if ( s->find( action ) != -1 ) // avoid duplicates return FALSE; - TQActionGroup * actionGroup = ::tqqt_cast<TQActionGroup*>( c ); + TQActionGroup * actionGroup = ::tqt_cast<TQActionGroup*>( c ); if ( actionGroup ) s->insert( actionGroup ); else if ( action ) @@ -304,7 +304,7 @@ void PopupMenuEditor::init() addSeparator.action()->setMenuText( i18n("new separator") ); setAcceptDrops( TRUE ); - setFocusPolicy( TQ_StrongFocus ); + setFocusPolicy( TQWidget::StrongFocus ); lineEdit = new TQLineEdit( this ); lineEdit->hide(); @@ -357,11 +357,11 @@ void PopupMenuEditor::insert( TQActionGroup * actionGroup, int index ) PopupMenuEditorItem *i = new PopupMenuEditorItem( (TQAction *)actionGroup, this, 0, TQString( actionGroup->name() ) + "Menu" ); TQActionGroup *g = 0; - TQObjectList *l = actionGroup->queryList( TQACTION_OBJECT_NAME_STRING, 0, FALSE, FALSE ); + TQObjectList *l = actionGroup->queryList( "TQAction", 0, FALSE, FALSE ); TQObjectListIterator it( *l ); insert( i, index ); for ( ; it.current(); ++it ) { - g = ::tqqt_cast<TQActionGroup*>(it.current()); + g = ::tqt_cast<TQActionGroup*>(it.current()); if ( g ) { if ( dropdown ) i->s->insert( g ); @@ -714,7 +714,7 @@ void PopupMenuEditor::setFocusAt( const TQPoint & pos ) bool PopupMenuEditor::eventFilter( TQObject * o, TQEvent * e ) { - if ( TQT_BASE_OBJECT(o) == TQT_BASE_OBJECT(lineEdit) && e->type() == TQEvent::FocusOut ) { + if ( o == 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().tqdrawPrimitive( TQStyle::PE_PanelPopup, &p, rect(), colorGroup() ); + style().drawPrimitive( TQStyle::PE_PanelPopup, &p, rect(), colorGroup() ); p.restore(); drawItems( &p ); } @@ -761,7 +761,7 @@ void PopupMenuEditor::mouseDoubleClickEvent( TQMouseEvent * ) void PopupMenuEditor::mouseMoveEvent( TQMouseEvent * e ) { - if ( e->state() & Qt::LeftButton ) { + if ( e->state() & TQt::LeftButton ) { if ( ( e->pos() - mousePressPos ).manhattanLength() > 3 ) { draggedItem = itemAt( mousePressPos.y() ); if ( draggedItem == &addItem ) { @@ -847,7 +847,7 @@ void PopupMenuEditor::dropEvent( TQDropEvent * e ) // Hide the sub menu of the current item, but do it later if ( currentIndex < (int)itemList.count() ) { PopupMenuEditor *s = itemList.at( currentIndex )->s; - TQTimer::singleShot( 0, s, TQT_SLOT( hide() ) ); + TQTimer::singleShot( 0, s, TQ_SLOT( hide() ) ); } draggedItem = 0; @@ -857,16 +857,16 @@ void PopupMenuEditor::dropEvent( TQDropEvent * e ) PopupMenuEditorItemPtrDrag::decode( e, &i ); } else { if ( e->provides( "application/x-designer-actiongroup" ) ) { - TQActionGroup * g = ::tqqt_cast<QDesignerActionGroup*>(ActionDrag::action()); + TQActionGroup * g = ::tqt_cast<QDesignerActionGroup*>(ActionDrag::action()); if ( g->usesDropDown() ) { i = new PopupMenuEditorItem( g, this ); TQString n = TQString( g->name() ) + "Item"; formWindow()->unify( i, n, FALSE ); i->setName( n ); - TQObjectList *l = g->queryList( TQACTION_OBJECT_NAME_STRING, 0, FALSE, FALSE ); + TQObjectList *l = g->queryList( "TQAction", 0, FALSE, FALSE ); TQObjectListIterator it( *l ); for ( ; it.current(); ++it ) { - g = ::tqqt_cast<TQActionGroup*>(it.current()); + g = ::tqt_cast<TQActionGroup*>(it.current()); if ( g ) i->s->insert( g ); else @@ -877,18 +877,18 @@ void PopupMenuEditor::dropEvent( TQDropEvent * e ) dropInPlace( g, e->pos().y() ); } } else if ( e->provides( "application/x-designer-actions" ) ) { - TQAction *a = ::tqqt_cast<QDesignerAction*>(ActionDrag::action()); + TQAction *a = ::tqt_cast<QDesignerAction*>(ActionDrag::action()); i = new PopupMenuEditorItem( a, this ); } } if ( i ) { dropInPlace( i, e->pos().y() ); - TQTimer::singleShot( 0, this, TQT_SLOT( resizeToContents() ) ); + TQTimer::singleShot( 0, this, TQ_SLOT( resizeToContents() ) ); } - TQTimer::singleShot( 0, this, TQT_SLOT( showSubMenu() ) ); - TQTimer::singleShot( 0, this, TQT_SLOT( setFocus() ) ); + TQTimer::singleShot( 0, this, TQ_SLOT( showSubMenu() ) ); + TQTimer::singleShot( 0, this, TQ_SLOT( setFocus() ) ); dropLine->hide(); e->accept(); } @@ -1012,12 +1012,12 @@ void PopupMenuEditor::focusInEvent( TQFocusEvent * ) void PopupMenuEditor::focusOutEvent( TQFocusEvent * ) { TQWidget * fw = tqApp->focusWidget(); - if ( !fw || ( !::tqqt_cast<PopupMenuEditor*>(fw) && fw != lineEdit ) ) { + if ( !fw || ( !::tqt_cast<PopupMenuEditor*>(fw) && fw != lineEdit ) ) { hideSubMenu(); - if ( fw && ::tqqt_cast<MenuBarEditor*>(fw) ) + if ( fw && ::tqt_cast<MenuBarEditor*>(fw) ) return; TQWidget * w = this; - while ( w && w != fw && ::tqqt_cast<PopupMenuEditor*>(w) ) { // hide all popups + while ( w && w != fw && ::tqt_cast<PopupMenuEditor*>(w) ) { // hide all popups w->hide(); w = ((PopupMenuEditor *)w)->parentEditor(); } @@ -1034,7 +1034,7 @@ void PopupMenuEditor::drawItem( TQPainter * p, PopupMenuEditorItem * i, p->fillRect( r, colorGroup().brush( TQColorGroup::Background ) ); if ( i->isSeparator() ) { - style().tqdrawPrimitive( TQStyle::PE_Separator, p, + style().drawPrimitive( TQStyle::PE_Separator, p, TQRect( r.x(), r.y() + 2, r.width(), 1 ), colorGroup(), TQStyle::Style_Sunken | f ); return; @@ -1042,7 +1042,7 @@ void PopupMenuEditor::drawItem( TQPainter * p, PopupMenuEditorItem * i, const TQAction * a = i->action(); if ( a->isToggleAction() && a->isOn() ) { - style().tqdrawPrimitive( TQStyle::PE_CheckMark, p, + style().drawPrimitive( TQStyle::PE_CheckMark, p, TQRect( x , y, iconWidth, h ), colorGroup(), f ); } else { @@ -1064,7 +1064,7 @@ void PopupMenuEditor::drawItem( TQPainter * p, PopupMenuEditorItem * i, TQPainter::AlignLeft | TQPainter::AlignVCenter, a->accel() ); if ( i->count() ) // Item has submenu - style().tqdrawPrimitive( TQStyle::PE_ArrowRight, p, + style().drawPrimitive( TQStyle::PE_ArrowRight, p, TQRect( r.width() - arrowWidth, r.y(), arrowWidth, r.height() ), colorGroup(), f ); } @@ -1243,8 +1243,8 @@ void PopupMenuEditor::dropInPlace( TQActionGroup * g, int y ) if (l.isEmpty()) return; for ( int i = 0; i < (int)l.count(); ++i ) { - TQAction *a = ::tqqt_cast<TQAction*>(l.at(i)); - TQActionGroup *g = ::tqqt_cast<TQActionGroup*>(l.at(i)); + TQAction *a = ::tqt_cast<TQAction*>(l.at(i)); + TQActionGroup *g = ::tqt_cast<TQActionGroup*>(l.at(i)); if ( g ) dropInPlace( g, y ); else if ( a ) @@ -1449,13 +1449,13 @@ TQString PopupMenuEditor::constructName( PopupMenuEditorItem *item ) TQString s; TQString name = item->action()->menuText(); TQWidget *e = parentEditor(); - PopupMenuEditor *p = ::tqqt_cast<PopupMenuEditor*>(e); + PopupMenuEditor *p = ::tqt_cast<PopupMenuEditor*>(e); if ( p ) { int idx = p->find( item->m ); PopupMenuEditorItem * i = ( idx > -1 ? p->at( idx ) : 0 ); s = ( i ? TQString( i->action()->name() ).remove( "Action" ) : TQString( "" ) ); } else { - MenuBarEditor *b = ::tqqt_cast<MenuBarEditor*>(e); + MenuBarEditor *b = ::tqt_cast<MenuBarEditor*>(e); if ( b ) { int idx = b->findItem( item->m ); MenuBarEditorItem * i = ( idx > -1 ? b->item( idx ) : 0 ); |