libopie API Documentation

OFontMenu Class Reference

This class is a specialised QPopupMenu. PopupMenu which can control the size of Widgets. More...

#include <ofontmenu.h>

Inheritance diagram for OFontMenu:

Inheritance graph
[legend]
Collaboration diagram for OFontMenu:

Collaboration graph
[legend]
List of all members.

Signals

void fontChanged (int size)
 this signal gets emitted when the font size gets changed


Public Member Functions

 OFontMenu (QWidget *parent, const char *name, const QList< QWidget > &list)
 Constructs the FontMenu.

void save (Config *cfg)
 This method saves the font size into a Config object OFontMenu will be used as group and size as key.

void restore (Config *cfg)
 This method restores the font size from a Config object it'll apply the sizes to the widgets and will also set the menu appropriate.

void setWidgets (const QList< QWidget > &list)
 set the list of widgets

void addWidget (QWidget *wid)
 add a widget to the list

void forceSize (QWidget *wid, int size)
 Forces a size on a widget.

void removeWidget (QWidget *wid)
 removes the widget from the list of controlled objects

const QList< QWidget > & widgets () const
 The list of controlled widgets.


Detailed Description

This class is a specialised QPopupMenu. PopupMenu which can control the size of Widgets.

It'll display three different font sizes. Small, Normal and large by adding widgets to the Menu you can control the font size of these widgets by using the save and restore method you can also apply font sizes over two different runtimes

QTable* tbl = new QTable(); QList<QWidget> wid; wid.append( tbl ); OFontMenu* menu = new OFontMenu(this, "Popup Menu", wid ); Config cfg("mycfg"); menu->restore( cfg );

Author:
Holger Freyther ( zecke@handhelds.org )
Version:
0.1
See also:
QPopupMenu

Definition at line 75 of file ofontmenu.h.


Constructor & Destructor Documentation

OFontMenu::OFontMenu QWidget parent,
const char *  name,
const QList< QWidget > &  list
 

Constructs the FontMenu.

Parameters:
parent The parent widget
name A name for this widget
list The list of widgets to be controlled

Definition at line 14 of file ofontmenu.cc.

References QPopupMenu::insertItem(), QPopupMenu::setCheckable(), and QObject::tr().


Member Function Documentation

void OFontMenu::save Config cfg  ) 
 

This method saves the font size into a Config object OFontMenu will be used as group and size as key.

Parameters:
cfg The Config object to be used

Definition at line 36 of file ofontmenu.cc.

References Config::setGroup(), and Config::writeEntry().

void OFontMenu::restore Config cfg  ) 
 

This method restores the font size from a Config object it'll apply the sizes to the widgets and will also set the menu appropriate.

Definition at line 47 of file ofontmenu.cc.

References Config::readNumEntry(), Config::setGroup(), and QPopupMenu::setItemChecked().

void OFontMenu::setWidgets const QList< QWidget > &  list  ) 
 

set the list of widgets

Parameters:
list the widget list

Definition at line 74 of file ofontmenu.cc.

void OFontMenu::addWidget QWidget wid  ) 
 

add a widget to the list

Parameters:
wid The widget to be added

Definition at line 83 of file ofontmenu.cc.

References QList< QWidget >::append().

void OFontMenu::forceSize QWidget wid,
int  size
 

Forces a size on a widget.

Parameters:
wid The widget
size The font size forced onto the widget

Definition at line 110 of file ofontmenu.cc.

References QList< WidSize >::append(), and QWidget::size().

void OFontMenu::removeWidget QWidget wid  ) 
 

removes the widget from the list of controlled objects

Parameters:
wid the to be removed widget

Definition at line 92 of file ofontmenu.cc.

References QList< QWidget >::remove().

const QList< QWidget > & OFontMenu::widgets  )  const
 

The list of controlled widgets.

Definition at line 100 of file ofontmenu.cc.

void OFontMenu::fontChanged int  size  )  [signal]
 

this signal gets emitted when the font size gets changed

Parameters:
size The new size of font


The documentation for this class was generated from the following files:
KDE Logo
This file is part of the documentation for OPIE Version 1.1.
Documentation copyright © 1997-2003 the KDE developers. 2003 OPIE developers
Generated on Tue Feb 10 20:24:56 2004 by doxygen 1.3.5 written by Dimitri van Heesch, © 1997-2001