summaryrefslogtreecommitdiffstats
path: root/tqtinterface/qt4/tools/designer/designer/formwindow.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tqtinterface/qt4/tools/designer/designer/formwindow.cpp')
-rw-r--r--tqtinterface/qt4/tools/designer/designer/formwindow.cpp108
1 files changed, 54 insertions, 54 deletions
diff --git a/tqtinterface/qt4/tools/designer/designer/formwindow.cpp b/tqtinterface/qt4/tools/designer/designer/formwindow.cpp
index 0b102e9..f3155ee 100644
--- a/tqtinterface/qt4/tools/designer/designer/formwindow.cpp
+++ b/tqtinterface/qt4/tools/designer/designer/formwindow.cpp
@@ -97,7 +97,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 );
@@ -256,7 +256,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() );
@@ -432,10 +432,10 @@ void FormWindow::insertWidget()
++it;
if ( o->isWidgetType() &&
( (TQWidget*)o )->isVisibleTo( this ) &&
- insertedWidgets.tqfind( (TQWidget*)o ) && o != TQT_TQOBJECT(w) ) {
+ insertedWidgets.find( (TQWidget*)o ) && o != TQT_TQOBJECT(w) ) {
TQRect r2( ( (TQWidget*)o )->pos(),
( (TQWidget*)o )->size() );
- if ( r.tqcontains( r2 ) )
+ if ( r.contains( r2 ) )
lst.append( (TQWidget*)o );
}
}
@@ -535,11 +535,11 @@ void FormWindow::handleContextMenu( TQContextMenuEvent *e, TQWidget *w )
if ( !isMainContainer( w ) && qstrcmp( w->name(), "central widget" ) != 0 ) { // press on a child widget
raiseChildSelections( w ); // raise selections and select widget
selectWidget( w );
- // if widget is laid out, tqfind the first non-laid out super-widget
+ // if widget is laid out, find the first non-laid out super-widget
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();
@@ -596,7 +596,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( (TQWidget*)o, FALSE );
}
setPropertyShowingBlocked( FALSE );
@@ -614,9 +614,9 @@ void FormWindow::handleMousePress( TQMouseEvent *e, TQWidget *w )
raiseChildSelections( w ); // raise selections and select widget
selectWidget( w );
- // if widget is laid out, tqfind the first non-laid out super-widget
+ // 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
@@ -674,7 +674,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 );
@@ -690,7 +690,7 @@ void FormWindow::handleMousePress( TQMouseEvent *e, TQWidget *w )
default: // any insert widget tool
if ( e->button() == Qt::LeftButton ) {
insertParent = WidgetFactory::containerOfWidget( mainContainer() ); // default tqparent for new widget is the formwindow
- if ( !isMainContainer( w ) ) { // press was not on formwindow, check if we can tqfind another tqparent
+ if ( !isMainContainer( w ) ) { // press was not on formwindow, check if we can find another tqparent
TQWidget *wid = w;
for (;;) {
int id = WidgetDatabase::idFromClassName( WidgetFactory::classNameOf( wid ) );
@@ -720,7 +720,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 );
@@ -752,9 +752,9 @@ void FormWindow::handleMouseMove( TQMouseEvent *e, TQWidget *w )
case POINTER_TOOL:
if ( widgetPressed && allowMove( w ) ) { // we are prepated for a move
- // if widget is laid out, tqfind the first non-laid out super-widget
+ // 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
@@ -860,13 +860,13 @@ void FormWindow::handleMouseMove( TQMouseEvent *e, TQWidget *w )
wid = tqApp->widgetAt( e->globalPos(), TRUE );
if ( wid )
wid = designerWidget( wid );
- if ( wid && ( isMainContainer( wid ) || insertedWidgets.tqfind( wid ) ) && wid->isVisibleTo( this ) )
+ if ( wid && ( isMainContainer( 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( newendWidget ) || insertedWidgets.tqfind( newendWidget ) ) && !isCentralWidget( newendWidget ) )
+ ( isMainContainer( newendWidget ) || insertedWidgets.find( newendWidget ) ) && !isCentralWidget( newendWidget ) )
endWidget = newendWidget;
mainWindow()->statusBar()->message( tr( "Connect '%1' to '%2'" ).arg( startWidget->name() ).
arg( endWidget->name() ) );
@@ -893,7 +893,7 @@ void FormWindow::handleMouseMove( TQMouseEvent *e, TQWidget *w )
drawRecRect = newendWidget != endWidget;
if ( !newendWidget )
endWidget = newendWidget;
- else if ( insertedWidgets.tqfind( newendWidget ) && !isCentralWidget( newendWidget ) )
+ else if ( insertedWidgets.find( newendWidget ) && !isCentralWidget( newendWidget ) )
endWidget = newendWidget;
if ( endWidget )
mainWindow()->statusBar()->message( tr( "Set buddy '%1' to '%2'" ).arg( startWidget->name() ).
@@ -927,7 +927,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
@@ -1160,7 +1160,7 @@ void FormWindow::handleKeyPress( TQKeyEvent *e, TQWidget *w )
TQObjectList *l = queryList( "TQWidget" );
if ( !l )
return;
- if ( l->tqfind( TQT_TQOBJECT(w) ) != -1 )
+ if ( l->find( TQT_TQOBJECT(w) ) != -1 )
e->accept();
delete l;
}
@@ -1210,7 +1210,7 @@ void FormWindow::selectWidget( TQT_BASE_OBJECT_NAME *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;
@@ -1230,7 +1230,7 @@ void FormWindow::selectWidget( TQT_BASE_OBJECT_NAME *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;
@@ -1255,7 +1255,7 @@ TQPoint FormWindow::grid() const
void FormWindow::updateSelection( QWidget *w )
{
- WidgetSelection *s = usedSelections.tqfind( w );
+ WidgetSelection *s = usedSelections.find( w );
if ( !w->isVisibleTo( this ) )
selectWidget( w, FALSE );
else if ( s )
@@ -1264,14 +1264,14 @@ void FormWindow::updateSelection( QWidget *w )
void FormWindow::raiseSelection( QWidget *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();
}
@@ -1370,7 +1370,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( (TQWidget*)o );
}
}
@@ -1382,7 +1382,7 @@ void FormWindow::selectWidgets()
bool FormWindow::isWidgetSelected( TQT_BASE_OBJECT_NAME *w )
{
if ( w->isWidgetType() )
- return usedSelections.tqfind( (TQWidget*)w ) != 0;
+ return usedSelections.find( (TQWidget*)w ) != 0;
return FALSE; // #### do stuff for TQObjects
}
@@ -1425,7 +1425,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;
@@ -1437,7 +1437,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;
@@ -1457,7 +1457,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 {
@@ -1566,7 +1566,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() )
@@ -1778,7 +1778,7 @@ void FormWindow::showOrderIndicators()
w->focusPolicy() != Qt::NoFocus ) {
OrderIndicator* ind = new OrderIndicator( order++, w, this );
orderIndicators.append( ind );
- if ( stackedWidgets.tqfindRef( w ) == -1 )
+ if ( stackedWidgets.findRef( w ) == -1 )
stackedWidgets.append( w );
}
}
@@ -1875,16 +1875,16 @@ void FormWindow::lowerWidgets()
commandHistory()->addCommand( cmd );
}
-void tqfind_accel( const TQString &txt, TQMap<TQChar, TQWidgetList > &accels, TQWidget *w )
+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 );
@@ -1906,17 +1906,17 @@ 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 )
- tqfind_accel( w->property( "text" ).toString(), accels, w );
+ find_accel( w->property( "text" ).toString(), accels, w );
if ( title )
- tqfind_accel( w->property( "title" ).toString(), accels, w );
+ find_accel( w->property( "title" ).toString(), accels, w );
if ( pageTitle )
- tqfind_accel( w->property( "pageTitle" ).toString(), accels, w );
+ find_accel( w->property( "pageTitle" ).toString(), accels, w );
} else if ( ::tqqt_cast<MenuBarEditor*>(o) ) {
((MenuBarEditor *)o)->checkAccels( accels );
}
@@ -2055,7 +2055,7 @@ void FormWindow::layoutHorizontalContainer( TQWidget *w )
for ( TQObject *o = WidgetFactory::containerOfWidget(w)->childrenListObject().first(); o; o = WidgetFactory::containerOfWidget(w)->childrenListObject().next() ) {
if ( o->isWidgetType() &&
( (TQWidget*)o )->isVisibleTo( this ) &&
- insertedWidgets.tqfind( (TQWidget*)o ) )
+ insertedWidgets.find( (TQWidget*)o ) )
widgets.append( (TQWidget*)o );
}
LayoutHorizontalCommand *cmd = new LayoutHorizontalCommand( tr( "Lay out tqchildren horizontally" ),
@@ -2075,7 +2075,7 @@ void FormWindow::layoutVerticalContainer( TQWidget *w )
for ( TQObject *o = WidgetFactory::containerOfWidget(w)->childrenListObject().first(); o; o = WidgetFactory::containerOfWidget(w)->childrenListObject().next() ) {
if ( o->isWidgetType() &&
( (TQWidget*)o )->isVisibleTo( this ) &&
- insertedWidgets.tqfind( (TQWidget*)o ) )
+ insertedWidgets.find( (TQWidget*)o ) )
widgets.append( (TQWidget*)o );
}
LayoutVerticalCommand *cmd = new LayoutVerticalCommand( tr( "Lay out tqchildren vertically" ),
@@ -2098,7 +2098,7 @@ void FormWindow::layoutGridContainer( TQWidget *w )
for ( TQObject *o = WidgetFactory::containerOfWidget(w)->childrenListObject().first(); o; o = WidgetFactory::containerOfWidget(w)->childrenListObject().next() ) {
if ( o->isWidgetType() &&
( (TQWidget*)o )->isVisibleTo( this ) &&
- insertedWidgets.tqfind( (TQWidget*)o ) )
+ insertedWidgets.find( (TQWidget*)o ) )
widgets.append( (TQWidget*)o );
}
LayoutGridCommand *cmd = new LayoutGridCommand( tr( "Lay out tqchildren in a grid" ),
@@ -2149,7 +2149,7 @@ BreakLayoutCommand *FormWindow::breakLayoutCommand( TQWidget *w )
if ( o->isWidgetType() &&
!mainWindow()->isAToolBarChild( (TQWidget*)o ) &&
( (TQWidget*)o )->isVisibleTo( this ) &&
- insertedWidgets.tqfind( (TQWidget*)o ) )
+ insertedWidgets.find( (TQWidget*)o ) )
widgets.append( (TQWidget*)o );
}
return new BreakLayoutCommand( tr( "Break Layout" ), this, WidgetFactory::widgetOfContainer( w ), widgets );
@@ -2182,7 +2182,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;
}
@@ -2196,7 +2196,7 @@ bool FormWindow::allowMove( TQWidget *w )
{
w = w->parentWidget();
while ( w ) {
- if ( ( isMainContainer( w ) || insertedWidgets.tqfind( w ) ) && WidgetFactory::layoutType( w ) == WidgetFactory::NoLayout )
+ if ( ( isMainContainer( w ) || insertedWidgets.find( w ) ) && WidgetFactory::layoutType( w ) == WidgetFactory::NoLayout )
return TRUE;
w = w->parentWidget();
}
@@ -2272,7 +2272,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( Qt::red );
p.setX( p.x() + dx );
@@ -2443,7 +2443,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;
}
}
@@ -2517,7 +2517,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 );
}
@@ -2528,7 +2528,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( it.current() ) ) ) &&
it.current() != mainContainer() )
@@ -2537,7 +2537,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();
}
@@ -2545,8 +2545,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 ) ) {
@@ -2650,7 +2650,7 @@ Project *FormWindow::project() const
return proj;
}
-TQAction *FormWindow::tqfindAction( const TQString &name )
+TQAction *FormWindow::findAction( const TQString &name )
{
for ( TQAction *a = actionList().first(); a; a = actionList().next() ) {
if ( TQString( a->name() ) == name )