• Skip to content
  • Skip to link menu
KDE 3.5 API Reference
  • KDE API Reference
  • API Reference
  • Sitemap
  • Contact Us
 

kdeui

KDockSplitter Class Reference

Like QSplitter but specially designed for dockwidgets stuff. More...

#include <kdockwidget_private.h>

Inheritance diagram for KDockSplitter:

Inheritance graph
[legend]

List of all members.


Public Member Functions

void activate (QWidget *c0, QWidget *c1=0L)
void deactivate ()
virtual bool event (QEvent *)
virtual bool eventFilter (QObject *, QEvent *)
QWidget * getAnother (QWidget *w) const
QWidget * getFirst () const
QWidget * getLast () const
 KDockSplitter (QWidget *parent=0, const char *name=0, Orientation orient=Vertical, int pos=50)
bool keepSize () const
bool opaqueResize () const
Orientation orientation ()
void restoreFromForcedFixedSize (KDockWidget *dw)
int separatorPos () const
int separatorPosInPercent ()
void setForcedFixedHeight (KDockWidget *dw, int h)
void setForcedFixedWidth (KDockWidget *dw, int w)
void setKeepSize (bool b=true)
void setOpaqueResize (bool b=true)
void setSeparatorPos (int pos, bool do_resize=true)
void setSeparatorPosInPercent (int percent)
void setSeparatorPosX (int pos, bool do_resize=false)
void updateName ()
virtual ~KDockSplitter ()

Protected Member Functions

int checkValue (int position) const
int checkValueOverlapped (int position, QWidget *child) const
virtual void resizeEvent (QResizeEvent *ev)

Detailed Description

Like QSplitter but specially designed for dockwidgets stuff.

For internal use only.

Author:
Max Judin.

Definition at line 44 of file kdockwidget_private.h.


Constructor & Destructor Documentation

KDockSplitter::KDockSplitter ( QWidget *  parent = 0,
const char *  name = 0,
Orientation  orient = Vertical,
int  pos = 50 
)

Constructor.

Parameters:
parent parent widget
name name
orient orientation. Either Vertical or Horizontal
pos procentual position of the splitter. Must be int [0...100].

Definition at line 32 of file kdockwidget_private.cpp.

virtual KDockSplitter::~KDockSplitter (  )  [inline, virtual]

Definition at line 60 of file kdockwidget_private.h.


Member Function Documentation

void KDockSplitter::activate ( QWidget *  c0,
QWidget *  c1 = 0L 
)

Initialize the splitter.

If c0 or c1 is 0L the child will not be replaced. So if you want to change c1 and not change c0, you'd call activate(0L,new_widget);

Parameters:
c0 the widget on top/left
c1 the widget on borrom/right

Definition at line 51 of file kdockwidget_private.cpp.

int KDockSplitter::checkValue ( int  position  )  const [protected]

Make sure the splitter position is not out of bounds.

Parameters:
position the current position
Returns:
a (new) valid splitter position.

Definition at line 466 of file kdockwidget_private.cpp.

int KDockSplitter::checkValueOverlapped ( int  position,
QWidget *  child 
) const [protected]

Make sure the splitter position is not out of bounds.

It has to honor all child widgets' mimimumSize.

Parameters:
position current divider position
child the overlapping child
Returns:
the (new) splitter position.

Definition at line 442 of file kdockwidget_private.cpp.

void KDockSplitter::deactivate (  ) 

Disables the splitter.

Definition at line 204 of file kdockwidget_private.cpp.

bool KDockSplitter::event ( QEvent *  e  )  [virtual]

Reimplemented from QWidget.

Definition at line 567 of file kdockwidget_private.cpp.

bool KDockSplitter::eventFilter ( QObject *  o,
QEvent *  e 
) [virtual]

The eventfilter installed on the divider processes all splitter resizing events.

Definition at line 492 of file kdockwidget_private.cpp.

QWidget * KDockSplitter::getAnother ( QWidget *  w  )  const

If w is child0, return child1, otherwise child0.

Returns:
the other child widget

Definition at line 578 of file kdockwidget_private.cpp.

QWidget* KDockSplitter::getFirst (  )  const [inline]

Returns:
the top/left child widget.

Definition at line 124 of file kdockwidget_private.h.

