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.cpp92
1 files changed, 46 insertions, 46 deletions
diff --git a/kommander/editor/actiondnd.cpp b/kommander/editor/actiondnd.cpp
index d07bfebf..bc3b2a21 100644
--- a/kommander/editor/actiondnd.cpp
+++ b/kommander/editor/actiondnd.cpp
@@ -47,7 +47,7 @@ bool QDesignerAction::addTo( TQWidget *w )
if ( !widgetToInsert )
return TQAction::addTo( w );
- if ( w->inherits( TQPOPUPMENU_OBJECT_NAME_STRING ) )
+ if ( w->inherits( "TQPopupMenu" ) )
return false;
widgetToInsert->reparent( w, TQPoint( 0, 0 ), false );
@@ -68,23 +68,23 @@ void QDesignerAction::remove()
{
if ( !widgetToInsert )
return;
- MainWindow::self->formWindow()->selectWidget( TQT_TQOBJECT(widgetToInsert), false );
+ MainWindow::self->formWindow()->selectWidget( widgetToInsert, false );
widgetToInsert->reparent( 0, TQPoint( 0, 0 ), false );
}
-QDesignerToolBarSeparator::QDesignerToolBarSeparator(Qt::Orientation o , TQToolBar *parent,
+QDesignerToolBarSeparator::QDesignerToolBarSeparator(TQt::Orientation o , TQToolBar *parent,
const char* name )
: TQWidget( parent, name )
{
- connect( parent, TQT_SIGNAL(orientationChanged(Qt::Orientation)),
- this, TQT_SLOT(setOrientation(Qt::Orientation)) );
+ connect( parent, TQ_SIGNAL(orientationChanged(TQt::Orientation)),
+ this, TQ_SLOT(setOrientation(TQt::Orientation)) );
setOrientation( o );
setBackgroundMode( parent->backgroundMode() );
setBackgroundOrigin( ParentOrigin );
setSizePolicy( TQSizePolicy( TQSizePolicy::Minimum, TQSizePolicy::Minimum ) );
}
-void QDesignerToolBarSeparator::setOrientation( Qt::Orientation o )
+void QDesignerToolBarSeparator::setOrientation( TQt::Orientation o )
{
orient = o;
}
@@ -98,7 +98,7 @@ TQSize QDesignerToolBarSeparator::sizeHint() const
{
int extent = style().pixelMetric( TQStyle::PM_DockWindowSeparatorExtent,
this );
- if ( orient ==Qt::Horizontal )
+ if ( orient ==TQt::Horizontal )
return TQSize( extent, 0 );
else
return TQSize( 0, extent );
@@ -109,10 +109,10 @@ void QDesignerToolBarSeparator::paintEvent( TQPaintEvent * )
TQPainter p( this );
TQStyle::SFlags flags = TQStyle::Style_Default;
- if ( orientation() ==Qt::Horizontal )
+ if ( orientation() ==TQt::Horizontal )
flags |= TQStyle::Style_Horizontal;
- style().tqdrawPrimitive( TQStyle::PE_DockWindowSeparator, &p, rect(),
+ style().drawPrimitive( TQStyle::PE_DockWindowSeparator, &p, rect(),
colorGroup(), flags );
}
@@ -125,11 +125,11 @@ QSeparatorAction::QSeparatorAction( TQObject *parent )
bool QSeparatorAction::addTo( TQWidget *w )
{
- if ( w->inherits( TQTOOLBAR_OBJECT_NAME_STRING ) ) {
+ if ( w->inherits( "TQToolBar" ) ) {
TQToolBar *tb = (TQToolBar*)w;
wid = new QDesignerToolBarSeparator( tb->orientation(), tb );
return true;
- } else if ( w->inherits( TQPOPUPMENU_OBJECT_NAME_STRING ) ) {
+ } else if ( w->inherits( "TQPopupMenu" ) ) {
idx = ( (TQPopupMenu*)w )->count();
( (TQPopupMenu*)w )->insertSeparator( idx );
return true;
@@ -139,10 +139,10 @@ bool QSeparatorAction::addTo( TQWidget *w )
bool QSeparatorAction::removeFrom( TQWidget *w )
{
- if ( w->inherits( TQTOOLBAR_OBJECT_NAME_STRING ) ) {
+ if ( w->inherits( "TQToolBar" ) ) {
delete wid;
return true;
- } else if ( w->inherits( TQPOPUPMENU_OBJECT_NAME_STRING ) ) {
+ } else if ( w->inherits( "TQPopupMenu" ) ) {
( (TQPopupMenu*)w )->removeItemAt( idx );
return true;
}
@@ -163,7 +163,7 @@ QDesignerToolBar::QDesignerToolBar( TQMainWindow *mw )
insertAnchor = 0;
afterAnchor = true;
setAcceptDrops( true );
- MetaDataBase::addEntry( TQT_TQOBJECT(this) );
+ MetaDataBase::addEntry( this );
lastIndicatorPos = TQPoint( -1, -1 );
indicator = new QDesignerIndicatorWidget( this );
indicator->hide();
@@ -181,7 +181,7 @@ QDesignerToolBar::QDesignerToolBar( TQMainWindow *mw, Dock dock )
setAcceptDrops( true );
indicator = new QDesignerIndicatorWidget( this );
indicator->hide();
- MetaDataBase::addEntry( TQT_TQOBJECT(this) );
+ MetaDataBase::addEntry( this );
installEventFilter( this );
widgetInserting = false;
findFormWindow();
@@ -201,8 +201,8 @@ void QDesignerToolBar::findFormWindow()
void QDesignerToolBar::addAction( TQAction *a )
{
actionList.append( a );
- connect( a, TQT_SIGNAL( destroyed() ), this, TQT_SLOT( actionRemoved() ) );
- if ( a->inherits( TQACTIONGROUP_OBJECT_NAME_STRING ) ) {
+ connect( a, TQ_SIGNAL( destroyed() ), this, TQ_SLOT( actionRemoved() ) );
+ if ( a->inherits( "TQActionGroup" ) ) {
( (QDesignerActionGroup*)a )->widget()->installEventFilter( this );
actionMap.insert( ( (QDesignerActionGroup*)a )->widget(), a );
} else if ( a->inherits( "QSeparatorAction" ) ) {
@@ -222,16 +222,16 @@ static void fixObject( TQObject *&o )
bool QDesignerToolBar::eventFilter( TQObject *o, TQEvent *e )
{
- if ( !o || !e || o->inherits( TQDOCKWINDOWHANDLE_OBJECT_NAME_STRING ) || o->inherits( "TQDockWindowTitleBar" ) )
+ if ( !o || !e || o->inherits( "TQDockWindowHandle" ) || o->inherits( "TQDockWindowTitleBar" ) )
return TQToolBar::eventFilter( o, e );
- if ( TQT_BASE_OBJECT(o) == TQT_BASE_OBJECT(this) && e->type() == TQEvent::MouseButtonPress &&
- ( ( TQMouseEvent*)e )->button() == Qt::LeftButton ) {
+ if ( o == this && e->type() == TQEvent::MouseButtonPress &&
+ ( ( TQMouseEvent*)e )->button() == TQt::LeftButton ) {
mousePressEvent( (TQMouseEvent*)e );
return true;
}
- if ( TQT_BASE_OBJECT(o) == TQT_BASE_OBJECT(this) )
+ if ( o == this )
return TQToolBar::eventFilter( o, e );
if ( e->type() == TQEvent::MouseButtonPress ) {
@@ -304,7 +304,7 @@ void QDesignerToolBar::contextMenuEvent( TQContextMenuEvent *e )
void QDesignerToolBar::mousePressEvent( TQMouseEvent *e )
{
widgetInserting = false;
- if ( e->button() == Qt::LeftButton &&
+ if ( e->button() == TQt::LeftButton &&
MainWindow::self->currentTool() != POINTER_TOOL &&
MainWindow::self->currentTool() != ORDER_TOOL ) {
@@ -391,10 +391,10 @@ void QDesignerToolBar::buttonMousePressEvent( TQMouseEvent *e, TQObject * )
{
widgetInserting = false;
- if ( e->button() == Qt::MidButton )
+ if ( e->button() == TQt::MidButton )
return;
- if ( e->button() == Qt::LeftButton &&
+ if ( e->button() == TQt::LeftButton &&
MainWindow::self->currentTool() != POINTER_TOOL &&
MainWindow::self->currentTool() != ORDER_TOOL ) {
@@ -430,7 +430,7 @@ void QDesignerToolBar::removeWidget( TQWidget *w )
void QDesignerToolBar::buttonMouseMoveEvent( TQMouseEvent *e, TQObject *o )
{
- if ( widgetInserting || ( e->state() & Qt::LeftButton ) == 0 )
+ if ( widgetInserting || ( e->state() & TQt::LeftButton ) == 0 )
return;
if ( TQABS( TQPoint( dragStartPos - e->pos() ).manhattanLength() ) < TQApplication::startDragDistance() )
return;
@@ -450,15 +450,15 @@ void QDesignerToolBar::buttonMouseMoveEvent( TQMouseEvent *e, TQObject *o )
TQApplication::sendPostedEvents();
adjustSize();
- TQString type = a->inherits( TQACTIONGROUP_OBJECT_NAME_STRING ) ? TQString( "application/x-designer-actiongroup" ) :
+ 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 );
+ TQStoredDrag *drag = new TQStoredDrag( type.utf8(), 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( TQT_TQOBJECT(( (QDesignerAction*)a )->widget()), false );
+ formWindow->selectWidget( ( (QDesignerAction*)a )->widget(), false );
}
if ( !drag->drag() ) {
AddActionToToolBarCommand *cmd = new AddActionToToolBarCommand( i18n("Add Action '%1' to Toolbar '%2'" ).
@@ -560,7 +560,7 @@ void QDesignerToolBar::reInsert()
clear();
for ( a = actionList.first(); a; a = actionList.next() ) {
a->addTo( this );
- if ( a->inherits( TQACTIONGROUP_OBJECT_NAME_STRING ) ) {
+ if ( a->inherits( "TQActionGroup" ) ) {
actionMap.insert( ( (QDesignerActionGroup*)a )->widget(), a );
if ( ( (QDesignerActionGroup*)a )->widget() )
( (QDesignerActionGroup*)a )->widget()->installEventFilter( this );
@@ -583,7 +583,7 @@ void QDesignerToolBar::actionRemoved()
TQPoint QDesignerToolBar::calcIndicatorPos( const TQPoint &pos )
{
- if ( orientation() ==Qt::Horizontal ) {
+ if ( orientation() ==TQt::Horizontal ) {
TQPoint pnt( width() - 2, 0 );
insertAnchor = 0;
afterAnchor = true;
@@ -637,7 +637,7 @@ void QDesignerToolBar::drawIndicator( const TQPoint &pos )
if ( lastIndicatorPos == pos )
return;
bool wasVsisible = indicator->isVisible();
- if ( orientation() ==Qt::Horizontal ) {
+ if ( orientation() ==TQt::Horizontal ) {
indicator->resize( 3, height() );
if ( pos != TQPoint( -1, -1 ) )
indicator->move( pos.x() - 1, 0 );
@@ -691,7 +691,7 @@ void QDesignerToolBar::installEventFilters( TQWidget *w )
{
if ( !w )
return;
- TQObjectList *l = w->queryList( TQWIDGET_OBJECT_NAME_STRING );
+ TQObjectList *l = w->queryList( "TQWidget" );
for ( TQObject *o = l->first(); o; o = l->next() )
o->installEventFilter( this );
delete l;
@@ -704,7 +704,7 @@ QDesignerMenuBar::QDesignerMenuBar( TQWidget *mw )
{
show();
setAcceptDrops( true );
- MetaDataBase::addEntry( TQT_TQOBJECT(this) );
+ MetaDataBase::addEntry( this );
itemNum = 0;
mousePressed = false;
lastIndicatorPos = TQPoint( -1, -1 );
@@ -769,7 +769,7 @@ void QDesignerMenuBar::mousePressEvent( TQMouseEvent *e )
lastIndicatorPos = TQPoint( -1, -1 );
insertAt = -1;
mousePressed = true;
- if ( e->button() == Qt::MidButton || e->button() == Qt::RightButton )
+ if ( e->button() == TQt::MidButton || e->button() == TQt::RightButton )
return;
dragStartPos = e->pos();
@@ -778,7 +778,7 @@ void QDesignerMenuBar::mousePressEvent( TQMouseEvent *e )
void QDesignerMenuBar::mouseMoveEvent( TQMouseEvent *e )
{
- if ( !mousePressed || e->state() == Qt::NoButton ) {
+ if ( !mousePressed || e->state() == TQt::NoButton ) {
TQMenuBar::mouseMoveEvent( e );
return;
}
@@ -847,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( Qt::UI_AnimateMenu );
- TQApplication::setEffectEnabled( Qt::UI_AnimateMenu, false );
+ bool uieffect = TQApplication::isEffectEnabled( TQt::UI_AnimateMenu );
+ TQApplication::setEffectEnabled( TQt::UI_AnimateMenu, false );
if ( !tqApp->activePopupWidget() )
actItem = -1;
activateItemAt( item );
- TQApplication::setEffectEnabled( Qt::UI_AnimateMenu, uieffect );
+ TQApplication::setEffectEnabled( TQt::UI_AnimateMenu, uieffect );
if ( item == -1 )
hidePopups();
} else {
@@ -977,7 +977,7 @@ void QDesignerPopupMenu::contextMenuEvent( TQContextMenuEvent *e )
{
#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(), Qt::RightButton, Qt::RightButton );
+ TQMouseEvent me( TQEvent::MouseButtonPress, e->pos(), e->globalPos(), TQt::RightButton, TQt::RightButton );
mousePressEvent(&me);
#else
Q_UNUSED( e );
@@ -986,10 +986,10 @@ void QDesignerPopupMenu::contextMenuEvent( TQContextMenuEvent *e )
void QDesignerPopupMenu::mousePressEvent( TQMouseEvent *e )
{
- if ( e->button() == Qt::MidButton )
+ if ( e->button() == TQt::MidButton )
return;
- if ( e->button() == Qt::RightButton ) {
+ if ( e->button() == TQt::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();
@@ -998,7 +998,7 @@ void QDesignerPopupMenu::mousePressEvent( TQMouseEvent *e )
popupMenu->close();
}
e->accept();
- TQTimer::singleShot( 0, this, TQT_SLOT(createPopupMenu()) );
+ TQTimer::singleShot( 0, this, TQ_SLOT(createPopupMenu()) );
return;
}
mousePressed = true;
@@ -1054,7 +1054,7 @@ void QDesignerPopupMenu::createPopupMenu()
void QDesignerPopupMenu::mouseMoveEvent( TQMouseEvent *e )
{
- if ( !mousePressed || e->state() == Qt::NoButton ) {
+ if ( !mousePressed || e->state() == TQt::NoButton ) {
TQPopupMenu::mouseMoveEvent( e );
return;
}
@@ -1074,9 +1074,9 @@ void QDesignerPopupMenu::mouseMoveEvent( TQMouseEvent *e )
formWindow->commandHistory()->addCommand( cmd );
cmd->execute();
- TQString type = a->inherits( TQACTIONGROUP_OBJECT_NAME_STRING ) ? TQString( "application/x-designer-actiongroup" ) :
+ 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 );
+ TQStoredDrag *drag = new TQStoredDrag( type.utf8(), this );
TQString s = TQString::number( (long)a ); // #### huha, that is evil
drag->setEncodedData( TQCString( s.latin1() ) );
drag->setPixmap( a->iconSet().pixmap() );
@@ -1217,7 +1217,7 @@ TQPoint QDesignerPopupMenu::calcIndicatorPos( const TQPoint &pos )
void QDesignerPopupMenu::addAction( TQAction *a )
{
actionList.append( a );
- connect( a, TQT_SIGNAL( destroyed() ), this, TQT_SLOT( actionRemoved() ) );
+ connect( a, TQ_SIGNAL( destroyed() ), this, TQ_SLOT( actionRemoved() ) );
}
void QDesignerPopupMenu::actionRemoved()