summaryrefslogtreecommitdiffstats
path: root/kommander/editor/actiondnd.cpp
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-06-16 19:02:47 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-06-16 19:02:47 +0000
commite985f7e545f4739493965aad69bbecb136dc9346 (patch)
tree54afd409d8acd6202dd8ab611d24e78c28e4c0a0 /kommander/editor/actiondnd.cpp
parentf7670c198945adc3b95ad69a959fe5f8ae55b493 (diff)
downloadtdewebdev-e985f7e545f4739493965aad69bbecb136dc9346.tar.gz
tdewebdev-e985f7e545f4739493965aad69bbecb136dc9346.zip
TQt4 port kdewebdev
This enables compilation under both Qt3 and Qt4 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdewebdev@1237029 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kommander/editor/actiondnd.cpp')
-rw-r--r--kommander/editor/actiondnd.cpp438
1 files changed, 220 insertions, 218 deletions
diff --git a/kommander/editor/actiondnd.cpp b/kommander/editor/actiondnd.cpp
index 67491ef4..119f481b 100644
--- a/kommander/editor/actiondnd.cpp
+++ b/kommander/editor/actiondnd.cpp
@@ -1,7 +1,7 @@
/**********************************************************************
** 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
@@ -42,7 +42,7 @@
#include <klocale.h>
-bool QDesignerAction::addTo( TQWidget *w )
+bool TQDesignerAction::addTo( TQWidget *w )
{
if ( !widgetToInsert )
return TQAction::addTo( w );
@@ -55,7 +55,7 @@ bool QDesignerAction::addTo( TQWidget *w )
return true;
}
-bool QDesignerAction::removeFrom( TQWidget *w )
+bool TQDesignerAction::removeFrom( TQWidget *w )
{
if ( !widgetToInsert )
return TQAction::removeFrom( w );
@@ -64,70 +64,70 @@ bool QDesignerAction::removeFrom( TQWidget *w )
return true;
}
-void QDesignerAction::remove()
+void TQDesignerAction::remove()
{
if ( !widgetToInsert )
return;
- MainWindow::self->formWindow()->selectWidget( widgetToInsert, false );
+ MainWindow::self->formWindow()->selectWidget( TQT_TQOBJECT(widgetToInsert), false );
widgetToInsert->reparent( 0, TQPoint( 0, 0 ), false );
}
-QDesignerToolBarSeparator::QDesignerToolBarSeparator(Orientation o , TQToolBar *parent,
+TQDesignerToolBarSeparator::TQDesignerToolBarSeparator(Qt::Orientation o , TQToolBar *tqparent,
const char* name )
- : TQWidget( parent, name )
+ : TQWidget( tqparent, name )
{
- connect( parent, TQT_SIGNAL(orientationChanged(Orientation)),
- this, TQT_SLOT(setOrientation(Orientation)) );
+ connect( tqparent, TQT_SIGNAL(orientationChanged(Qt::Orientation)),
+ this, TQT_SLOT(setOrientation(Qt::Orientation)) );
setOrientation( o );
- setBackgroundMode( parent->backgroundMode() );
+ setBackgroundMode( tqparent->backgroundMode() );
setBackgroundOrigin( ParentOrigin );
- setSizePolicy( TQSizePolicy( TQSizePolicy::Minimum, TQSizePolicy::Minimum ) );
+ tqsetSizePolicy( TQSizePolicy( TQSizePolicy::Minimum, TQSizePolicy::Minimum ) );
}
-void QDesignerToolBarSeparator::setOrientation( Orientation o )
+void TQDesignerToolBarSeparator::setOrientation( Qt::Orientation o )
{
orient = o;
}
-void QDesignerToolBarSeparator::styleChange( TQStyle& )
+void TQDesignerToolBarSeparator::styleChange( TQStyle& )
{
setOrientation( orient );
}
-TQSize QDesignerToolBarSeparator::sizeHint() const
+TQSize TQDesignerToolBarSeparator::tqsizeHint() const
{
- int extent = style().pixelMetric( TQStyle::PM_DockWindowSeparatorExtent,
+ int extent = tqstyle().tqpixelMetric( TQStyle::PM_DockWindowSeparatorExtent,
this );
- if ( orient == Horizontal )
+ if ( orient ==Qt::Horizontal )
return TQSize( extent, 0 );
else
return TQSize( 0, extent );
}
-void QDesignerToolBarSeparator::paintEvent( TQPaintEvent * )
+void TQDesignerToolBarSeparator::paintEvent( TQPaintEvent * )
{
TQPainter p( this );
TQStyle::SFlags flags = TQStyle::Style_Default;
- if ( orientation() == Horizontal )
+ if ( orientation() ==Qt::Horizontal )
flags |= TQStyle::Style_Horizontal;
- style().drawPrimitive( TQStyle::PE_DockWindowSeparator, &p, rect(),
- colorGroup(), flags );
+ tqstyle().tqdrawPrimitive( TQStyle::PE_DockWindowSeparator, &p, rect(),
+ tqcolorGroup(), flags );
}
-QSeparatorAction::QSeparatorAction( TQObject *parent )
- : TQAction( parent, "qt_designer_separator" ), wid( 0 )
+TQSeparatorAction::TQSeparatorAction( TQObject *tqparent )
+ : TQAction( tqparent, "qt_designer_separator" ), wid( 0 )
{
}
-bool QSeparatorAction::addTo( TQWidget *w )
+bool TQSeparatorAction::addTo( TQWidget *w )
{
if ( w->inherits( TQTOOLBAR_OBJECT_NAME_STRING ) ) {
TQToolBar *tb = (TQToolBar*)w;
- wid = new QDesignerToolBarSeparator( tb->orientation(), tb );
+ wid = new TQDesignerToolBarSeparator( tb->orientation(), tb );
return true;
} else if ( w->inherits( TQPOPUPMENU_OBJECT_NAME_STRING ) ) {
idx = ( (TQPopupMenu*)w )->count();
@@ -137,7 +137,7 @@ bool QSeparatorAction::addTo( TQWidget *w )
return false;
}
-bool QSeparatorAction::removeFrom( TQWidget *w )
+bool TQSeparatorAction::removeFrom( TQWidget *w )
{
if ( w->inherits( TQTOOLBAR_OBJECT_NAME_STRING ) ) {
delete wid;
@@ -149,7 +149,7 @@ bool QSeparatorAction::removeFrom( TQWidget *w )
return false;
}
-TQWidget *QSeparatorAction::widget() const
+TQWidget *TQSeparatorAction::widget() const
{
return wid;
}
@@ -157,15 +157,15 @@ TQWidget *QSeparatorAction::widget() const
-QDesignerToolBar::QDesignerToolBar( TQMainWindow *mw )
+TQDesignerToolBar::TQDesignerToolBar( TQMainWindow *mw )
: TQToolBar( mw ), lastIndicatorPos( -1, -1 )
{
insertAnchor = 0;
afterAnchor = true;
setAcceptDrops( true );
- MetaDataBase::addEntry( this );
+ MetaDataBase::addEntry( TQT_TQOBJECT(this) );
lastIndicatorPos = TQPoint( -1, -1 );
- indicator = new QDesignerIndicatorWidget( this );
+ indicator = new TQDesignerIndicatorWidget( this );
indicator->hide();
installEventFilter( this );
widgetInserting = false;
@@ -173,65 +173,65 @@ QDesignerToolBar::QDesignerToolBar( TQMainWindow *mw )
mw->setDockEnabled( DockTornOff, false );
}
-QDesignerToolBar::QDesignerToolBar( TQMainWindow *mw, Dock dock )
- : TQToolBar( TQString::null, mw, dock), lastIndicatorPos( -1, -1 )
+TQDesignerToolBar::TQDesignerToolBar( TQMainWindow *mw, Dock dock )
+ : TQToolBar( TQString(), mw, dock), lastIndicatorPos( -1, -1 )
{
insertAnchor = 0;
afterAnchor = true;
setAcceptDrops( true );
- indicator = new QDesignerIndicatorWidget( this );
+ indicator = new TQDesignerIndicatorWidget( this );
indicator->hide();
- MetaDataBase::addEntry( this );
+ MetaDataBase::addEntry( TQT_TQOBJECT(this) );
installEventFilter( this );
widgetInserting = false;
findFormWindow();
mw->setDockEnabled( DockTornOff, false );
}
-void QDesignerToolBar::findFormWindow()
+void TQDesignerToolBar::findFormWindow()
{
TQWidget *w = this;
while ( w ) {
if ( w->inherits( "FormWindow" ) )
formWindow = (FormWindow*)w;
- w = w->parentWidget();
+ w = w->tqparentWidget();
}
}
-void QDesignerToolBar::addAction( TQAction *a )
+void TQDesignerToolBar::addAction( TQAction *a )
{
actionList.append( a );
connect( a, TQT_SIGNAL( destroyed() ), this, TQT_SLOT( actionRemoved() ) );
if ( a->inherits( TQACTIONGROUP_OBJECT_NAME_STRING ) ) {
- ( (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 );
+ ( (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 );
} else {
- ( (QDesignerAction*)a )->widget()->installEventFilter( this );
- actionMap.insert( ( (QDesignerAction*)a )->widget(), a );
+ ( (TQDesignerAction*)a )->widget()->installEventFilter( this );
+ actionMap.insert( ( (TQDesignerAction*)a )->widget(), a );
}
}
static void fixObject( TQObject *&o )
{
- while ( o && o->parent() && !o->parent()->inherits( "QDesignerToolBar" ) )
- o = o->parent();
+ while ( o && o->tqparent() && !o->tqparent()->inherits( "TQDesignerToolBar" ) )
+ o = o->tqparent();
}
-bool QDesignerToolBar::eventFilter( TQObject *o, TQEvent *e )
+bool TQDesignerToolBar::eventFilter( TQObject *o, TQEvent *e )
{
- if ( !o || !e || o->inherits( "QDockWindowHandle" ) || o->inherits( "QDockWindowTitleBar" ) )
+ if ( !o || !e || o->inherits( TQDOCKWINDOWHANDLE_OBJECT_NAME_STRING ) || o->inherits( "TQDockWindowTitleBar" ) )
return TQToolBar::eventFilter( o, e );
- if ( o == this && e->type() == TQEvent::MouseButtonPress &&
- ( ( TQMouseEvent*)e )->button() == LeftButton ) {
+ if ( TQT_BASE_OBJECT(o) == TQT_BASE_OBJECT(this) && e->type() == TQEvent::MouseButtonPress &&
+ ( ( TQMouseEvent*)e )->button() == Qt::LeftButton ) {
mousePressEvent( (TQMouseEvent*)e );
return true;
}
- if ( o == this )
+ if ( TQT_BASE_OBJECT(o) == TQT_BASE_OBJECT(this) )
return TQToolBar::eventFilter( o, e );
if ( e->type() == TQEvent::MouseButtonPress ) {
@@ -279,7 +279,7 @@ bool QDesignerToolBar::eventFilter( TQObject *o, TQEvent *e )
return TQToolBar::eventFilter( o, e );
}
-void QDesignerToolBar::paintEvent( TQPaintEvent *e )
+void TQDesignerToolBar::paintEvent( TQPaintEvent *e )
{
TQToolBar::paintEvent( e );
if ( e->rect() != rect() )
@@ -287,24 +287,24 @@ void QDesignerToolBar::paintEvent( TQPaintEvent *e )
lastIndicatorPos = TQPoint( -1, -1 );
}
-void QDesignerToolBar::contextMenuEvent( TQContextMenuEvent *e )
+void TQDesignerToolBar::contextMenuEvent( TQContextMenuEvent *e )
{
e->accept();
TQPopupMenu menu( 0 );
menu.insertItem( i18n("Delete Toolbar" ), 1 );
int res = menu.exec( e->globalPos() );
if ( res != -1 ) {
- RemoveToolBarCommand *cmd = new RemoveToolBarCommand( i18n("Delete Toolbar '%1'" ).arg( name() ),
+ RemoveToolBarCommand *cmd = new RemoveToolBarCommand( i18n("Delete Toolbar '%1'" ).tqarg( name() ),
formWindow, 0, this );
formWindow->commandHistory()->addCommand( cmd );
cmd->execute();
}
}
-void QDesignerToolBar::mousePressEvent( TQMouseEvent *e )
+void TQDesignerToolBar::mousePressEvent( TQMouseEvent *e )
{
widgetInserting = false;
- if ( e->button() == LeftButton &&
+ if ( e->button() == Qt::LeftButton &&
MainWindow::self->currentTool() != POINTER_TOOL &&
MainWindow::self->currentTool() != ORDER_TOOL ) {
@@ -318,33 +318,33 @@ void QDesignerToolBar::mousePressEvent( TQMouseEvent *e )
}
}
-void QDesignerToolBar::mouseReleaseEvent( TQMouseEvent *e )
+void TQDesignerToolBar::mouseReleaseEvent( TQMouseEvent *e )
{
if ( widgetInserting )
doInsertWidget( mapFromGlobal( e->globalPos() ) );
widgetInserting = false;
}
-void QDesignerToolBar::buttonMouseReleaseEvent( TQMouseEvent *e, TQObject *w )
+void TQDesignerToolBar::buttonMouseReleaseEvent( TQMouseEvent *e, TQObject *w )
{
if ( widgetInserting )
doInsertWidget( mapFromGlobal( e->globalPos() ) );
- else if ( w->isWidgetType() && formWindow->widgets()->find( w ) ) {
+ else if ( w->isWidgetType() && formWindow->widgets()->tqfind( w ) ) {
formWindow->clearSelection( false );
formWindow->selectWidget( w );
}
widgetInserting = false;
}
-void QDesignerToolBar::buttonContextMenuEvent( TQContextMenuEvent *e, TQObject *o )
+void TQDesignerToolBar::buttonContextMenuEvent( TQContextMenuEvent *e, TQObject *o )
{
e->accept();
TQPopupMenu menu( 0 );
const int ID_DELETE = 1;
const int ID_SEP = 2;
const int ID_DELTOOLBAR = 3;
- TQMap<TQWidget*, TQAction*>::Iterator it = actionMap.find( (TQWidget*)o );
- if ( it != actionMap.end() && (*it)->inherits( "QSeparatorAction" ) )
+ TQMap<TQWidget*, TQAction*>::Iterator it = actionMap.tqfind( (TQWidget*)o );
+ if ( it != actionMap.end() && (*it)->inherits( "TQSeparatorAction" ) )
menu.insertItem( i18n("Delete Separator" ), ID_DELETE );
else
menu.insertItem( i18n("Delete Item" ), ID_DELETE );
@@ -353,21 +353,21 @@ void QDesignerToolBar::buttonContextMenuEvent( TQContextMenuEvent *e, TQObject *
menu.insertItem( i18n("Delete Toolbar" ), ID_DELTOOLBAR );
int res = menu.exec( e->globalPos() );
if ( res == ID_DELETE ) {
- TQMap<TQWidget*, TQAction*>::Iterator it = actionMap.find( (TQWidget*)o );
+ TQMap<TQWidget*, TQAction*>::Iterator it = actionMap.tqfind( (TQWidget*)o );
if ( it == actionMap.end() )
return;
TQAction *a = *it;
- int index = actionList.find( a );
+ int index = actionList.tqfind( a );
RemoveActionFromToolBarCommand *cmd = new RemoveActionFromToolBarCommand(
i18n("Delete Action '%1' From Toolbar '%2'" ).
- arg( a->name() ).arg( caption() ),
+ tqarg( a->name() ).tqarg( caption() ),
formWindow, a, this, index );
formWindow->commandHistory()->addCommand( cmd );
cmd->execute();
} else if ( res == ID_SEP ) {
calcIndicatorPos( mapFromGlobal( e->globalPos() ) );
- TQAction *a = new QSeparatorAction( 0 );
- int index = actionList.findRef( *actionMap.find( insertAnchor ) );
+ TQAction *a = new TQSeparatorAction( 0 );
+ int index = actionList.tqfindRef( *actionMap.tqfind( insertAnchor ) );
if ( index != -1 && afterAnchor )
++index;
if ( !insertAnchor )
@@ -380,21 +380,21 @@ void QDesignerToolBar::buttonContextMenuEvent( TQContextMenuEvent *e, TQObject *
formWindow->commandHistory()->addCommand( cmd );
cmd->execute();
} else if ( res == ID_DELTOOLBAR ) {
- RemoveToolBarCommand *cmd = new RemoveToolBarCommand( i18n("Delete Toolbar '%1'" ).arg( name() ),
+ RemoveToolBarCommand *cmd = new RemoveToolBarCommand( i18n("Delete Toolbar '%1'" ).tqarg( name() ),
formWindow, 0, this );
formWindow->commandHistory()->addCommand( cmd );
cmd->execute();
}
}
-void QDesignerToolBar::buttonMousePressEvent( TQMouseEvent *e, TQObject * )
+void TQDesignerToolBar::buttonMousePressEvent( TQMouseEvent *e, TQObject * )
{
widgetInserting = false;
- if ( e->button() == MidButton )
+ if ( e->button() == Qt::MidButton )
return;
- if ( e->button() == LeftButton &&
+ if ( e->button() == Qt::LeftButton &&
MainWindow::self->currentTool() != POINTER_TOOL &&
MainWindow::self->currentTool() != ORDER_TOOL ) {
@@ -411,16 +411,16 @@ void QDesignerToolBar::buttonMousePressEvent( TQMouseEvent *e, TQObject * )
dragStartPos = e->pos();
}
-void QDesignerToolBar::removeWidget( TQWidget *w )
+void TQDesignerToolBar::removeWidget( TQWidget *w )
{
- TQMap<TQWidget*, TQAction*>::Iterator it = actionMap.find( w );
+ TQMap<TQWidget*, TQAction*>::Iterator it = actionMap.tqfind( w );
if ( it == actionMap.end() )
return;
TQAction *a = *it;
- int index = actionList.find( a );
+ int index = actionList.tqfind( a );
RemoveActionFromToolBarCommand *cmd =
new RemoveActionFromToolBarCommand( i18n("Delete Action '%1' From Toolbar '%2'" ).
- arg( a->name() ).arg( caption() ),
+ tqarg( a->name() ).tqarg( caption() ),
formWindow, a, this, index );
formWindow->commandHistory()->addCommand( cmd );
cmd->execute();
@@ -428,22 +428,22 @@ void QDesignerToolBar::removeWidget( TQWidget *w )
adjustSize();
}
-void QDesignerToolBar::buttonMouseMoveEvent( TQMouseEvent *e, TQObject *o )
+void TQDesignerToolBar::buttonMouseMoveEvent( TQMouseEvent *e, TQObject *o )
{
- if ( widgetInserting || ( e->state() & LeftButton ) == 0 )
+ if ( widgetInserting || ( e->state() & Qt::LeftButton ) == 0 )
return;
- if ( QABS( TQPoint( dragStartPos - e->pos() ).manhattanLength() ) < TQApplication::startDragDistance() )
+ if ( TQABS( TQPoint( dragStartPos - e->pos() ).manhattanLength() ) < TQApplication::startDragDistance() )
return;
- TQMap<TQWidget*, TQAction*>::Iterator it = actionMap.find( (TQWidget*)o );
+ TQMap<TQWidget*, TQAction*>::Iterator it = actionMap.tqfind( (TQWidget*)o );
if ( it == actionMap.end() )
return;
TQAction *a = *it;
if ( !a )
return;
- int index = actionList.find( a );
+ int index = actionList.tqfind( a );
RemoveActionFromToolBarCommand *cmd =
new RemoveActionFromToolBarCommand( i18n("Delete Action '%1' From Toolbar '%2'" ).
- arg( a->name() ).arg( caption() ),
+ tqarg( a->name() ).tqarg( caption() ),
formWindow, a, this, index );
formWindow->commandHistory()->addCommand( cmd );
cmd->execute();
@@ -451,18 +451,18 @@ void QDesignerToolBar::buttonMouseMoveEvent( TQMouseEvent *e, TQObject *o )
adjustSize();
TQString type = a->inherits( TQACTIONGROUP_OBJECT_NAME_STRING ) ? TQString( "application/x-designer-actiongroup" ) :
- a->inherits( "QSeparatorAction" ) ? TQString( "application/x-designer-separator" ) : TQString( "application/x-designer-actions" );
+ a->inherits( "TQSeparatorAction" ) ? 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( "QDesignerAction" ) ) {
- if ( formWindow->widgets()->find( ( (QDesignerAction*)a )->widget() ) )
- formWindow->selectWidget( ( (QDesignerAction*)a )->widget(), false );
+ if ( a->inherits( "TQDesignerAction" ) ) {
+ if ( formWindow->widgets()->tqfind( ( (TQDesignerAction*)a )->widget() ) )
+ formWindow->selectWidget( TQT_TQOBJECT(( (TQDesignerAction*)a )->widget()), false );
}
if ( !drag->drag() ) {
AddActionToToolBarCommand *cmd = new AddActionToToolBarCommand( i18n("Add Action '%1' to Toolbar '%2'" ).
- arg( a->name() ).arg( caption() ),
+ tqarg( a->name() ).tqarg( caption() ),
formWindow, a, this, index );
formWindow->commandHistory()->addCommand( cmd );
cmd->execute();
@@ -471,9 +471,9 @@ void QDesignerToolBar::buttonMouseMoveEvent( TQMouseEvent *e, TQObject *o )
indicator->hide();
}
-#ifndef QT_NO_DRAGANDDROP
+#ifndef TQT_NO_DRAGANDDROP
-void QDesignerToolBar::dragEnterEvent( TQDragEnterEvent *e )
+void TQDesignerToolBar::dragEnterEvent( TQDragEnterEvent *e )
{
widgetInserting = false;
lastIndicatorPos = TQPoint( -1, -1 );
@@ -483,7 +483,7 @@ void QDesignerToolBar::dragEnterEvent( TQDragEnterEvent *e )
e->accept();
}
-void QDesignerToolBar::dragMoveEvent( TQDragMoveEvent *e )
+void TQDesignerToolBar::dragMoveEvent( TQDragMoveEvent *e )
{
if ( e->provides( "application/x-designer-actions" ) ||
e->provides( "application/x-designer-actiongroup" ) ||
@@ -494,14 +494,14 @@ void QDesignerToolBar::dragMoveEvent( TQDragMoveEvent *e )
drawIndicator( calcIndicatorPos( e->pos() ) );
}
-void QDesignerToolBar::dragLeaveEvent( TQDragLeaveEvent * )
+void TQDesignerToolBar::dragLeaveEvent( TQDragLeaveEvent * )
{
indicator->hide();
insertAnchor = 0;
afterAnchor = true;
}
-void QDesignerToolBar::dropEvent( TQDropEvent *e )
+void TQDesignerToolBar::dropEvent( TQDropEvent *e )
{
if ( e->provides( "application/x-designer-actions" ) ||
e->provides( "application/x-designer-actiongroup" ) ||
@@ -511,15 +511,15 @@ void QDesignerToolBar::dropEvent( TQDropEvent *e )
return;
TQString s;
if ( e->provides( "application/x-designer-actiongroup" ) )
- s = TQString( e->encodedData( "application/x-designer-actiongroup" ) );
+ s = TQString( e->tqencodedData( "application/x-designer-actiongroup" ) );
else if ( e->provides( "application/x-designer-separator" ) )
- s = TQString( e->encodedData( "application/x-designer-separator" ) );
+ s = TQString( e->tqencodedData( "application/x-designer-separator" ) );
else
- s = TQString( e->encodedData( "application/x-designer-actions" ) );
+ s = TQString( e->tqencodedData( "application/x-designer-actions" ) );
indicator->hide();
TQAction *a = 0;
- int index = actionList.findRef( *actionMap.find( insertAnchor ) );
+ int index = actionList.tqfindRef( *actionMap.tqfind( insertAnchor ) );
if ( index != -1 && afterAnchor )
++index;
if ( !insertAnchor )
@@ -527,14 +527,14 @@ void QDesignerToolBar::dropEvent( TQDropEvent *e )
if ( e->provides( "application/x-designer-actions" ) ||
e->provides( "application/x-designer-separator" ) ) {
if ( e->provides( "application/x-designer-actions" ) )
- a = (QDesignerAction*)s.toLong();
+ a = (TQDesignerAction*)s.toLong();
else
- a = (QSeparatorAction*)s.toLong();
+ a = (TQSeparatorAction*)s.toLong();
} else {
- a = (QDesignerActionGroup*)s.toLong();
+ a = (TQDesignerActionGroup*)s.toLong();
}
- if ( actionList.findRef( a ) != -1 ) {
+ if ( actionList.tqfindRef( a ) != -1 ) {
TQMessageBox::warning( MainWindow::self, i18n("Insert/Move Action" ),
i18n("Action '%1' has already been added to this toolbar.\n"
"An Action may only occur once in a given toolbar." ).
@@ -543,7 +543,7 @@ void QDesignerToolBar::dropEvent( TQDropEvent *e )
}
AddActionToToolBarCommand *cmd = new AddActionToToolBarCommand( i18n("Add Action '%1' to Toolbar '%2'" ).
- arg( a->name() ).arg( caption() ),
+ tqarg( a->name() ).tqarg( caption() ),
formWindow, a, this, index );
formWindow->commandHistory()->addCommand( cmd );
cmd->execute();
@@ -553,7 +553,7 @@ void QDesignerToolBar::dropEvent( TQDropEvent *e )
#endif
-void QDesignerToolBar::reInsert()
+void TQDesignerToolBar::reInsert()
{
TQAction *a = 0;
actionMap.clear();
@@ -561,36 +561,37 @@ void QDesignerToolBar::reInsert()
for ( a = actionList.first(); a; a = actionList.next() ) {
a->addTo( this );
if ( a->inherits( TQACTIONGROUP_OBJECT_NAME_STRING ) ) {
- 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 );
+ 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 );
}
}
TQApplication::sendPostedEvents();
adjustSize();
}
-void QDesignerToolBar::actionRemoved()
+void TQDesignerToolBar::actionRemoved()
{
actionList.removeRef( (TQAction*)sender() );
}
-TQPoint QDesignerToolBar::calcIndicatorPos( const TQPoint &pos )
+TQPoint TQDesignerToolBar::calcIndicatorPos( const TQPoint &pos )
{
- if ( orientation() == Horizontal ) {
+ if ( orientation() ==Qt::Horizontal ) {
TQPoint pnt( width() - 2, 0 );
insertAnchor = 0;
afterAnchor = true;
- if ( !children() )
+ TQObjectList clo = childrenListObject();
+ if ( clo.isEmpty() )
return pnt;
pnt = TQPoint( 13, 0 );
- TQObjectListIt it( *children() );
+ TQObjectListIt it( clo );
TQObject * obj;
while( (obj=it.current()) != 0 ) {
++it;
@@ -609,10 +610,11 @@ TQPoint QDesignerToolBar::calcIndicatorPos( const TQPoint &pos )
TQPoint pnt( 0, height() - 2 );
insertAnchor = 0;
afterAnchor = true;
- if ( !children() )
+ TQObjectList clo = childrenListObject();
+ if ( clo.isEmpty() )
return pnt;
pnt = TQPoint( 0, 13 );
- TQObjectListIt it( *children() );
+ TQObjectListIt it( clo );
TQObject * obj;
while( (obj=it.current()) != 0 ) {
++it;
@@ -630,12 +632,12 @@ TQPoint QDesignerToolBar::calcIndicatorPos( const TQPoint &pos )
}
}
-void QDesignerToolBar::drawIndicator( const TQPoint &pos )
+void TQDesignerToolBar::drawIndicator( const TQPoint &pos )
{
if ( lastIndicatorPos == pos )
return;
bool wasVsisible = indicator->isVisible();
- if ( orientation() == Horizontal ) {
+ if ( orientation() ==Qt::Horizontal ) {
indicator->resize( 3, height() );
if ( pos != TQPoint( -1, -1 ) )
indicator->move( pos.x() - 1, 0 );
@@ -654,7 +656,7 @@ void QDesignerToolBar::drawIndicator( const TQPoint &pos )
TQApplication::sendPostedEvents();
}
-void QDesignerToolBar::doInsertWidget( const TQPoint &p )
+void TQDesignerToolBar::doInsertWidget( const TQPoint &p )
{
if ( formWindow != MainWindow::self->formWindow() )
return;
@@ -662,30 +664,30 @@ void QDesignerToolBar::doInsertWidget( const TQPoint &p )
TQWidget *w = WidgetFactory::create( MainWindow::self->currentTool(), this, 0, true );
installEventFilters( w );
MainWindow::self->formWindow()->insertWidget( w, true );
- QDesignerAction *a = new QDesignerAction( w, parent() );
- int index = actionList.findRef( *actionMap.find( insertAnchor ) );
+ TQDesignerAction *a = new TQDesignerAction( w, tqparent() );
+ int index = actionList.tqfindRef( *actionMap.tqfind( insertAnchor ) );
if ( index != -1 && afterAnchor )
++index;
if ( !insertAnchor )
index = 0;
AddActionToToolBarCommand *cmd = new AddActionToToolBarCommand( i18n("Add Widget '%1' to Toolbar '%2'" ).
- arg( w->name() ).arg( caption() ),
+ tqarg( w->name() ).tqarg( caption() ),
formWindow, a, this, index );
formWindow->commandHistory()->addCommand( cmd );
cmd->execute();
MainWindow::self->resetTool();
}
-void QDesignerToolBar::clear()
+void TQDesignerToolBar::clear()
{
for ( TQAction *a = actionList.first(); a; a = actionList.next() ) {
- if ( a->inherits( "QDesignerAction" ) )
- ( (QDesignerAction*)a )->remove();
+ if ( a->inherits( "TQDesignerAction" ) )
+ ( (TQDesignerAction*)a )->remove();
}
TQToolBar::clear();
}
-void QDesignerToolBar::installEventFilters( TQWidget *w )
+void TQDesignerToolBar::installEventFilters( TQWidget *w )
{
if ( !w )
return;
@@ -697,32 +699,32 @@ void QDesignerToolBar::installEventFilters( TQWidget *w )
-QDesignerMenuBar::QDesignerMenuBar( TQWidget *mw )
+TQDesignerMenuBar::TQDesignerMenuBar( TQWidget *mw )
: TQMenuBar( mw, 0 )
{
show();
setAcceptDrops( true );
- MetaDataBase::addEntry( this );
+ MetaDataBase::addEntry( TQT_TQOBJECT(this) );
itemNum = 0;
mousePressed = false;
lastIndicatorPos = TQPoint( -1, -1 );
insertAt = -1;
- indicator = new QDesignerIndicatorWidget( this );
+ indicator = new TQDesignerIndicatorWidget( this );
indicator->hide();
findFormWindow();
}
-void QDesignerMenuBar::findFormWindow()
+void TQDesignerMenuBar::findFormWindow()
{
TQWidget *w = this;
while ( w ) {
if ( w->inherits( "FormWindow" ) )
formWindow = (FormWindow*)w;
- w = w->parentWidget();
+ w = w->tqparentWidget();
}
}
-void QDesignerMenuBar::contextMenuEvent( TQContextMenuEvent *e )
+void TQDesignerMenuBar::contextMenuEvent( TQContextMenuEvent *e )
{
e->accept();
int itm = itemAtPos( e->pos() );
@@ -736,17 +738,17 @@ void QDesignerMenuBar::contextMenuEvent( TQContextMenuEvent *e )
menu.insertItem( i18n("Rename Item..." ), 2 );
int res = menu.exec( e->globalPos() );
if ( res == 1 ) {
- TQMenuItem *item = findItem( idAt( itm ) );
- RemoveMenuCommand *cmd = new RemoveMenuCommand( i18n("Delete Menu '%1'" ).arg( item->text() ),
+ TQMenuItem *item = tqfindItem( idAt( itm ) );
+ RemoveMenuCommand *cmd = new RemoveMenuCommand( i18n("Delete Menu '%1'" ).tqarg( item->text() ),
formWindow,
- (TQMainWindow*)parentWidget(), this,
- (QDesignerPopupMenu*)item->popup(),
+ (TQMainWindow*)tqparentWidget(), this,
+ (TQDesignerPopupMenu*)item->popup(),
idAt( itm ), itm, item->text() );
formWindow->commandHistory()->addCommand( cmd );
cmd->execute();
- // #### need to do a proper invalidate and re-layout
- parentWidget()->layout()->invalidate();
- parentWidget()->layout()->activate();
+ // #### need to do a proper tqinvalidate and re-tqlayout
+ tqparentWidget()->tqlayout()->tqinvalidate();
+ tqparentWidget()->tqlayout()->activate();
} else if ( res == 2 ) {
bool ok;
TQString old = text( idAt( itm ) );
@@ -754,7 +756,7 @@ void QDesignerMenuBar::contextMenuEvent( TQContextMenuEvent *e )
text( idAt( itm ) ), &ok, 0 );
if ( ok ) {
RenameMenuCommand *cmd = new RenameMenuCommand(
- i18n("Rename Menu '%1' to '%2'" ).arg( old ).arg( txt ),
+ i18n("Rename Menu '%1' to '%2'" ).tqarg( old ).tqarg( txt ),
formWindow, this, idAt( itm ), old, txt );
formWindow->commandHistory()->addCommand( cmd );
cmd->execute();
@@ -762,33 +764,33 @@ void QDesignerMenuBar::contextMenuEvent( TQContextMenuEvent *e )
}
}
-void QDesignerMenuBar::mousePressEvent( TQMouseEvent *e )
+void TQDesignerMenuBar::mousePressEvent( TQMouseEvent *e )
{
lastIndicatorPos = TQPoint( -1, -1 );
insertAt = -1;
mousePressed = true;
- if ( e->button() == MidButton || e->button() == RightButton )
+ if ( e->button() == Qt::MidButton || e->button() == Qt::RightButton )
return;
dragStartPos = e->pos();
TQMenuBar::mousePressEvent( e );
}
-void QDesignerMenuBar::mouseMoveEvent( TQMouseEvent *e )
+void TQDesignerMenuBar::mouseMoveEvent( TQMouseEvent *e )
{
- if ( !mousePressed || e->state() == NoButton ) {
+ if ( !mousePressed || e->state() == Qt::NoButton ) {
TQMenuBar::mouseMoveEvent( e );
return;
}
- if ( QABS( TQPoint( dragStartPos - e->pos() ).manhattanLength() ) < TQApplication::startDragDistance() )
+ if ( TQABS( TQPoint( dragStartPos - e->pos() ).manhattanLength() ) < TQApplication::startDragDistance() )
return;
hidePopups();
activateItemAt( -1 );
int itm = itemAtPos( dragStartPos );
if ( itm == -1 )
return;
- TQPopupMenu *popup = findItem( idAt( itm ) )->popup();
- TQString txt = findItem( idAt( itm ) )->text();
+ TQPopupMenu *popup = tqfindItem( idAt( itm ) )->popup();
+ TQString txt = tqfindItem( idAt( itm ) )->text();
removeItemAt( itm );
TQStoredDrag *drag = new TQStoredDrag( "application/x-designer-menuitem", this );
@@ -812,15 +814,15 @@ void QDesignerMenuBar::mouseMoveEvent( TQMouseEvent *e )
mousePressed = false;
}
-void QDesignerMenuBar::mouseReleaseEvent( TQMouseEvent *e )
+void TQDesignerMenuBar::mouseReleaseEvent( TQMouseEvent *e )
{
TQMenuBar::mouseReleaseEvent( e );
mousePressed = false;
}
-#ifndef QT_NO_DRAGANDDROP
+#ifndef TQT_NO_DRAGANDDROP
-void QDesignerMenuBar::dragEnterEvent( TQDragEnterEvent *e )
+void TQDesignerMenuBar::dragEnterEvent( TQDragEnterEvent *e )
{
if ( e->provides( "application/x-designer-actions" ) ||
e->provides( "application/x-designer-actiongroup" ) ||
@@ -832,7 +834,7 @@ void QDesignerMenuBar::dragEnterEvent( TQDragEnterEvent *e )
insertAt = -1;
}
-void QDesignerMenuBar::dragMoveEvent( TQDragMoveEvent *e )
+void TQDesignerMenuBar::dragMoveEvent( TQDragMoveEvent *e )
{
if ( e->provides( "application/x-designer-actions" ) ||
e->provides( "application/x-designer-menuitem" ) ||
@@ -845,12 +847,12 @@ void QDesignerMenuBar::dragMoveEvent( TQDragMoveEvent *e )
e->provides( "application/x-designer-actiongroup" ) ||
e->provides( "application/x-designer-separator" ) ) {
int item = itemAtPos( e->pos() );
- bool uieffect = TQApplication::isEffectEnabled( UI_AnimateMenu );
- TQApplication::setEffectEnabled( UI_AnimateMenu, false );
- if ( !qApp->activePopupWidget() )
+ bool uieffect = TQApplication::isEffectEnabled( Qt::UI_AnimateMenu );
+ TQApplication::setEffectEnabled( Qt::UI_AnimateMenu, false );
+ if ( !tqApp->activePopupWidget() )
actItem = -1;
activateItemAt( item );
- TQApplication::setEffectEnabled( UI_AnimateMenu, uieffect );
+ TQApplication::setEffectEnabled( Qt::UI_AnimateMenu, uieffect );
if ( item == -1 )
hidePopups();
} else {
@@ -858,28 +860,28 @@ void QDesignerMenuBar::dragMoveEvent( TQDragMoveEvent *e )
}
}
-void QDesignerMenuBar::dragLeaveEvent( TQDragLeaveEvent * )
+void TQDesignerMenuBar::dragLeaveEvent( TQDragLeaveEvent * )
{
mousePressed = false;
lastIndicatorPos = TQPoint( -1, -1 );
insertAt = -1;
}
-void QDesignerMenuBar::dropEvent( TQDropEvent *e )
+void TQDesignerMenuBar::dropEvent( TQDropEvent *e )
{
mousePressed = false;
if ( !e->provides( "application/x-designer-menuitem" ) )
return;
e->accept();
- TQString s( e->encodedData( "application/x-designer-menuitem" ) );
- TQString s1 = s.left( s.find( "/" ) );
- TQString s2 = s.mid( s.find( "/" ) + 1 );
+ TQString s( e->tqencodedData( "application/x-designer-menuitem" ) );
+ TQString s1 = s.left( s.tqfind( "/" ) );
+ TQString s2 = s.mid( s.tqfind( "/" ) + 1 );
TQPopupMenu *popup = (TQPopupMenu*)s1.toLong(); // #### huha, that is evil
TQString txt = s2;
insertItem( txt, popup, -1, insertAt );
- MoveMenuCommand *cmd = new MoveMenuCommand( i18n("Move Menu '%1'" ).arg( txt ), formWindow,
- this, (QDesignerPopupMenu*)popup, oldPos, insertAt, txt );
+ MoveMenuCommand *cmd = new MoveMenuCommand( i18n("Move Menu '%1'" ).tqarg( txt ), formWindow,
+ this, (TQDesignerPopupMenu*)popup, oldPos, insertAt, txt );
// do not execute, we did the work already
formWindow->commandHistory()->addCommand( cmd );
@@ -888,12 +890,12 @@ void QDesignerMenuBar::dropEvent( TQDropEvent *e )
#endif
-TQPoint QDesignerMenuBar::calcIndicatorPos( const TQPoint &pos )
+TQPoint TQDesignerMenuBar::calcIndicatorPos( const TQPoint &pos )
{
int w = frameWidth();
insertAt = count();
for ( int i = 0; i < (int)count(); ++i ) {
- TQRect r = itemRect( i );
+ TQRect r = tqitemRect( i );
if ( pos.x() < w + r.width() / 2 ) {
insertAt = i;
break;
@@ -904,7 +906,7 @@ TQPoint QDesignerMenuBar::calcIndicatorPos( const TQPoint &pos )
return TQPoint( w, 0 );
}
-void QDesignerMenuBar::drawIndicator( const TQPoint &pos )
+void TQDesignerMenuBar::drawIndicator( const TQPoint &pos )
{
if ( lastIndicatorPos == pos )
return;
@@ -918,47 +920,47 @@ void QDesignerMenuBar::drawIndicator( const TQPoint &pos )
TQApplication::sendPostedEvents();
}
-void QDesignerMenuBar::setItemNumber( int num )
+void TQDesignerMenuBar::setItemNumber( int num )
{
itemNum = num;
}
-int QDesignerMenuBar::itemNumber() const
+int TQDesignerMenuBar::itemNumber() const
{
return itemNum;
}
-void QDesignerMenuBar::setItemText( const TQString &s )
+void TQDesignerMenuBar::setItemText( const TQString &s )
{
if ( itemNum < 0 || itemNum >= (int)count() )
return;
changeItem( idAt( itemNum ), s );
}
-TQString QDesignerMenuBar::itemText() const
+TQString TQDesignerMenuBar::itemText() const
{
if ( itemNum < 0 || (int)itemNum >= (int)count() )
- return TQString::null;
+ return TQString();
return text( idAt( itemNum ) );
}
-void QDesignerMenuBar::setItemName( const TQCString &s )
+void TQDesignerMenuBar::setItemName( const TQCString &s )
{
if ( itemNum < 0 || itemNum >= (int)count() )
return;
- findItem( idAt( itemNum ) )->popup()->setName( s );
+ tqfindItem( idAt( itemNum ) )->popup()->setName( s );
}
-TQCString QDesignerMenuBar::itemName() const
+TQCString TQDesignerMenuBar::itemName() const
{
if ( itemNum < 0 || itemNum >= (int)count() )
return "";
- return findItem( idAt( itemNum ) )->popup()->name();
+ return tqfindItem( idAt( itemNum ) )->popup()->name();
}
-QDesignerPopupMenu::QDesignerPopupMenu( TQWidget *w )
+TQDesignerPopupMenu::TQDesignerPopupMenu( TQWidget *w )
: TQPopupMenu( w, 0 ),
popupMenu( 0 )
{
@@ -967,27 +969,27 @@ QDesignerPopupMenu::QDesignerPopupMenu( TQWidget *w )
insertAt = -1;
mousePressed = false;
lastIndicatorPos = TQPoint( -1, -1 );
- indicator = new QDesignerIndicatorWidget( this );
+ indicator = new TQDesignerIndicatorWidget( this );
indicator->hide();
}
-void QDesignerPopupMenu::contextMenuEvent( TQContextMenuEvent *e )
+void TQDesignerPopupMenu::contextMenuEvent( TQContextMenuEvent *e )
{
-#if defined( Q_WS_MAC ) //the mac needs us to use context menu rather than right click
+#if defined( TQ_WS_MAC ) //the mac needs us to use context menu rather than right click
e->accept();
- TQMouseEvent me( TQEvent::MouseButtonPress, e->pos(), e->globalPos(), RightButton, RightButton );
+ TQMouseEvent me( TQEvent::MouseButtonPress, e->pos(), e->globalPos(), Qt::RightButton, Qt::RightButton );
mousePressEvent(&me);
#else
Q_UNUSED( e );
#endif
}
-void QDesignerPopupMenu::mousePressEvent( TQMouseEvent *e )
+void TQDesignerPopupMenu::mousePressEvent( TQMouseEvent *e )
{
- if ( e->button() == MidButton )
+ if ( e->button() == Qt::MidButton )
return;
- if ( e->button() == RightButton ) {
+ if ( e->button() == Qt::RightButton ) {
// A popup for a popup, we only need one, so make sure that
// we don't create multiple. The timer keeps the event loop sane.
popupPos = e->globalPos();
@@ -1004,7 +1006,7 @@ void QDesignerPopupMenu::mousePressEvent( TQMouseEvent *e )
TQPopupMenu::mousePressEvent( e );
}
-void QDesignerPopupMenu::createPopupMenu()
+void TQDesignerPopupMenu::createPopupMenu()
{
// actually creates our popup for the popupmenu.
TQPopupMenu menu( 0 );
@@ -1016,7 +1018,7 @@ void QDesignerPopupMenu::createPopupMenu()
if ( itm == -1 )
return;
TQAction *a = actionList.at( itm );
- if ( a && a->inherits( "QSeparatorAction" ) )
+ if ( a && a->inherits( "TQSeparatorAction" ) )
menu.insertItem( i18n("Delete Separator" ), ID_DELETE );
else
menu.insertItem( i18n("Delete Item" ), ID_DELETE );
@@ -1028,35 +1030,35 @@ void QDesignerPopupMenu::createPopupMenu()
return;
RemoveActionFromPopupCommand *cmd = new RemoveActionFromPopupCommand(
i18n("Delete Action '%1' From Popup Menu '%2'" ).
- arg( a->name() ).arg( caption() ),
+ tqarg( a->name() ).tqarg( caption() ),
formWindow, a, this, itm );
formWindow->commandHistory()->addCommand( cmd );
cmd->execute();
} else if ( res == ID_SEP ) {
TQPoint p( pos() );
calcIndicatorPos( mapFromGlobal( popupPos ) );
- TQAction *a = new QSeparatorAction( 0 );
+ TQAction *a = new TQSeparatorAction( 0 );
AddActionToPopupCommand *cmd = new AddActionToPopupCommand(
i18n("Add Separator to Popup Menu '%1'" ).
arg( name() ),
formWindow, a, this, insertAt );
formWindow->commandHistory()->addCommand( cmd );
cmd->execute();
- ( (QDesignerMenuBar*)( (TQMainWindow*)parentWidget() )->menuBar() )->hidePopups();
- ( (QDesignerMenuBar*)( (TQMainWindow*)parentWidget() )->menuBar() )->activateItemAt( -1 );
+ ( (TQDesignerMenuBar*)( (TQMainWindow*)tqparentWidget() )->menuBar() )->hidePopups();
+ ( (TQDesignerMenuBar*)( (TQMainWindow*)tqparentWidget() )->menuBar() )->activateItemAt( -1 );
popup( p );
}
// set this back to zero so we know a popup (will soon) not exist.
popupMenu = 0;
}
-void QDesignerPopupMenu::mouseMoveEvent( TQMouseEvent *e )
+void TQDesignerPopupMenu::mouseMoveEvent( TQMouseEvent *e )
{
- if ( !mousePressed || e->state() == NoButton ) {
+ if ( !mousePressed || e->state() == Qt::NoButton ) {
TQPopupMenu::mouseMoveEvent( e );
return;
}
- if ( QABS( TQPoint( dragStartPos - e->pos() ).manhattanLength() ) < TQApplication::startDragDistance() ) {
+ if ( TQABS( TQPoint( dragStartPos - e->pos() ).manhattanLength() ) < TQApplication::startDragDistance() ) {
TQPopupMenu::mouseMoveEvent( e );
return;
}
@@ -1067,20 +1069,20 @@ void QDesignerPopupMenu::mouseMoveEvent( TQMouseEvent *e )
if ( !a )
return;
RemoveActionFromPopupCommand *cmd = new RemoveActionFromPopupCommand( i18n("Delete Action '%1' From Popup Menu '%2'" ).
- arg( a->name() ).arg( caption() ),
+ tqarg( a->name() ).tqarg( caption() ),
formWindow, a, this, itm );
formWindow->commandHistory()->addCommand( cmd );
cmd->execute();
TQString type = a->inherits( TQACTIONGROUP_OBJECT_NAME_STRING ) ? TQString( "application/x-designer-actiongroup" ) :
- a->inherits( "QSeparatorAction" ) ? TQString( "application/x-designer-separator" ) : TQString( "application/x-designer-actions" );
+ a->inherits( "TQSeparatorAction" ) ? 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 ( !drag->drag() ) {
AddActionToPopupCommand *cmd = new AddActionToPopupCommand( i18n("Add Action '%1' to Popup Menu '%2'" ).
- arg( a->name() ).arg( name() ),
+ tqarg( a->name() ).tqarg( name() ),
formWindow, a, this, itm );
formWindow->commandHistory()->addCommand( cmd );
cmd->execute();
@@ -1090,15 +1092,15 @@ void QDesignerPopupMenu::mouseMoveEvent( TQMouseEvent *e )
mousePressed = false;
}
-void QDesignerPopupMenu::mouseReleaseEvent( TQMouseEvent *e )
+void TQDesignerPopupMenu::mouseReleaseEvent( TQMouseEvent *e )
{
mousePressed = false;
TQPopupMenu::mouseReleaseEvent( e );
}
-#ifndef QT_NO_DRAGANDDROP
+#ifndef TQT_NO_DRAGANDDROP
-void QDesignerPopupMenu::dragEnterEvent( TQDragEnterEvent *e )
+void TQDesignerPopupMenu::dragEnterEvent( TQDragEnterEvent *e )
{
mousePressed = false;
lastIndicatorPos = TQPoint( -1, -1 );
@@ -1108,7 +1110,7 @@ void QDesignerPopupMenu::dragEnterEvent( TQDragEnterEvent *e )
e->accept();
}
-void QDesignerPopupMenu::dragMoveEvent( TQDragMoveEvent *e )
+void TQDesignerPopupMenu::dragMoveEvent( TQDragMoveEvent *e )
{
mousePressed = false;
if ( e->provides( "application/x-designer-actions" ) ||
@@ -1120,14 +1122,14 @@ void QDesignerPopupMenu::dragMoveEvent( TQDragMoveEvent *e )
drawIndicator( calcIndicatorPos( e->pos() ) );
}
-void QDesignerPopupMenu::dragLeaveEvent( TQDragLeaveEvent * )
+void TQDesignerPopupMenu::dragLeaveEvent( TQDragLeaveEvent * )
{
mousePressed = false;
indicator->hide();
insertAt = -1;
}
-void QDesignerPopupMenu::dropEvent( TQDropEvent *e )
+void TQDesignerPopupMenu::dropEvent( TQDropEvent *e )
{
mousePressed = false;
if ( e->provides( "application/x-designer-actions" ) ||
@@ -1140,20 +1142,20 @@ void QDesignerPopupMenu::dropEvent( TQDropEvent *e )
TQPoint p = pos();
TQAction *a = 0;
if ( e->provides( "application/x-designer-actiongroup" ) ) {
- TQString s( e->encodedData( "application/x-designer-actiongroup" ) );
- a = (QDesignerActionGroup*)s.toLong();
+ TQString s( e->tqencodedData( "application/x-designer-actiongroup" ) );
+ a = (TQDesignerActionGroup*)s.toLong();
} else {
TQString s;
if ( e->provides( "application/x-designer-separator" ) ) {
- s = TQString( e->encodedData( "application/x-designer-separator" ) );
- a = (QSeparatorAction*)s.toLong();
+ s = TQString( e->tqencodedData( "application/x-designer-separator" ) );
+ a = (TQSeparatorAction*)s.toLong();
} else {
- s = TQString( e->encodedData( "application/x-designer-actions" ) );
- a = (QDesignerAction*)s.toLong();
+ s = TQString( e->tqencodedData( "application/x-designer-actions" ) );
+ a = (TQDesignerAction*)s.toLong();
}
}
- if ( actionList.findRef( a ) != -1 ) {
+ if ( actionList.tqfindRef( a ) != -1 ) {
TQMessageBox::warning( MainWindow::self, i18n("Insert/Move Action" ),
i18n("Action '%1' has already been added to this menu.\n"
"An Action may only occur once in a given menu." ).
@@ -1162,27 +1164,27 @@ void QDesignerPopupMenu::dropEvent( TQDropEvent *e )
}
AddActionToPopupCommand *cmd = new AddActionToPopupCommand( i18n("Add Action '%1' to Popup Menu '%2'" ).
- arg( a->name() ).arg( name() ),
+ tqarg( a->name() ).tqarg( name() ),
formWindow, a, this, insertAt );
formWindow->commandHistory()->addCommand( cmd );
cmd->execute();
- ( (QDesignerMenuBar*)( (TQMainWindow*)parentWidget() )->menuBar() )->hidePopups();
- ( (QDesignerMenuBar*)( (TQMainWindow*)parentWidget() )->menuBar() )->activateItemAt( -1 );
+ ( (TQDesignerMenuBar*)( (TQMainWindow*)tqparentWidget() )->menuBar() )->hidePopups();
+ ( (TQDesignerMenuBar*)( (TQMainWindow*)tqparentWidget() )->menuBar() )->activateItemAt( -1 );
indicator->hide();
popup( p );
}
#endif
-void QDesignerPopupMenu::reInsert()
+void TQDesignerPopupMenu::reInsert()
{
clear();
for ( TQAction *a = actionList.first(); a; a = actionList.next() )
a->addTo( this );
}
-void QDesignerPopupMenu::drawIndicator( const TQPoint &pos )
+void TQDesignerPopupMenu::drawIndicator( const TQPoint &pos )
{
if ( lastIndicatorPos == pos )
return;
@@ -1196,7 +1198,7 @@ void QDesignerPopupMenu::drawIndicator( const TQPoint &pos )
TQApplication::sendPostedEvents();
}
-TQPoint QDesignerPopupMenu::calcIndicatorPos( const TQPoint &pos )
+TQPoint TQDesignerPopupMenu::calcIndicatorPos( const TQPoint &pos )
{
int h = frameWidth();
insertAt = count();
@@ -1212,18 +1214,18 @@ TQPoint QDesignerPopupMenu::calcIndicatorPos( const TQPoint &pos )
return TQPoint( 0, h );
}
-void QDesignerPopupMenu::addAction( TQAction *a )
+void TQDesignerPopupMenu::addAction( TQAction *a )
{
actionList.append( a );
connect( a, TQT_SIGNAL( destroyed() ), this, TQT_SLOT( actionRemoved() ) );
}
-void QDesignerPopupMenu::actionRemoved()
+void TQDesignerPopupMenu::actionRemoved()
{
actionList.removeRef( (TQAction*)sender() );
}
-void QDesignerPopupMenu::paintEvent( TQPaintEvent *e )
+void TQDesignerPopupMenu::paintEvent( TQPaintEvent *e )
{
TQPopupMenu::paintEvent( e );
if ( e->rect() != rect() )
@@ -1231,13 +1233,13 @@ void QDesignerPopupMenu::paintEvent( TQPaintEvent *e )
lastIndicatorPos = TQPoint( -1, -1 );
}
-void QDesignerPopupMenu::findFormWindow()
+void TQDesignerPopupMenu::findFormWindow()
{
TQWidget *w = this;
while ( w ) {
if ( w->inherits( "FormWindow" ) )
formWindow = (FormWindow*)w;
- w = w->parentWidget();
+ w = w->tqparentWidget();
}
}