Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

Opie::Ui::OSplitter Class Reference

a small dynamically changing its layout to store two or more widgets side by side More...

#include </home/clem/local/src/opie/libopie2/opieui/big-screen/osplitter.h>

Collaboration diagram for Opie::Ui::OSplitter:

Collaboration graph
[legend]
List of all members.

Public Types

typedef QValueList< Opie::Ui::Internal::OSplitterContainerContainerList

Signals

void currentChanged (QWidget *)
void sizeChanged (bool b, Orientation ori)

Public Member Functions

 OSplitter (Qt::Orientation=Horizontal, QWidget *parent=0, const char *name=0, WFlags fl=0)
 ~OSplitter ()
void setLabel (const QString &name)
void setIconName (const QString &name)
QString label () const
QString iconName () const
void setSizeChange (int width_height)
void addWidget (OSplitter *splitter)
void addWidget (QWidget *wid, const QString &icon, const QString &label)
void removeWidget (QWidget *)
void removeWidget (OSplitter *)
void setCurrentWidget (QWidget *)
void setCurrentWidget (const QString &label)
void setCurrentWidget (int)
QWidget * currentWidget () const

Protected Member Functions

void resizeEvent (QResizeEvent *)

Private Member Functions

bool layoutMode () const
void setTabWidget (OTabWidget *)
void addToTab (const Opie::Ui::Internal::OSplitterContainer &)
void addToBox (const Opie::Ui::Internal::OSplitterContainer &)
void removeFromTab (QWidget *)
void changeTab ()
void changeHBox ()
void changeVBox ()
void commonChangeBox ()

Private Attributes

QHBox * m_hbox
OTabWidgetm_tabWidget
OTabWidgetm_parentTab
Orientation m_orient
int m_size_policy
ContainerList m_container
QList< OSplitterm_splitter
QString m_icon
QString m_name
Private * d

Detailed Description

a small dynamically changing its layout to store two or more widgets side by side

If you've widgets that could be placed side by side but you think on small resolutions is not enough place but it would really make sense on bigger resolutions this class will help you. You can add as many widgets you want to it. Set a poliy on which width/height it should switch the layout. You can either say to place widgets vertical or horizontal. This class uses QHBox, QVBox and QTAbWidget internally. OSplitter takes ownership of the widgets

Since:
1.2
Version:
0.1
Author:
zecke

Definition at line 72 of file osplitter.h.


Member Typedef Documentation

typedef QValueList<Opie::Ui::Internal::OSplitterContainer> Opie::Ui::OSplitter::ContainerList
 

Definition at line 74 of file osplitter.h.


Constructor & Destructor Documentation

Opie::Ui::OSplitter::OSplitter Qt::Orientation  = Horizontal,
QWidget *  parent = 0,
const char *  name = 0,
WFlags  fl = 0
 

OSplitter::~OSplitter  ) 
 

Destructor destructs this object and cleans up. All child widgets will be deleted

See also:
addWidget

Definition at line 83 of file osplitter.cpp.

References m_hbox, m_splitter, and m_tabWidget.


Member Function Documentation

void OSplitter::addToBox const Opie::Ui::Internal::OSplitterContainer  )  [private]
 

Definition at line 408 of file osplitter.cpp.

References m_hbox, wid, and Opie::Ui::Internal::OSplitterContainer::widget.

Referenced by addWidget(), and commonChangeBox().

void OSplitter::addToTab const Opie::Ui::Internal::OSplitterContainer  )  [private]
 

Definition at line 394 of file osplitter.cpp.

References Opie::Ui::OTabWidget::addTab(), Opie::Ui::Internal::OSplitterContainer::icon, m_tabWidget, Opie::Ui::Internal::OSplitterContainer::name, wid, and Opie::Ui::Internal::OSplitterContainer::widget.

Referenced by addWidget(), and changeTab().

void OSplitter::addWidget QWidget *  wid,
const QString icon,
const QString label
 

Adds a widget to the Splitter. The widgets gets inserted at the end of either the Box or TabWidget. Ownership gets transfered and the widgets gets reparented. Note: icon and label is only available on small screensizes if size is smaller than the mark Warning: No null checking of the widget is done. Only on debug a message will be outputtet

Parameters:
wid The widget which will be added
icon The icon of the possible Tab
label The label of the possible Tab

Definition at line 208 of file osplitter.cpp.

References addToBox(), addToTab(), QValueList< T >::append(), Opie::Ui::Internal::OSplitterContainer::icon, m_container, m_hbox, m_parentTab, m_splitter, m_tabWidget, Opie::Ui::Internal::OSplitterContainer::name, setTabWidget(), and Opie::Ui::Internal::OSplitterContainer::widget.