QWidget* KDockSplitter::getLast (  )  const [inline]

Returns:
the bottom/right child widget.

Definition at line 128 of file kdockwidget_private.h.

bool KDockSplitter::keepSize (  )  const

Definition at line 616 of file kdockwidget_private.cpp.

bool KDockSplitter::opaqueResize (  )  const

Definition at line 606 of file kdockwidget_private.cpp.

Orientation KDockSplitter::orientation (  )  [inline]

The orientation is either Horizontal or Vertical.

Definition at line 159 of file kdockwidget_private.h.

void KDockSplitter::resizeEvent ( QResizeEvent *  ev  )  [protected, virtual]

The resize event resizes child0, child1 and the divider.

The new sizes are dependant of

  • whether child0 or child1 is a KDockContainer
  • the current mode which may be
    • Closed
    • Overlapped (opened)
    • Nonoverlap (opened)
So there are 3*2=6 different modes we have to face.
Parameters:
ev the resize Event. If ev=0L the user changed the mode (for example from overlap to nonoverlap mode).

Reimplemented from QWidget.

Definition at line 239 of file kdockwidget_private.cpp.

void KDockSplitter::restoreFromForcedFixedSize ( KDockWidget *  dw  ) 

Definition at line 154 of file kdockwidget_private.cpp.

int KDockSplitter::separatorPos (  )  const

Return the separator position in the range [0.

.100000] To get the separator position in procent (%), call separatorPositionInPercent()!

Returns:
high resolution separator position in range [0..100000], where 100000 is 100%.

Definition at line 234 of file kdockwidget_private.cpp.

int KDockSplitter::separatorPosInPercent (  ) 

Return the separator position in percent (%), so the range is [0.

.100]

Returns:
separator position in percent

Definition at line 211 of file kdockwidget_private.cpp.

void KDockSplitter::setForcedFixedHeight ( KDockWidget *  dw,
int  h 
)

Definition at line 132 of file kdockwidget_private.cpp.

void KDockSplitter::setForcedFixedWidth ( KDockWidget *  dw,
int  w 
)

Definition at line 110 of file kdockwidget_private.cpp.

void KDockSplitter::setKeepSize ( bool  b = true  ) 

If b is true, the splitter will keep its size on resize events.

If no KDockContainer is around, always the left child0 will be fixed size.

Definition at line 611 of file kdockwidget_private.cpp.

void KDockSplitter::setOpaqueResize ( bool  b = true  ) 

Set opaque flag.

Parameters:
b if true, both child widgets are resized immediately, if false, the widgets only resize on MouseUpEvent.

Definition at line 601 of file kdockwidget_private.cpp.

void KDockSplitter::setSeparatorPos ( int  pos,
bool  do_resize = true 
)

set separator position.

Parameters:
pos the separator position in range [0..100000]. 100000 is 100%.
do_resize if this is true, then a resize event is generated. This may cause the size to change.

Definition at line 221 of file kdockwidget_private.cpp.

void KDockSplitter::setSeparatorPosInPercent ( int  percent  ) 

Set the separator position in percent (%), so the range must be [0.

.100]

Parameters:
percent separator position in percent

Definition at line 216 of file kdockwidget_private.cpp.

void KDockSplitter::setSeparatorPosX ( int  pos,
bool  do_resize = false 
)

For usage from outside.

If the splitter is in fixed position when called, the value of pos will be saved and used when the splitter is restored. If do_resize is true, the size will be changed unless the splitter is in fixed mode.

Definition at line 228 of file kdockwidget_private.cpp.

void KDockSplitter::updateName (  ) 

Definition at line 583 of file kdockwidget_private.cpp.


The documentation for this class was generated from the following files:
  • kdockwidget_private.h
  • kdockwidget_private.cpp

kdeui

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

API Reference

Skip menu "API Reference"
  • dcop
  • DNSSD
  • interfaces
  • Kate
  • kconf_update
  • KDECore
  • KDED
  • kdefx
  • KDEsu
  • kdeui
  • KDocTools
  • KHTML
  • KImgIO
  • KInit
  • kio
  • kioslave
  • KJS
  • KNewStuff
  • KParts
  • KUtils
Generated for API Reference by doxygen 1.5.9
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal