Kexi API Documentation (2.0 alpha)

KDockSplitter Class Reference

#include <ksplitter.h>

Inheritance diagram for KDockSplitter:

QWidget List of all members.

Detailed Description

Like QSplitter but specially designed for dockwidgets stuff.

Definition at line 47 of file ksplitter.h.

Public Member Functions

 KDockSplitter (QWidget *parent=0, const char *name=0, Orientation orient=Vertical, int pos=50)
 Constructor.
virtual ~KDockSplitter ()
void activate (QWidget *c0, QWidget *c1=0L)
 Initialize the splitter.
void deactivate ()
 Disables the splitter.
int separatorPosInPercent ()
 Return the separator position in percent (%), so the range is [0.
void setSeparatorPosInPercent (int percent)
 Set the separator position in percent (%), so the range must be [0.
int separatorPos () const
 Return the separator position in the range [0.
void setSeparatorPos (int pos, bool do_resize=true)
 set separator position.
void setSeparatorPosX (int pos, bool do_resize=false)
 For usage from outside.
virtual bool eventFilter (QObject *, QEvent *)
 The eventfilter installed on the divider processes all splitter resizing events.
virtual bool event (QEvent *)
QWidgetgetFirst () const
QWidgetgetLast () const
QWidgetgetAnother (QWidget *w) const
 If w is child0, return child1, otherwise child0.
void updateName ()
void setOpaqueResize (bool b=true)
 Set opaque flag.
bool opaqueResize () const
void setKeepSize (bool b=true)
 If b is true, the splitter will keep its size on resize events.
bool keepSize () const
void setForcedFixedWidth (KDockWidget *dw, int w)
void setForcedFixedHeight (KDockWidget *dw, int h)
void restoreFromForcedFixedSize (KDockWidget *dw)
Orientation orientation ()
 The orientation is either Horizontal or Vertical.

Protected Member Functions

int checkValue (int position) const
 Make sure the splitter position is not out of bounds.
int checkValueOverlapped (int position, QWidget *child) const
 Make sure the splitter position is not out of bounds.
virtual void resizeEvent (QResizeEvent *ev)
 The resize event resizes child0, child1 and the divider.

Friends

class KDockContainer


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].

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

Definition at line 59 of file ksplitter.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

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.

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.

void KDockSplitter::deactivate  ) 
 

Disables the splitter.

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

virtual bool KDockSplitter::eventFilter QObject *  ,
QEvent * 
[virtual]
 

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

QWidget* KDockSplitter::getAnother QWidget w  )  const
 

If w is child0, return child1, otherwise child0.

Returns:
the other child widget

QWidget* KDockSplitter::getFirst  )  const [inline]
 

Returns:
the top/left child widget.

Definition at line 138 of file ksplitter.h.

QWidget* KDockSplitter::getLast  )  const [inline]
 

Returns:
the bottom/right child widget.

Definition at line 142 of file ksplitter.h.

bool KDockSplitter::keepSize  )  const
 

bool KDockSplitter::opaqueResize  )  const
 

Orientation KDockSplitter::orientation  )  [inline]
 

The orientation is either Horizontal or Vertical.

Definition at line 173 of file ksplitter.h.

virtual 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).

void KDockSplitter::restoreFromForcedFixedSize KDockWidget *  dw  ) 
 

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%.

int KDockSplitter::separatorPosInPercent  )  [inline]
 

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

.100]

Returns:
separator position in percent

Definition at line 79 of file ksplitter.h.

Referenced by KexiMainWindowImpl::closeProject().

void KDockSplitter::setForcedFixedHeight KDockWidget *  dw,
int  h
 

void KDockSplitter::setForcedFixedWidth KDockWidget *  dw,
int  w
 

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.

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.

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 true by default

void KDockSplitter::setSeparatorPosInPercent int  percent  )  [inline]
 

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

.100]

Parameters:
percent separator position in percent

Definition at line 92 of file ksplitter.h.

Referenced by KexiMainWindowImpl::closeProject(), KexiMainWindowImpl::initPropertyEditor(), KexiMainWindowImpl::Private::restoreNavigatorWidth(), and KexiMainWindowImpl::slotAutoOpenObjectsLater().

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.

void KDockSplitter::updateName  ) 
 


Friends And Related Function Documentation

friend class KDockContainer [friend]
 

Definition at line 176 of file ksplitter.h.


The documentation for this class was generated from the following file:
KDE Logo
This file is part of the documentation for Kexi 2.0 alpha.
Documentation copyright © 2002-2007 the Kexi Team.
Generated on Tue Apr 1 20:50:06 2008 by doxygen 1.4.2 written by Dimitri van Heesch, © 1997-2003