summaryrefslogtreecommitdiffstats
path: root/kommander/editor/actiondnd.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'kommander/editor/actiondnd.cpp')
-rw-r--r--kommander/editor/actiondnd.cpp500
1 files changed, 250 insertions, 250 deletions
diff --git a/kommander/editor/actiondnd.cpp b/kommander/editor/actiondnd.cpp
index 0da7c650..17d8af3f 100644
--- a/kommander/editor/actiondnd.cpp
+++ b/kommander/editor/actiondnd.cpp
@@ -18,19 +18,19 @@
**
**********************************************************************/
-#include <qaction.h>
-#include <qapplication.h>
-#include <qbitmap.h>
-#include <qdragobject.h>
+#include <tqaction.h>
+#include <tqapplication.h>
+#include <tqbitmap.h>
+#include <tqdragobject.h>
#include <kinputdialog.h>
-#include <qlayout.h>
-#include <qmainwindow.h>
-#include <qmenudata.h>
-#include <qmessagebox.h>
-#include <qobjectlist.h>
-#include <qpainter.h>
-#include <qstyle.h>
-#include <qtimer.h>
+#include <tqlayout.h>
+#include <tqmainwindow.h>
+#include <tqmenudata.h>
+#include <tqmessagebox.h>
+#include <tqobjectlist.h>
+#include <tqpainter.h>
+#include <tqstyle.h>
+#include <tqtimer.h>
#include "actiondnd.h"
#include "command.h"
@@ -42,23 +42,23 @@
#include <klocale.h>
-bool QDesignerAction::addTo( QWidget *w )
+bool QDesignerAction::addTo( TQWidget *w )
{
if ( !widgetToInsert )
- return QAction::addTo( w );
+ return TQAction::addTo( w );
- if ( w->inherits( "QPopupMenu" ) )
+ if ( w->inherits( "TQPopupMenu" ) )
return false;
- widgetToInsert->reparent( w, QPoint( 0, 0 ), false );
+ widgetToInsert->reparent( w, TQPoint( 0, 0 ), false );
addedTo( widgetToInsert, w );
return true;
}
-bool QDesignerAction::removeFrom( QWidget *w )
+bool QDesignerAction::removeFrom( TQWidget *w )
{
if ( !widgetToInsert )
- return QAction::removeFrom( w );
+ return TQAction::removeFrom( w );
remove();
return true;
@@ -69,19 +69,19 @@ void QDesignerAction::remove()
if ( !widgetToInsert )
return;
MainWindow::self->formWindow()->selectWidget( widgetToInsert, false );
- widgetToInsert->reparent( 0, QPoint( 0, 0 ), false );
+ widgetToInsert->reparent( 0, TQPoint( 0, 0 ), false );
}
-QDesignerToolBarSeparator::QDesignerToolBarSeparator(Orientation o , QToolBar *parent,
+QDesignerToolBarSeparator::QDesignerToolBarSeparator(Orientation o , TQToolBar *parent,
const char* name )
- : QWidget( parent, name )
+ : TQWidget( parent, name )
{
- connect( parent, SIGNAL(orientationChanged(Orientation)),
- this, SLOT(setOrientation(Orientation)) );
+ connect( parent, TQT_SIGNAL(orientationChanged(Orientation)),
+ this, TQT_SLOT(setOrientation(Orientation)) );
setOrientation( o );
setBackgroundMode( parent->backgroundMode() );
setBackgroundOrigin( ParentOrigin );
- setSizePolicy( QSizePolicy( QSizePolicy::Minimum, QSizePolicy::Minimum ) );
+ setSizePolicy( TQSizePolicy( TQSizePolicy::Minimum, TQSizePolicy::Minimum ) );
}
void QDesignerToolBarSeparator::setOrientation( Orientation o )
@@ -89,67 +89,67 @@ void QDesignerToolBarSeparator::setOrientation( Orientation o )
orient = o;
}
-void QDesignerToolBarSeparator::styleChange( QStyle& )
+void QDesignerToolBarSeparator::styleChange( TQStyle& )
{
setOrientation( orient );
}
-QSize QDesignerToolBarSeparator::sizeHint() const
+TQSize QDesignerToolBarSeparator::sizeHint() const
{
- int extent = style().pixelMetric( QStyle::PM_DockWindowSeparatorExtent,
+ int extent = style().pixelMetric( TQStyle::PM_DockWindowSeparatorExtent,
this );
if ( orient == Horizontal )
- return QSize( extent, 0 );
+ return TQSize( extent, 0 );
else
- return QSize( 0, extent );
+ return TQSize( 0, extent );
}
-void QDesignerToolBarSeparator::paintEvent( QPaintEvent * )
+void QDesignerToolBarSeparator::paintEvent( TQPaintEvent * )
{
- QPainter p( this );
- QStyle::SFlags flags = QStyle::Style_Default;
+ TQPainter p( this );
+ TQStyle::SFlags flags = TQStyle::Style_Default;
if ( orientation() == Horizontal )
- flags |= QStyle::Style_Horizontal;
+ flags |= TQStyle::Style_Horizontal;
- style().drawPrimitive( QStyle::PE_DockWindowSeparator, &p, rect(),
+ style().drawPrimitive( TQStyle::PE_DockWindowSeparator, &p, rect(),
colorGroup(), flags );
}
-QSeparatorAction::QSeparatorAction( QObject *parent )
- : QAction( parent, "qt_designer_separator" ), wid( 0 )
+QSeparatorAction::QSeparatorAction( TQObject *parent )
+ : TQAction( parent, "qt_designer_separator" ), wid( 0 )
{
}
-bool QSeparatorAction::addTo( QWidget *w )
+bool QSeparatorAction::addTo( TQWidget *w )
{
- if ( w->inherits( "QToolBar" ) ) {
- QToolBar *tb = (QToolBar*)w;
+ if ( w->inherits( "TQToolBar" ) ) {
+ TQToolBar *tb = (TQToolBar*)w;
wid = new QDesignerToolBarSeparator( tb->orientation(), tb );
return true;
- } else if ( w->inherits( "QPopupMenu" ) ) {
- idx = ( (QPopupMenu*)w )->count();
- ( (QPopupMenu*)w )->insertSeparator( idx );
+ } else if ( w->inherits( "TQPopupMenu" ) ) {
+ idx = ( (TQPopupMenu*)w )->count();
+ ( (TQPopupMenu*)w )->insertSeparator( idx );
return true;
}
return false;
}
-bool QSeparatorAction::removeFrom( QWidget *w )
+bool QSeparatorAction::removeFrom( TQWidget *w )
{
- if ( w->inherits( "QToolBar" ) ) {
+ if ( w->inherits( "TQToolBar" ) ) {
delete wid;
return true;
- } else if ( w->inherits( "QPopupMenu" ) ) {
- ( (QPopupMenu*)w )->removeItemAt( idx );
+ } else if ( w->inherits( "TQPopupMenu" ) ) {
+ ( (TQPopupMenu*)w )->removeItemAt( idx );
return true;
}
return false;
}
-QWidget *QSeparatorAction::widget() const
+TQWidget *QSeparatorAction::widget() const
{
return wid;
}
@@ -157,14 +157,14 @@ QWidget *QSeparatorAction::widget() const
-QDesignerToolBar::QDesignerToolBar( QMainWindow *mw )
- : QToolBar( mw ), lastIndicatorPos( -1, -1 )
+QDesignerToolBar::QDesignerToolBar( TQMainWindow *mw )
+ : TQToolBar( mw ), lastIndicatorPos( -1, -1 )
{
insertAnchor = 0;
afterAnchor = true;
setAcceptDrops( true );
MetaDataBase::addEntry( this );
- lastIndicatorPos = QPoint( -1, -1 );
+ lastIndicatorPos = TQPoint( -1, -1 );
indicator = new QDesignerIndicatorWidget( this );
indicator->hide();
installEventFilter( this );
@@ -173,8 +173,8 @@ QDesignerToolBar::QDesignerToolBar( QMainWindow *mw )
mw->setDockEnabled( DockTornOff, false );
}
-QDesignerToolBar::QDesignerToolBar( QMainWindow *mw, Dock dock )
- : QToolBar( QString::null, mw, dock), lastIndicatorPos( -1, -1 )
+QDesignerToolBar::QDesignerToolBar( TQMainWindow *mw, Dock dock )
+ : TQToolBar( TQString::null, mw, dock), lastIndicatorPos( -1, -1 )
{
insertAnchor = 0;
afterAnchor = true;
@@ -190,7 +190,7 @@ QDesignerToolBar::QDesignerToolBar( QMainWindow *mw, Dock dock )
void QDesignerToolBar::findFormWindow()
{
- QWidget *w = this;
+ TQWidget *w = this;
while ( w ) {
if ( w->inherits( "FormWindow" ) )
formWindow = (FormWindow*)w;
@@ -198,11 +198,11 @@ void QDesignerToolBar::findFormWindow()
}
}
-void QDesignerToolBar::addAction( QAction *a )
+void QDesignerToolBar::addAction( TQAction *a )
{
actionList.append( a );
- connect( a, SIGNAL( destroyed() ), this, SLOT( actionRemoved() ) );
- if ( a->inherits( "QActionGroup" ) ) {
+ connect( a, TQT_SIGNAL( destroyed() ), this, TQT_SLOT( actionRemoved() ) );
+ if ( a->inherits( "TQActionGroup" ) ) {
( (QDesignerActionGroup*)a )->widget()->installEventFilter( this );
actionMap.insert( ( (QDesignerActionGroup*)a )->widget(), a );
} else if ( a->inherits( "QSeparatorAction" ) ) {
@@ -214,83 +214,83 @@ void QDesignerToolBar::addAction( QAction *a )
}
}
-static void fixObject( QObject *&o )
+static void fixObject( TQObject *&o )
{
while ( o && o->parent() && !o->parent()->inherits( "QDesignerToolBar" ) )
o = o->parent();
}
-bool QDesignerToolBar::eventFilter( QObject *o, QEvent *e )
+bool QDesignerToolBar::eventFilter( TQObject *o, TQEvent *e )
{
if ( !o || !e || o->inherits( "QDockWindowHandle" ) || o->inherits( "QDockWindowTitleBar" ) )
- return QToolBar::eventFilter( o, e );
+ return TQToolBar::eventFilter( o, e );
- if ( o == this && e->type() == QEvent::MouseButtonPress &&
- ( ( QMouseEvent*)e )->button() == LeftButton ) {
- mousePressEvent( (QMouseEvent*)e );
+ if ( o == this && e->type() == TQEvent::MouseButtonPress &&
+ ( ( TQMouseEvent*)e )->button() == LeftButton ) {
+ mousePressEvent( (TQMouseEvent*)e );
return true;
}
if ( o == this )
- return QToolBar::eventFilter( o, e );
+ return TQToolBar::eventFilter( o, e );
- if ( e->type() == QEvent::MouseButtonPress ) {
- QMouseEvent *ke = (QMouseEvent*)e;
+ if ( e->type() == TQEvent::MouseButtonPress ) {
+ TQMouseEvent *ke = (TQMouseEvent*)e;
fixObject( o );
if ( !o )
return false;
buttonMousePressEvent( ke, o );
return true;
- } else if(e->type() == QEvent::ContextMenu ) {
- QContextMenuEvent *ce = (QContextMenuEvent*)e;
+ } else if(e->type() == TQEvent::ContextMenu ) {
+ TQContextMenuEvent *ce = (TQContextMenuEvent*)e;
fixObject( o );
if( !o )
return false;
buttonContextMenuEvent( ce, o );
return true;
- } else if ( e->type() == QEvent::MouseMove ) {
- QMouseEvent *ke = (QMouseEvent*)e;
+ } else if ( e->type() == TQEvent::MouseMove ) {
+ TQMouseEvent *ke = (TQMouseEvent*)e;
fixObject( o );
if ( !o )
return false;
buttonMouseMoveEvent( ke, o );
return true;
- } else if ( e->type() == QEvent::MouseButtonRelease ) {
- QMouseEvent *ke = (QMouseEvent*)e;
+ } else if ( e->type() == TQEvent::MouseButtonRelease ) {
+ TQMouseEvent *ke = (TQMouseEvent*)e;
fixObject( o );
if ( !o )
return false;
buttonMouseReleaseEvent( ke, o );
return true;
- } else if ( e->type() == QEvent::DragEnter ) {
- QDragEnterEvent *de = (QDragEnterEvent*)e;
+ } else if ( e->type() == TQEvent::DragEnter ) {
+ TQDragEnterEvent *de = (TQDragEnterEvent*)e;
if ( de->provides( "application/x-designer-actions" ) ||
de->provides( "application/x-designer-actiongroup" ) ||
de->provides( "application/x-designer-separator" ) )
de->accept();
- } else if ( e->type() == QEvent::DragMove ) {
- QDragMoveEvent *de = (QDragMoveEvent*)e;
+ } else if ( e->type() == TQEvent::DragMove ) {
+ TQDragMoveEvent *de = (TQDragMoveEvent*)e;
if ( de->provides( "application/x-designer-actions" ) ||
de->provides( "application/x-designer-actiongroup" ) ||
de->provides( "application/x-designer-separator" ) )
de->accept();
}
- return QToolBar::eventFilter( o, e );
+ return TQToolBar::eventFilter( o, e );
}
-void QDesignerToolBar::paintEvent( QPaintEvent *e )
+void QDesignerToolBar::paintEvent( TQPaintEvent *e )
{
- QToolBar::paintEvent( e );
+ TQToolBar::paintEvent( e );
if ( e->rect() != rect() )
return;
- lastIndicatorPos = QPoint( -1, -1 );
+ lastIndicatorPos = TQPoint( -1, -1 );
}
-void QDesignerToolBar::contextMenuEvent( QContextMenuEvent *e )
+void QDesignerToolBar::contextMenuEvent( TQContextMenuEvent *e )
{
e->accept();
- QPopupMenu menu( 0 );
+ TQPopupMenu menu( 0 );
menu.insertItem( i18n("Delete Toolbar" ), 1 );
int res = menu.exec( e->globalPos() );
if ( res != -1 ) {
@@ -301,7 +301,7 @@ void QDesignerToolBar::contextMenuEvent( QContextMenuEvent *e )
}
}
-void QDesignerToolBar::mousePressEvent( QMouseEvent *e )
+void QDesignerToolBar::mousePressEvent( TQMouseEvent *e )
{
widgetInserting = false;
if ( e->button() == LeftButton &&
@@ -318,14 +318,14 @@ void QDesignerToolBar::mousePressEvent( QMouseEvent *e )
}
}
-void QDesignerToolBar::mouseReleaseEvent( QMouseEvent *e )
+void QDesignerToolBar::mouseReleaseEvent( TQMouseEvent *e )
{
if ( widgetInserting )
doInsertWidget( mapFromGlobal( e->globalPos() ) );
widgetInserting = false;
}
-void QDesignerToolBar::buttonMouseReleaseEvent( QMouseEvent *e, QObject *w )
+void QDesignerToolBar::buttonMouseReleaseEvent( TQMouseEvent *e, TQObject *w )
{
if ( widgetInserting )
doInsertWidget( mapFromGlobal( e->globalPos() ) );
@@ -336,14 +336,14 @@ void QDesignerToolBar::buttonMouseReleaseEvent( QMouseEvent *e, QObject *w )
widgetInserting = false;
}
-void QDesignerToolBar::buttonContextMenuEvent( QContextMenuEvent *e, QObject *o )
+void QDesignerToolBar::buttonContextMenuEvent( TQContextMenuEvent *e, TQObject *o )
{
e->accept();
- QPopupMenu menu( 0 );
+ TQPopupMenu menu( 0 );
const int ID_DELETE = 1;
const int ID_SEP = 2;
const int ID_DELTOOLBAR = 3;
- QMap<QWidget*, QAction*>::Iterator it = actionMap.find( (QWidget*)o );
+ TQMap<TQWidget*, TQAction*>::Iterator it = actionMap.find( (TQWidget*)o );
if ( it != actionMap.end() && (*it)->inherits( "QSeparatorAction" ) )
menu.insertItem( i18n("Delete Separator" ), ID_DELETE );
else
@@ -353,10 +353,10 @@ void QDesignerToolBar::buttonContextMenuEvent( QContextMenuEvent *e, QObject *o
menu.insertItem( i18n("Delete Toolbar" ), ID_DELTOOLBAR );
int res = menu.exec( e->globalPos() );
if ( res == ID_DELETE ) {
- QMap<QWidget*, QAction*>::Iterator it = actionMap.find( (QWidget*)o );
+ TQMap<TQWidget*, TQAction*>::Iterator it = actionMap.find( (TQWidget*)o );
if ( it == actionMap.end() )
return;
- QAction *a = *it;
+ TQAction *a = *it;
int index = actionList.find( a );
RemoveActionFromToolBarCommand *cmd = new RemoveActionFromToolBarCommand(
i18n("Delete Action '%1' From Toolbar '%2'" ).
@@ -366,7 +366,7 @@ void QDesignerToolBar::buttonContextMenuEvent( QContextMenuEvent *e, QObject *o
cmd->execute();
} else if ( res == ID_SEP ) {
calcIndicatorPos( mapFromGlobal( e->globalPos() ) );
- QAction *a = new QSeparatorAction( 0 );
+ TQAction *a = new QSeparatorAction( 0 );
int index = actionList.findRef( *actionMap.find( insertAnchor ) );
if ( index != -1 && afterAnchor )
++index;
@@ -387,7 +387,7 @@ void QDesignerToolBar::buttonContextMenuEvent( QContextMenuEvent *e, QObject *o
}
}
-void QDesignerToolBar::buttonMousePressEvent( QMouseEvent *e, QObject * )
+void QDesignerToolBar::buttonMousePressEvent( TQMouseEvent *e, TQObject * )
{
widgetInserting = false;
@@ -411,12 +411,12 @@ void QDesignerToolBar::buttonMousePressEvent( QMouseEvent *e, QObject * )
dragStartPos = e->pos();
}
-void QDesignerToolBar::removeWidget( QWidget *w )
+void QDesignerToolBar::removeWidget( TQWidget *w )
{
- QMap<QWidget*, QAction*>::Iterator it = actionMap.find( w );
+ TQMap<TQWidget*, TQAction*>::Iterator it = actionMap.find( w );
if ( it == actionMap.end() )
return;
- QAction *a = *it;
+ TQAction *a = *it;
int index = actionList.find( a );
RemoveActionFromToolBarCommand *cmd =
new RemoveActionFromToolBarCommand( i18n("Delete Action '%1' From Toolbar '%2'" ).
@@ -424,20 +424,20 @@ void QDesignerToolBar::removeWidget( QWidget *w )
formWindow, a, this, index );
formWindow->commandHistory()->addCommand( cmd );
cmd->execute();
- QApplication::sendPostedEvents();
+ TQApplication::sendPostedEvents();
adjustSize();
}
-void QDesignerToolBar::buttonMouseMoveEvent( QMouseEvent *e, QObject *o )
+void QDesignerToolBar::buttonMouseMoveEvent( TQMouseEvent *e, TQObject *o )
{
if ( widgetInserting || ( e->state() & LeftButton ) == 0 )
return;
- if ( QABS( QPoint( dragStartPos - e->pos() ).manhattanLength() ) < QApplication::startDragDistance() )
+ if ( QABS( TQPoint( dragStartPos - e->pos() ).manhattanLength() ) < TQApplication::startDragDistance() )
return;
- QMap<QWidget*, QAction*>::Iterator it = actionMap.find( (QWidget*)o );
+ TQMap<TQWidget*, TQAction*>::Iterator it = actionMap.find( (TQWidget*)o );
if ( it == actionMap.end() )
return;
- QAction *a = *it;
+ TQAction *a = *it;
if ( !a )
return;
int index = actionList.find( a );
@@ -447,14 +447,14 @@ void QDesignerToolBar::buttonMouseMoveEvent( QMouseEvent *e, QObject *o )
formWindow, a, this, index );
formWindow->commandHistory()->addCommand( cmd );
cmd->execute();
- QApplication::sendPostedEvents();
+ TQApplication::sendPostedEvents();
adjustSize();
- QString type = a->inherits( "QActionGroup" ) ? QString( "application/x-designer-actiongroup" ) :
- a->inherits( "QSeparatorAction" ) ? QString( "application/x-designer-separator" ) : QString( "application/x-designer-actions" );
- QStoredDrag *drag = new QStoredDrag( type, this );
- QString s = QString::number( (long)a ); // #### huha, that is evil
- drag->setEncodedData( QCString( s.latin1() ) );
+ TQString type = a->inherits( "TQActionGroup" ) ? TQString( "application/x-designer-actiongroup" ) :
+ 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( "QDesignerAction" ) ) {
if ( formWindow->widgets()->find( ( (QDesignerAction*)a )->widget() ) )
@@ -467,23 +467,23 @@ void QDesignerToolBar::buttonMouseMoveEvent( QMouseEvent *e, QObject *o )
formWindow->commandHistory()->addCommand( cmd );
cmd->execute();
}
- lastIndicatorPos = QPoint( -1, -1 );
+ lastIndicatorPos = TQPoint( -1, -1 );
indicator->hide();
}
#ifndef QT_NO_DRAGANDDROP
-void QDesignerToolBar::dragEnterEvent( QDragEnterEvent *e )
+void QDesignerToolBar::dragEnterEvent( TQDragEnterEvent *e )
{
widgetInserting = false;
- lastIndicatorPos = QPoint( -1, -1 );
+ lastIndicatorPos = TQPoint( -1, -1 );
if ( e->provides( "application/x-designer-actions" ) ||
e->provides( "application/x-designer-actiongroup" ) ||
e->provides( "application/x-designer-separator" ) )
e->accept();
}
-void QDesignerToolBar::dragMoveEvent( QDragMoveEvent *e )
+void QDesignerToolBar::dragMoveEvent( TQDragMoveEvent *e )
{
if ( e->provides( "application/x-designer-actions" ) ||
e->provides( "application/x-designer-actiongroup" ) ||
@@ -494,14 +494,14 @@ void QDesignerToolBar::dragMoveEvent( QDragMoveEvent *e )
drawIndicator( calcIndicatorPos( e->pos() ) );
}
-void QDesignerToolBar::dragLeaveEvent( QDragLeaveEvent * )
+void QDesignerToolBar::dragLeaveEvent( TQDragLeaveEvent * )
{
indicator->hide();
insertAnchor = 0;
afterAnchor = true;
}
-void QDesignerToolBar::dropEvent( QDropEvent *e )
+void QDesignerToolBar::dropEvent( TQDropEvent *e )
{
if ( e->provides( "application/x-designer-actions" ) ||
e->provides( "application/x-designer-actiongroup" ) ||
@@ -509,16 +509,16 @@ void QDesignerToolBar::dropEvent( QDropEvent *e )
e->accept();
else
return;
- QString s;
+ TQString s;
if ( e->provides( "application/x-designer-actiongroup" ) )
- s = QString( e->encodedData( "application/x-designer-actiongroup" ) );
+ s = TQString( e->encodedData( "application/x-designer-actiongroup" ) );
else if ( e->provides( "application/x-designer-separator" ) )
- s = QString( e->encodedData( "application/x-designer-separator" ) );
+ s = TQString( e->encodedData( "application/x-designer-separator" ) );
else
- s = QString( e->encodedData( "application/x-designer-actions" ) );
+ s = TQString( e->encodedData( "application/x-designer-actions" ) );
indicator->hide();
- QAction *a = 0;
+ TQAction *a = 0;
int index = actionList.findRef( *actionMap.find( insertAnchor ) );
if ( index != -1 && afterAnchor )
++index;
@@ -535,7 +535,7 @@ void QDesignerToolBar::dropEvent( QDropEvent *e )
}
if ( actionList.findRef( a ) != -1 ) {
- QMessageBox::warning( MainWindow::self, i18n("Insert/Move Action" ),
+ 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." ).
arg( a->name() ) );
@@ -548,19 +548,19 @@ void QDesignerToolBar::dropEvent( QDropEvent *e )
formWindow->commandHistory()->addCommand( cmd );
cmd->execute();
- lastIndicatorPos = QPoint( -1, -1 );
+ lastIndicatorPos = TQPoint( -1, -1 );
}
#endif
void QDesignerToolBar::reInsert()
{
- QAction *a = 0;
+ TQAction *a = 0;
actionMap.clear();
clear();
for ( a = actionList.first(); a; a = actionList.next() ) {
a->addTo( this );
- if ( a->inherits( "QActionGroup" ) ) {
+ if ( a->inherits( "TQActionGroup" ) ) {
actionMap.insert( ( (QDesignerActionGroup*)a )->widget(), a );
if ( ( (QDesignerActionGroup*)a )->widget() )
( (QDesignerActionGroup*)a )->widget()->installEventFilter( this );
@@ -572,31 +572,31 @@ void QDesignerToolBar::reInsert()
( (QSeparatorAction*)a )->widget()->installEventFilter( this );
}
}
- QApplication::sendPostedEvents();
+ TQApplication::sendPostedEvents();
adjustSize();
}
void QDesignerToolBar::actionRemoved()
{
- actionList.removeRef( (QAction*)sender() );
+ actionList.removeRef( (TQAction*)sender() );
}
-QPoint QDesignerToolBar::calcIndicatorPos( const QPoint &pos )
+TQPoint QDesignerToolBar::calcIndicatorPos( const TQPoint &pos )
{
if ( orientation() == Horizontal ) {
- QPoint pnt( width() - 2, 0 );
+ TQPoint pnt( width() - 2, 0 );
insertAnchor = 0;
afterAnchor = true;
if ( !children() )
return pnt;
- pnt = QPoint( 13, 0 );
- QObjectListIt it( *children() );
- QObject * obj;
+ pnt = TQPoint( 13, 0 );
+ TQObjectListIt it( *children() );
+ TQObject * obj;
while( (obj=it.current()) != 0 ) {
++it;
if ( obj->isWidgetType() &&
qstrcmp( "qt_dockwidget_internal", obj->name() ) != 0 ) {
- QWidget *w = (QWidget*)obj;
+ TQWidget *w = (TQWidget*)obj;
if ( w->x() < pos.x() ) {
pnt.setX( w->x() + w->width() + 1 );
insertAnchor = w;
@@ -606,19 +606,19 @@ QPoint QDesignerToolBar::calcIndicatorPos( const QPoint &pos )
}
return pnt;
} else {
- QPoint pnt( 0, height() - 2 );
+ TQPoint pnt( 0, height() - 2 );
insertAnchor = 0;
afterAnchor = true;
if ( !children() )
return pnt;
- pnt = QPoint( 0, 13 );
- QObjectListIt it( *children() );
- QObject * obj;
+ pnt = TQPoint( 0, 13 );
+ TQObjectListIt it( *children() );
+ TQObject * obj;
while( (obj=it.current()) != 0 ) {
++it;
if ( obj->isWidgetType() &&
qstrcmp( "qt_dockwidget_internal", obj->name() ) != 0 ) {
- QWidget *w = (QWidget*)obj;
+ TQWidget *w = (TQWidget*)obj;
if ( w->y() < pos.y() ) {
pnt.setY( w->y() + w->height() + 1 );
insertAnchor = w;
@@ -630,36 +630,36 @@ QPoint QDesignerToolBar::calcIndicatorPos( const QPoint &pos )
}
}
-void QDesignerToolBar::drawIndicator( const QPoint &pos )
+void QDesignerToolBar::drawIndicator( const TQPoint &pos )
{
if ( lastIndicatorPos == pos )
return;
bool wasVsisible = indicator->isVisible();
if ( orientation() == Horizontal ) {
indicator->resize( 3, height() );
- if ( pos != QPoint( -1, -1 ) )
+ if ( pos != TQPoint( -1, -1 ) )
indicator->move( pos.x() - 1, 0 );
indicator->show();
indicator->raise();
lastIndicatorPos = pos;
} else {
indicator->resize( width(), 3 );
- if ( pos != QPoint( -1, -1 ) )
+ if ( pos != TQPoint( -1, -1 ) )
indicator->move( 0, pos.y() - 1 );
indicator->show();
indicator->raise();
lastIndicatorPos = pos;
}
if ( !wasVsisible )
- QApplication::sendPostedEvents();
+ TQApplication::sendPostedEvents();
}
-void QDesignerToolBar::doInsertWidget( const QPoint &p )
+void QDesignerToolBar::doInsertWidget( const TQPoint &p )
{
if ( formWindow != MainWindow::self->formWindow() )
return;
calcIndicatorPos( p );
- QWidget *w = WidgetFactory::create( MainWindow::self->currentTool(), this, 0, true );
+ TQWidget *w = WidgetFactory::create( MainWindow::self->currentTool(), this, 0, true );
installEventFilters( w );
MainWindow::self->formWindow()->insertWidget( w, true );
QDesignerAction *a = new QDesignerAction( w, parent() );
@@ -678,34 +678,34 @@ void QDesignerToolBar::doInsertWidget( const QPoint &p )
void QDesignerToolBar::clear()
{
- for ( QAction *a = actionList.first(); a; a = actionList.next() ) {
+ for ( TQAction *a = actionList.first(); a; a = actionList.next() ) {
if ( a->inherits( "QDesignerAction" ) )
( (QDesignerAction*)a )->remove();
}
- QToolBar::clear();
+ TQToolBar::clear();
}
-void QDesignerToolBar::installEventFilters( QWidget *w )
+void QDesignerToolBar::installEventFilters( TQWidget *w )
{
if ( !w )
return;
- QObjectList *l = w->queryList( "QWidget" );
- for ( QObject *o = l->first(); o; o = l->next() )
+ TQObjectList *l = w->queryList( "TQWidget" );
+ for ( TQObject *o = l->first(); o; o = l->next() )
o->installEventFilter( this );
delete l;
}
-QDesignerMenuBar::QDesignerMenuBar( QWidget *mw )
- : QMenuBar( mw, 0 )
+QDesignerMenuBar::QDesignerMenuBar( TQWidget *mw )
+ : TQMenuBar( mw, 0 )
{
show();
setAcceptDrops( true );
MetaDataBase::addEntry( this );
itemNum = 0;
mousePressed = false;
- lastIndicatorPos = QPoint( -1, -1 );
+ lastIndicatorPos = TQPoint( -1, -1 );
insertAt = -1;
indicator = new QDesignerIndicatorWidget( this );
indicator->hide();
@@ -714,7 +714,7 @@ QDesignerMenuBar::QDesignerMenuBar( QWidget *mw )
void QDesignerMenuBar::findFormWindow()
{
- QWidget *w = this;
+ TQWidget *w = this;
while ( w ) {
if ( w->inherits( "FormWindow" ) )
formWindow = (FormWindow*)w;
@@ -722,7 +722,7 @@ void QDesignerMenuBar::findFormWindow()
}
}
-void QDesignerMenuBar::contextMenuEvent( QContextMenuEvent *e )
+void QDesignerMenuBar::contextMenuEvent( TQContextMenuEvent *e )
{
e->accept();
int itm = itemAtPos( e->pos() );
@@ -731,15 +731,15 @@ void QDesignerMenuBar::contextMenuEvent( QContextMenuEvent *e )
formWindow->mainWindow()->popupFormWindowMenu( e->globalPos(), formWindow );
return;
}
- QPopupMenu menu( this );
+ TQPopupMenu menu( this );
menu.insertItem( i18n("Delete Item" ), 1 );
menu.insertItem( i18n("Rename Item..." ), 2 );
int res = menu.exec( e->globalPos() );
if ( res == 1 ) {
- QMenuItem *item = findItem( idAt( itm ) );
+ TQMenuItem *item = findItem( idAt( itm ) );
RemoveMenuCommand *cmd = new RemoveMenuCommand( i18n("Delete Menu '%1'" ).arg( item->text() ),
formWindow,
- (QMainWindow*)parentWidget(), this,
+ (TQMainWindow*)parentWidget(), this,
(QDesignerPopupMenu*)item->popup(),
idAt( itm ), itm, item->text() );
formWindow->commandHistory()->addCommand( cmd );
@@ -749,8 +749,8 @@ void QDesignerMenuBar::contextMenuEvent( QContextMenuEvent *e )
parentWidget()->layout()->activate();
} else if ( res == 2 ) {
bool ok;
- QString old = text( idAt( itm ) );
- QString txt = KInputDialog::getText( i18n("Rename Menu Item" ), i18n("Menu text:" ),
+ TQString old = text( idAt( itm ) );
+ TQString txt = KInputDialog::getText( i18n("Rename Menu Item" ), i18n("Menu text:" ),
text( idAt( itm ) ), &ok, 0 );
if ( ok ) {
RenameMenuCommand *cmd = new RenameMenuCommand(
@@ -762,43 +762,43 @@ void QDesignerMenuBar::contextMenuEvent( QContextMenuEvent *e )
}
}
-void QDesignerMenuBar::mousePressEvent( QMouseEvent *e )
+void QDesignerMenuBar::mousePressEvent( TQMouseEvent *e )
{
- lastIndicatorPos = QPoint( -1, -1 );
+ lastIndicatorPos = TQPoint( -1, -1 );
insertAt = -1;
mousePressed = true;
if ( e->button() == MidButton || e->button() == RightButton )
return;
dragStartPos = e->pos();
- QMenuBar::mousePressEvent( e );
+ TQMenuBar::mousePressEvent( e );
}
-void QDesignerMenuBar::mouseMoveEvent( QMouseEvent *e )
+void QDesignerMenuBar::mouseMoveEvent( TQMouseEvent *e )
{
if ( !mousePressed || e->state() == NoButton ) {
- QMenuBar::mouseMoveEvent( e );
+ TQMenuBar::mouseMoveEvent( e );
return;
}
- if ( QABS( QPoint( dragStartPos - e->pos() ).manhattanLength() ) < QApplication::startDragDistance() )
+ if ( QABS( TQPoint( dragStartPos - e->pos() ).manhattanLength() ) < TQApplication::startDragDistance() )
return;
hidePopups();
activateItemAt( -1 );
int itm = itemAtPos( dragStartPos );
if ( itm == -1 )
return;
- QPopupMenu *popup = findItem( idAt( itm ) )->popup();
- QString txt = findItem( idAt( itm ) )->text();
+ TQPopupMenu *popup = findItem( idAt( itm ) )->popup();
+ TQString txt = findItem( idAt( itm ) )->text();
removeItemAt( itm );
- QStoredDrag *drag = new QStoredDrag( "application/x-designer-menuitem", this );
- QString s = QString::number( (long)popup );
+ TQStoredDrag *drag = new TQStoredDrag( "application/x-designer-menuitem", this );
+ TQString s = TQString::number( (long)popup );
s += "/" + txt;
- drag->setEncodedData( QCString( s.latin1() ) );
- QSize sz( fontMetrics().boundingRect( txt ).size() );
- QPixmap pix( sz.width() + 20, sz.height() * 2 );
+ drag->setEncodedData( TQCString( s.latin1() ) );
+ TQSize sz( fontMetrics().boundingRect( txt ).size() );
+ TQPixmap pix( sz.width() + 20, sz.height() * 2 );
pix.fill( white );
- QPainter p( &pix, this );
+ TQPainter p( &pix, this );
p.drawText( 2, 0, pix.width(), pix.height(), 0, txt );
p.end();
pix.setMask( pix.createHeuristicMask() );
@@ -807,20 +807,20 @@ void QDesignerMenuBar::mouseMoveEvent( QMouseEvent *e )
if ( !drag->drag() ) {
insertItem( txt, popup, -1, itm );
}
- lastIndicatorPos = QPoint( -1, -1 );
+ lastIndicatorPos = TQPoint( -1, -1 );
indicator->hide();
mousePressed = false;
}
-void QDesignerMenuBar::mouseReleaseEvent( QMouseEvent *e )
+void QDesignerMenuBar::mouseReleaseEvent( TQMouseEvent *e )
{
- QMenuBar::mouseReleaseEvent( e );
+ TQMenuBar::mouseReleaseEvent( e );
mousePressed = false;
}
#ifndef QT_NO_DRAGANDDROP
-void QDesignerMenuBar::dragEnterEvent( QDragEnterEvent *e )
+void QDesignerMenuBar::dragEnterEvent( TQDragEnterEvent *e )
{
if ( e->provides( "application/x-designer-actions" ) ||
e->provides( "application/x-designer-actiongroup" ) ||
@@ -828,11 +828,11 @@ void QDesignerMenuBar::dragEnterEvent( QDragEnterEvent *e )
e->accept();
if ( e->provides( "application/x-designer-menuitem" ) )
e->accept();
- lastIndicatorPos = QPoint( -1, -1 );
+ lastIndicatorPos = TQPoint( -1, -1 );
insertAt = -1;
}
-void QDesignerMenuBar::dragMoveEvent( QDragMoveEvent *e )
+void QDesignerMenuBar::dragMoveEvent( TQDragMoveEvent *e )
{
if ( e->provides( "application/x-designer-actions" ) ||
e->provides( "application/x-designer-menuitem" ) ||
@@ -845,12 +845,12 @@ void QDesignerMenuBar::dragMoveEvent( QDragMoveEvent *e )
e->provides( "application/x-designer-actiongroup" ) ||
e->provides( "application/x-designer-separator" ) ) {
int item = itemAtPos( e->pos() );
- bool uieffect = QApplication::isEffectEnabled( UI_AnimateMenu );
- QApplication::setEffectEnabled( UI_AnimateMenu, false );
+ bool uieffect = TQApplication::isEffectEnabled( UI_AnimateMenu );
+ TQApplication::setEffectEnabled( UI_AnimateMenu, false );
if ( !qApp->activePopupWidget() )
actItem = -1;
activateItemAt( item );
- QApplication::setEffectEnabled( UI_AnimateMenu, uieffect );
+ TQApplication::setEffectEnabled( UI_AnimateMenu, uieffect );
if ( item == -1 )
hidePopups();
} else {
@@ -858,24 +858,24 @@ void QDesignerMenuBar::dragMoveEvent( QDragMoveEvent *e )
}
}
-void QDesignerMenuBar::dragLeaveEvent( QDragLeaveEvent * )
+void QDesignerMenuBar::dragLeaveEvent( TQDragLeaveEvent * )
{
mousePressed = false;
- lastIndicatorPos = QPoint( -1, -1 );
+ lastIndicatorPos = TQPoint( -1, -1 );
insertAt = -1;
}
-void QDesignerMenuBar::dropEvent( QDropEvent *e )
+void QDesignerMenuBar::dropEvent( TQDropEvent *e )
{
mousePressed = false;
if ( !e->provides( "application/x-designer-menuitem" ) )
return;
e->accept();
- QString s( e->encodedData( "application/x-designer-menuitem" ) );
- QString s1 = s.left( s.find( "/" ) );
- QString s2 = s.mid( s.find( "/" ) + 1 );
- QPopupMenu *popup = (QPopupMenu*)s1.toLong(); // #### huha, that is evil
- QString txt = s2;
+ TQString s( e->encodedData( "application/x-designer-menuitem" ) );
+ TQString s1 = s.left( s.find( "/" ) );
+ TQString s2 = s.mid( s.find( "/" ) + 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,
@@ -888,12 +888,12 @@ void QDesignerMenuBar::dropEvent( QDropEvent *e )
#endif
-QPoint QDesignerMenuBar::calcIndicatorPos( const QPoint &pos )
+TQPoint QDesignerMenuBar::calcIndicatorPos( const TQPoint &pos )
{
int w = frameWidth();
insertAt = count();
for ( int i = 0; i < (int)count(); ++i ) {
- QRect r = itemRect( i );
+ TQRect r = itemRect( i );
if ( pos.x() < w + r.width() / 2 ) {
insertAt = i;
break;
@@ -901,10 +901,10 @@ QPoint QDesignerMenuBar::calcIndicatorPos( const QPoint &pos )
w += r.width();
}
- return QPoint( w, 0 );
+ return TQPoint( w, 0 );
}
-void QDesignerMenuBar::drawIndicator( const QPoint &pos )
+void QDesignerMenuBar::drawIndicator( const TQPoint &pos )
{
if ( lastIndicatorPos == pos )
return;
@@ -915,7 +915,7 @@ void QDesignerMenuBar::drawIndicator( const QPoint &pos )
indicator->raise();
lastIndicatorPos = pos;
if ( !wasVsisible )
- QApplication::sendPostedEvents();
+ TQApplication::sendPostedEvents();
}
void QDesignerMenuBar::setItemNumber( int num )
@@ -928,28 +928,28 @@ int QDesignerMenuBar::itemNumber() const
return itemNum;
}
-void QDesignerMenuBar::setItemText( const QString &s )
+void QDesignerMenuBar::setItemText( const TQString &s )
{
if ( itemNum < 0 || itemNum >= (int)count() )
return;
changeItem( idAt( itemNum ), s );
}
-QString QDesignerMenuBar::itemText() const
+TQString QDesignerMenuBar::itemText() const
{
if ( itemNum < 0 || (int)itemNum >= (int)count() )
- return QString::null;
+ return TQString::null;
return text( idAt( itemNum ) );
}
-void QDesignerMenuBar::setItemName( const QCString &s )
+void QDesignerMenuBar::setItemName( const TQCString &s )
{
if ( itemNum < 0 || itemNum >= (int)count() )
return;
findItem( idAt( itemNum ) )->popup()->setName( s );
}
-QCString QDesignerMenuBar::itemName() const
+TQCString QDesignerMenuBar::itemName() const
{
if ( itemNum < 0 || itemNum >= (int)count() )
return "";
@@ -958,31 +958,31 @@ QCString QDesignerMenuBar::itemName() const
-QDesignerPopupMenu::QDesignerPopupMenu( QWidget *w )
- : QPopupMenu( w, 0 ),
+QDesignerPopupMenu::QDesignerPopupMenu( TQWidget *w )
+ : TQPopupMenu( w, 0 ),
popupMenu( 0 )
{
findFormWindow();
setAcceptDrops( true );
insertAt = -1;
mousePressed = false;
- lastIndicatorPos = QPoint( -1, -1 );
+ lastIndicatorPos = TQPoint( -1, -1 );
indicator = new QDesignerIndicatorWidget( this );
indicator->hide();
}
-void QDesignerPopupMenu::contextMenuEvent( QContextMenuEvent *e )
+void QDesignerPopupMenu::contextMenuEvent( TQContextMenuEvent *e )
{
#if defined( Q_WS_MAC ) //the mac needs us to use context menu rather than right click
e->accept();
- QMouseEvent me( QEvent::MouseButtonPress, e->pos(), e->globalPos(), RightButton, RightButton );
+ TQMouseEvent me( TQEvent::MouseButtonPress, e->pos(), e->globalPos(), RightButton, RightButton );
mousePressEvent(&me);
#else
Q_UNUSED( e );
#endif
}
-void QDesignerPopupMenu::mousePressEvent( QMouseEvent *e )
+void QDesignerPopupMenu::mousePressEvent( TQMouseEvent *e )
{
if ( e->button() == MidButton )
return;
@@ -996,18 +996,18 @@ void QDesignerPopupMenu::mousePressEvent( QMouseEvent *e )
popupMenu->close();
}
e->accept();
- QTimer::singleShot( 0, this, SLOT(createPopupMenu()) );
+ TQTimer::singleShot( 0, this, TQT_SLOT(createPopupMenu()) );
return;
}
mousePressed = true;
dragStartPos = e->pos();
- QPopupMenu::mousePressEvent( e );
+ TQPopupMenu::mousePressEvent( e );
}
void QDesignerPopupMenu::createPopupMenu()
{
// actually creates our popup for the popupmenu.
- QPopupMenu menu( 0 );
+ TQPopupMenu menu( 0 );
popupMenu = &menu;
int itm;
const int ID_DELETE = 1;
@@ -1015,7 +1015,7 @@ void QDesignerPopupMenu::createPopupMenu()
itm = itemAtPos( popupLocalPos, false );
if ( itm == -1 )
return;
- QAction *a = actionList.at( itm );
+ TQAction *a = actionList.at( itm );
if ( a && a->inherits( "QSeparatorAction" ) )
menu.insertItem( i18n("Delete Separator" ), ID_DELETE );
else
@@ -1023,7 +1023,7 @@ void QDesignerPopupMenu::createPopupMenu()
menu.insertItem( i18n("Insert Separator" ), ID_SEP );
int res = menu.exec( popupPos );
if ( res == ID_DELETE ) {
- QAction *a = actionList.at( itm );
+ TQAction *a = actionList.at( itm );
if ( !a )
return;
RemoveActionFromPopupCommand *cmd = new RemoveActionFromPopupCommand(
@@ -1033,37 +1033,37 @@ void QDesignerPopupMenu::createPopupMenu()
formWindow->commandHistory()->addCommand( cmd );
cmd->execute();
} else if ( res == ID_SEP ) {
- QPoint p( pos() );
+ TQPoint p( pos() );
calcIndicatorPos( mapFromGlobal( popupPos ) );
- QAction *a = new QSeparatorAction( 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();
- ( (QDesignerMenuBar*)( (QMainWindow*)parentWidget() )->menuBar() )->hidePopups();
- ( (QDesignerMenuBar*)( (QMainWindow*)parentWidget() )->menuBar() )->activateItemAt( -1 );
+ ( (QDesignerMenuBar*)( (TQMainWindow*)parentWidget() )->menuBar() )->hidePopups();
+ ( (QDesignerMenuBar*)( (TQMainWindow*)parentWidget() )->menuBar() )->activateItemAt( -1 );
popup( p );
}
// set this back to zero so we know a popup (will soon) not exist.
popupMenu = 0;
}
-void QDesignerPopupMenu::mouseMoveEvent( QMouseEvent *e )
+void QDesignerPopupMenu::mouseMoveEvent( TQMouseEvent *e )
{
if ( !mousePressed || e->state() == NoButton ) {
- QPopupMenu::mouseMoveEvent( e );
+ TQPopupMenu::mouseMoveEvent( e );
return;
}
- if ( QABS( QPoint( dragStartPos - e->pos() ).manhattanLength() ) < QApplication::startDragDistance() ) {
- QPopupMenu::mouseMoveEvent( e );
+ if ( QABS( TQPoint( dragStartPos - e->pos() ).manhattanLength() ) < TQApplication::startDragDistance() ) {
+ TQPopupMenu::mouseMoveEvent( e );
return;
}
int itm = itemAtPos( dragStartPos, false );
if ( itm == -1 )
return;
- QAction *a = actionList.at( itm );
+ TQAction *a = actionList.at( itm );
if ( !a )
return;
RemoveActionFromPopupCommand *cmd = new RemoveActionFromPopupCommand( i18n("Delete Action '%1' From Popup Menu '%2'" ).
@@ -1072,11 +1072,11 @@ void QDesignerPopupMenu::mouseMoveEvent( QMouseEvent *e )
formWindow->commandHistory()->addCommand( cmd );
cmd->execute();
- QString type = a->inherits( "QActionGroup" ) ? QString( "application/x-designer-actiongroup" ) :
- a->inherits( "QSeparatorAction" ) ? QString( "application/x-designer-separator" ) : QString( "application/x-designer-actions" );
- QStoredDrag *drag = new QStoredDrag( type, this );
- QString s = QString::number( (long)a ); // #### huha, that is evil
- drag->setEncodedData( QCString( s.latin1() ) );
+ TQString type = a->inherits( "TQActionGroup" ) ? TQString( "application/x-designer-actiongroup" ) :
+ 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 ( !drag->drag() ) {
AddActionToPopupCommand *cmd = new AddActionToPopupCommand( i18n("Add Action '%1' to Popup Menu '%2'" ).
@@ -1086,29 +1086,29 @@ void QDesignerPopupMenu::mouseMoveEvent( QMouseEvent *e )
cmd->execute();
}
indicator->hide();
- lastIndicatorPos = QPoint( -1, -1 );
+ lastIndicatorPos = TQPoint( -1, -1 );
mousePressed = false;
}
-void QDesignerPopupMenu::mouseReleaseEvent( QMouseEvent *e )
+void QDesignerPopupMenu::mouseReleaseEvent( TQMouseEvent *e )
{
mousePressed = false;
- QPopupMenu::mouseReleaseEvent( e );
+ TQPopupMenu::mouseReleaseEvent( e );
}
#ifndef QT_NO_DRAGANDDROP
-void QDesignerPopupMenu::dragEnterEvent( QDragEnterEvent *e )
+void QDesignerPopupMenu::dragEnterEvent( TQDragEnterEvent *e )
{
mousePressed = false;
- lastIndicatorPos = QPoint( -1, -1 );
+ lastIndicatorPos = TQPoint( -1, -1 );
if ( e->provides( "application/x-designer-actions" ) ||
e->provides( "application/x-designer-actiongroup" ) ||
e->provides( "application/x-designer-separator" ) )
e->accept();
}
-void QDesignerPopupMenu::dragMoveEvent( QDragMoveEvent *e )
+void QDesignerPopupMenu::dragMoveEvent( TQDragMoveEvent *e )
{
mousePressed = false;
if ( e->provides( "application/x-designer-actions" ) ||
@@ -1120,14 +1120,14 @@ void QDesignerPopupMenu::dragMoveEvent( QDragMoveEvent *e )
drawIndicator( calcIndicatorPos( e->pos() ) );
}
-void QDesignerPopupMenu::dragLeaveEvent( QDragLeaveEvent * )
+void QDesignerPopupMenu::dragLeaveEvent( TQDragLeaveEvent * )
{
mousePressed = false;
indicator->hide();
insertAt = -1;
}
-void QDesignerPopupMenu::dropEvent( QDropEvent *e )
+void QDesignerPopupMenu::dropEvent( TQDropEvent *e )
{
mousePressed = false;
if ( e->provides( "application/x-designer-actions" ) ||
@@ -1137,24 +1137,24 @@ void QDesignerPopupMenu::dropEvent( QDropEvent *e )
else
return;
- QPoint p = pos();
- QAction *a = 0;
+ TQPoint p = pos();
+ TQAction *a = 0;
if ( e->provides( "application/x-designer-actiongroup" ) ) {
- QString s( e->encodedData( "application/x-designer-actiongroup" ) );
+ TQString s( e->encodedData( "application/x-designer-actiongroup" ) );
a = (QDesignerActionGroup*)s.toLong();
} else {
- QString s;
+ TQString s;
if ( e->provides( "application/x-designer-separator" ) ) {
- s = QString( e->encodedData( "application/x-designer-separator" ) );
+ s = TQString( e->encodedData( "application/x-designer-separator" ) );
a = (QSeparatorAction*)s.toLong();
} else {
- s = QString( e->encodedData( "application/x-designer-actions" ) );
+ s = TQString( e->encodedData( "application/x-designer-actions" ) );
a = (QDesignerAction*)s.toLong();
}
}
if ( actionList.findRef( a ) != -1 ) {
- QMessageBox::warning( MainWindow::self, i18n("Insert/Move Action" ),
+ 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." ).
arg( a->name() ) );
@@ -1167,8 +1167,8 @@ void QDesignerPopupMenu::dropEvent( QDropEvent *e )
formWindow->commandHistory()->addCommand( cmd );
cmd->execute();
- ( (QDesignerMenuBar*)( (QMainWindow*)parentWidget() )->menuBar() )->hidePopups();
- ( (QDesignerMenuBar*)( (QMainWindow*)parentWidget() )->menuBar() )->activateItemAt( -1 );
+ ( (QDesignerMenuBar*)( (TQMainWindow*)parentWidget() )->menuBar() )->hidePopups();
+ ( (QDesignerMenuBar*)( (TQMainWindow*)parentWidget() )->menuBar() )->activateItemAt( -1 );
indicator->hide();
popup( p );
}
@@ -1178,11 +1178,11 @@ void QDesignerPopupMenu::dropEvent( QDropEvent *e )
void QDesignerPopupMenu::reInsert()
{
clear();
- for ( QAction *a = actionList.first(); a; a = actionList.next() )
+ for ( TQAction *a = actionList.first(); a; a = actionList.next() )
a->addTo( this );
}
-void QDesignerPopupMenu::drawIndicator( const QPoint &pos )
+void QDesignerPopupMenu::drawIndicator( const TQPoint &pos )
{
if ( lastIndicatorPos == pos )
return;
@@ -1193,15 +1193,15 @@ void QDesignerPopupMenu::drawIndicator( const QPoint &pos )
indicator->raise();
lastIndicatorPos = pos;
if ( !wasVsisible )
- QApplication::sendPostedEvents();
+ TQApplication::sendPostedEvents();
}
-QPoint QDesignerPopupMenu::calcIndicatorPos( const QPoint &pos )
+TQPoint QDesignerPopupMenu::calcIndicatorPos( const TQPoint &pos )
{
int h = frameWidth();
insertAt = count();
for ( int i = 0; i < (int)count(); ++i ) {
- QRect r = itemGeometry( i );
+ TQRect r = itemGeometry( i );
if ( pos.y() < h + r.height() / 2 ) {
insertAt = i;
break;
@@ -1209,31 +1209,31 @@ QPoint QDesignerPopupMenu::calcIndicatorPos( const QPoint &pos )
h += r.height();
}
- return QPoint( 0, h );
+ return TQPoint( 0, h );
}
-void QDesignerPopupMenu::addAction( QAction *a )
+void QDesignerPopupMenu::addAction( TQAction *a )
{
actionList.append( a );
- connect( a, SIGNAL( destroyed() ), this, SLOT( actionRemoved() ) );
+ connect( a, TQT_SIGNAL( destroyed() ), this, TQT_SLOT( actionRemoved() ) );
}
void QDesignerPopupMenu::actionRemoved()
{
- actionList.removeRef( (QAction*)sender() );
+ actionList.removeRef( (TQAction*)sender() );
}
-void QDesignerPopupMenu::paintEvent( QPaintEvent *e )
+void QDesignerPopupMenu::paintEvent( TQPaintEvent *e )
{
- QPopupMenu::paintEvent( e );
+ TQPopupMenu::paintEvent( e );
if ( e->rect() != rect() )
return;
- lastIndicatorPos = QPoint( -1, -1 );
+ lastIndicatorPos = TQPoint( -1, -1 );
}
void QDesignerPopupMenu::findFormWindow()
{
- QWidget *w = this;
+ TQWidget *w = this;
while ( w ) {
if ( w->inherits( "FormWindow" ) )
formWindow = (FormWindow*)w;