Fix a number of runtime object identification problems which led to an even larger array of minor glitches

NOTE: kdevelop and kdewebdev still need to be fully repaired


git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdelibs@1222475 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
v3.5.13-sru
tpearson 14 years ago
parent f0023a8307
commit 28042add4d

@ -263,7 +263,7 @@ void KAcceleratorManagerPrivate::calculateAccelerators(Item *item, TQString &use
void KAcceleratorManagerPrivate::traverseChildren(TQWidget *widget, Item *item) void KAcceleratorManagerPrivate::traverseChildren(TQWidget *widget, Item *item)
{ {
TQObjectList *childList = widget->queryList("TQWidget", 0, false, false); TQObjectList *childList = widget->queryList(TQWIDGET_OBJECT_NAME_STRING, 0, false, false);
for ( TQObject *it = childList->first(); it; it = childList->next() ) for ( TQObject *it = childList->first(); it; it = childList->next() )
{ {
TQWidget *w = TQT_TQWIDGET(it); TQWidget *w = TQT_TQWIDGET(it);

@ -484,12 +484,12 @@ void KPrintDialog::setDialogPages(TQPtrList<KPrintDialogPage> *pages)
d->m_pages.append(pages->take(0)); d->m_pages.append(pages->take(0));
d->m_pages.first()->reparent(d->m_dummy, TQPoint(0,0)); d->m_pages.first()->reparent(d->m_dummy, TQPoint(0,0));
d->m_pages.first()->show(); d->m_pages.first()->show();
delete d->m_dummy->child("TabWidget", "TQTabWidget"); delete d->m_dummy->child("TabWidget", TQTABWIDGET_OBJECT_NAME_STRING);
} }
else else
{ {
// more than one page. // more than one page.
TQTabWidget *tabs = static_cast<TQTabWidget*>(TQT_TQWIDGET(d->m_dummy->child("TabWidget", "TQTabWidget"))); TQTabWidget *tabs = static_cast<TQTabWidget*>(TQT_TQWIDGET(d->m_dummy->child("TabWidget", TQTABWIDGET_OBJECT_NAME_STRING)));
if (!tabs) if (!tabs)
{ {
// TQTabWidget doesn't exist. Create it and reparent all // TQTabWidget doesn't exist. Create it and reparent all
@ -822,7 +822,7 @@ void KPrintDialog::slotWizard()
void KPrintDialog::reload() void KPrintDialog::reload()
{ {
// remove printer dependent pages (usually from plugin) // remove printer dependent pages (usually from plugin)
TQTabWidget *tabs = static_cast<TQTabWidget*>(TQT_TQWIDGET(d->m_dummy->child("TabWidget", "TQTabWidget"))); TQTabWidget *tabs = static_cast<TQTabWidget*>(TQT_TQWIDGET(d->m_dummy->child("TabWidget", TQTABWIDGET_OBJECT_NAME_STRING)));
for (uint i=0; i<d->m_pages.count(); i++) for (uint i=0; i<d->m_pages.count(); i++)
if (d->m_pages.tqat(i)->onlyRealPrinters()) if (d->m_pages.tqat(i)->onlyRealPrinters())
{ {
@ -951,7 +951,7 @@ void KPrintDialog::enableDialogPage( int index, bool flag )
if ( d->m_pages.count() > 1 ) if ( d->m_pages.count() > 1 )
{ {
TQTabWidget *tabs = static_cast<TQTabWidget*>(TQT_TQWIDGET(d->m_dummy->child("TabWidget", "TQTabWidget"))); TQTabWidget *tabs = static_cast<TQTabWidget*>(TQT_TQWIDGET(d->m_dummy->child("TabWidget", TQTABWIDGET_OBJECT_NAME_STRING)));
tabs->setTabEnabled( d->m_pages.tqat( index ), flag ); tabs->setTabEnabled( d->m_pages.tqat( index ), flag );
} }
else else

@ -249,7 +249,7 @@ void KComboBox::wheelEvent( TQWheelEvent *ev )
void KComboBox::setLineEdit( TQLineEdit *edit ) void KComboBox::setLineEdit( TQLineEdit *edit )
{ {
if ( !editable() && edit && if ( !editable() && edit &&
!qstrcmp( edit->className(), "TQLineEdit" ) ) !qstrcmp( edit->className(), TQLINEEDIT_OBJECT_NAME_STRING ) )
{ {
// uic generates code that creates a read-only KComboBox and then // uic generates code that creates a read-only KComboBox and then
// calls combo->setEditable( true ), which causes TQComboBox to set up // calls combo->setEditable( true ), which causes TQComboBox to set up

@ -684,7 +684,7 @@ int KJanusWidget::pageIndex( TQWidget *widget ) const
// and addGridPage() but not with addPage() which returns a child of // and addGridPage() but not with addPage() which returns a child of
// the toplevel page. addPage() returns a TQFrame so I check for that. // the toplevel page. addPage() returns a TQFrame so I check for that.
// //
if( widget->isA("TQFrame") ) if( widget->isA(TQFRAME_OBJECT_NAME_STRING) )
{ {
return d->mPageToInt[widget->tqparentWidget()]; return d->mPageToInt[widget->tqparentWidget()];
} }

@ -394,7 +394,7 @@ void KMainWindow::hide()
d->hiddenDockWindows.clear(); d->hiddenDockWindows.clear();
TQObjectList *list = queryList( "TQDockWindow" ); TQObjectList *list = queryList( TQDOCKWINDOW_OBJECT_NAME_STRING );
for( TQObjectListIt it( *list ); it.current(); ++it ) { for( TQObjectListIt it( *list ); it.current(); ++it ) {
TQDockWindow *dw = (TQDockWindow*)it.current(); TQDockWindow *dw = (TQDockWindow*)it.current();
if ( dw->isTopLevel() && dw->isVisible() ) { if ( dw->isTopLevel() && dw->isVisible() ) {

@ -85,7 +85,7 @@ void KWindowInfo::permanent( const TQString &text )
void KWindowInfo::permanent( const TQString &text, const TQPixmap &pix ) void KWindowInfo::permanent( const TQString &text, const TQPixmap &pix )
{ {
if ( !oldText.isNull() ) { if ( !oldText.isNull() ) {
TQObjectList *l = queryList( "TQTimer" ); TQObjectList *l = queryList( TQTIMER_OBJECT_NAME_STRING );
TQObjectListIt it( *l ); TQObjectListIt it( *l );
TQObject *obj; TQObject *obj;

@ -897,7 +897,7 @@ void KHTMLView::layout()
void KHTMLView::closeChildDialogs() void KHTMLView::closeChildDialogs()
{ {
TQObjectList *dlgs = queryList("TQDialog"); TQObjectList *dlgs = queryList(TQDIALOG_OBJECT_NAME_STRING);
for (TQObject *dlg = dlgs->first(); dlg; dlg = dlgs->next()) for (TQObject *dlg = dlgs->first(); dlg; dlg = dlgs->next())
{ {
KDialogBase* dlgbase = dynamic_cast<KDialogBase *>( dlg ); KDialogBase* dlgbase = dynamic_cast<KDialogBase *>( dlg );

@ -91,7 +91,7 @@ bool TabWidget::eventFilter(TQObject *obj, TQEvent *e )
// child and its children // child and its children
TQObject* pLostChild = TQT_TQOBJECT(((TQChildEvent*)e)->child()); TQObject* pLostChild = TQT_TQOBJECT(((TQChildEvent*)e)->child());
if ((pLostChild != 0L) && (pLostChild->isWidgetType())) { if ((pLostChild != 0L) && (pLostChild->isWidgetType())) {
TQObjectList *list = pLostChild->queryList( "TQWidget" ); TQObjectList *list = pLostChild->queryList( TQWIDGET_OBJECT_NAME_STRING );
list->insert(0, pLostChild); // add the lost child to the list too, just to save code list->insert(0, pLostChild); // add the lost child to the list too, just to save code
TQObjectListIt it( *list ); // iterate over all lost child widgets TQObjectListIt it( *list ); // iterate over all lost child widgets
TQObject * o; TQObject * o;
@ -114,7 +114,7 @@ bool TabWidget::eventFilter(TQObject *obj, TQEvent *e )
TQWidget* pNewWidget = (TQWidget*)pNewChild; TQWidget* pNewWidget = (TQWidget*)pNewChild;
if (pNewWidget->testWFlags((WFlags)(WType_Dialog | WShowModal))) if (pNewWidget->testWFlags((WFlags)(WType_Dialog | WShowModal)))
return false; return false;
TQObjectList *list = pNewWidget->queryList( "TQWidget" ); TQObjectList *list = pNewWidget->queryList( TQWIDGET_OBJECT_NAME_STRING );
list->insert(0, pNewChild); // add the new child to the list too, just to save code list->insert(0, pNewChild); // add the new child to the list too, just to save code
TQObjectListIt it( *list ); // iterate over all new child widgets TQObjectListIt it( *list ); // iterate over all new child widgets
TQObject * o; TQObject * o;
@ -138,7 +138,7 @@ void TabWidget::childDestroyed()
const TQObject* pLostChild = TQT_TQOBJECT_CONST(sender()); const TQObject* pLostChild = TQT_TQOBJECT_CONST(sender());
if ((pLostChild != 0L) && (pLostChild->isWidgetType())) if ((pLostChild != 0L) && (pLostChild->isWidgetType()))
{ {
TQObjectList *list = ((TQObject*)(pLostChild))->queryList("TQWidget"); TQObjectList *list = ((TQObject*)(pLostChild))->queryList(TQWIDGET_OBJECT_NAME_STRING);
list->insert(0, pLostChild); // add the lost child to the list too, just to save code list->insert(0, pLostChild); // add the lost child to the list too, just to save code
TQObjectListIt it( *list ); // iterate over all lost child widgets TQObjectListIt it( *list ); // iterate over all lost child widgets
TQObject * obj; TQObject * obj;

@ -752,7 +752,7 @@ void KMdiChildFrm::setClient( KMdiChildView *w, bool bAutomaticResize )
// memorize the focuses in a dictionary because they will get lost during reparenting // memorize the focuses in a dictionary because they will get lost during reparenting
TQDict<TQ_FocusPolicy>* pFocPolDict = new TQDict<TQ_FocusPolicy>; TQDict<TQ_FocusPolicy>* pFocPolDict = new TQDict<TQ_FocusPolicy>;
pFocPolDict->setAutoDelete( true ); pFocPolDict->setAutoDelete( true );
TQObjectList *list = m_pClient->queryList( "TQWidget" ); TQObjectList *list = m_pClient->queryList( TQWIDGET_OBJECT_NAME_STRING );
TQObjectListIt it( *list ); // iterate over the buttons TQObjectListIt it( *list ); // iterate over the buttons
TQObject * obj; TQObject * obj;
int i = 1; int i = 1;
@ -833,7 +833,7 @@ void KMdiChildFrm::unsetClient( TQPoint positionOffset )
m_pClient->setMaximumSize( maxs.width(), maxs.height() ); m_pClient->setMaximumSize( maxs.width(), maxs.height() );
// remember the focus policies using the dictionary and reset them // remember the focus policies using the dictionary and reset them
TQObjectList *list = m_pClient->queryList( "TQWidget" ); TQObjectList *list = m_pClient->queryList( TQWIDGET_OBJECT_NAME_STRING );
TQObjectListIt it( *list ); // iterate over all child widgets of child frame TQObjectListIt it( *list ); // iterate over all child widgets of child frame
TQObject * obj; TQObject * obj;
TQWidget* firstFocusableChildWidget = 0; TQWidget* firstFocusableChildWidget = 0;
@ -887,7 +887,7 @@ void KMdiChildFrm::unsetClient( TQPoint positionOffset )
void KMdiChildFrm::linkChildren( TQDict<TQ_FocusPolicy>* pFocPolDict ) void KMdiChildFrm::linkChildren( TQDict<TQ_FocusPolicy>* pFocPolDict )
{ {
// reset the focus policies for all widgets in the view (take them from the dictionary) // reset the focus policies for all widgets in the view (take them from the dictionary)
TQObjectList* list = m_pClient->queryList( "TQWidget" ); TQObjectList* list = m_pClient->queryList( TQWIDGET_OBJECT_NAME_STRING );
TQObjectListIt it( *list ); // iterate over all child widgets of child frame TQObjectListIt it( *list ); // iterate over all child widgets of child frame
TQObject* obj; TQObject* obj;
while ( ( obj = it.current() ) != 0 ) while ( ( obj = it.current() ) != 0 )
@ -936,7 +936,7 @@ TQDict<TQ_FocusPolicy>* KMdiChildFrm::unlinkChildren()
TQDict<TQ_FocusPolicy>* pFocPolDict = new TQDict<TQ_FocusPolicy>; TQDict<TQ_FocusPolicy>* pFocPolDict = new TQDict<TQ_FocusPolicy>;
pFocPolDict->setAutoDelete( true ); pFocPolDict->setAutoDelete( true );
TQObjectList *list = m_pClient->queryList( "TQWidget" ); TQObjectList *list = m_pClient->queryList( TQWIDGET_OBJECT_NAME_STRING );
TQObjectListIt it( *list ); // iterate over all child widgets of child frame TQObjectListIt it( *list ); // iterate over all child widgets of child frame
TQObject * obj; TQObject * obj;
int i = 1; int i = 1;
@ -1180,7 +1180,7 @@ bool KMdiChildFrm::eventFilter( TQObject *obj, TQEvent *e )
if ( ( pNewChild != 0L ) && ::tqqt_cast<TQWidget*>( pNewChild ) ) if ( ( pNewChild != 0L ) && ::tqqt_cast<TQWidget*>( pNewChild ) )
{ {
TQWidget * pNewWidget = TQT_TQWIDGET( pNewChild ); TQWidget * pNewWidget = TQT_TQWIDGET( pNewChild );
TQObjectList *list = pNewWidget->queryList( "TQWidget" ); TQObjectList *list = pNewWidget->queryList( TQWIDGET_OBJECT_NAME_STRING );
list->insert( 0, pNewChild ); // add the new child to the list too, just to save code list->insert( 0, pNewChild ); // add the new child to the list too, just to save code
TQObjectListIt it( *list ); // iterate over all new child widgets TQObjectListIt it( *list ); // iterate over all new child widgets
TQObject * obj; TQObject * obj;

@ -496,7 +496,7 @@ void KMdiChildView::slot_childDestroyed()
const TQObject * pLostChild = TQT_TQOBJECT_CONST(sender()); const TQObject * pLostChild = TQT_TQOBJECT_CONST(sender());
if ( pLostChild && ( pLostChild->isWidgetType() ) ) if ( pLostChild && ( pLostChild->isWidgetType() ) )
{ {
TQObjectList* list = ( ( TQObject* ) ( pLostChild ) ) ->queryList( "TQWidget" ); TQObjectList* list = ( ( TQObject* ) ( pLostChild ) ) ->queryList( TQWIDGET_OBJECT_NAME_STRING );
list->insert( 0, pLostChild ); // add the lost child to the list too, just to save code list->insert( 0, pLostChild ); // add the lost child to the list too, just to save code
TQObjectListIt it( *list ); // iterate over all lost child widgets TQObjectListIt it( *list ); // iterate over all lost child widgets
TQObject* obj; TQObject* obj;
@ -545,7 +545,7 @@ bool KMdiChildView::eventFilter( TQObject *obj, TQEvent *e )
{ {
if ( obj->isWidgetType() ) if ( obj->isWidgetType() )
{ {
TQObjectList * list = queryList( "TQWidget" ); TQObjectList * list = queryList( TQWIDGET_OBJECT_NAME_STRING );
if ( list->tqfind( obj ) != -1 ) if ( list->tqfind( obj ) != -1 )
m_focusedChildWidget = ( TQWidget* ) obj; m_focusedChildWidget = ( TQWidget* ) obj;
@ -569,7 +569,7 @@ bool KMdiChildView::eventFilter( TQObject *obj, TQEvent *e )
TQObject * pLostChild = TQT_TQOBJECT(( ( TQChildEvent* ) e ) ->child()); TQObject * pLostChild = TQT_TQOBJECT(( ( TQChildEvent* ) e ) ->child());
if ( ( pLostChild != 0L ) && ( pLostChild->isWidgetType() ) ) if ( ( pLostChild != 0L ) && ( pLostChild->isWidgetType() ) )
{ {
TQObjectList * list = pLostChild->queryList( "TQWidget" ); TQObjectList * list = pLostChild->queryList( TQWIDGET_OBJECT_NAME_STRING );
list->insert( 0, pLostChild ); // add the lost child to the list too, just to save code list->insert( 0, pLostChild ); // add the lost child to the list too, just to save code
TQObjectListIt it( *list ); // iterate over all lost child widgets TQObjectListIt it( *list ); // iterate over all lost child widgets
TQObject * o; TQObject * o;
@ -602,7 +602,7 @@ bool KMdiChildView::eventFilter( TQObject *obj, TQEvent *e )
TQWidget * pNewWidget = ( TQWidget* ) pNewChild; TQWidget * pNewWidget = ( TQWidget* ) pNewChild;
if ( pNewWidget->testWFlags( (WFlags)(WType_Dialog | WShowModal) ) ) if ( pNewWidget->testWFlags( (WFlags)(WType_Dialog | WShowModal) ) )
return false; return false;
TQObjectList *list = pNewWidget->queryList( "TQWidget" ); TQObjectList *list = pNewWidget->queryList( TQWIDGET_OBJECT_NAME_STRING );
list->insert( 0, pNewChild ); // add the new child to the list too, just to save code list->insert( 0, pNewChild ); // add the new child to the list too, just to save code
TQObjectListIt it( *list ); // iterate over all new child widgets TQObjectListIt it( *list ); // iterate over all new child widgets
TQObject * o; TQObject * o;
@ -647,7 +647,7 @@ bool KMdiChildView::eventFilter( TQObject *obj, TQEvent *e )
/** Switches interposing in event loop of all current child widgets off. */ /** Switches interposing in event loop of all current child widgets off. */
void KMdiChildView::removeEventFilterForAllChildren() void KMdiChildView::removeEventFilterForAllChildren()
{ {
TQObjectList* list = queryList( "TQWidget" ); TQObjectList* list = queryList( TQWIDGET_OBJECT_NAME_STRING );
TQObjectListIt it( *list ); // iterate over all child widgets TQObjectListIt it( *list ); // iterate over all child widgets
TQObject* obj; TQObject* obj;
while ( ( obj = it.current() ) != 0 ) while ( ( obj = it.current() ) != 0 )

@ -34,7 +34,7 @@ void KMdiFocusList::addWidgetTree( TQWidget* w )
w->setFocusPolicy( TQ_ClickFocus ); w->setFocusPolicy( TQ_ClickFocus );
kdDebug( 760 ) << "KMdiFocusList::addWidgetTree: adding toplevel" << endl; kdDebug( 760 ) << "KMdiFocusList::addWidgetTree: adding toplevel" << endl;
connect( w, TQT_SIGNAL( destroyed( TQObject * ) ), this, TQT_SLOT( objectHasBeenDestroyed( TQObject* ) ) ); connect( w, TQT_SIGNAL( destroyed( TQObject * ) ), this, TQT_SLOT( objectHasBeenDestroyed( TQObject* ) ) );
TQObjectList *l = w->queryList( "TQWidget" ); TQObjectList *l = w->queryList( TQWIDGET_OBJECT_NAME_STRING );
TQObjectListIt it( *l ); TQObjectListIt it( *l );
TQObject *obj; TQObject *obj;
while ( ( obj = it.current() ) != 0 ) while ( ( obj = it.current() ) != 0 )

Loading…
Cancel
Save