summaryrefslogtreecommitdiffstats
path: root/tqtinterface/qt4/tools/designer/designer/widgetfactory.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tqtinterface/qt4/tools/designer/designer/widgetfactory.cpp')
-rw-r--r--tqtinterface/qt4/tools/designer/designer/widgetfactory.cpp78
1 files changed, 39 insertions, 39 deletions
diff --git a/tqtinterface/qt4/tools/designer/designer/widgetfactory.cpp b/tqtinterface/qt4/tools/designer/designer/widgetfactory.cpp
index 84ccb85..edd455f 100644
--- a/tqtinterface/qt4/tools/designer/designer/widgetfactory.cpp
+++ b/tqtinterface/qt4/tools/designer/designer/widgetfactory.cpp
@@ -103,7 +103,7 @@
#include <globaldefs.h>
#include <tqobject.h>
-FormWindow *tqfind_formwindow( TQWidget *w )
+FormWindow *find_formwindow( TQWidget *w )
{
if ( !w )
return 0;
@@ -219,7 +219,7 @@ bool TQDesignerTabWidget::eventFilter( TQObject *o, TQEvent *e )
int index = 0;
TQRect rect;
for ( ; index < tabBar()->count(); index++ ) {
- if ( tabBar()->tabAt( index )->rect().tqcontains( de->pos() ) ) {
+ if ( tabBar()->tabAt( index )->rect().contains( de->pos() ) ) {
rect = tabBar()->tabAt( index )->rect();
break;
}
@@ -228,7 +228,7 @@ bool TQDesignerTabWidget::eventFilter( TQObject *o, TQEvent *e )
if ( index == tabBar()->count() -1 ) {
TQRect rect2 = rect;
rect2.setLeft( rect2.left() + rect2.width() / 2 );
- if ( rect2.tqcontains( de->pos() ) )
+ if ( rect2.contains( de->pos() ) )
index++;
}
@@ -256,24 +256,24 @@ bool TQDesignerTabWidget::eventFilter( TQObject *o, TQEvent *e )
int newIndex = 0;
for ( ; newIndex < tabBar()->count(); newIndex++ ) {
- if ( tabBar()->tabAt( newIndex )->rect().tqcontains( de->pos() ) )
+ if ( tabBar()->tabAt( newIndex )->rect().contains( de->pos() ) )
break;
}
if ( newIndex == tabBar()->count() -1 ) {
TQRect rect2 = tabBar()->tabAt( newIndex )->rect();
rect2.setLeft( rect2.left() + rect2.width() / 2 );
- if ( rect2.tqcontains( de->pos() ) )
+ if ( rect2.contains( de->pos() ) )
newIndex++;
}
int oldIndex = 0;
for ( ; oldIndex < tabBar()->count(); oldIndex++ ) {
- if ( tabBar()->tabAt( oldIndex )->rect().tqcontains( pressPoint ) )
+ if ( tabBar()->tabAt( oldIndex )->rect().contains( pressPoint ) )
break;
}
- FormWindow *fw = tqfind_formwindow( this );
+ FormWindow *fw = find_formwindow( this );
MoveTabPageCommand *cmd =
new MoveTabPageCommand( tr( "Move Tab Page" ), fw, this,
dragPage, dragLabel, newIndex, oldIndex );
@@ -330,7 +330,7 @@ void TQDesignerWidgetStack::nextPage()
int TQDesignerWidgetStack::currentPage() const
{
TQDesignerWidgetStack* that = (TQDesignerWidgetStack*) this;
- return that->pages.tqfind( visibleWidget() );
+ return that->pages.find( visibleWidget() );
}
void TQDesignerWidgetStack::setCurrentPage( int i )
@@ -385,12 +385,12 @@ int TQDesignerWidgetStack::insertPage( TQWidget *p, int i )
raiseWidget( p );
TQApplication::sendPostedEvents();
updateButtons();
- return pages.tqfind( p );
+ return pages.find( p );
}
int TQDesignerWidgetStack::removePage( TQWidget *p )
{
- int i = pages.tqfind( p );
+ int i = pages.find( p );
pages.remove( p );
removeWidget( p );
setCurrentPage( 0 );
@@ -465,7 +465,7 @@ int TQDesignerWizard::pageNum( TQWidget *p )
void TQDesignerWizard::addPage( TQWidget *p, const TQString &t )
{
TQWizard::addPage( p, t );
- if ( removedPages.tqfind( p ) )
+ if ( removedPages.find( p ) )
removedPages.remove( p );
}
@@ -478,7 +478,7 @@ void TQDesignerWizard::removePage( TQWidget *p )
void TQDesignerWizard::insertPage( TQWidget *p, const TQString &t, int index )
{
TQWizard::insertPage( p, t, index );
- if ( removedPages.tqfind( p ) )
+ if ( removedPages.find( p ) )
removedPages.remove( p );
}
@@ -490,7 +490,7 @@ TQMap< int, TQStringList > *changedProperties = 0;
\brief Set of static functions for creating widgets, layouts and do other stuff
The widget factory offers functions to create widgets, create and
- delete layouts tqfind out other details - all based on the
+ delete layouts find out other details - all based on the
WidgetDatabase's data. So the functions that use ids use the same
ids as in the WidgetDatabase.
*/
@@ -507,9 +507,9 @@ void WidgetFactory::saveDefaultProperties( TQT_BASE_OBJECT_NAME *tqbo, int id )
var = TQVariant( TQPixmap() );
else if ( !var.isValid() && qstrcmp( "iconSet", lst.at( i ) ) == 0 )
var = TQVariant( TQIconSet() );
- propMap.tqreplace( lst.at( i ), var );
+ propMap.replace( lst.at( i ), var );
}
- defaultProperties->tqreplace( id, propMap );
+ defaultProperties->replace( id, propMap );
}
void WidgetFactory::saveChangedProperties( TQT_BASE_OBJECT_NAME *w, int id )
@@ -547,9 +547,9 @@ TQWidget *WidgetFactory::create( int id, TQWidget *tqparent, const char *name, b
return 0;
MetaDataBase::addEntry( w );
- if ( !defaultProperties->tqcontains( id ) )
+ if ( !defaultProperties->contains( id ) )
saveDefaultProperties( w, id );
- if ( !changedProperties->tqcontains( id ) )
+ if ( !changedProperties->contains( id ) )
saveChangedProperties( w, id );
return w;
@@ -696,7 +696,7 @@ TQWidget *WidgetFactory::createWidget( const TQString &className, TQWidget *tqpa
} else {
b = new TQDesignerPushButton( tqparent, name );
}
- TQWidget *w = tqfind_formwindow( b );
+ TQWidget *w = find_formwindow( b );
b->setAutoDefault( w && ::tqqt_cast<TQDialog*>(((FormWindow*)w)->mainContainer()) );
return b;
} else if ( className == "TQToolButton" ) {
@@ -811,7 +811,7 @@ TQWidget *WidgetFactory::createWidget( const TQString &className, TQWidget *tqpa
else if ( className == "TQTabWidget" ) {
TQTabWidget *tw = new TQDesignerTabWidget( tqparent, name );
if ( init ) {
- FormWindow *fw = tqfind_formwindow( tqparent );
+ FormWindow *fw = find_formwindow( tqparent );
TQWidget *w = fw ? new TQDesignerWidget( fw, tw, "tab" ) : new TQWidget( tw, "tab" );
tw->addTab( w, MainWindow::tr("Tab 1") );
MetaDataBase::addEntry( w );
@@ -824,7 +824,7 @@ TQWidget *WidgetFactory::createWidget( const TQString &className, TQWidget *tqpa
} else if ( className == "TQWidgetStack" ) {
TQDesignerWidgetStack *ws = new TQDesignerWidgetStack( tqparent, name );
if ( init ) {
- FormWindow *fw = tqfind_formwindow( tqparent );
+ FormWindow *fw = find_formwindow( tqparent );
TQWidget *w = fw ? new TQDesignerWidget( fw, ws, "WStackPage" ) : new TQWidget( ws, "WStackPage" );
ws->insertPage( w );
MetaDataBase::addEntry( w );
@@ -841,7 +841,7 @@ TQWidget *WidgetFactory::createWidget( const TQString &className, TQWidget *tqpa
::tqqt_cast<TQWidgetStack*>(tqparent) ||
::tqqt_cast<TQToolBox*>(tqparent) ||
::tqqt_cast<TQMainWindow*>(tqparent) ) ) {
- FormWindow *fw = tqfind_formwindow( tqparent );
+ FormWindow *fw = find_formwindow( tqparent );
if ( fw ) {
TQDesignerWidget *dw = new TQDesignerWidget( fw, tqparent, name );
MetaDataBase::addEntry( dw );
@@ -956,7 +956,7 @@ TQWidget *WidgetFactory::createWidget( const TQString &className, TQWidget *tqpa
if ( !init )
return new TQDesignerToolBox( tqparent, name );
TQToolBox *tb = new TQDesignerToolBox( tqparent, name );
- FormWindow *fw = tqfind_formwindow( tqparent );
+ FormWindow *fw = find_formwindow( tqparent );
TQWidget *w = fw ? new TQDesignerWidget( fw, tb, "page1" ) :
new TQWidget( tb, "page1" );
tb->addItem( w, MainWindow::tr("Page 1") );
@@ -1128,7 +1128,7 @@ TQWidget* WidgetFactory::containerOfWidget( TQWidget *w )
/*! Returns the actual designer widget of the container \a w. This is
normally \a w itself, but might be a tqparent or grand tqparent of \a w
(e.g. when working with a tabwidget and \a w is the container which
- tqcontains and layouts childs, but the actual widget known to the
+ contains and layouts childs, but the actual widget known to the
designer is the tabwidget which is the tqparent of \a w. So this
function returns the tabwidget then.)
*/
@@ -1378,13 +1378,13 @@ bool WidgetFactory::hasSpecialEditor( int id, TQObject *editorWidget )
{
TQString className = WidgetDatabase::className( id );
- if ( className.tqcontains( "ListBox" ) )
+ if ( className.contains( "ListBox" ) )
return TRUE;
- if ( className.tqcontains( "ComboBox" ) )
+ if ( className.contains( "ComboBox" ) )
return TRUE;
- if ( className.tqcontains( "ListView" ) )
+ if ( className.contains( "ListView" ) )
return TRUE;
- if ( className.tqcontains( "IconView" ) )
+ if ( className.contains( "IconView" ) )
return TRUE;
if ( className == "TQTextEdit" || className == "TQMultiLineEdit" )
return TRUE;
@@ -1398,8 +1398,8 @@ bool WidgetFactory::hasItems( int id, TQObject *editorWidget )
{
TQString className = WidgetDatabase::className( id );
- if ( className.tqcontains( "ListBox" ) || className.tqcontains( "ListView" ) ||
- className.tqcontains( "IconView" ) || className.tqcontains( "ComboBox" ) ||
+ if ( className.contains( "ListBox" ) || className.contains( "ListView" ) ||
+ className.contains( "IconView" ) || className.contains( "ComboBox" ) ||
::tqqt_cast<TQTable*>(editorWidget) != 0 )
return TRUE;
@@ -1410,7 +1410,7 @@ void WidgetFactory::editWidget( int id, TQWidget *tqparent, TQWidget *editWidget
{
TQString className = WidgetDatabase::className( id );
- if ( className.tqcontains( "ListBox" ) ) {
+ if ( className.contains( "ListBox" ) ) {
if ( !::tqqt_cast<TQListBox*>(editWidget) )
return;
ListBoxEditor *e = new ListBoxEditor( tqparent, editWidget, fw );
@@ -1419,7 +1419,7 @@ void WidgetFactory::editWidget( int id, TQWidget *tqparent, TQWidget *editWidget
return;
}
- if ( className.tqcontains( "ComboBox" ) ) {
+ if ( className.contains( "ComboBox" ) ) {
if ( !::tqqt_cast<TQComboBox*>(editWidget) )
return;
TQComboBox *cb = (TQComboBox*)editWidget;
@@ -1435,7 +1435,7 @@ void WidgetFactory::editWidget( int id, TQWidget *tqparent, TQWidget *editWidget
return;
}
- if ( className.tqcontains( "ListView" ) ) {
+ if ( className.contains( "ListView" ) ) {
if ( !::tqqt_cast<TQListView*>(editWidget) )
return;
TQListView *lv = (TQListView*)editWidget;
@@ -1445,7 +1445,7 @@ void WidgetFactory::editWidget( int id, TQWidget *tqparent, TQWidget *editWidget
return;
}
- if ( className.tqcontains( "IconView" ) ) {
+ if ( className.contains( "IconView" ) ) {
if ( !::tqqt_cast<TQIconView*>(editWidget) )
return;
IconViewEditor *e = new IconViewEditor( tqparent, editWidget, fw );
@@ -1474,15 +1474,15 @@ bool WidgetFactory::canResetProperty( TQT_BASE_OBJECT_NAME *w, const TQString &p
{
if ( propName == "name" || propName == "geometry" )
return FALSE;
- TQStringList l = *changedProperties->tqfind( WidgetDatabase::idFromClassName( WidgetFactory::classNameOf( w ) ) );
- return l.tqfindIndex( propName ) == -1;
+ TQStringList l = *changedProperties->find( WidgetDatabase::idFromClassName( WidgetFactory::classNameOf( w ) ) );
+ return l.findIndex( propName ) == -1;
}
bool WidgetFactory::resetProperty( TQT_BASE_OBJECT_NAME *tqbo, const TQString &propName )
{
TQObject *w = TQT_TQOBJECT(tqbo);
const TQMetaProperty *p = w->tqmetaObject()->property( w->tqmetaObject()->
- tqfindProperty( propName, TRUE ), TRUE );
+ findProperty( propName, TRUE ), TRUE );
if (!p )
return FALSE;
return p->reset( w );
@@ -1503,14 +1503,14 @@ TQVariant WidgetFactory::defaultValue( TQT_BASE_OBJECT_NAME *w, const TQString &
return TQVariant( -1 );
}
- return *( *defaultProperties->tqfind( WidgetDatabase::idFromClassName( classNameOf( w ) ) ) ).tqfind( propName );
+ return *( *defaultProperties->find( WidgetDatabase::idFromClassName( classNameOf( w ) ) ) ).find( propName );
}
TQString WidgetFactory::defaultCurrentItem( TQT_BASE_OBJECT_NAME *tqbo, const TQString &propName )
{
TQObject *w = TQT_TQOBJECT(tqbo);
const TQMetaProperty *p = w->tqmetaObject()->
- property( w->tqmetaObject()->tqfindProperty( propName, TRUE ), TRUE );
+ property( w->tqmetaObject()->findProperty( propName, TRUE ), TRUE );
if ( !p ) {
int v = defaultValue( w, "tqalignment" ).toInt();
if ( propName == "hAlign" ) {
@@ -1550,7 +1550,7 @@ TQWidget *WidgetFactory::createCustomWidget( TQWidget *tqparent, const char *nam
TQVariant WidgetFactory::property( TQT_BASE_OBJECT_NAME *tqbo, const char *name )
{
TQObject *w = TQT_TQOBJECT(tqbo);
- int id = w->tqmetaObject()->tqfindProperty( name, TRUE );
+ int id = w->tqmetaObject()->findProperty( name, TRUE );
const TQMetaProperty* p = w->tqmetaObject()->property( id, TRUE );
if ( !p || !p->isValid() )
return MetaDataBase::fakeProperty( w, name );