summaryrefslogtreecommitdiffstats
path: root/kdevdesigner/designer/actiondnd.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'kdevdesigner/designer/actiondnd.cpp')
-rw-r--r--kdevdesigner/designer/actiondnd.cpp294
1 files changed, 147 insertions, 147 deletions
diff --git a/kdevdesigner/designer/actiondnd.cpp b/kdevdesigner/designer/actiondnd.cpp
index 071f0d4b..4c287582 100644
--- a/kdevdesigner/designer/actiondnd.cpp
+++ b/kdevdesigner/designer/actiondnd.cpp
@@ -33,46 +33,46 @@
#include "widgetfactory.h"
#include "hierarchyview.h"
-#include <qaction.h>
-#include <qapplication.h>
-#include <qbitmap.h>
-#include <qdragobject.h>
-#include <qinputdialog.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 <tqaction.h>
+#include <tqapplication.h>
+#include <tqbitmap.h>
+#include <tqdragobject.h>
+#include <tqinputdialog.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 <klocale.h>
-QAction *ActionDrag::the_action = 0;
+TQAction *ActionDrag::the_action = 0;
-ActionDrag::ActionDrag(QAction *action, QWidget *source)
-: QStoredDrag("application/x-designer-actions", source)
+ActionDrag::ActionDrag(TQAction *action, TQWidget *source)
+: TQStoredDrag("application/x-designer-actions", source)
{
Q_ASSERT(the_action == 0);
the_action = action;
}
-ActionDrag::ActionDrag(QActionGroup *group, QWidget *source)
-: QStoredDrag("application/x-designer-actiongroup", source)
+ActionDrag::ActionDrag(TQActionGroup *group, TQWidget *source)
+: TQStoredDrag("application/x-designer-actiongroup", source)
{
Q_ASSERT(the_action == 0);
the_action = group;
}
-ActionDrag::ActionDrag(const QString &type, QAction *action, QWidget *source)
-: QStoredDrag(type, source)
+ActionDrag::ActionDrag(const TQString &type, TQAction *action, TQWidget *source)
+: TQStoredDrag(type, source)
{
Q_ASSERT(the_action == 0);
the_action = action;
}
-bool ActionDrag::canDecode(QDropEvent *e)
+bool ActionDrag::canDecode(TQDropEvent *e)
{
return e->provides( "application/x-designer-actions" ) ||
e->provides( "application/x-designer-actiongroup" ) ||
@@ -100,24 +100,24 @@ void QDesignerActionGroup::init()
WidgetFactory::saveChangedProperties( this, id );
}
-bool QDesignerAction::addTo( QWidget *w )
+bool QDesignerAction::addTo( TQWidget *w )
{
if ( !widgetToInsert )
- return QAction::addTo( w );
+ return TQAction::addTo( w );
- if ( ::qt_cast<QPopupMenu*>(w) )
+ if ( ::qt_cast<TQPopupMenu*>(w) )
return FALSE;
- widgetToInsert->reparent( w, QPoint( 0, 0 ), FALSE );
+ widgetToInsert->reparent( w, TQPoint( 0, 0 ), FALSE );
widgetToInsert->show();
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;
@@ -128,19 +128,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 )
@@ -148,81 +148,81 @@ 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 ( ::qt_cast<QToolBar*>(w) ) {
- QToolBar *tb = (QToolBar*)w;
+ if ( ::qt_cast<TQToolBar*>(w) ) {
+ TQToolBar *tb = (TQToolBar*)w;
wid = new QDesignerToolBarSeparator( tb->orientation(), tb );
return TRUE;
- } else if ( ::qt_cast<QPopupMenu*>(w) ) {
- idx = ( (QPopupMenu*)w )->count();
- ( (QPopupMenu*)w )->insertSeparator( idx );
+ } else if ( ::qt_cast<TQPopupMenu*>(w) ) {
+ idx = ( (TQPopupMenu*)w )->count();
+ ( (TQPopupMenu*)w )->insertSeparator( idx );
return TRUE;
}
return FALSE;
}
-bool QSeparatorAction::removeFrom( QWidget *w )
+bool QSeparatorAction::removeFrom( TQWidget *w )
{
- if ( ::qt_cast<QToolBar*>(w) ) {
+ if ( ::qt_cast<TQToolBar*>(w) ) {
delete wid;
return TRUE;
- } else if ( ::qt_cast<QPopupMenu*>(w) ) {
- ( (QPopupMenu*)w )->removeItemAt( idx );
+ } else if ( ::qt_cast<TQPopupMenu*>(w) ) {
+ ( (TQPopupMenu*)w )->removeItemAt( idx );
return TRUE;
}
return FALSE;
}
-QWidget *QSeparatorAction::widget() const
+TQWidget *QSeparatorAction::widget() const
{
return wid;
}
-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 );
@@ -231,8 +231,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;
@@ -248,7 +248,7 @@ QDesignerToolBar::QDesignerToolBar( QMainWindow *mw, Dock dock )
void QDesignerToolBar::findFormWindow()
{
- QWidget *w = this;
+ TQWidget *w = this;
while ( w ) {
formWindow = ::qt_cast<FormWindow*>(w);
if ( formWindow )
@@ -257,11 +257,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 ( ::qt_cast<QActionGroup*>(a) ) {
+ connect( a, TQT_SIGNAL( destroyed() ), this, TQT_SLOT( actionRemoved() ) );
+ if ( ::qt_cast<TQActionGroup*>(a) ) {
( (QDesignerActionGroup*)a )->widget()->installEventFilter( this );
actionMap.insert( ( (QDesignerActionGroup*)a )->widget(), a );
} else if ( ::qt_cast<QSeparatorAction*>(a) ) {
@@ -273,79 +273,79 @@ void QDesignerToolBar::addAction( QAction *a )
}
}
-static void fixObject( QObject *&o )
+static void fixObject( TQObject *&o )
{
while ( o && o->parent() && !::qt_cast<QDesignerToolBar*>(o->parent()) )
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 (ActionDrag::canDecode(de))
de->accept();
- } else if ( e->type() == QEvent::DragMove ) {
- QDragMoveEvent *de = (QDragMoveEvent*)e;
+ } else if ( e->type() == TQEvent::DragMove ) {
+ TQDragMoveEvent *de = (TQDragMoveEvent*)e;
if (ActionDrag::canDecode(de))
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 ) {
@@ -356,7 +356,7 @@ void QDesignerToolBar::contextMenuEvent( QContextMenuEvent *e )
}
}
-void QDesignerToolBar::mousePressEvent( QMouseEvent *e )
+void QDesignerToolBar::mousePressEvent( TQMouseEvent *e )
{
widgetInserting = FALSE;
if ( e->button() == LeftButton &&
@@ -367,14 +367,14 @@ void QDesignerToolBar::mousePressEvent( QMouseEvent *e )
widgetInserting = TRUE;
}
-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() ) );
@@ -385,14 +385,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() && ::qt_cast<QSeparatorAction*>(*it) )
menu.insertItem( i18n( "Delete Separator" ), ID_DELETE );
else
@@ -402,10 +402,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'" ).
@@ -415,7 +415,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;
@@ -436,7 +436,7 @@ void QDesignerToolBar::buttonContextMenuEvent( QContextMenuEvent *e, QObject *o
}
}
-void QDesignerToolBar::buttonMousePressEvent( QMouseEvent *e, QObject * )
+void QDesignerToolBar::buttonMousePressEvent( TQMouseEvent *e, TQObject * )
{
widgetInserting = FALSE;
@@ -455,12 +455,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'" ).
@@ -468,20 +468,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 );
@@ -491,12 +491,12 @@ void QDesignerToolBar::buttonMouseMoveEvent( QMouseEvent *e, QObject *o )
formWindow, a, this, index );
formWindow->commandHistory()->addCommand( cmd );
cmd->execute();
- QApplication::sendPostedEvents();
+ TQApplication::sendPostedEvents();
adjustSize();
- QString type = ::qt_cast<QActionGroup*>(a) ? QString( "application/x-designer-actiongroup" ) :
- ::qt_cast<QSeparatorAction*>(a) ? QString( "application/x-designer-separator" ) : QString( "application/x-designer-actions" );
- QStoredDrag *drag = new ActionDrag( type, a, this );
+ TQString type = ::qt_cast<TQActionGroup*>(a) ? TQString( "application/x-designer-actiongroup" ) :
+ ::qt_cast<QSeparatorAction*>(a) ? TQString( "application/x-designer-separator" ) : TQString( "application/x-designer-actions" );
+ TQStoredDrag *drag = new ActionDrag( type, a, this );
drag->setPixmap( a->iconSet().pixmap() );
if ( ::qt_cast<QDesignerAction*>(a) ) {
if ( formWindow->widgets()->find( ( (QDesignerAction*)a )->widget() ) )
@@ -509,21 +509,21 @@ 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 (ActionDrag::canDecode(e))
e->accept();
}
-void QDesignerToolBar::dragMoveEvent( QDragMoveEvent *e )
+void QDesignerToolBar::dragMoveEvent( TQDragMoveEvent *e )
{
if (ActionDrag::canDecode(e)) {
e->accept();
@@ -531,14 +531,14 @@ void QDesignerToolBar::dragMoveEvent( QDragMoveEvent *e )
}
}
-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 (!ActionDrag::canDecode(e))
return;
@@ -546,7 +546,7 @@ void QDesignerToolBar::dropEvent( QDropEvent *e )
e->accept();
indicator->hide();
- QAction *a = 0;
+ TQAction *a = 0;
int index = actionList.findRef( *actionMap.find( insertAnchor ) );
if ( index != -1 && afterAnchor )
++index;
@@ -563,7 +563,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() ) );
@@ -576,19 +576,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 ( ::qt_cast<QActionGroup*>(a) ) {
+ if ( ::qt_cast<TQActionGroup*>(a) ) {
actionMap.insert( ( (QDesignerActionGroup*)a )->widget(), a );
if ( ( (QDesignerActionGroup*)a )->widget() )
( (QDesignerActionGroup*)a )->widget()->installEventFilter( this );
@@ -600,31 +600,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;
@@ -634,19 +634,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;
@@ -658,36 +658,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() );
@@ -706,19 +706,19 @@ 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 ( ::qt_cast<QDesignerAction*>(a) )
( (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;
}