kmdichildview.cpp
//----------------------------------------------------------------------------
// filename : kmdichildview.cpp
//----------------------------------------------------------------------------
// Project : KDE MDI extension
//
// begin : 07/1999 by Szymon Stefanek as part of kvirc
// (an IRC application)
// changes : 09/1999 by Falk Brettschneider to create a
// -06/2000 stand-alone Qt extension set of
// classes and a Qt-based library
// 2000-2003 maintained by the KDevelop project
// patches : 02/2000 by Massimo Morin (mmorin@schedsys.com)
// */2000 by Lars Beikirch (Lars.Beikirch@gmx.net)
// 02/2001 by Eva Brucherseifer (eva@rt.e-technik.tu-darmstadt.de)
// 01/2003 by Jens Zurheide (jens.zurheide@gmx.de)
//
// copyright : (C) 1999-2003 by Szymon Stefanek (stefanek@tin.it)
// and
// Falk Brettschneider
// email : falkbr@kdevelop.org (Falk Brettschneider)
//----------------------------------------------------------------------------
//
//----------------------------------------------------------------------------
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU Library General Public License as
// published by the Free Software Foundation; either version 2 of the
// License, or (at your option) any later version.
//
//----------------------------------------------------------------------------
#include "kmdichildview.h"
#include "kmdichildview.moc"
#include <qdatetime.h>
#include <qobjectlist.h>
#include "kmdimainfrm.h"
#include "kmdichildfrm.h"
#include "kmdidefines.h"
#include <kdebug.h>
#include <klocale.h>
#include <qiconset.h>
//============ KMdiChildView ============//
KMdiChildView::KMdiChildView( const QString& caption, QWidget* parentWidget, const char* name, WFlags f )
: QWidget( parentWidget, name, f )
, m_focusedChildWidget( 0L )
, m_firstFocusableChildWidget( 0L )
, m_lastFocusableChildWidget( 0L )
, m_stateChanged( true )
, m_bToolView( false )
, m_bInterruptActivation( false )
, m_bMainframesActivateViewIsPending( false )
, m_bFocusInEventIsPending( false )
, m_trackChanges( 0 )
{
setGeometry( 0, 0, 0, 0 ); // reset
if ( caption != 0L )
m_szCaption = caption;
else
m_szCaption = i18n( "Unnamed" );
m_sTabCaption = m_szCaption;
setFocusPolicy( ClickFocus );
installEventFilter( this );
// store the current time
updateTimeStamp();
}
//============ KMdiChildView ============//
KMdiChildView::KMdiChildView( QWidget* parentWidget, const char* name, WFlags f )
: QWidget( parentWidget, name, f )
, m_focusedChildWidget( 0L )
, m_firstFocusableChildWidget( 0L )
, m_lastFocusableChildWidget( 0L )
, m_stateChanged( true )
, m_bToolView( false )
, m_bInterruptActivation( false )
, m_bMainframesActivateViewIsPending( false )
, m_bFocusInEventIsPending( false )
, m_trackChanges( 0 )
{
setGeometry( 0, 0, 0, 0 ); // reset
m_szCaption = i18n( "Unnamed" );
m_sTabCaption = m_szCaption;
setFocusPolicy( ClickFocus );
installEventFilter( this );
// store the current time
updateTimeStamp();
}
//============ ~KMdiChildView ============//
KMdiChildView::~KMdiChildView()
{
kdDebug( 760 ) << k_funcinfo << endl;
}
void KMdiChildView::trackIconAndCaptionChanges( QWidget *view )
{
m_trackChanges = view;
}
//============== internal geometry ==============//
QRect KMdiChildView::internalGeometry() const
{
if ( mdiParent() )
{ // is attached
// get the client area coordinates inside the MDI child frame
QRect posInFrame = geometry();
// map these values to the parent of the MDI child frame
// (this usually is the MDI child area) and return
QPoint ptTopLeft = mdiParent() ->mapToParent( posInFrame.topLeft() );
QSize sz = size();
return QRect( ptTopLeft, sz );
}
else
{
QRect geo = geometry();
QRect frameGeo = externalGeometry();
return QRect( frameGeo.x(), frameGeo.y(), geo.width(), geo.height() );
// return geometry();
}
}
//============== set internal geometry ==============//
void KMdiChildView::setInternalGeometry( const QRect& newGeometry )
{
if ( mdiParent() )
{ // is attached
// retrieve the frame size
QRect geo = internalGeometry();
QRect frameGeo = externalGeometry();
int nFrameSizeTop = geo.y() - frameGeo.y();
int nFrameSizeLeft = geo.x() - frameGeo.x();
// create the new geometry that is accepted by the QWidget::setGeometry() method
QRect newGeoQt;
newGeoQt.setX( newGeometry.x() - nFrameSizeLeft );
newGeoQt.setY( newGeometry.y() - nFrameSizeTop );
newGeoQt.setWidth( newGeometry.width() + nFrameSizeLeft + KMDI_CHILDFRM_DOUBLE_BORDER / 2 );
newGeoQt.setHeight( newGeometry.height() + nFrameSizeTop + KMDI_CHILDFRM_DOUBLE_BORDER / 2 );
// newGeoQt.setWidth(newGeometry.width()+KMDI_MDI_CHILDFRM_DOUBLE_BORDER);
// newGeoQt.setHeight(newGeometry.height()+mdiParent()->captionHeight()+KMDI_MDI_CHILDFRM_DOUBLE_BORDER);
// set the geometry
mdiParent()->setGeometry( newGeoQt );
}
else
{
// retrieve the frame size
QRect geo = internalGeometry();
QRect frameGeo = externalGeometry();
int nFrameSizeTop = geo.y() - frameGeo.y();
int nFrameSizeLeft = geo.x() - frameGeo.x();
// create the new geometry that is accepted by the QWidget::setGeometry() method
QRect newGeoQt;
newGeoQt.setX( newGeometry.x() - nFrameSizeLeft );
newGeoQt.setY( newGeometry.y() - nFrameSizeTop );
newGeoQt.setWidth( newGeometry.width() );
newGeoQt.setHeight( newGeometry.height() );
// set the geometry
setGeometry( newGeoQt );
}
}
//============== external geometry ==============//
QRect KMdiChildView::externalGeometry() const
{
return mdiParent() ? mdiParent()->frameGeometry() : frameGeometry();
}
//============== set external geometry ==============//
void KMdiChildView::setExternalGeometry( const QRect& newGeometry )
{
if ( mdiParent() )
{ // is attached
mdiParent() ->setGeometry( newGeometry );
}
else
{
// retrieve the frame size
QRect geo = internalGeometry();
QRect frameGeo = externalGeometry();
int nTotalFrameWidth = frameGeo.width() - geo.width();
int nTotalFrameHeight = frameGeo.height() - geo.height();
int nFrameSizeTop = geo.y() - frameGeo.y();
int nFrameSizeLeft = geo.x() - frameGeo.x();
// create the new geometry that is accepted by the QWidget::setGeometry() method
// not attached => the window system makes the frame
QRect newGeoQt;
newGeoQt.setX( newGeometry.x() + nFrameSizeLeft );
newGeoQt.setY( newGeometry.y() + nFrameSizeTop );
newGeoQt.setWidth( newGeometry.width() - nTotalFrameWidth );
newGeoQt.setHeight( newGeometry.height() - nTotalFrameHeight );
// set the geometry
setGeometry( newGeoQt );
}
}
//============== minimize ==============//
void KMdiChildView::minimize( bool bAnimate )
{
if ( mdiParent() )
{
if ( !isMinimized() )
{
mdiParent() ->setState( KMdiChildFrm::Minimized, bAnimate );
}
}
else
showMinimized();
}
void KMdiChildView::showMinimized()
{
emit isMinimizedNow();
QWidget::showMinimized();
}
//slot:
void KMdiChildView::minimize()
{
minimize( true );
}
//============= maximize ==============//
void KMdiChildView::maximize( bool bAnimate )
{
if ( mdiParent() )
{
if ( !isMaximized() )
{
mdiParent() ->setState( KMdiChildFrm::Maximized, bAnimate );
emit mdiParentNowMaximized( true );
}
}
else
showMaximized();
}
void KMdiChildView::showMaximized()
{
emit isMaximizedNow();
QWidget::showMaximized();
}
//slot:
void KMdiChildView::maximize()
{
maximize( true );
}
//============== restoreGeometry ================//
QRect KMdiChildView::restoreGeometry()
{
if ( mdiParent() )
return mdiParent() ->restoreGeometry();
else //FIXME not really supported, may be we must use Windows or X11 funtions
return geometry();
}
//============== setRestoreGeometry ================//
void KMdiChildView::setRestoreGeometry( const QRect& newRestGeo )
{
if ( mdiParent() )
mdiParent()->setRestoreGeometry( newRestGeo );
}
//============== attach ================//
void KMdiChildView::attach()
{
emit attachWindow( this, true );
}
//============== detach =================//
void KMdiChildView::detach()
{
emit detachWindow( this, true );
}
//=============== isMinimized ? =================//
bool KMdiChildView::isMinimized() const
{
if ( mdiParent() )
return ( mdiParent()->state() == KMdiChildFrm::Minimized );
else
return QWidget::isMinimized();
}
//============== isMaximized ? ==================//
bool KMdiChildView::isMaximized() const
{
if ( mdiParent() )
return ( mdiParent()->state() == KMdiChildFrm::Maximized );
else
return QWidget::isMaximized();
}
//============== restore ================//
void KMdiChildView::restore()
{
if ( mdiParent() )
{
if ( isMaximized() )
emit mdiParentNowMaximized( false );
if ( isMinimized() || isMaximized() )
mdiParent()->setState( KMdiChildFrm::Normal );
}
else
showNormal();
}
void KMdiChildView::showNormal()
{
emit isRestoredNow();
QWidget::showNormal();
}
//=============== youAreAttached ============//
void KMdiChildView::youAreAttached( KMdiChildFrm *lpC )
{
lpC->setCaption( m_szCaption );
emit isAttachedNow();
}
//================ youAreDetached =============//
void KMdiChildView::youAreDetached()
{
setCaption( m_szCaption );
setTabCaption( m_sTabCaption );
if ( myIconPtr() )
setIcon( *( myIconPtr() ) );
setFocusPolicy( QWidget::StrongFocus );
emit isDetachedNow();
}
//================ setCaption ================//
// this set the caption of only the window
void KMdiChildView::setCaption( const QString& szCaption )
{
// this will work only for window
m_szCaption = szCaption;
if ( mdiParent() )
mdiParent() ->setCaption( m_szCaption );
else //have to call the parent one
QWidget::setCaption( m_szCaption );
emit windowCaptionChanged( m_szCaption );
}
//============== closeEvent ================//
void KMdiChildView::closeEvent( QCloseEvent *e )
{
e->ignore(); //we ignore the event , and then close later if needed.
emit childWindowCloseRequest( this );
}
//================ myIconPtr =================//
QPixmap* KMdiChildView::myIconPtr()
{
return 0;
}
//============= focusInEvent ===============//
void KMdiChildView::focusInEvent( QFocusEvent *e )
{
QWidget::focusInEvent( e );
// every widget get a focusInEvent when a popup menu is opened!?! -> maybe bug of QT
if ( e && ( ( e->reason() ) == QFocusEvent::Popup ) )
return ;
m_bFocusInEventIsPending = true;
activate();
m_bFocusInEventIsPending = false;
emit gotFocus( this );
}
//============= activate ===============//
void KMdiChildView::activate()
{
// avoid circularity
static bool s_bActivateIsPending = false;
if ( s_bActivateIsPending )
return ;
s_bActivateIsPending = true;
// raise the view and push the taskbar button
if ( !m_bMainframesActivateViewIsPending )
emit focusInEventOccurs( this );
// if this method was called directly, check if the mainframe wants that we interrupt
if ( m_bInterruptActivation )
m_bInterruptActivation = false;
else
{
if ( !m_bFocusInEventIsPending )
setFocus();
kdDebug( 760 ) << k_funcinfo << endl;
emit activated( this );
}
if ( m_focusedChildWidget != 0L )
m_focusedChildWidget->setFocus();
else
{
if ( m_firstFocusableChildWidget != 0L )
{
m_firstFocusableChildWidget->setFocus();
m_focusedChildWidget = m_firstFocusableChildWidget;
}
}
s_bActivateIsPending = false;
}
//============= focusOutEvent ===============//
void KMdiChildView::focusOutEvent( QFocusEvent* e )
{
QWidget::focusOutEvent( e );
emit lostFocus( this );
}
//============= resizeEvent ===============//
void KMdiChildView::resizeEvent( QResizeEvent* e )
{
QWidget::resizeEvent( e );
if ( m_stateChanged )
{
m_stateChanged = false;
if ( isMaximized() )
{ //maximized
emit isMaximizedNow();
}
else if ( isMinimized() )
{ //minimized
emit isMinimizedNow();
}
else
{ //is restored
emit isRestoredNow();
}
}
}
void KMdiChildView::slot_childDestroyed()
{
// do what we do if a child is removed
// if we lost a child we uninstall ourself as event filter for the lost
// child and its children
const QObject * pLostChild = QObject::sender();
if ( pLostChild && ( pLostChild->isWidgetType() ) )
{
QObjectList* list = ( ( QObject* ) ( pLostChild ) ) ->queryList( "QWidget" );
list->insert( 0, pLostChild ); // add the lost child to the list too, just to save code
QObjectListIt it( *list ); // iterate over all lost child widgets
QObject* obj;
while ( ( obj = it.current() ) != 0 )
{ // for each found object...
QWidget * widg = ( QWidget* ) obj;
++it;
widg->removeEventFilter( this );
if ( m_firstFocusableChildWidget == widg )
m_firstFocusableChildWidget = 0L; // reset first widget
if ( m_lastFocusableChildWidget == widg )
m_lastFocusableChildWidget = 0L; // reset last widget
if ( m_focusedChildWidget == widg )
m_focusedChildWidget = 0L; // reset focused widget
}
delete list; // delete the list, not the objects
}
}
//============= eventFilter ===============//
bool KMdiChildView::eventFilter( QObject *obj, QEvent *e )
{
if ( e->type() == QEvent::KeyPress && isAttached() )
{
QKeyEvent* ke = ( QKeyEvent* ) e;
if ( ke->key() == Qt::Key_Tab )
{
QWidget* w = ( QWidget* ) obj;
FocusPolicy wfp = w->focusPolicy();
if ( wfp == QWidget::StrongFocus || wfp == QWidget::TabFocus || w->focusPolicy() == QWidget::WheelFocus )
{
if ( m_lastFocusableChildWidget != 0 )
{
if ( w == m_lastFocusableChildWidget )
{
if ( w != m_firstFocusableChildWidget )
m_firstFocusableChildWidget->setFocus();
}
}
}
}
}
else if ( e->type() == QEvent::FocusIn )
{
if ( obj->isWidgetType() )
{
QObjectList * list = queryList( "QWidget" );
if ( list->find( obj ) != -1 )
m_focusedChildWidget = ( QWidget* ) obj;
delete list; // delete the list, not the objects
}
if ( !isAttached() )
{ // is toplevel, for attached views activation is done by main frame event filter
static bool m_bActivationIsPending = false;
if ( !m_bActivationIsPending )
{
m_bActivationIsPending = true;
activate(); // sets the focus
m_bActivationIsPending = false;
}
}
}
else if ( e->type() == QEvent::ChildRemoved )
{
// if we lost a child we uninstall ourself as event filter for the lost
// child and its children
QObject * pLostChild = ( ( QChildEvent* ) e ) ->child();
if ( ( pLostChild != 0L ) && ( pLostChild->isWidgetType() ) )
{
QObjectList * list = pLostChild->queryList( "QWidget" );
list->insert( 0, pLostChild ); // add the lost child to the list too, just to save code
QObjectListIt it( *list ); // iterate over all lost child widgets
QObject * o;
while ( ( o = it.current() ) != 0 )
{ // for each found object...
QWidget * widg = ( QWidget* ) o;
++it;
widg->removeEventFilter( this );
FocusPolicy wfp = widg->focusPolicy();
if ( wfp == QWidget::StrongFocus || wfp == QWidget::TabFocus || widg->focusPolicy() == QWidget::WheelFocus )
{
if ( m_firstFocusableChildWidget == widg )
m_firstFocusableChildWidget = 0L; // reset first widget
if ( m_lastFocusableChildWidget == widg )
m_lastFocusableChildWidget = 0L; // reset last widget
}
}
delete list; // delete the list, not the objects
}
}
else if ( e->type() == QEvent::ChildInserted )
{
// if we got a new child and we are attached to the MDI system we
// install ourself as event filter for the new child and its children
// (as we did when we were added to the MDI system).
QObject * pNewChild = ( ( QChildEvent* ) e ) ->child();
if ( ( pNewChild != 0L ) && ( pNewChild->isWidgetType() ) )
{
QWidget * pNewWidget = ( QWidget* ) pNewChild;
if ( pNewWidget->testWFlags( Qt::WType_Dialog | Qt::WShowModal ) )
return false;
QObjectList *list = pNewWidget->queryList( "QWidget" );
list->insert( 0, pNewChild ); // add the new child to the list too, just to save code
QObjectListIt it( *list ); // iterate over all new child widgets
QObject * o;
while ( ( o = it.current() ) != 0 )
{ // for each found object...
QWidget * widg = ( QWidget* ) o;
++it;
widg->installEventFilter( this );
connect( widg, SIGNAL( destroyed() ), this, SLOT( slot_childDestroyed() ) );
FocusPolicy wfp = widg->focusPolicy();
if ( wfp == QWidget::StrongFocus || wfp == QWidget::TabFocus || widg->focusPolicy() == QWidget::WheelFocus )
{
if ( m_firstFocusableChildWidget == 0 )
m_firstFocusableChildWidget = widg; // first widge
m_lastFocusableChildWidget = widg; // last widget
}
}
delete list; // delete the list, not the objects
}
}
else
{
if ( e->type() == QEvent::IconChange )
{
// qDebug("KMDiChildView:: QEvent:IconChange intercepted\n");
if ( obj == this )
iconUpdated( this, icon() ? ( *icon() ) : QPixmap() );
else if ( obj == m_trackChanges )
setIcon( m_trackChanges->icon() ? ( *( m_trackChanges->icon() ) ) : QPixmap() );
}
if ( e->type() == QEvent::CaptionChange )
{
if ( obj == this )
captionUpdated( this, caption() );
}
}
return false; // standard event processing
}
void KMdiChildView::removeEventFilterForAllChildren()
{
QObjectList* list = queryList( "QWidget" );
QObjectListIt it( *list ); // iterate over all child widgets
QObject* obj;
while ( ( obj = it.current() ) != 0 )
{ // for each found object...
QWidget* widg = ( QWidget* ) obj;
++it;
widg->removeEventFilter( this );
}
delete list; // delete the list, not the objects
}
QWidget* KMdiChildView::focusedChildWidget()
{
return m_focusedChildWidget;
}
void KMdiChildView::setFirstFocusableChildWidget( QWidget* firstFocusableChildWidget )
{
m_firstFocusableChildWidget = firstFocusableChildWidget;
}
void KMdiChildView::setLastFocusableChildWidget( QWidget* lastFocusableChildWidget )
{
m_lastFocusableChildWidget = lastFocusableChildWidget;
}
void KMdiChildView::setTabCaption ( const QString& stbCaption )
{
m_sTabCaption = stbCaption;
emit tabCaptionChanged( m_sTabCaption );
}
void KMdiChildView::setMDICaption ( const QString& caption )
{
setCaption( caption );
setTabCaption( caption );
}
void KMdiChildView::setWindowMenuID( int id )
{
m_windowMenuID = id;
}
//============= slot_clickedInWindowMenu ===============//
void KMdiChildView::slot_clickedInWindowMenu()
{
updateTimeStamp();
emit clickedInWindowMenu( m_windowMenuID );
}
//============= slot_clickedInDockMenu ===============//
void KMdiChildView::slot_clickedInDockMenu()
{
emit clickedInDockMenu( m_windowMenuID );
}
//============= setMinimumSize ===============//
void KMdiChildView::setMinimumSize( int minw, int minh )
{
QWidget::setMinimumSize( minw, minh );
if ( mdiParent() && mdiParent()->state() != KMdiChildFrm::Minimized )
{
mdiParent() ->setMinimumSize( minw + KMDI_CHILDFRM_DOUBLE_BORDER,
minh + KMDI_CHILDFRM_DOUBLE_BORDER + KMDI_CHILDFRM_SEPARATOR + mdiParent() ->captionHeight() );
}
}
//============= setMaximumSize ===============//
void KMdiChildView::setMaximumSize( int maxw, int maxh )
{
if ( mdiParent() && mdiParent()->state() == KMdiChildFrm::Normal )
{
int w = maxw + KMDI_CHILDFRM_DOUBLE_BORDER;
if ( w > QWIDGETSIZE_MAX )
w = QWIDGETSIZE_MAX;
int h = maxh + KMDI_CHILDFRM_DOUBLE_BORDER + KMDI_CHILDFRM_SEPARATOR + mdiParent() ->captionHeight();
if ( h > QWIDGETSIZE_MAX )
h = QWIDGETSIZE_MAX;
mdiParent()->setMaximumSize( w, h );
}
QWidget::setMaximumSize( maxw, maxh );
}
//============= show ===============//
void KMdiChildView::show()
{
if ( mdiParent() )
mdiParent()->show();
QWidget::show();
}
//============= hide ===============//
void KMdiChildView::hide()
{
if ( mdiParent() )
mdiParent()->hide();
QWidget::hide();
}
//============= raise ===============//
void KMdiChildView::raise()
{
if ( mdiParent() ) //TODO Check Z-order
mdiParent()->raise();
QWidget::raise();
}
// kate: space-indent off; replace-tabs off; indent-mode csands; tab-width 4;
KMdiChildFrm::setRestoreGeometry
void setRestoreGeometry(const QRect &newRestGeo)
Sets the geometry that will be restored by calling restore().
Definition: kmdichildfrm.cpp:680
KMdiChildView::setInternalGeometry
void setInternalGeometry(const QRect &newGeomety)
Sets the geometry of the client area of this MDI child window.
Definition: kmdichildview.cpp:136
KMdiChildView::attachWindow
void attachWindow(KMdiChildView *, bool)
Internally used by KMdiChildView::attach to send it as command to the mainframe.
KMdiChildView::focusInEvent
virtual void focusInEvent(QFocusEvent *e)
If attached, the childframe will be activated and the MDI taskbar button will be pressed.
Definition: kmdichildview.cpp:402
KMdiChildView::hide
virtual void hide()
Calls QWidget::hide() or it's parent widget hide() if attached.
Definition: kmdichildview.cpp:756
KMdiChildView::setExternalGeometry
void setExternalGeometry(const QRect &newGeomety)
Sets the geometry of the frame of this MDI child window.
Definition: kmdichildview.cpp:190
KMdiChildView::m_szCaption
QString m_szCaption
See KMdiChildView::caption.
Definition: kmdichildview.h:119
KMdiChildView::slot_clickedInDockMenu
virtual void slot_clickedInDockMenu()
Called if someone click on the "Dock/Undock..." menu item for this child frame window.
Definition: kmdichildview.cpp:708
KMdiChildView::setLastFocusableChildWidget
void setLastFocusableChildWidget(QWidget *)
Memorizes the last focusable child widget of this widget.
Definition: kmdichildview.cpp:672
KMdiChildView::restore
virtual void restore()
Restores this window to its normal size.
Definition: kmdichildview.cpp:328
KMdiChildView::focusInEventOccurs
void focusInEventOccurs(KMdiChildView *)
Is sent when this MDI child view is going to receive focus (before actually changing the focus)...
KMdiChildView::eventFilter
virtual bool eventFilter(QObject *obj, QEvent *e)
It only catches QEvent::KeyPress events there.
Definition: kmdichildview.cpp:522
KMdiChildView::updateTimeStamp
void updateTimeStamp()
Remember the current time.
Definition: kmdichildview.h:359
KMdiChildFrm::setMinimumSize
virtual void setMinimumSize(int minw, int minh)
Sets the minimum size of the widget to w by h pixels.
Definition: kmdichildfrm.cpp:1217
KMdiChildView::slot_clickedInWindowMenu
virtual void slot_clickedInWindowMenu()
Called if someone click on the "Window" menu item for this child frame window.
Definition: kmdichildview.cpp:699
KMdiChildView::isAttachedNow
void isAttachedNow()
Signals this has been attached.
KMdiChildView::isAttached
bool isAttached() const
Returns true if the MDI view is a child window within the MDI mainframe widget or false if the MDI vi...
Definition: kmdichildview.h:227
KMdiChildView::childWindowCloseRequest
void childWindowCloseRequest(KMdiChildView *)
Internally used to send information to the mainframe that this MDI child view wants to be closed...
KMdiChildView::isDetachedNow
void isDetachedNow()
Signals this has been detached.
KMdiChildView::isMaximized
bool isMaximized() const
Tells if the window is minimized when attached to the Mdi manager, otherwise returns false...
Definition: kmdichildview.cpp:318
KMdiChildView::youAreAttached
virtual void youAreAttached(KMdiChildFrm *lpC)
Internally called, if KMdiMainFrm::attach is called.
Definition: kmdichildview.cpp:350
KMdiChildView::setCaption
virtual void setCaption(const QString &szCaption)
Sets the window caption string...
Definition: kmdichildview.cpp:373
KMdiChildView::isRestoredNow
void isRestoredNow()
Signals this has been restored (normalized)
KMdiChildView::showNormal
virtual void showNormal()
Overridden from its base class method.
Definition: kmdichildview.cpp:342
KMdiChildView::windowCaptionChanged
void windowCaptionChanged(const QString &)
Emitted when the window caption is changed via KMdiChildView::setCaption or KMdiChildView::setMDICapt...
KMdiChildView::showMinimized
virtual void showMinimized()
Overridden from its base class method.
Definition: kmdichildview.cpp:234
KMdiChildView::myIconPtr
virtual QPixmap * myIconPtr()
You should override this function in the derived class.
Definition: kmdichildview.cpp:395
KMdiChildView::youAreDetached
virtual void youAreDetached()
Internally called, if KMdiMainFrm::detach is called.
Definition: kmdichildview.cpp:358
KMdiChildView::m_focusedChildWidget
QWidget * m_focusedChildWidget
See KMdiChildView::focusedChildWidget.
Definition: kmdichildview.h:129
KMdiChildView::isMaximizedNow
void isMaximizedNow()
Signals this has been maximized.
KMdiChildView::KMdiChildView
KMdiChildView(const QString &caption, QWidget *parentWidget=0L, const char *name=0L, WFlags f=0)
Constructor.
Definition: kmdichildview.cpp:47
KMdiChildView::minimize
virtual void minimize()
Mimimizes the MDI view.
Definition: kmdichildview.cpp:241
KMdiChildView::clickedInWindowMenu
void clickedInWindowMenu(int)
Is automatically emitted when slot_clickedInWindowMenu is called.
KMdiChildView::maximize
virtual void maximize()
Maximizes the MDI view.
Definition: kmdichildview.cpp:269
KMdiChildView::caption
const QString & caption() const
Returns the caption of the child window (different from the caption on the button in the taskbar) ...
Definition: kmdichildview.h:232
KMdiChildView::attach
virtual void attach()
Attaches this window to the Mdi manager.
Definition: kmdichildview.cpp:294
KMdiChildView::isMinimizedNow
void isMinimizedNow()
Signals this has been minimized.
KMdiChildView::m_stateChanged
bool m_stateChanged
Holds a temporary information about if the MDI view state has changed but is not processed yet (pendi...
Definition: kmdichildview.h:150
KMdiChildView::internalGeometry
QRect internalGeometry() const
Returns the geometry of this MDI child window as QWidget::geometry() does.
Definition: kmdichildview.cpp:113
KMdiChildView::removeEventFilterForAllChildren
void removeEventFilterForAllChildren()
Switches interposing in event loop of all current child widgets off.
Definition: kmdichildview.cpp:648
KMdiChildView::setFirstFocusableChildWidget
void setFirstFocusableChildWidget(QWidget *)
Memorizes the first focusable child widget of this widget.
Definition: kmdichildview.cpp:667
KMdiChildView::activate
void activate()
This method does the same as focusInEvent().
Definition: kmdichildview.cpp:420
KMdiChildView::setMaximumSize
virtual void setMaximumSize(int maxw, int maxh)
Sets the maximum size of the widget to w by h pixels.
Definition: kmdichildview.cpp:727
KMdiChildView::setTabCaption
virtual void setTabCaption(const QString &caption)
Sets the caption of the button referring to this window.
Definition: kmdichildview.cpp:678
KMdiChildFrm
Internal class.
Definition: kmdichildfrm.h:130
KMdiChildView::showMaximized
virtual void showMaximized()
Overridden from its base class method.
Definition: kmdichildview.cpp:262
KMdiChildView::m_firstFocusableChildWidget
QWidget * m_firstFocusableChildWidget
See KMdiChildView::setFirstFocusableChildWidget.
Definition: kmdichildview.h:134
KMdiChildView::focusOutEvent
virtual void focusOutEvent(QFocusEvent *e)
Send the lostFocus signal.
Definition: kmdichildview.cpp:460
KMdiChildView::detach
virtual void detach()
Detaches this window from the Mdi manager.
Definition: kmdichildview.cpp:301
KMdiChildView::show
virtual void show()
Calls QWidget::show but also for it's parent widget if attached.
Definition: kmdichildview.cpp:746
KMdiChildView::raise
virtual void raise()
Calls QWidget::raise() or it's parent widget raise() if attached.
Definition: kmdichildview.cpp:766
KMdiChildView::detachWindow
void detachWindow(KMdiChildView *, bool)
Internally used by KMdiChildView::detach to send it as command to the mainframe.
KMdiChildView::mdiParent
KMdiChildFrm * mdiParent() const
Returns the KMdiChildFrm parent widget (or 0 if the window is not attached)
Definition: kmdichildview.h:604
KMdiChildView::focusedChildWidget
QWidget * focusedChildWidget()
Returns the current focused child widget of this widget.
Definition: kmdichildview.cpp:662
KMdiChildFrm::setState
void setState(MdiWindowState state, bool bAnimate=true)
Minimizes, Maximizes, or restores the window.
Definition: kmdichildfrm.cpp:511
KMdiChildView::~KMdiChildView
~KMdiChildView()
Destructor.
Definition: kmdichildview.cpp:100
KMdiChildView::m_sTabCaption
QString m_sTabCaption
See KMdiChildView::tabCaption.
Definition: kmdichildview.h:124
KMdiChildView::gotFocus
void gotFocus(KMdiChildView *)
Is sent when this MDI child has received the focus (after actually changing the focus).
KMdiChildView::tabCaptionChanged
void tabCaptionChanged(const QString &)
Emitted when the window caption is changed via KMdiChildView::setTabCaption or KMdiChildView::setMDIC...
KMdiChildView::resizeEvent
virtual void resizeEvent(QResizeEvent *e)
Internally used for the minimize/maximize/restore mechanism when in attach mode.
Definition: kmdichildview.cpp:468
KMdiChildView::lostFocus
void lostFocus(KMdiChildView *)
Is sent when this MDI child view has lost the focus (after actually changing the focus).
KMdiChildView::mdiParentNowMaximized
void mdiParentNowMaximized(bool)
Internally used to send information to the mainframe that this MDI view is maximized now...
KMdiChildView::setMinimumSize
virtual void setMinimumSize(int minw, int minh)
Sets the minimum size of the widget to w by h pixels.
Definition: kmdichildview.cpp:715
KMdiChildView::activated
void activated(KMdiChildView *)
Is sent when this MDI child was set to the activate view of all MDI views (after actually changing th...
KMdiChildFrm::captionHeight
int captionHeight() const
Returns the caption bar height.
Definition: kmdichildfrm.h:271
KMdiChildView::setMDICaption
virtual void setMDICaption(const QString &caption)
Sets the caption of both the window and the button on the taskbar.
Definition: kmdichildview.cpp:684
KMdiChildView::setWindowMenuID
void setWindowMenuID(int id)
Internally used for setting an ID for the 'Window' menu entry.
Definition: kmdichildview.cpp:691
KMdiChildView::clickedInDockMenu
void clickedInDockMenu(int)
Is automatically emitted when slot_clickedInDockMenu is called.
KMdiChildFrm::setCaption
void setCaption(const QString &text)
Sets the caption of this window.
Definition: kmdichildfrm.cpp:687
KMdiChildView::m_lastFocusableChildWidget
QWidget * m_lastFocusableChildWidget
See KMdiChildView::setLastFocusableChildWidget.
Definition: kmdichildview.h:139
KMdiChildView::setRestoreGeometry
void setRestoreGeometry(const QRect &newRestGeo)
Sets the geometry that will be restored by calling restore().
Definition: kmdichildview.cpp:286
KMdiChildFrm::restoreGeometry
QRect restoreGeometry() const
Returns the geometry that will be restored by calling restore().
Definition: kmdichildfrm.cpp:673
KMdiChildView::m_windowMenuID
int m_windowMenuID
Every child view window has an temporary ID in the Window menu of the main frame. ...
Definition: kmdichildview.h:144
KMdiChildView::restoreGeometry
QRect restoreGeometry()
Returns the geometry that will be restored by calling restore().
Definition: kmdichildview.cpp:276
KMdiChildView::closeEvent
virtual void closeEvent(QCloseEvent *e)
Ignores the event and calls KMdiMainFrm::childWindowCloseRequest instead.
Definition: kmdichildview.cpp:387
KMdiChildView::externalGeometry
QRect externalGeometry() const
Returns the frame geometry of this window or of the parent if there is any...
Definition: kmdichildview.cpp:183
KMdiChildView::isMinimized
bool isMinimized() const
Tells if the window is minimized when attached to the Mdi manager, or if it is VISIBLE when 'floating...
Definition: kmdichildview.cpp:308

KDE Home | KDE Accessibility Home | Description of Access Keys