void OSplitter::addWidget OSplitter split  ) 
 

This functions allows to add another OSplitter and to share the OTabBar in small screen mode. The ownerships gets transfered. OSplitters are always added after normal widget items

Definition at line 161 of file osplitter.cpp.

References addToBox(), m_parentTab, m_splitter, m_tabWidget, setTabWidget(), and Opie::Ui::Internal::OSplitterContainer::widget.

void OSplitter::changeHBox  )  [private]
 

Definition at line 491 of file osplitter.cpp.

References commonChangeBox(), and m_hbox.

Referenced by resizeEvent(), and setTabWidget().

void OSplitter::changeTab  )  [private]
 

Definition at line 430 of file osplitter.cpp.

References addToTab(), QValueList< T >::begin(), currentChanged(), QValueList< T >::end(), QValueList< T >::isEmpty(), m_container, m_hbox, m_splitter, and m_tabWidget.

Referenced by resizeEvent(), and setTabWidget().

void OSplitter::changeVBox  )  [private]
 

Definition at line 503 of file osplitter.cpp.

References commonChangeBox(), and m_hbox.

Referenced by resizeEvent(), and setTabWidget().

void OSplitter::commonChangeBox  )  [private]
 

Definition at line 523 of file osplitter.cpp.

References addToBox(), QValueList< T >::begin(), QValueList< T >::end(), iconName(), label(), m_container, m_hbox, m_splitter, m_tabWidget, removeFromTab(), and Opie::Ui::Internal::OSplitterContainer::widget.

Referenced by changeHBox(), and changeVBox().

void Opie::Ui::OSplitter::currentChanged QWidget *   )  [signal]
 

Emitted if in tab and comes directly from the tab widget

Referenced by changeTab().

QWidget * OSplitter::currentWidget  )  const
 

return the currently activated widget if in tab widget mode or null because all widgets are visible

Definition at line 320 of file osplitter.cpp.

References Opie::Ui::OTabWidget::currentWidget(), l, m_parentTab, and m_tabWidget.

QString OSplitter::iconName  )  const
 

returns the iconName

See also:
setIconName

Definition at line 121 of file osplitter.cpp.

References m_icon.

Referenced by commonChangeBox().

QString OSplitter::label  )  const
 

returns the label set with setLabel

See also:
setLabel

Definition at line 130 of file osplitter.cpp.

References m_name.

Referenced by commonChangeBox().

bool OSplitter::layoutMode  )  const [private]
 

For internal use only.

Definition at line 611 of file osplitter.cpp.

References height, m_orient, m_size_policy, size, and width.

Referenced by setTabWidget().

void OSplitter::removeFromTab QWidget *   )  [private]
 

Definition at line 418 of file osplitter.cpp.

References m_tabWidget, and Opie::Ui::OTabWidget::removePage().

Referenced by commonChangeBox(), and removeWidget().

void OSplitter::removeWidget OSplitter split  ) 
 

This removes the splitter again. You currently need to call this before you delete or otherwise you can get mem corruption or other weird behaviour. Owner ship gets transfered back to you it's current parent is 0

Definition at line 189 of file osplitter.cpp.

References setTabWidget().

void OSplitter::removeWidget QWidget *  w  ) 
 

Removes the widget from the tab widgets if necessary. OSplitter drops ownership of this widget and the widget will be reparented i tto 0. The widget will not be deleted.

Parameters:
w The widget to be removed

Definition at line 244 of file osplitter.cpp.

References QValueList< T >::begin(), QValueList< T >::end(), m_container, m_hbox, QValueList< T >::remove(), and removeFromTab().

void OSplitter::resizeEvent QResizeEvent *  res  )  [protected]
 

for internal reasons

Definition at line 360 of file osplitter.cpp.

References changeHBox(), changeTab(), changeVBox(), m_orient, m_size_policy, and sizeChanged().

Referenced by setSizeChange().

void OSplitter::setCurrentWidget int  tab  ) 
 

This will only work when the TabWidget is active If everything is visible this signal is kindly ignored

See also:
OTabWidget::setCurrentTab(int)
Parameters:
tab The tab to make current

Definition at line 310 of file osplitter.cpp.

References m_tabWidget, and Opie::Ui::OTabWidget::setCurrentTab().

void OSplitter::setCurrentWidget const QString label  ) 
 

This is an overloaded member function and only differs in the argument it takes. Searches list of widgets for label. It'll pick the first label it finds

Parameters:
label Label to look for. First match will be taken

Definition at line 290 of file osplitter.cpp.

