summaryrefslogtreecommitdiffstats
path: root/lib/compatibility/kmdi/qextmdi/kmdichildarea.cpp
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-06-16 19:02:47 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-06-16 19:02:47 +0000
commite985f7e545f4739493965aad69bbecb136dc9346 (patch)
tree54afd409d8acd6202dd8ab611d24e78c28e4c0a0 /lib/compatibility/kmdi/qextmdi/kmdichildarea.cpp
parentf7670c198945adc3b95ad69a959fe5f8ae55b493 (diff)
downloadtdewebdev-e985f7e545f4739493965aad69bbecb136dc9346.tar.gz
tdewebdev-e985f7e545f4739493965aad69bbecb136dc9346.zip
TQt4 port kdewebdev
This enables compilation under both Qt3 and Qt4 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdewebdev@1237029 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'lib/compatibility/kmdi/qextmdi/kmdichildarea.cpp')
-rw-r--r--lib/compatibility/kmdi/qextmdi/kmdichildarea.cpp52
1 files changed, 28 insertions, 24 deletions
diff --git a/lib/compatibility/kmdi/qextmdi/kmdichildarea.cpp b/lib/compatibility/kmdi/qextmdi/kmdichildarea.cpp
index 923b5537..da7ede0d 100644
--- a/lib/compatibility/kmdi/qextmdi/kmdichildarea.cpp
+++ b/lib/compatibility/kmdi/qextmdi/kmdichildarea.cpp
@@ -6,8 +6,8 @@
// begin : 07/1999 by Szymon Stefanek as part of kvirc
// (an IRC application)
// changes : 09/1999 by Falk Brettschneider to create an
-// - 06/2000 stand-alone Qt extension set of
-// classes and a Qt-based library
+// - 06/2000 stand-alone TQt extension set of
+// classes and a TQt-based library
// 2000-2003 maintained by the KDevelop project
//
// copyright : (C) 1999-2003 by Szymon Stefanek (stefanek@tin.it)
@@ -45,8 +45,8 @@
//============ KMdiChildArea ============//
-KMdiChildArea::KMdiChildArea( TQWidget *parent )
- : TQFrame( parent, "kmdi_childarea" )
+KMdiChildArea::KMdiChildArea( TQWidget *tqparent )
+ : TQFrame( tqparent, "kmdi_childarea" )
{
setFrameStyle( TQFrame::Panel | TQFrame::Sunken );
m_captionFont = TQFont();
@@ -58,7 +58,7 @@ KMdiChildArea::KMdiChildArea( TQWidget *parent )
m_captionInactiveForeColor = KGlobalSettings::inactiveTextColor();
m_pZ = new TQPtrList<KMdiChildFrm>;
m_pZ->setAutoDelete( true );
- setFocusPolicy( ClickFocus );
+ setFocusPolicy( TQ_ClickFocus );
m_defaultChildFrmSize = TQSize( 400, 300 );
}
@@ -75,11 +75,11 @@ void KMdiChildArea::manageChild( KMdiChildFrm* child, bool show, bool cascade )
KMdiChildFrm* top = topChild();
//remove old references. There can be more than one so we remove them all
- if ( m_pZ->findRef( child ) != -1 )
+ if ( m_pZ->tqfindRef( child ) != -1 )
{
- //TQPtrList::find* moves current() to the found item
+ //TQPtrList::tqfind* moves current() to the found item
m_pZ->take();
- while ( m_pZ->findNextRef( child ) != -1 )
+ while ( m_pZ->tqfindNextRef( child ) != -1 )
m_pZ->take();
}
@@ -112,7 +112,7 @@ void KMdiChildArea::destroyChild( KMdiChildFrm *child, bool focusTop )
bool wasMaximized = ( child->state() == KMdiChildFrm::Maximized );
// destroy the old one
- TQObject::disconnect( child );
+ TQT_BASE_OBJECT_NAME::disconnect( child );
child->blockSignals( true );
m_pZ->setAutoDelete( false );
m_pZ->removeRef( child );
@@ -144,7 +144,7 @@ void KMdiChildArea::destroyChildButNotItsView( KMdiChildFrm* child, bool focusTo
bool wasMaximized = ( child->state() == KMdiChildFrm::Maximized );
// destroy the old one
- TQObject::disconnect( child );
+ TQT_BASE_OBJECT_NAME::disconnect( child );
child->unsetClient();
m_pZ->setAutoDelete( false );
m_pZ->removeRef( child );
@@ -181,7 +181,7 @@ void KMdiChildArea::setTopChild( KMdiChildFrm* child, bool /* bSetFocus */ )
m_pZ->removeRef( child );
m_pZ->setAutoDelete( true );
- //disable the labels of all the other children
+ //disable the labels of all the other tqchildren
TQPtrListIterator<KMdiChildFrm> it( *m_pZ );
for ( ; ( *it ); ++it )
( *it )->m_pCaption->setActive( false );
@@ -194,7 +194,7 @@ void KMdiChildArea::setTopChild( KMdiChildFrm* child, bool /* bSetFocus */ )
m_pZ->append( child );
int nChildAreaMinW = 0, nChildAreaMinH = 0;
- int nChildAreaMaxW = QWIDGETSIZE_MAX, nChildAreaMaxH = QWIDGETSIZE_MAX;
+ int nChildAreaMaxW = TQWIDGETSIZE_MAX, nChildAreaMaxH = TQWIDGETSIZE_MAX;
if ( topChildMaximized && child->m_pClient )
{
//the former top child is maximized, so maximize the new one
@@ -218,15 +218,19 @@ void KMdiChildArea::setTopChild( KMdiChildFrm* child, bool /* bSetFocus */ )
else
child->raise();
+#ifdef USE_QT4
+ child->m_pClient->setFocus();
+#else // USE_QT4
TQFocusEvent::setReason( TQFocusEvent::Other );
child->m_pClient->setFocus();
+#endif // USE_QT4
}
}
void KMdiChildArea::resizeEvent( TQResizeEvent* e )
{
- //If we have a maximized children at the top , adjust its size
+ //If we have a maximized tqchildren at the top , adjust its size
KMdiChildFrm* child = topChild();
if ( child && child->state() == KMdiChildFrm::Maximized )
{
@@ -240,7 +244,7 @@ void KMdiChildArea::resizeEvent( TQResizeEvent* e )
height() + child->m_pCaption->heightHint() + KMDI_CHILDFRM_SEPARATOR + KMDI_CHILDFRM_DOUBLE_BORDER );
}
- layoutMinimizedChildren();
+ tqlayoutMinimizedChildren();
TQWidget::resizeEvent( e );
}
@@ -249,7 +253,7 @@ void KMdiChildArea::resizeEvent( TQResizeEvent* e )
void KMdiChildArea::mousePressEvent( TQMouseEvent *e )
{
//Popup the window menu
- if ( e->button() & RightButton )
+ if ( e->button() & Qt::RightButton )
emit popupWindowMenu( mapToGlobal( e->pos() ) );
}
@@ -319,7 +323,7 @@ TQPoint KMdiChildArea::getCascadePoint( int indexOfWindow )
void KMdiChildArea::childMinimized( KMdiChildFrm *minimizedChild, bool wasMaximized )
{
//can't find the child in our list, so we don't care.
- if ( m_pZ->findRef( minimizedChild ) == -1 )
+ if ( m_pZ->tqfindRef( minimizedChild ) == -1 )
{
kdDebug( 760 ) << k_funcinfo << "child was minimized but wasn't in our list!" << endl;
return;
@@ -364,7 +368,7 @@ void KMdiChildArea::focusTopChild()
if ( !lastChild->m_pClient->hasFocus() )
{
- //disable the labels of all the other children
+ //disable the labels of all the other tqchildren
TQPtrListIterator<KMdiChildFrm> it ( *m_pZ );
for ( ; ( *it ); ++it )
{
@@ -420,10 +424,10 @@ void KMdiChildArea::cascadeMaximized()
childFrm->move( pnt );
TQSize curSize( width() - pnt.x(), height() - pnt.y() );
- if ( ( childFrm->minimumSize().width() > curSize.width() ) ||
- ( childFrm->minimumSize().height() > curSize.height() ) )
+ if ( ( childFrm->tqminimumSize().width() > curSize.width() ) ||
+ ( childFrm->tqminimumSize().height() > curSize.height() ) )
{
- childFrm->resize( childFrm->minimumSize() );
+ childFrm->resize( childFrm->tqminimumSize() );
}
else
childFrm->resize( curSize );
@@ -607,7 +611,7 @@ void KMdiChildArea::tileAnodine()
return ;
int numCols = int( sqrt( ( double ) numVisible ) ); // set columns to square root of visible count
- // create an array to form grid layout
+ // create an array to form grid tqlayout
int *numRows = new int[ numCols ];
int numCurCol = 0;
@@ -720,7 +724,7 @@ void KMdiChildArea::tileVertically()
}
-void KMdiChildArea::layoutMinimizedChildren()
+void KMdiChildArea::tqlayoutMinimizedChildren()
{
int posX = 0;
int posY = height();
@@ -738,7 +742,7 @@ void KMdiChildArea::layoutMinimizedChildren()
}
child->move( posX, posY - child->height() );
- posX = child->geometry().right();
+ posX = child->tqgeometry().right();
}
}
}
@@ -786,4 +790,4 @@ void KMdiChildArea::getCaptionColors( const TQPalette& /*pal*/, TQColor& activeB
inactiveFG = KGlobalSettings::inactiveTextColor();
}
-// kate: space-indent off; replace-tabs off; tab-width 4; indent-mode csands;
+// kate: space-indent off; tqreplace-tabs off; tab-width 4; indent-mode csands;