KDevelop API Documentation

Splitter Class Reference

A special splitter that lacks many of the features of QSplitter, but has some other features we need: One can replace one widget by another, add widgets at an arbitrary position in the chain, and the user can resize the widgets by moving a SplitterBar (which is much easier to grab than a QSplitterHandle) around. More...

#include <splitter.h>

Inheritance diagram for Splitter:

QWidget List of all members.

Signals

void collapsed (Splitter *splitter)

Public Member Functions

 Splitter (QWidget *parent=0, const char *name=0)
 ~Splitter ()
void setOrientation (Orientation orient)
Orientation orientation () const
bool hasMultipleChildren () const
 Returns true if there is more than one child.

QWidgetfirstChild ()
 Returns the first child.

void addChild (QWidget *w)
 Adds the widget w to the list of managed children.

void splitChild (QWidget *old, QWidget *w)
 Splits the space covered by old into two halves and embeds the widget w into the second.

void replaceChild (QWidget *old, QWidget *w)
 Puts the widget w into the space formerly covered by old.

void moveSplitter (QWidget *w, int pos)
 Moves the splitter after widget w to the vertical offset pos.


Protected Member Functions

virtual QSize minimumSizeHint () const
virtual void childEvent (QChildEvent *e)
virtual void resizeEvent (QResizeEvent *e)

Private Slots

void collapse ()

Private Member Functions

void doLayout ()
int handleWidth () const

Private Attributes

QPtrList< QWidgetchildlist
QPtrList< SplitterHandlehandlelist
QValueList< int > sizes
Orientation _or

Detailed Description

A special splitter that lacks many of the features of QSplitter, but has some other features we need: One can replace one widget by another, add widgets at an arbitrary position in the chain, and the user can resize the widgets by moving a SplitterBar (which is much easier to grab than a QSplitterHandle) around.

Because of these features, widgets are not automatically embedded by using the splitter as parent.

Definition at line 39 of file splitter.h.


Constructor & Destructor Documentation

Splitter::Splitter QWidget parent = 0,
const char *  name = 0
 

Definition at line 29 of file splitter.cpp.

References _or, handlelist, and Splitter().

Referenced by Splitter().

Splitter::~Splitter  ) 
 

Definition at line 38 of file splitter.cpp.


Member Function Documentation

void Splitter::addChild QWidget w  ) 
 

Adds the widget w to the list of managed children.

Definition at line 89 of file splitter.cpp.

References addChild(), childlist, doLayout(), endl(), handlelist, kdDebug(), orientation(), and splitChild().

Referenced by addChild().

void Splitter::childEvent QChildEvent e  )  [protected, virtual]
 

Definition at line 237 of file splitter.cpp.

References childEvent(), childlist, collapse(), doLayout(), handlelist, orientation(), and sizes.

Referenced by childEvent().

void Splitter::collapse  )  [private, slot]
 

Definition at line 262 of file splitter.cpp.

References collapsed().

Referenced by childEvent().

void Splitter::collapsed Splitter splitter  )  [signal]
 

Referenced by collapse().

void Splitter::doLayout  )  [private]
 

Definition at line 182 of file splitter.cpp.

References childlist, handlelist, orientation(), and sizes.

Referenced by addChild(), childEvent(), moveSplitter(), replaceChild(), resizeEvent(), setOrientation(), and splitChild().

QWidget * Splitter::firstChild  ) 
 

Returns the first child.

This is useful for destroying the splitter when the number of children has gone down to one. See TopLevel::eventFilter().

Definition at line 77 of file splitter.cpp.

References childlist.

int Splitter::handleWidth  )  const [private]
 

Definition at line 83 of file splitter.cpp.

References orientation().

Referenced by moveSplitter(), and splitChild().

bool Splitter::hasMultipleChildren  )  const
 

Returns true if there is more than one child.

Definition at line 71 of file splitter.cpp.

References childlist.

Referenced by setOrientation().

QSize Splitter::minimumSizeHint  )  const [protected, virtual]
 

Definition at line 224 of file splitter.cpp.

References childlist, and orientation().

void Splitter::moveSplitter QWidget w,
int  pos
 

Moves the splitter after widget w to the vertical offset pos.

Definition at line 164 of file splitter.cpp.

References childlist, doLayout(), handleWidth(), moveSplitter(), and sizes.

Referenced by moveSplitter().

Qt::Orientation Splitter::orientation  )  const
 

Definition at line 65 of file splitter.cpp.

References _or.

Referenced by addChild(), childEvent(), doLayout(), handleWidth(), minimumSizeHint(), replaceChild(), and splitChild().

void Splitter::replaceChild QWidget old,
QWidget w
 

Puts the widget w into the space formerly covered by old.

old is not destroyed. Note: w must have the splitter as parent.

Definition at line 144 of file splitter.cpp.

References childlist, doLayout(), endl(), handlelist, kdDebug(), orientation(), and replaceChild().

Referenced by replaceChild().

void Splitter::resizeEvent QResizeEvent e  )  [protected, virtual]
 

Definition at line 268 of file splitter.cpp.

References doLayout(), and resizeEvent().

Referenced by resizeEvent().

void Splitter::setOrientation Orientation  orient  ) 
 

Definition at line 42 of file splitter.cpp.

References _or, childlist, doLayout(), endl(), handlelist, hasMultipleChildren(), kdDebug(), and setOrientation().

Referenced by setOrientation().

void Splitter::splitChild QWidget old,
QWidget w
 

Splits the space covered by old into two halves and embeds the widget w into the second.

Note: w must have the splitter as parent.

Definition at line 109 of file splitter.cpp.

References childlist, doLayout(), endl(), handlelist, handleWidth(), kdDebug(), orientation(), sizes, and splitChild().

Referenced by addChild(), and splitChild().


Member Data Documentation

Orientation Splitter::_or [private]
 

Definition at line 101 of file splitter.h.

Referenced by orientation(), setOrientation(), and Splitter().

QPtrList<QWidget> Splitter::childlist [private]
 

Definition at line 98 of file splitter.h.

Referenced by addChild(), childEvent(), doLayout(), firstChild(), hasMultipleChildren(), minimumSizeHint(), moveSplitter(), replaceChild(), setOrientation(), and splitChild().

QPtrList<SplitterHandle> Splitter::handlelist [private]
 

Definition at line 99 of file splitter.h.

Referenced by addChild(), childEvent(), doLayout(), replaceChild(), setOrientation(), splitChild(), and Splitter().

QValueList<int> Splitter::sizes [private]
 

Definition at line 100 of file splitter.h.

Referenced by childEvent(), doLayout(), moveSplitter(), and splitChild().


The documentation for this class was generated from the following files:
KDE Logo
This file is part of the documentation for KDevelop Version 3.0.4.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Tue Oct 19 08:02:06 2004 by doxygen 1.3.7 written by Dimitri van Heesch, © 1997-2003