References QValueList< T >::begin(), QValueList< T >::end(), m_container, and setCurrentWidget().

void OSplitter::setCurrentWidget QWidget *  w  ) 
 

This method will give focus to the widget. If in a tabwidget the tabbar will be changed

Parameters:
w The widget which will be set the current one

Definition at line 274 of file osplitter.cpp.

References m_tabWidget, and Opie::Ui::OTabWidget::setCurrentTab().

Referenced by setCurrentWidget().

void OSplitter::setIconName const QString name  ) 
 

See also:
setLabel but this is for the icon retrieved by Resource
Parameters:
name The name of the icon in example ( "zoom" )

Definition at line 111 of file osplitter.cpp.

References m_icon.

void OSplitter::setLabel const QString name  ) 
 

Sets the label for the Splitter. This label will be used if a parent splitter is arranged as TabWidget but this splitter is in fullscreen mode. Then a tab with OSplitter::label() and iconName() gets added.

Parameters:
name The name of the Label

Definition at line 101 of file osplitter.cpp.

References m_name.

void OSplitter::setSizeChange int  width_height  ) 
 

This function sets the size change policy of the splitter. If this size marked is crossed the splitter will relayout. Note: that depending on the set Orientation it'll either look at the width or height. Note: If you want to from side to side view to tabbed view you need to make sure that the size you supply is not smaller than the minimum size of your added widgets. Note that if you use widgets like QComboBoxes you need to teach them to accept smaller sizes as well

See also:
QWidget::setSizePolicy
Parameters:
width_height The mark that will be watched. Interpreted depending on the Orientation of the Splitter.
Returns:
void

Definition at line 148 of file osplitter.cpp.

References height, m_size_policy, resizeEvent(), and width.

Referenced by ListViews::ListViews().

void OSplitter::setTabWidget OTabWidget  )  [private]
 

Definition at line 560 of file osplitter.cpp.

References QValueList< T >::begin(), changeHBox(), changeTab(), changeVBox(), QValueList< T >::end(), QValueList< T >::isEmpty(), layoutMode(), m_container, m_hbox, m_orient, and m_tabWidget.

Referenced by addWidget(), and removeWidget().

void Opie::Ui::OSplitter::sizeChanged bool  b,
Orientation  ori
[signal]
 

emitted whenever a border is crossed true if in small screen mode false if in bigscreen this signal is emitted after the layout switch

Parameters:
b The layout mode
ori The orientation

Referenced by resizeEvent().


Member Data Documentation

Private* Opie::Ui::OSplitter::d [private]
 

Definition at line 145 of file osplitter.h.

ContainerList Opie::Ui::OSplitter::m_container [private]
 

Definition at line 140 of file osplitter.h.

Referenced by addWidget(), changeTab(), commonChangeBox(), removeWidget(), setCurrentWidget(), and setTabWidget().

QHBox* Opie::Ui::OSplitter::m_hbox [private]
 

Definition at line 134 of file osplitter.h.

Referenced by addToBox(), addWidget(), changeHBox(), changeTab(), changeVBox(), commonChangeBox(), removeWidget(), setTabWidget(), and ~OSplitter().

QString Opie::Ui::OSplitter::m_icon [private]
 

Definition at line 143 of file osplitter.h.

Referenced by iconName(), and setIconName().

QString Opie::Ui::OSplitter::m_name [private]
 

Definition at line 143 of file osplitter.h.

Referenced by label(), and setLabel().

Orientation Opie::Ui::OSplitter::m_orient [private]
 

Definition at line 137 of file osplitter.h.

Referenced by layoutMode(), resizeEvent(), and setTabWidget().

OTabWidget* Opie::Ui::OSplitter::m_parentTab [private]
 

Definition at line 136 of file osplitter.h.

Referenced by addWidget(), and currentWidget().

int Opie::Ui::OSplitter::m_size_policy [private]
 

Definition at line 138 of file osplitter.h.

Referenced by layoutMode(), resizeEvent(), and setSizeChange().

QList<OSplitter> Opie::Ui::OSplitter::m_splitter [private]
 

Definition at line 141 of file osplitter.h.

Referenced by addWidget(), changeTab(), commonChangeBox(), and ~OSplitter().

OTabWidget* Opie::Ui::OSplitter::m_tabWidget [private]
 

Definition at line 135 of file osplitter.h.

Referenced by addToTab(), addWidget(), changeTab(), commonChangeBox(), currentWidget(), removeFromTab(), setCurrentWidget(), setTabWidget(), and ~OSplitter().


The documentation for this class was generated from the following files:
Generated on Sat Nov 5 18:01:50 2005 for OPIE by  doxygen 1.4.2