summaryrefslogtreecommitdiffstats
path: root/kdevdesigner/designer/formwindow.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'kdevdesigner/designer/formwindow.cpp')
-rw-r--r--kdevdesigner/designer/formwindow.cpp90
1 files changed, 45 insertions, 45 deletions
diff --git a/kdevdesigner/designer/formwindow.cpp b/kdevdesigner/designer/formwindow.cpp
index 312b543f..6070b378 100644
--- a/kdevdesigner/designer/formwindow.cpp
+++ b/kdevdesigner/designer/formwindow.cpp
@@ -95,7 +95,7 @@ static void setCursorToAll( const TQCursor &c, TQWidget *start )
static void restoreCursors( TQWidget *start, FormWindow *fw )
{
- if ( fw->widgets()->tqfind( start ) )
+ if ( fw->widgets()->find( start ) )
start->setCursor( MetaDataBase::cursor( start ) );
else
start->setCursor( TQt::ArrowCursor );
@@ -258,7 +258,7 @@ void FormWindow::paintGrid( TQWidget *w, TQPaintEvent *e )
TQPixmap grid;
TQString grid_name;
grid_name.sprintf("FormWindowGrid_%d_%d", mainWindow()->grid().x(), mainWindow()->grid().y());
- if( !TQPixmapCache::tqfind( grid_name, grid ) ) {
+ if( !TQPixmapCache::find( grid_name, grid ) ) {
grid = TQPixmap( 350 + ( 350 % mainWindow()->grid().x() ), 350 + ( 350 % mainWindow()->grid().y() ) );
grid.fill( tqcolorGroup().color( TQColorGroup::Foreground ) );
TQBitmap tqmask( grid.width(), grid.height() );
@@ -435,10 +435,10 @@ void FormWindow::insertWidget()
++it;
if ( o->isWidgetType() &&
( (TQWidget*)o )->isVisibleTo( this ) &&
- insertedWidgets.tqfind( TQT_TQWIDGET(o) ) && TQT_BASE_OBJECT(o) != TQT_BASE_OBJECT(w) ) {
+ insertedWidgets.find( TQT_TQWIDGET(o) ) && TQT_BASE_OBJECT(o) != TQT_BASE_OBJECT(w) ) {
TQRect r2( ( (TQWidget*)o )->pos(),
( (TQWidget*)o )->size() );
- if ( r.tqcontains( r2 ) )
+ if ( r.contains( r2 ) )
lst.append( (TQWidget*)o );
}
}
@@ -542,7 +542,7 @@ void FormWindow::handleContextMenu( TQContextMenuEvent *e, TQWidget *w )
TQWidget *realWidget = w; // but store the original one
while ( w->parentWidget() &&
( WidgetFactory::layoutType( w->parentWidget()) != WidgetFactory::NoLayout ||
- !insertedWidgets.tqfind(w) ) )
+ !insertedWidgets.find(w) ) )
w = w->parentWidget();
if ( ::tqqt_cast<TQMainWindow*>(mainContainer()) && ((TQMainWindow*)mainContainer())->centralWidget() == realWidget ) {
e->accept();
@@ -599,7 +599,7 @@ void FormWindow::handleMousePress( TQMouseEvent *e, TQWidget *w )
for ( TQObject *o = l->first(); o; o = l->next() ) {
if ( !o->isWidgetType() )
continue;
- if ( insertedWidgets.tqfind( (TQWidget*)o ) )
+ if ( insertedWidgets.find( (TQWidget*)o ) )
selectWidget( TQT_TQOBJECT(o), FALSE );
}
setPropertyShowingBlocked( FALSE );
@@ -619,7 +619,7 @@ void FormWindow::handleMousePress( TQMouseEvent *e, TQWidget *w )
// if widget is laid out, find the first non-laid out super-widget
while ( w->parentWidget() &&
- ( WidgetFactory::layoutType( w->parentWidget()) != WidgetFactory::NoLayout || !insertedWidgets.tqfind(w) ) )
+ ( WidgetFactory::layoutType( w->parentWidget()) != WidgetFactory::NoLayout || !insertedWidgets.find(w) ) )
w = w->parentWidget();
if ( e->button() == Qt::LeftButton ) { // left button: store original tqgeometry and more as the widget might start moving
@@ -677,7 +677,7 @@ void FormWindow::handleMousePress( TQMouseEvent *e, TQWidget *w )
orderedWidgets.removeRef( w );
orderedWidgets.append( w );
for ( TQWidget *wid = orderedWidgets.last(); wid; wid = orderedWidgets.prev() ) {
- int i = stackedWidgets.tqfindRef( wid );
+ int i = stackedWidgets.findRef( wid );
if ( i != -1 ) {
stackedWidgets.removeRef( wid );
stackedWidgets.insert( 0, wid );
@@ -723,7 +723,7 @@ void FormWindow::handleMouseDblClick( TQMouseEvent *, TQWidget *w )
orderedWidgets.clear();
orderedWidgets.append( w );
for ( TQWidget *wid = orderedWidgets.last(); wid; wid = orderedWidgets.prev() ) {
- int i = stackedWidgets.tqfindRef( wid );
+ int i = stackedWidgets.findRef( wid );
if ( i != -1 ) {
stackedWidgets.removeRef( wid );
stackedWidgets.insert( 0, wid );
@@ -757,7 +757,7 @@ void FormWindow::handleMouseMove( TQMouseEvent *e, TQWidget *w )
// if widget is laid out, find the first non-laid out super-widget
while ( w->parentWidget() &&
- ( WidgetFactory::layoutType( w->parentWidget() ) != WidgetFactory::NoLayout || !insertedWidgets.tqfind(w ) ) )
+ ( WidgetFactory::layoutType( w->parentWidget() ) != WidgetFactory::NoLayout || !insertedWidgets.find(w ) ) )
w = w->parentWidget();
// calc correct position
@@ -863,13 +863,13 @@ void FormWindow::handleMouseMove( TQMouseEvent *e, TQWidget *w )
wid = tqApp->widgetAt( e->globalPos(), TRUE );
if ( wid )
wid = designerWidget( TQT_TQOBJECT(wid) );
- if ( wid && ( isMainContainer( TQT_TQOBJECT(wid) ) || insertedWidgets.tqfind( wid ) ) && wid->isVisibleTo( this ) )
+ if ( wid && ( isMainContainer( TQT_TQOBJECT(wid) ) || insertedWidgets.find( wid ) ) && wid->isVisibleTo( this ) )
newendWidget = wid;
if ( ::tqqt_cast<TQLayoutWidget*>(newendWidget) || ::tqqt_cast<Spacer*>(newendWidget) )
newendWidget = (TQWidget*)endWidget;
drawRecRect = newendWidget != endWidget;
if ( newendWidget &&
- ( isMainContainer( TQT_TQOBJECT(newendWidget) ) || insertedWidgets.tqfind( newendWidget ) ) && !isCentralWidget( TQT_TQOBJECT(newendWidget) ) )
+ ( isMainContainer( TQT_TQOBJECT(newendWidget) ) || insertedWidgets.find( newendWidget ) ) && !isCentralWidget( TQT_TQOBJECT(newendWidget) ) )
endWidget = newendWidget;
mainWindow()->statusMessage( i18n( "Connect '%1' to '%2'" ).tqarg( startWidget->name() ).
arg( endWidget->name() ) );
@@ -896,7 +896,7 @@ void FormWindow::handleMouseMove( TQMouseEvent *e, TQWidget *w )
drawRecRect = newendWidget != endWidget;
if ( !newendWidget )
endWidget = newendWidget;
- else if ( insertedWidgets.tqfind( newendWidget ) && !isCentralWidget( TQT_TQOBJECT(newendWidget) ) )
+ else if ( insertedWidgets.find( newendWidget ) && !isCentralWidget( TQT_TQOBJECT(newendWidget) ) )
endWidget = newendWidget;
if ( endWidget )
mainWindow()->statusMessage( i18n( "Set buddy '%1' to '%2'" ).tqarg( startWidget->name() ).
@@ -930,7 +930,7 @@ void FormWindow::handleMouseRelease( TQMouseEvent *e, TQWidget *w )
if ( widgetPressed && allowMove( w ) ) { // we moved the widget
sizePreviewLabel->hide();
- if ( moving.isEmpty() || w->pos() == *moving.tqfind(w) )
+ if ( moving.isEmpty() || w->pos() == *moving.find(w) )
break;
// restore targetContainer
@@ -1163,7 +1163,7 @@ void FormWindow::handleKeyPress( TQKeyEvent *e, TQWidget *w )
TQObjectList *l = queryList( TQWIDGET_OBJECT_NAME_STRING );
if ( !l )
return;
- if ( l->tqfind( TQT_TQOBJECT(w) ) != -1 )
+ if ( l->find( TQT_TQOBJECT(w) ) != -1 )
e->accept();
delete l;
}
@@ -1213,7 +1213,7 @@ void FormWindow::selectWidget( TQObject *o, bool select )
repaintSelection( (TQWidget*)opw );
if ( !isPropertyShowingBlocked() )
emitShowProperties( propertyWidget );
- WidgetSelection *s = usedSelections.tqfind( w );
+ WidgetSelection *s = usedSelections.find( w );
if ( s ) {
s->show();
return;
@@ -1233,7 +1233,7 @@ void FormWindow::selectWidget( TQObject *o, bool select )
s->setWidget( w );
emitSelectionChanged();
} else {
- WidgetSelection *s = usedSelections.tqfind( w );
+ WidgetSelection *s = usedSelections.find( w );
if ( s )
s->setWidget( 0 );
TQObject *opw = propertyWidget;
@@ -1258,7 +1258,7 @@ TQPoint FormWindow::grid() const
void FormWindow::updateSelection( TQWidget *w )
{
- WidgetSelection *s = usedSelections.tqfind( w );
+ WidgetSelection *s = usedSelections.find( w );
if ( !w->isVisibleTo( this ) )
selectWidget( TQT_TQOBJECT(w), FALSE );
else if ( s )
@@ -1267,14 +1267,14 @@ void FormWindow::updateSelection( TQWidget *w )
void FormWindow::raiseSelection( TQWidget *w )
{
- WidgetSelection *s = usedSelections.tqfind( w );
+ WidgetSelection *s = usedSelections.find( w );
if ( s )
s->show();
}
void FormWindow::repaintSelection( TQWidget *w )
{
- WidgetSelection *s = usedSelections.tqfind( w );
+ WidgetSelection *s = usedSelections.find( w );
if ( s )
s->update();
}
@@ -1373,7 +1373,7 @@ void FormWindow::selectWidgets()
TQPoint p = ( (TQWidget*)o )->mapToGlobal( TQPoint(0,0) );
p = mapFromGlobal( p );
TQRect r( p, ( (TQWidget*)o )->size() );
- if ( r.intersects( currRect ) && !r.tqcontains( currRect ) )
+ if ( r.intersects( currRect ) && !r.contains( currRect ) )
selectWidget( TQT_TQOBJECT(o) );
}
}
@@ -1385,7 +1385,7 @@ void FormWindow::selectWidgets()
bool FormWindow::isWidgetSelected( TQObject *w )
{
if ( w->isWidgetType() )
- return usedSelections.tqfind( (TQWidget*)w ) != 0;
+ return usedSelections.find( (TQWidget*)w ) != 0;
return FALSE; // #### do stuff for TQObjects
}
@@ -1428,7 +1428,7 @@ void FormWindow::raiseChildSelections( TQWidget *w )
TQPtrDictIterator<WidgetSelection> it( usedSelections );
for ( ; it.current(); ++it ) {
- if ( l->tqfindRef( TQT_TQOBJECT(it.current()->widget()) ) != -1 )
+ if ( l->findRef( TQT_TQOBJECT(it.current()->widget()) ) != -1 )
it.current()->show();
}
delete l;
@@ -1440,7 +1440,7 @@ void FormWindow::updateChildSelections( TQWidget *w )
if ( l ) {
for ( TQObject *o = l->first(); o; o = l->next() ) {
if ( o->isWidgetType() &&
- insertedWidgets.tqfind( (TQWidget*)o ) )
+ insertedWidgets.find( (TQWidget*)o ) )
updateSelection( (TQWidget*)o );
}
delete l;
@@ -1460,7 +1460,7 @@ void FormWindow::checkSelectionsForMove( TQWidget *w )
if ( it.current()->widget() == mainContainer() )
continue;
++it;
- if ( l->tqfind( TQT_TQOBJECT(sel->widget()) ) == -1 ) {
+ if ( l->find( TQT_TQOBJECT(sel->widget()) ) == -1 ) {
if ( WidgetFactory::layoutType( w ) == WidgetFactory::NoLayout )
sel->setWidget( 0 );
} else {
@@ -1569,7 +1569,7 @@ void FormWindow::invalidCheckedSelections()
void FormWindow::checkPreviewGeometry( TQRect &r )
{
- if ( !TQT_TQRECT_OBJECT(rect()).tqcontains( r ) ) {
+ if ( !TQT_TQRECT_OBJECT(rect()).contains( r ) ) {
if ( r.left() < rect().left() )
r.moveTopLeft( TQPoint( 0, r.top() ) );
if ( r.right() > rect().right() )
@@ -1782,7 +1782,7 @@ void FormWindow::showOrderIndicators()
w->focusPolicy() != TQ_NoFocus ) {
OrderIndicator* ind = new OrderIndicator( order++, w, this );
orderIndicators.append( ind );
- if ( stackedWidgets.tqfindRef( w ) == -1 )
+ if ( stackedWidgets.findRef( w ) == -1 )
stackedWidgets.append( w );
}
}
@@ -1881,14 +1881,14 @@ void FormWindow::lowerWidgets()
void find_accel( const TQString &txt, TQMap<TQChar, TQWidgetList > &accels, TQWidget *w )
{
- int i = txt.tqfind( "&" );
+ int i = txt.find( "&" );
if ( i == -1 )
return;
TQChar c = txt[ i + 1 ];
if ( c.isNull() || c == '&' )
return;
c = c.lower();
- TQMap<TQChar, TQWidgetList >::Iterator it = accels.tqfind( c );
+ TQMap<TQChar, TQWidgetList >::Iterator it = accels.find( c );
if ( it == accels.end() ) {
TQWidgetList wl;
wl.append( w );
@@ -1910,11 +1910,11 @@ void FormWindow::checkAccels()
insertedWidgets[ (void*)o ] ) {
TQWidget *w = (TQWidget*)o;
const TQMetaProperty* text =
- w->tqmetaObject()->property( w->tqmetaObject()->tqfindProperty( "text", TRUE ), TRUE );
+ w->tqmetaObject()->property( w->tqmetaObject()->findProperty( "text", TRUE ), TRUE );
const TQMetaProperty* title =
- w->tqmetaObject()->property( w->tqmetaObject()->tqfindProperty( "title", TRUE ), TRUE );
+ w->tqmetaObject()->property( w->tqmetaObject()->findProperty( "title", TRUE ), TRUE );
const TQMetaProperty* pageTitle =
- w->tqmetaObject()->property( w->tqmetaObject()->tqfindProperty( "pageTitle", TRUE ), TRUE );
+ w->tqmetaObject()->property( w->tqmetaObject()->findProperty( "pageTitle", TRUE ), TRUE );
if ( text )
find_accel( w->property( "text" ).toString(), accels, w );
if ( title )
@@ -2060,7 +2060,7 @@ void FormWindow::layoutHorizontalContainer( TQWidget *w )
for ( TQObject *o = l.first(); o; o = l.next() ) {
if ( o->isWidgetType() &&
( (TQWidget*)o )->isVisibleTo( this ) &&
- insertedWidgets.tqfind( (TQWidget*)o ) )
+ insertedWidgets.find( (TQWidget*)o ) )
widgets.append( (TQWidget*)o );
}
LayoutHorizontalCommand *cmd = new LayoutHorizontalCommand( i18n( "Lay Out ChildrenQt::Horizontally" ),
@@ -2081,7 +2081,7 @@ void FormWindow::layoutVerticalContainer( TQWidget *w )
for ( TQObject *o = l.first(); o; o = l.next() ) {
if ( o->isWidgetType() &&
( (TQWidget*)o )->isVisibleTo( this ) &&
- insertedWidgets.tqfind( (TQWidget*)o ) )
+ insertedWidgets.find( (TQWidget*)o ) )
widgets.append( (TQWidget*)o );
}
LayoutVerticalCommand *cmd = new LayoutVerticalCommand( i18n( "Lay Out ChildrenQt::Vertically" ),
@@ -2105,7 +2105,7 @@ void FormWindow::layoutGridContainer( TQWidget *w )
for ( TQObject *o = l.first(); o; o = l.next() ) {
if ( o->isWidgetType() &&
( (TQWidget*)o )->isVisibleTo( this ) &&
- insertedWidgets.tqfind( (TQWidget*)o ) )
+ insertedWidgets.find( (TQWidget*)o ) )
widgets.append( (TQWidget*)o );
}
LayoutGridCommand *cmd = new LayoutGridCommand( i18n( "Lay Out Children in a Grid" ),
@@ -2157,7 +2157,7 @@ BreakLayoutCommand *FormWindow::breakLayoutCommand( TQWidget *w )
if ( o->isWidgetType() &&
!mainWindow()->isAToolBarChild( TQT_TQOBJECT(o) ) &&
( (TQWidget*)o )->isVisibleTo( this ) &&
- insertedWidgets.tqfind( (TQWidget*)o ) )
+ insertedWidgets.find( (TQWidget*)o ) )
widgets.append( (TQWidget*)o );
}
return new BreakLayoutCommand( i18n( "Break Layout" ), this, WidgetFactory::widgetOfContainer( w ), widgets );
@@ -2190,7 +2190,7 @@ bool FormWindow::hasInsertedChildren( TQWidget *w ) const
for ( TQObject *o = l->first(); o; o = l->next() ) {
if ( o->isWidgetType() &&
( (TQWidget*)o )->isVisibleTo( (FormWindow*)this ) &&
- insertedWidgets.tqfind( (TQWidget*)o ) ) {
+ insertedWidgets.find( (TQWidget*)o ) ) {
delete l;
return TRUE;
}
@@ -2204,7 +2204,7 @@ bool FormWindow::allowMove( TQWidget *w )
{
w = w->parentWidget();
while ( w ) {
- if ( ( isMainContainer( TQT_TQOBJECT(w) ) || insertedWidgets.tqfind( w ) ) && WidgetFactory::layoutType( w ) == WidgetFactory::NoLayout )
+ if ( ( isMainContainer( TQT_TQOBJECT(w) ) || insertedWidgets.find( w ) ) && WidgetFactory::layoutType( w ) == WidgetFactory::NoLayout )
return TRUE;
w = w->parentWidget();
}
@@ -2280,7 +2280,7 @@ void FormWindow::restoreConnectionLine()
w = h = 64;
r = r.normalize();
- while ( r.tqcontains( p ) ) {
+ while ( r.contains( p ) ) {
unclippedPainter->drawPixmap( p, *buffer, TQRect( p, TQSize( w, h ) ) );
unclippedPainter->setPen( red );
p.setX( p.x() + dx );
@@ -2451,7 +2451,7 @@ bool FormWindow::isDatabaseWidgetUsed() const
TQPtrDictIterator<TQWidget> it( insertedWidgets );
for ( ; it.current(); ++it ) {
TQString c( it.current()->className() );
- if ( dbClasses.tqcontains( c ) > 0 ) {
+ if ( dbClasses.contains( c ) > 0 ) {
return TRUE;
}
}
@@ -2525,7 +2525,7 @@ TQWidget *FormWindow::containerAt( const TQPoint &pos, TQWidget *notParentOf )
TQWidget *container = 0;
int depth = -1;
TQWidgetList selected = selectedWidgets();
- if ( TQT_TQRECT_OBJECT(rect()).tqcontains( mapFromGlobal( pos ) ) ) {
+ if ( TQT_TQRECT_OBJECT(rect()).contains( mapFromGlobal( pos ) ) ) {
container = mainContainer();
depth = widgetDepth( container );
}
@@ -2536,7 +2536,7 @@ TQWidget *FormWindow::containerAt( const TQPoint &pos, TQWidget *notParentOf )
continue;
if ( !it.current()->isVisibleTo( this ) )
continue;
- if ( selected.tqfind( it.current() ) != -1 )
+ if ( selected.find( it.current() ) != -1 )
continue;
if ( !WidgetDatabase::isContainer( WidgetDatabase::idFromClassName( WidgetFactory::classNameOf( TQT_TQOBJECT(it.current()) ) ) ) &&
it.current() != mainContainer() )
@@ -2545,7 +2545,7 @@ TQWidget *FormWindow::containerAt( const TQPoint &pos, TQWidget *notParentOf )
// the rectangles of all ancestors of the container must contain the insert position
TQWidget *w = it.current();
while ( w && !w->isTopLevel() ) {
- if ( !TQT_TQRECT_OBJECT(w->rect()).tqcontains( ( w->mapFromGlobal( pos ) ) ) )
+ if ( !TQT_TQRECT_OBJECT(w->rect()).contains( ( w->mapFromGlobal( pos ) ) ) )
break;
w = w->parentWidget();
}
@@ -2553,8 +2553,8 @@ TQWidget *FormWindow::containerAt( const TQPoint &pos, TQWidget *notParentOf )
int wd = widgetDepth( it.current() );
if ( wd == depth && container ) {
- if ( ( it.current()->parentWidget()->childrenListObject() ).tqfind( TQT_TQOBJECT(it.current()) ) >
- ( container->parentWidget()->childrenListObject() ).tqfind( TQT_TQOBJECT(container) ) )
+ if ( ( it.current()->parentWidget()->childrenListObject() ).find( TQT_TQOBJECT(it.current()) ) >
+ ( container->parentWidget()->childrenListObject() ).find( TQT_TQOBJECT(container) ) )
wd++;
}
if ( wd > depth && !isChildOf( it.current(), notParentOf ) ) {