diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-06-17 03:03:11 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-06-17 03:03:11 +0000 |
commit | a2bae01d006ea8053e85bc16d09a8cf40a4b0b75 (patch) | |
tree | 7f2b2a1d90d0d5fbcbf23e06962192923058e0ad /kommander/editor/actiondnd.cpp | |
parent | 4e0c064056c23aabc053dc4a54d82ff1dceaf6a9 (diff) | |
download | tdewebdev-a2bae01d006ea8053e85bc16d09a8cf40a4b0b75.tar.gz tdewebdev-a2bae01d006ea8053e85bc16d09a8cf40a4b0b75.zip |
Fix kdewebdev FTBFS under Qt3
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdewebdev@1237074 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kommander/editor/actiondnd.cpp')
-rw-r--r-- | kommander/editor/actiondnd.cpp | 236 |
1 files changed, 118 insertions, 118 deletions
diff --git a/kommander/editor/actiondnd.cpp b/kommander/editor/actiondnd.cpp index 119f481b..58cdb4a3 100644 --- a/kommander/editor/actiondnd.cpp +++ b/kommander/editor/actiondnd.cpp @@ -42,7 +42,7 @@ #include <klocale.h> -bool TQDesignerAction::addTo( TQWidget *w ) +bool QDesignerAction::addTo( TQWidget *w ) { if ( !widgetToInsert ) return TQAction::addTo( w ); @@ -55,7 +55,7 @@ bool TQDesignerAction::addTo( TQWidget *w ) return true; } -bool TQDesignerAction::removeFrom( TQWidget *w ) +bool QDesignerAction::removeFrom( TQWidget *w ) { if ( !widgetToInsert ) return TQAction::removeFrom( w ); @@ -64,7 +64,7 @@ bool TQDesignerAction::removeFrom( TQWidget *w ) return true; } -void TQDesignerAction::remove() +void QDesignerAction::remove() { if ( !widgetToInsert ) return; @@ -72,7 +72,7 @@ void TQDesignerAction::remove() widgetToInsert->reparent( 0, TQPoint( 0, 0 ), false ); } -TQDesignerToolBarSeparator::TQDesignerToolBarSeparator(Qt::Orientation o , TQToolBar *tqparent, +QDesignerToolBarSeparator::QDesignerToolBarSeparator(Qt::Orientation o , TQToolBar *tqparent, const char* name ) : TQWidget( tqparent, name ) { @@ -84,17 +84,17 @@ TQDesignerToolBarSeparator::TQDesignerToolBarSeparator(Qt::Orientation o , TQToo tqsetSizePolicy( TQSizePolicy( TQSizePolicy::Minimum, TQSizePolicy::Minimum ) ); } -void TQDesignerToolBarSeparator::setOrientation( Qt::Orientation o ) +void QDesignerToolBarSeparator::setOrientation( Qt::Orientation o ) { orient = o; } -void TQDesignerToolBarSeparator::styleChange( TQStyle& ) +void QDesignerToolBarSeparator::styleChange( TQStyle& ) { setOrientation( orient ); } -TQSize TQDesignerToolBarSeparator::tqsizeHint() const +TQSize QDesignerToolBarSeparator::tqsizeHint() const { int extent = tqstyle().tqpixelMetric( TQStyle::PM_DockWindowSeparatorExtent, this ); @@ -104,7 +104,7 @@ TQSize TQDesignerToolBarSeparator::tqsizeHint() const return TQSize( 0, extent ); } -void TQDesignerToolBarSeparator::paintEvent( TQPaintEvent * ) +void QDesignerToolBarSeparator::paintEvent( TQPaintEvent * ) { TQPainter p( this ); TQStyle::SFlags flags = TQStyle::Style_Default; @@ -118,16 +118,16 @@ void TQDesignerToolBarSeparator::paintEvent( TQPaintEvent * ) -TQSeparatorAction::TQSeparatorAction( TQObject *tqparent ) +QSeparatorAction::QSeparatorAction( TQObject *tqparent ) : TQAction( tqparent, "qt_designer_separator" ), wid( 0 ) { } -bool TQSeparatorAction::addTo( TQWidget *w ) +bool QSeparatorAction::addTo( TQWidget *w ) { if ( w->inherits( TQTOOLBAR_OBJECT_NAME_STRING ) ) { TQToolBar *tb = (TQToolBar*)w; - wid = new TQDesignerToolBarSeparator( tb->orientation(), tb ); + wid = new QDesignerToolBarSeparator( tb->orientation(), tb ); return true; } else if ( w->inherits( TQPOPUPMENU_OBJECT_NAME_STRING ) ) { idx = ( (TQPopupMenu*)w )->count(); @@ -137,7 +137,7 @@ bool TQSeparatorAction::addTo( TQWidget *w ) return false; } -bool TQSeparatorAction::removeFrom( TQWidget *w ) +bool QSeparatorAction::removeFrom( TQWidget *w ) { if ( w->inherits( TQTOOLBAR_OBJECT_NAME_STRING ) ) { delete wid; @@ -149,7 +149,7 @@ bool TQSeparatorAction::removeFrom( TQWidget *w ) return false; } -TQWidget *TQSeparatorAction::widget() const +TQWidget *QSeparatorAction::widget() const { return wid; } @@ -157,7 +157,7 @@ TQWidget *TQSeparatorAction::widget() const -TQDesignerToolBar::TQDesignerToolBar( TQMainWindow *mw ) +QDesignerToolBar::QDesignerToolBar( TQMainWindow *mw ) : TQToolBar( mw ), lastIndicatorPos( -1, -1 ) { insertAnchor = 0; @@ -165,7 +165,7 @@ TQDesignerToolBar::TQDesignerToolBar( TQMainWindow *mw ) setAcceptDrops( true ); MetaDataBase::addEntry( TQT_TQOBJECT(this) ); lastIndicatorPos = TQPoint( -1, -1 ); - indicator = new TQDesignerIndicatorWidget( this ); + indicator = new QDesignerIndicatorWidget( this ); indicator->hide(); installEventFilter( this ); widgetInserting = false; @@ -173,13 +173,13 @@ TQDesignerToolBar::TQDesignerToolBar( TQMainWindow *mw ) mw->setDockEnabled( DockTornOff, false ); } -TQDesignerToolBar::TQDesignerToolBar( TQMainWindow *mw, Dock dock ) +QDesignerToolBar::QDesignerToolBar( TQMainWindow *mw, Dock dock ) : TQToolBar( TQString(), mw, dock), lastIndicatorPos( -1, -1 ) { insertAnchor = 0; afterAnchor = true; setAcceptDrops( true ); - indicator = new TQDesignerIndicatorWidget( this ); + indicator = new QDesignerIndicatorWidget( this ); indicator->hide(); MetaDataBase::addEntry( TQT_TQOBJECT(this) ); installEventFilter( this ); @@ -188,7 +188,7 @@ TQDesignerToolBar::TQDesignerToolBar( TQMainWindow *mw, Dock dock ) mw->setDockEnabled( DockTornOff, false ); } -void TQDesignerToolBar::findFormWindow() +void QDesignerToolBar::findFormWindow() { TQWidget *w = this; while ( w ) { @@ -198,29 +198,29 @@ void TQDesignerToolBar::findFormWindow() } } -void TQDesignerToolBar::addAction( TQAction *a ) +void QDesignerToolBar::addAction( TQAction *a ) { actionList.append( a ); connect( a, TQT_SIGNAL( destroyed() ), this, TQT_SLOT( actionRemoved() ) ); if ( a->inherits( TQACTIONGROUP_OBJECT_NAME_STRING ) ) { - ( (TQDesignerActionGroup*)a )->widget()->installEventFilter( this ); - actionMap.insert( ( (TQDesignerActionGroup*)a )->widget(), a ); - } else if ( a->inherits( "TQSeparatorAction" ) ) { - ( (TQSeparatorAction*)a )->widget()->installEventFilter( this ); - actionMap.insert( ( (TQSeparatorAction*)a )->widget(), a ); + ( (QDesignerActionGroup*)a )->widget()->installEventFilter( this ); + actionMap.insert( ( (QDesignerActionGroup*)a )->widget(), a ); + } else if ( a->inherits( "QSeparatorAction" ) ) { + ( (QSeparatorAction*)a )->widget()->installEventFilter( this ); + actionMap.insert( ( (QSeparatorAction*)a )->widget(), a ); } else { - ( (TQDesignerAction*)a )->widget()->installEventFilter( this ); - actionMap.insert( ( (TQDesignerAction*)a )->widget(), a ); + ( (QDesignerAction*)a )->widget()->installEventFilter( this ); + actionMap.insert( ( (QDesignerAction*)a )->widget(), a ); } } static void fixObject( TQObject *&o ) { - while ( o && o->tqparent() && !o->tqparent()->inherits( "TQDesignerToolBar" ) ) + while ( o && o->tqparent() && !o->tqparent()->inherits( "QDesignerToolBar" ) ) o = o->tqparent(); } -bool TQDesignerToolBar::eventFilter( TQObject *o, TQEvent *e ) +bool QDesignerToolBar::eventFilter( TQObject *o, TQEvent *e ) { if ( !o || !e || o->inherits( TQDOCKWINDOWHANDLE_OBJECT_NAME_STRING ) || o->inherits( "TQDockWindowTitleBar" ) ) return TQToolBar::eventFilter( o, e ); @@ -279,7 +279,7 @@ bool TQDesignerToolBar::eventFilter( TQObject *o, TQEvent *e ) return TQToolBar::eventFilter( o, e ); } -void TQDesignerToolBar::paintEvent( TQPaintEvent *e ) +void QDesignerToolBar::paintEvent( TQPaintEvent *e ) { TQToolBar::paintEvent( e ); if ( e->rect() != rect() ) @@ -287,7 +287,7 @@ void TQDesignerToolBar::paintEvent( TQPaintEvent *e ) lastIndicatorPos = TQPoint( -1, -1 ); } -void TQDesignerToolBar::contextMenuEvent( TQContextMenuEvent *e ) +void QDesignerToolBar::contextMenuEvent( TQContextMenuEvent *e ) { e->accept(); TQPopupMenu menu( 0 ); @@ -301,7 +301,7 @@ void TQDesignerToolBar::contextMenuEvent( TQContextMenuEvent *e ) } } -void TQDesignerToolBar::mousePressEvent( TQMouseEvent *e ) +void QDesignerToolBar::mousePressEvent( TQMouseEvent *e ) { widgetInserting = false; if ( e->button() == Qt::LeftButton && @@ -318,14 +318,14 @@ void TQDesignerToolBar::mousePressEvent( TQMouseEvent *e ) } } -void TQDesignerToolBar::mouseReleaseEvent( TQMouseEvent *e ) +void QDesignerToolBar::mouseReleaseEvent( TQMouseEvent *e ) { if ( widgetInserting ) doInsertWidget( mapFromGlobal( e->globalPos() ) ); widgetInserting = false; } -void TQDesignerToolBar::buttonMouseReleaseEvent( TQMouseEvent *e, TQObject *w ) +void QDesignerToolBar::buttonMouseReleaseEvent( TQMouseEvent *e, TQObject *w ) { if ( widgetInserting ) doInsertWidget( mapFromGlobal( e->globalPos() ) ); @@ -336,7 +336,7 @@ void TQDesignerToolBar::buttonMouseReleaseEvent( TQMouseEvent *e, TQObject *w ) widgetInserting = false; } -void TQDesignerToolBar::buttonContextMenuEvent( TQContextMenuEvent *e, TQObject *o ) +void QDesignerToolBar::buttonContextMenuEvent( TQContextMenuEvent *e, TQObject *o ) { e->accept(); TQPopupMenu menu( 0 ); @@ -344,7 +344,7 @@ void TQDesignerToolBar::buttonContextMenuEvent( TQContextMenuEvent *e, TQObject const int ID_SEP = 2; const int ID_DELTOOLBAR = 3; TQMap<TQWidget*, TQAction*>::Iterator it = actionMap.tqfind( (TQWidget*)o ); - if ( it != actionMap.end() && (*it)->inherits( "TQSeparatorAction" ) ) + if ( it != actionMap.end() && (*it)->inherits( "QSeparatorAction" ) ) menu.insertItem( i18n("Delete Separator" ), ID_DELETE ); else menu.insertItem( i18n("Delete Item" ), ID_DELETE ); @@ -366,7 +366,7 @@ void TQDesignerToolBar::buttonContextMenuEvent( TQContextMenuEvent *e, TQObject cmd->execute(); } else if ( res == ID_SEP ) { calcIndicatorPos( mapFromGlobal( e->globalPos() ) ); - TQAction *a = new TQSeparatorAction( 0 ); + TQAction *a = new QSeparatorAction( 0 ); int index = actionList.tqfindRef( *actionMap.tqfind( insertAnchor ) ); if ( index != -1 && afterAnchor ) ++index; @@ -387,7 +387,7 @@ void TQDesignerToolBar::buttonContextMenuEvent( TQContextMenuEvent *e, TQObject } } -void TQDesignerToolBar::buttonMousePressEvent( TQMouseEvent *e, TQObject * ) +void QDesignerToolBar::buttonMousePressEvent( TQMouseEvent *e, TQObject * ) { widgetInserting = false; @@ -411,7 +411,7 @@ void TQDesignerToolBar::buttonMousePressEvent( TQMouseEvent *e, TQObject * ) dragStartPos = e->pos(); } -void TQDesignerToolBar::removeWidget( TQWidget *w ) +void QDesignerToolBar::removeWidget( TQWidget *w ) { TQMap<TQWidget*, TQAction*>::Iterator it = actionMap.tqfind( w ); if ( it == actionMap.end() ) @@ -428,7 +428,7 @@ void TQDesignerToolBar::removeWidget( TQWidget *w ) adjustSize(); } -void TQDesignerToolBar::buttonMouseMoveEvent( TQMouseEvent *e, TQObject *o ) +void QDesignerToolBar::buttonMouseMoveEvent( TQMouseEvent *e, TQObject *o ) { if ( widgetInserting || ( e->state() & Qt::LeftButton ) == 0 ) return; @@ -451,14 +451,14 @@ void TQDesignerToolBar::buttonMouseMoveEvent( TQMouseEvent *e, TQObject *o ) adjustSize(); TQString type = a->inherits( TQACTIONGROUP_OBJECT_NAME_STRING ) ? TQString( "application/x-designer-actiongroup" ) : - a->inherits( "TQSeparatorAction" ) ? TQString( "application/x-designer-separator" ) : TQString( "application/x-designer-actions" ); + a->inherits( "QSeparatorAction" ) ? TQString( "application/x-designer-separator" ) : TQString( "application/x-designer-actions" ); TQStoredDrag *drag = new TQStoredDrag( type, this ); TQString s = TQString::number( (long)a ); // #### huha, that is evil drag->setEncodedData( TQCString( s.latin1() ) ); drag->setPixmap( a->iconSet().pixmap() ); - if ( a->inherits( "TQDesignerAction" ) ) { - if ( formWindow->widgets()->tqfind( ( (TQDesignerAction*)a )->widget() ) ) - formWindow->selectWidget( TQT_TQOBJECT(( (TQDesignerAction*)a )->widget()), false ); + if ( a->inherits( "QDesignerAction" ) ) { + if ( formWindow->widgets()->tqfind( ( (QDesignerAction*)a )->widget() ) ) + formWindow->selectWidget( TQT_TQOBJECT(( (QDesignerAction*)a )->widget()), false ); } if ( !drag->drag() ) { AddActionToToolBarCommand *cmd = new AddActionToToolBarCommand( i18n("Add Action '%1' to Toolbar '%2'" ). @@ -473,7 +473,7 @@ void TQDesignerToolBar::buttonMouseMoveEvent( TQMouseEvent *e, TQObject *o ) #ifndef TQT_NO_DRAGANDDROP -void TQDesignerToolBar::dragEnterEvent( TQDragEnterEvent *e ) +void QDesignerToolBar::dragEnterEvent( TQDragEnterEvent *e ) { widgetInserting = false; lastIndicatorPos = TQPoint( -1, -1 ); @@ -483,7 +483,7 @@ void TQDesignerToolBar::dragEnterEvent( TQDragEnterEvent *e ) e->accept(); } -void TQDesignerToolBar::dragMoveEvent( TQDragMoveEvent *e ) +void QDesignerToolBar::dragMoveEvent( TQDragMoveEvent *e ) { if ( e->provides( "application/x-designer-actions" ) || e->provides( "application/x-designer-actiongroup" ) || @@ -494,14 +494,14 @@ void TQDesignerToolBar::dragMoveEvent( TQDragMoveEvent *e ) drawIndicator( calcIndicatorPos( e->pos() ) ); } -void TQDesignerToolBar::dragLeaveEvent( TQDragLeaveEvent * ) +void QDesignerToolBar::dragLeaveEvent( TQDragLeaveEvent * ) { indicator->hide(); insertAnchor = 0; afterAnchor = true; } -void TQDesignerToolBar::dropEvent( TQDropEvent *e ) +void QDesignerToolBar::dropEvent( TQDropEvent *e ) { if ( e->provides( "application/x-designer-actions" ) || e->provides( "application/x-designer-actiongroup" ) || @@ -527,11 +527,11 @@ void TQDesignerToolBar::dropEvent( TQDropEvent *e ) if ( e->provides( "application/x-designer-actions" ) || e->provides( "application/x-designer-separator" ) ) { if ( e->provides( "application/x-designer-actions" ) ) - a = (TQDesignerAction*)s.toLong(); + a = (QDesignerAction*)s.toLong(); else - a = (TQSeparatorAction*)s.toLong(); + a = (QSeparatorAction*)s.toLong(); } else { - a = (TQDesignerActionGroup*)s.toLong(); + a = (QDesignerActionGroup*)s.toLong(); } if ( actionList.tqfindRef( a ) != -1 ) { @@ -553,7 +553,7 @@ void TQDesignerToolBar::dropEvent( TQDropEvent *e ) #endif -void TQDesignerToolBar::reInsert() +void QDesignerToolBar::reInsert() { TQAction *a = 0; actionMap.clear(); @@ -561,27 +561,27 @@ void TQDesignerToolBar::reInsert() for ( a = actionList.first(); a; a = actionList.next() ) { a->addTo( this ); if ( a->inherits( TQACTIONGROUP_OBJECT_NAME_STRING ) ) { - actionMap.insert( ( (TQDesignerActionGroup*)a )->widget(), a ); - if ( ( (TQDesignerActionGroup*)a )->widget() ) - ( (TQDesignerActionGroup*)a )->widget()->installEventFilter( this ); - } else if ( a->inherits( "TQDesignerAction" ) ) { - actionMap.insert( ( (TQDesignerAction*)a )->widget(), a ); - ( (TQDesignerAction*)a )->widget()->installEventFilter( this ); - } else if ( a->inherits( "TQSeparatorAction" ) ) { - actionMap.insert( ( (TQSeparatorAction*)a )->widget(), a ); - ( (TQSeparatorAction*)a )->widget()->installEventFilter( this ); + actionMap.insert( ( (QDesignerActionGroup*)a )->widget(), a ); + if ( ( (QDesignerActionGroup*)a )->widget() ) + ( (QDesignerActionGroup*)a )->widget()->installEventFilter( this ); + } else if ( a->inherits( "QDesignerAction" ) ) { + actionMap.insert( ( (QDesignerAction*)a )->widget(), a ); + ( (QDesignerAction*)a )->widget()->installEventFilter( this ); + } else if ( a->inherits( "QSeparatorAction" ) ) { + actionMap.insert( ( (QSeparatorAction*)a )->widget(), a ); + ( (QSeparatorAction*)a )->widget()->installEventFilter( this ); } } TQApplication::sendPostedEvents(); adjustSize(); } -void TQDesignerToolBar::actionRemoved() +void QDesignerToolBar::actionRemoved() { actionList.removeRef( (TQAction*)sender() ); } -TQPoint TQDesignerToolBar::calcIndicatorPos( const TQPoint &pos ) +TQPoint QDesignerToolBar::calcIndicatorPos( const TQPoint &pos ) { if ( orientation() ==Qt::Horizontal ) { TQPoint pnt( width() - 2, 0 ); @@ -632,7 +632,7 @@ TQPoint TQDesignerToolBar::calcIndicatorPos( const TQPoint &pos ) } } -void TQDesignerToolBar::drawIndicator( const TQPoint &pos ) +void QDesignerToolBar::drawIndicator( const TQPoint &pos ) { if ( lastIndicatorPos == pos ) return; @@ -656,7 +656,7 @@ void TQDesignerToolBar::drawIndicator( const TQPoint &pos ) TQApplication::sendPostedEvents(); } -void TQDesignerToolBar::doInsertWidget( const TQPoint &p ) +void QDesignerToolBar::doInsertWidget( const TQPoint &p ) { if ( formWindow != MainWindow::self->formWindow() ) return; @@ -664,7 +664,7 @@ void TQDesignerToolBar::doInsertWidget( const TQPoint &p ) TQWidget *w = WidgetFactory::create( MainWindow::self->currentTool(), this, 0, true ); installEventFilters( w ); MainWindow::self->formWindow()->insertWidget( w, true ); - TQDesignerAction *a = new TQDesignerAction( w, tqparent() ); + QDesignerAction *a = new QDesignerAction( w, tqparent() ); int index = actionList.tqfindRef( *actionMap.tqfind( insertAnchor ) ); if ( index != -1 && afterAnchor ) ++index; @@ -678,16 +678,16 @@ void TQDesignerToolBar::doInsertWidget( const TQPoint &p ) MainWindow::self->resetTool(); } -void TQDesignerToolBar::clear() +void QDesignerToolBar::clear() { for ( TQAction *a = actionList.first(); a; a = actionList.next() ) { - if ( a->inherits( "TQDesignerAction" ) ) - ( (TQDesignerAction*)a )->remove(); + if ( a->inherits( "QDesignerAction" ) ) + ( (QDesignerAction*)a )->remove(); } TQToolBar::clear(); } -void TQDesignerToolBar::installEventFilters( TQWidget *w ) +void QDesignerToolBar::installEventFilters( TQWidget *w ) { if ( !w ) return; @@ -699,7 +699,7 @@ void TQDesignerToolBar::installEventFilters( TQWidget *w ) -TQDesignerMenuBar::TQDesignerMenuBar( TQWidget *mw ) +QDesignerMenuBar::QDesignerMenuBar( TQWidget *mw ) : TQMenuBar( mw, 0 ) { show(); @@ -709,12 +709,12 @@ TQDesignerMenuBar::TQDesignerMenuBar( TQWidget *mw ) mousePressed = false; lastIndicatorPos = TQPoint( -1, -1 ); insertAt = -1; - indicator = new TQDesignerIndicatorWidget( this ); + indicator = new QDesignerIndicatorWidget( this ); indicator->hide(); findFormWindow(); } -void TQDesignerMenuBar::findFormWindow() +void QDesignerMenuBar::findFormWindow() { TQWidget *w = this; while ( w ) { @@ -724,7 +724,7 @@ void TQDesignerMenuBar::findFormWindow() } } -void TQDesignerMenuBar::contextMenuEvent( TQContextMenuEvent *e ) +void QDesignerMenuBar::contextMenuEvent( TQContextMenuEvent *e ) { e->accept(); int itm = itemAtPos( e->pos() ); @@ -742,7 +742,7 @@ void TQDesignerMenuBar::contextMenuEvent( TQContextMenuEvent *e ) RemoveMenuCommand *cmd = new RemoveMenuCommand( i18n("Delete Menu '%1'" ).tqarg( item->text() ), formWindow, (TQMainWindow*)tqparentWidget(), this, - (TQDesignerPopupMenu*)item->popup(), + (QDesignerPopupMenu*)item->popup(), idAt( itm ), itm, item->text() ); formWindow->commandHistory()->addCommand( cmd ); cmd->execute(); @@ -764,7 +764,7 @@ void TQDesignerMenuBar::contextMenuEvent( TQContextMenuEvent *e ) } } -void TQDesignerMenuBar::mousePressEvent( TQMouseEvent *e ) +void QDesignerMenuBar::mousePressEvent( TQMouseEvent *e ) { lastIndicatorPos = TQPoint( -1, -1 ); insertAt = -1; @@ -776,7 +776,7 @@ void TQDesignerMenuBar::mousePressEvent( TQMouseEvent *e ) TQMenuBar::mousePressEvent( e ); } -void TQDesignerMenuBar::mouseMoveEvent( TQMouseEvent *e ) +void QDesignerMenuBar::mouseMoveEvent( TQMouseEvent *e ) { if ( !mousePressed || e->state() == Qt::NoButton ) { TQMenuBar::mouseMoveEvent( e ); @@ -814,7 +814,7 @@ void TQDesignerMenuBar::mouseMoveEvent( TQMouseEvent *e ) mousePressed = false; } -void TQDesignerMenuBar::mouseReleaseEvent( TQMouseEvent *e ) +void QDesignerMenuBar::mouseReleaseEvent( TQMouseEvent *e ) { TQMenuBar::mouseReleaseEvent( e ); mousePressed = false; @@ -822,7 +822,7 @@ void TQDesignerMenuBar::mouseReleaseEvent( TQMouseEvent *e ) #ifndef TQT_NO_DRAGANDDROP -void TQDesignerMenuBar::dragEnterEvent( TQDragEnterEvent *e ) +void QDesignerMenuBar::dragEnterEvent( TQDragEnterEvent *e ) { if ( e->provides( "application/x-designer-actions" ) || e->provides( "application/x-designer-actiongroup" ) || @@ -834,7 +834,7 @@ void TQDesignerMenuBar::dragEnterEvent( TQDragEnterEvent *e ) insertAt = -1; } -void TQDesignerMenuBar::dragMoveEvent( TQDragMoveEvent *e ) +void QDesignerMenuBar::dragMoveEvent( TQDragMoveEvent *e ) { if ( e->provides( "application/x-designer-actions" ) || e->provides( "application/x-designer-menuitem" ) || @@ -860,14 +860,14 @@ void TQDesignerMenuBar::dragMoveEvent( TQDragMoveEvent *e ) } } -void TQDesignerMenuBar::dragLeaveEvent( TQDragLeaveEvent * ) +void QDesignerMenuBar::dragLeaveEvent( TQDragLeaveEvent * ) { mousePressed = false; lastIndicatorPos = TQPoint( -1, -1 ); insertAt = -1; } -void TQDesignerMenuBar::dropEvent( TQDropEvent *e ) +void QDesignerMenuBar::dropEvent( TQDropEvent *e ) { mousePressed = false; if ( !e->provides( "application/x-designer-menuitem" ) ) @@ -881,7 +881,7 @@ void TQDesignerMenuBar::dropEvent( TQDropEvent *e ) insertItem( txt, popup, -1, insertAt ); MoveMenuCommand *cmd = new MoveMenuCommand( i18n("Move Menu '%1'" ).tqarg( txt ), formWindow, - this, (TQDesignerPopupMenu*)popup, oldPos, insertAt, txt ); + this, (QDesignerPopupMenu*)popup, oldPos, insertAt, txt ); // do not execute, we did the work already formWindow->commandHistory()->addCommand( cmd ); @@ -890,7 +890,7 @@ void TQDesignerMenuBar::dropEvent( TQDropEvent *e ) #endif -TQPoint TQDesignerMenuBar::calcIndicatorPos( const TQPoint &pos ) +TQPoint QDesignerMenuBar::calcIndicatorPos( const TQPoint &pos ) { int w = frameWidth(); insertAt = count(); @@ -906,7 +906,7 @@ TQPoint TQDesignerMenuBar::calcIndicatorPos( const TQPoint &pos ) return TQPoint( w, 0 ); } -void TQDesignerMenuBar::drawIndicator( const TQPoint &pos ) +void QDesignerMenuBar::drawIndicator( const TQPoint &pos ) { if ( lastIndicatorPos == pos ) return; @@ -920,38 +920,38 @@ void TQDesignerMenuBar::drawIndicator( const TQPoint &pos ) TQApplication::sendPostedEvents(); } -void TQDesignerMenuBar::setItemNumber( int num ) +void QDesignerMenuBar::setItemNumber( int num ) { itemNum = num; } -int TQDesignerMenuBar::itemNumber() const +int QDesignerMenuBar::itemNumber() const { return itemNum; } -void TQDesignerMenuBar::setItemText( const TQString &s ) +void QDesignerMenuBar::setItemText( const TQString &s ) { if ( itemNum < 0 || itemNum >= (int)count() ) return; changeItem( idAt( itemNum ), s ); } -TQString TQDesignerMenuBar::itemText() const +TQString QDesignerMenuBar::itemText() const { if ( itemNum < 0 || (int)itemNum >= (int)count() ) return TQString(); return text( idAt( itemNum ) ); } -void TQDesignerMenuBar::setItemName( const TQCString &s ) +void QDesignerMenuBar::setItemName( const TQCString &s ) { if ( itemNum < 0 || itemNum >= (int)count() ) return; tqfindItem( idAt( itemNum ) )->popup()->setName( s ); } -TQCString TQDesignerMenuBar::itemName() const +TQCString QDesignerMenuBar::itemName() const { if ( itemNum < 0 || itemNum >= (int)count() ) return ""; @@ -960,7 +960,7 @@ TQCString TQDesignerMenuBar::itemName() const -TQDesignerPopupMenu::TQDesignerPopupMenu( TQWidget *w ) +QDesignerPopupMenu::QDesignerPopupMenu( TQWidget *w ) : TQPopupMenu( w, 0 ), popupMenu( 0 ) { @@ -969,11 +969,11 @@ TQDesignerPopupMenu::TQDesignerPopupMenu( TQWidget *w ) insertAt = -1; mousePressed = false; lastIndicatorPos = TQPoint( -1, -1 ); - indicator = new TQDesignerIndicatorWidget( this ); + indicator = new QDesignerIndicatorWidget( this ); indicator->hide(); } -void TQDesignerPopupMenu::contextMenuEvent( TQContextMenuEvent *e ) +void QDesignerPopupMenu::contextMenuEvent( TQContextMenuEvent *e ) { #if defined( TQ_WS_MAC ) //the mac needs us to use context menu rather than right click e->accept(); @@ -984,7 +984,7 @@ void TQDesignerPopupMenu::contextMenuEvent( TQContextMenuEvent *e ) #endif } -void TQDesignerPopupMenu::mousePressEvent( TQMouseEvent *e ) +void QDesignerPopupMenu::mousePressEvent( TQMouseEvent *e ) { if ( e->button() == Qt::MidButton ) return; @@ -1006,7 +1006,7 @@ void TQDesignerPopupMenu::mousePressEvent( TQMouseEvent *e ) TQPopupMenu::mousePressEvent( e ); } -void TQDesignerPopupMenu::createPopupMenu() +void QDesignerPopupMenu::createPopupMenu() { // actually creates our popup for the popupmenu. TQPopupMenu menu( 0 ); @@ -1018,7 +1018,7 @@ void TQDesignerPopupMenu::createPopupMenu() if ( itm == -1 ) return; TQAction *a = actionList.at( itm ); - if ( a && a->inherits( "TQSeparatorAction" ) ) + if ( a && a->inherits( "QSeparatorAction" ) ) menu.insertItem( i18n("Delete Separator" ), ID_DELETE ); else menu.insertItem( i18n("Delete Item" ), ID_DELETE ); @@ -1037,22 +1037,22 @@ void TQDesignerPopupMenu::createPopupMenu() } else if ( res == ID_SEP ) { TQPoint p( pos() ); calcIndicatorPos( mapFromGlobal( popupPos ) ); - TQAction *a = new TQSeparatorAction( 0 ); + TQAction *a = new QSeparatorAction( 0 ); AddActionToPopupCommand *cmd = new AddActionToPopupCommand( i18n("Add Separator to Popup Menu '%1'" ). arg( name() ), formWindow, a, this, insertAt ); formWindow->commandHistory()->addCommand( cmd ); cmd->execute(); - ( (TQDesignerMenuBar*)( (TQMainWindow*)tqparentWidget() )->menuBar() )->hidePopups(); - ( (TQDesignerMenuBar*)( (TQMainWindow*)tqparentWidget() )->menuBar() )->activateItemAt( -1 ); + ( (QDesignerMenuBar*)( (TQMainWindow*)tqparentWidget() )->menuBar() )->hidePopups(); + ( (QDesignerMenuBar*)( (TQMainWindow*)tqparentWidget() )->menuBar() )->activateItemAt( -1 ); popup( p ); } // set this back to zero so we know a popup (will soon) not exist. popupMenu = 0; } -void TQDesignerPopupMenu::mouseMoveEvent( TQMouseEvent *e ) +void QDesignerPopupMenu::mouseMoveEvent( TQMouseEvent *e ) { if ( !mousePressed || e->state() == Qt::NoButton ) { TQPopupMenu::mouseMoveEvent( e ); @@ -1075,7 +1075,7 @@ void TQDesignerPopupMenu::mouseMoveEvent( TQMouseEvent *e ) cmd->execute(); TQString type = a->inherits( TQACTIONGROUP_OBJECT_NAME_STRING ) ? TQString( "application/x-designer-actiongroup" ) : - a->inherits( "TQSeparatorAction" ) ? TQString( "application/x-designer-separator" ) : TQString( "application/x-designer-actions" ); + a->inherits( "QSeparatorAction" ) ? TQString( "application/x-designer-separator" ) : TQString( "application/x-designer-actions" ); TQStoredDrag *drag = new TQStoredDrag( type, this ); TQString s = TQString::number( (long)a ); // #### huha, that is evil drag->setEncodedData( TQCString( s.latin1() ) ); @@ -1092,7 +1092,7 @@ void TQDesignerPopupMenu::mouseMoveEvent( TQMouseEvent *e ) mousePressed = false; } -void TQDesignerPopupMenu::mouseReleaseEvent( TQMouseEvent *e ) +void QDesignerPopupMenu::mouseReleaseEvent( TQMouseEvent *e ) { mousePressed = false; TQPopupMenu::mouseReleaseEvent( e ); @@ -1100,7 +1100,7 @@ void TQDesignerPopupMenu::mouseReleaseEvent( TQMouseEvent *e ) #ifndef TQT_NO_DRAGANDDROP -void TQDesignerPopupMenu::dragEnterEvent( TQDragEnterEvent *e ) +void QDesignerPopupMenu::dragEnterEvent( TQDragEnterEvent *e ) { mousePressed = false; lastIndicatorPos = TQPoint( -1, -1 ); @@ -1110,7 +1110,7 @@ void TQDesignerPopupMenu::dragEnterEvent( TQDragEnterEvent *e ) e->accept(); } -void TQDesignerPopupMenu::dragMoveEvent( TQDragMoveEvent *e ) +void QDesignerPopupMenu::dragMoveEvent( TQDragMoveEvent *e ) { mousePressed = false; if ( e->provides( "application/x-designer-actions" ) || @@ -1122,14 +1122,14 @@ void TQDesignerPopupMenu::dragMoveEvent( TQDragMoveEvent *e ) drawIndicator( calcIndicatorPos( e->pos() ) ); } -void TQDesignerPopupMenu::dragLeaveEvent( TQDragLeaveEvent * ) +void QDesignerPopupMenu::dragLeaveEvent( TQDragLeaveEvent * ) { mousePressed = false; indicator->hide(); insertAt = -1; } -void TQDesignerPopupMenu::dropEvent( TQDropEvent *e ) +void QDesignerPopupMenu::dropEvent( TQDropEvent *e ) { mousePressed = false; if ( e->provides( "application/x-designer-actions" ) || @@ -1143,15 +1143,15 @@ void TQDesignerPopupMenu::dropEvent( TQDropEvent *e ) TQAction *a = 0; if ( e->provides( "application/x-designer-actiongroup" ) ) { TQString s( e->tqencodedData( "application/x-designer-actiongroup" ) ); - a = (TQDesignerActionGroup*)s.toLong(); + a = (QDesignerActionGroup*)s.toLong(); } else { TQString s; if ( e->provides( "application/x-designer-separator" ) ) { s = TQString( e->tqencodedData( "application/x-designer-separator" ) ); - a = (TQSeparatorAction*)s.toLong(); + a = (QSeparatorAction*)s.toLong(); } else { s = TQString( e->tqencodedData( "application/x-designer-actions" ) ); - a = (TQDesignerAction*)s.toLong(); + a = (QDesignerAction*)s.toLong(); } } @@ -1169,22 +1169,22 @@ void TQDesignerPopupMenu::dropEvent( TQDropEvent *e ) formWindow->commandHistory()->addCommand( cmd ); cmd->execute(); - ( (TQDesignerMenuBar*)( (TQMainWindow*)tqparentWidget() )->menuBar() )->hidePopups(); - ( (TQDesignerMenuBar*)( (TQMainWindow*)tqparentWidget() )->menuBar() )->activateItemAt( -1 ); + ( (QDesignerMenuBar*)( (TQMainWindow*)tqparentWidget() )->menuBar() )->hidePopups(); + ( (QDesignerMenuBar*)( (TQMainWindow*)tqparentWidget() )->menuBar() )->activateItemAt( -1 ); indicator->hide(); popup( p ); } #endif -void TQDesignerPopupMenu::reInsert() +void QDesignerPopupMenu::reInsert() { clear(); for ( TQAction *a = actionList.first(); a; a = actionList.next() ) a->addTo( this ); } -void TQDesignerPopupMenu::drawIndicator( const TQPoint &pos ) +void QDesignerPopupMenu::drawIndicator( const TQPoint &pos ) { if ( lastIndicatorPos == pos ) return; @@ -1198,7 +1198,7 @@ void TQDesignerPopupMenu::drawIndicator( const TQPoint &pos ) TQApplication::sendPostedEvents(); } -TQPoint TQDesignerPopupMenu::calcIndicatorPos( const TQPoint &pos ) +TQPoint QDesignerPopupMenu::calcIndicatorPos( const TQPoint &pos ) { int h = frameWidth(); insertAt = count(); @@ -1214,18 +1214,18 @@ TQPoint TQDesignerPopupMenu::calcIndicatorPos( const TQPoint &pos ) return TQPoint( 0, h ); } -void TQDesignerPopupMenu::addAction( TQAction *a ) +void QDesignerPopupMenu::addAction( TQAction *a ) { actionList.append( a ); connect( a, TQT_SIGNAL( destroyed() ), this, TQT_SLOT( actionRemoved() ) ); } -void TQDesignerPopupMenu::actionRemoved() +void QDesignerPopupMenu::actionRemoved() { actionList.removeRef( (TQAction*)sender() ); } -void TQDesignerPopupMenu::paintEvent( TQPaintEvent *e ) +void QDesignerPopupMenu::paintEvent( TQPaintEvent *e ) { TQPopupMenu::paintEvent( e ); if ( e->rect() != rect() ) @@ -1233,7 +1233,7 @@ void TQDesignerPopupMenu::paintEvent( TQPaintEvent *e ) lastIndicatorPos = TQPoint( -1, -1 ); } -void TQDesignerPopupMenu::findFormWindow() +void QDesignerPopupMenu::findFormWindow() { TQWidget *w = this; while ( w ) { |