• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdelibs API Reference
  • KDE Home
  • Contact Us
 

KDE3Support

Public Member Functions | Protected Member Functions | List of all members
K3DockSplitter Class Reference

#include <k3dockwidget_private.h>

Inheritance diagram for K3DockSplitter:
Inheritance graph
[legend]

Public Member Functions

 K3DockSplitter (QWidget *parent=0, const char *name=0, Qt::Orientation orient=Qt::Vertical, int pos=50)
 
virtual ~K3DockSplitter ()
 
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
 
bool keepSize () const
 
bool opaqueResize () const
 
Qt::Orientation orientation ()
 
void restoreFromForcedFixedSize (K3DockWidget *dw)
 
int separatorPos () const
 
int separatorPosInPercent ()
 
void setForcedFixedHeight (K3DockWidget *dw, int h)
 
void setForcedFixedWidth (K3DockWidget *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 ()
 

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.

Author
Max Judin.

Definition at line 49 of file k3dockwidget_private.h.

Constructor & Destructor Documentation

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

Constructor.

Parameters
parentparent widget
namename
orientorientation. Either Vertical or Horizontal
posprocentual position of the splitter. Must be int [0...100].

Definition at line 33 of file k3dockwidget_private.cpp.

virtual K3DockSplitter::~K3DockSplitter ( )
inlinevirtual

Definition at line 65 of file k3dockwidget_private.h.

Member Function Documentation

void K3DockSplitter::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
c0the widget on top/left
c1the widget on borrom/right

Definition at line 52 of file k3dockwidget_private.cpp.

int K3DockSplitter::checkValue ( int  position) const
protected

Make sure the splitter position is not out of bounds.

Parameters
positionthe current position
Returns
a (new) valid splitter position.

Definition at line 467 of file k3dockwidget_private.cpp.

int K3DockSplitter::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
positioncurrent divider position
childthe overlapping child
Returns
the (new) splitter position.

Definition at line 443 of file k3dockwidget_private.cpp.

void K3DockSplitter::deactivate ( )

Disables the splitter.

Definition at line 205 of file k3dockwidget_private.cpp.

bool K3DockSplitter::event ( QEvent *  e)
virtual

Definition at line 568 of file k3dockwidget_private.cpp.

bool K3DockSplitter::eventFilter ( QObject *  o,
QEvent *  e 
)
virtual

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

Definition at line 493 of file k3dockwidget_private.cpp.

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

If w is child0, return child1, otherwise child0.

Returns
the other child widget

Definition at line 579 of file k3dockwidget_private.cpp.

QWidget* K3DockSplitter::getFirst ( ) const
inline
Returns
the top/left child widget.

Definition at line 129 of file k3dockwidget_private.h.

QWidget* K3DockSplitter::getLast ( ) const
inline
Returns
the bottom/right child widget.

Definition at line 133 of file k3dockwidget_private.h.

bool K3DockSplitter::keepSize ( ) const

Definition at line 617 of file k3dockwidget_private.cpp.

bool K3DockSplitter::opaqueResize ( ) const

Definition at line 607 of file k3dockwidget_private.cpp.

Qt::Orientation K3DockSplitter::orientation ( )
inline

The orientation is either Horizontal or Vertical.

Definition at line 164 of file k3dockwidget_private.h.

void K3DockSplitter::resizeEvent ( QResizeEvent *  ev)
protectedvirtual

The resize event resizes child0, child1 and the divider.

The new sizes are dependent on

  • whether child0 or child1 is a K3DockContainer
  • the current mode which may be
    • Closed
    • Overlapped (opened)
    • Nonoverlap (opened)

So there are 3*2=6 different modes we have to face.

Parameters
evthe resize Event. If ev=0L the user changed the mode (for example from overlap to nonoverlap mode).

Definition at line 240 of file k3dockwidget_private.cpp.

void K3DockSplitter::restoreFromForcedFixedSize ( K3DockWidget *  dw)

Definition at line 155 of file k3dockwidget_private.cpp.

int K3DockSplitter::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 235 of file k3dockwidget_private.cpp.

int K3DockSplitter::separatorPosInPercent ( )

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

Returns
separator position in percent

Definition at line 212 of file k3dockwidget_private.cpp.

void K3DockSplitter::setForcedFixedHeight ( K3DockWidget *  dw,
int  h 
)

Definition at line 133 of file k3dockwidget_private.cpp.

void K3DockSplitter::setForcedFixedWidth ( K3DockWidget *  dw,
int  w 
)

Definition at line 111 of file k3dockwidget_private.cpp.

void K3DockSplitter::setKeepSize ( bool  b = true)

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

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

Definition at line 612 of file k3dockwidget_private.cpp.

void K3DockSplitter::setOpaqueResize ( bool  b = true)

Set opaque flag.

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

Definition at line 602 of file k3dockwidget_private.cpp.

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

set separator position.

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

Definition at line 222 of file k3dockwidget_private.cpp.

void K3DockSplitter::setSeparatorPosInPercent ( int  percent)

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

Parameters
percentseparator position in percent

Definition at line 217 of file k3dockwidget_private.cpp.

void K3DockSplitter::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 229 of file k3dockwidget_private.cpp.

void K3DockSplitter::updateName ( )

Definition at line 584 of file k3dockwidget_private.cpp.


The documentation for this class was generated from the following files:
  • k3dockwidget_private.h
  • k3dockwidget_private.cpp
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:51:59 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

KDE3Support

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

kdelibs API Reference

Skip menu "kdelibs API Reference"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDEWebKit
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  • kjsembed
  •   WTF
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • Nepomuk
  • Nepomuk-Core
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal