• Skip to content
  • Skip to link menu
Trinity API Reference
  • Trinity API Reference
  • kmdi
 

kmdi

  • kmdi
kmdifocuslist.cpp
1 /* This file is part of the KDE project
2  Copyright (C) 2003 Joseph Wenninger <jowenn@kde.org>
3 
4  This library is free software; you can redistribute it and/or
5  modify it under the terms of the GNU Library General Public
6  License version 2 as published by the Free Software Foundation.
7 
8  This library is distributed in the hope that it will be useful,
9  but WITHOUT ANY WARRANTY; without even the implied warranty of
10  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11  Library General Public License for more details.
12 
13  You should have received a copy of the GNU Library General Public License
14  along with this library; see the file COPYING.LIB. If not, write to
15  the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
16  Boston, MA 02110-1301, USA.
17 */
18 
19 #include "kmdifocuslist.h"
20 #include "kmdifocuslist.moc"
21 #include <tqobjectlist.h>
22 #include <kdebug.h>
23 
24 KMdiFocusList::KMdiFocusList( TQObject *parent ) : TQObject( parent )
25 {}
26 
27 KMdiFocusList::~KMdiFocusList()
28 {}
29 
30 void KMdiFocusList::addWidgetTree( TQWidget* w )
31 {
32  //this method should never be called twice on the same hierarchy
33  m_list.insert( w, w->focusPolicy() );
34  w->setFocusPolicy( TQ_ClickFocus );
35  kdDebug( 760 ) << "KMdiFocusList::addWidgetTree: adding toplevel" << endl;
36  connect( w, TQT_SIGNAL( destroyed( TQObject * ) ), this, TQT_SLOT( objectHasBeenDestroyed( TQObject* ) ) );
37  TQObjectList *l = w->queryList( TQWIDGET_OBJECT_NAME_STRING );
38  TQObjectListIt it( *l );
39  TQObject *obj;
40  while ( ( obj = it.current() ) != 0 )
41  {
42  TQWidget * wid = ( TQWidget* ) obj;
43  m_list.insert( wid, wid->focusPolicy() );
44  wid->setFocusPolicy( TQ_ClickFocus );
45  kdDebug( 760 ) << "KMdiFocusList::addWidgetTree: adding widget" << endl;
46  connect( wid, TQT_SIGNAL( destroyed( TQObject * ) ), this, TQT_SLOT( objectHasBeenDestroyed( TQObject* ) ) );
47  ++it;
48  }
49  delete l;
50 }
51 
52 void KMdiFocusList::restore()
53 {
54  for ( TQMap<TQWidget*, TQ_FocusPolicy>::const_iterator it = m_list.constBegin();it != m_list.constEnd();++it )
55  {
56  it.key() ->setFocusPolicy( it.data() );
57  }
58  m_list.clear();
59 }
60 
61 
62 void KMdiFocusList::objectHasBeenDestroyed( TQObject * o )
63 {
64  if ( !o || !o->isWidgetType() )
65  return ;
66  TQWidget *w = ( TQWidget* ) o;
67  m_list.remove( w );
68 }
69 
70 // kate: space-indent off; tab-width 4; replace-tabs off; indent-mode csands;

kmdi

Skip menu "kmdi"
  • Main Page
  • Namespace List
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members
  • Related Pages

kmdi

Skip menu "kmdi"
  • arts
  • dcop
  • dnssd
  • interfaces
  •     interface
  •     library
  •   kspeech
  •   ktexteditor
  • kabc
  • kate
  • kcmshell
  • kdecore
  • kded
  • kdefx
  • kdeprint
  • kdesu
  • kdeui
  • kdoctools
  • khtml
  • kimgio
  • kinit
  • kio
  •   bookmarks
  •   httpfilter
  •   kfile
  •   kio
  •   kioexec
  •   kpasswdserver
  •   kssl
  • kioslave
  •   http
  • kjs
  • kmdi
  •   kmdi
  • knewstuff
  • kparts
  • krandr
  • kresources
  • kspell2
  • kunittest
  • kutils
  • kwallet
  • libkmid
  • libkscreensaver
Generated for kmdi by doxygen 1.8.1.2
This website is maintained by Timothy Pearson.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. |