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

libkdepim

  • KPIM
  • KWidgetLister
Signals | Public Member Functions | Protected Slots | Protected Member Functions | List of all members
KPIM::KWidgetLister Class Reference

#include <kwidgetlister.h>

Inheritance diagram for KPIM::KWidgetLister:
Inheritance graph
[legend]

Signals

void clearWidgets ()
 
void widgetAdded ()
 
void widgetAdded (QWidget *widget)
 
void widgetRemoved ()
 
void widgetRemoved (QWidget *widget)
 

Public Member Functions

 KWidgetLister (int minWidgets=1, int maxWidgets=8, QWidget *parent=0)
 
 KWidgetLister (bool fewerMoreButton, int minWidgets=1, int maxWidgets=8, QWidget *parent=0)
 
virtual ~KWidgetLister ()
 

Protected Slots

virtual void slotClear ()
 
virtual void slotFewer ()
 
virtual void slotMore ()
 

Protected Member Functions

virtual void addWidgetAfterThisWidget (QWidget *currentWidget, QWidget *widget=0)
 
virtual void addWidgetAtEnd (QWidget *widget=0)
 
virtual void clearWidget (QWidget *w)
 
virtual QWidget * createWidget (QWidget *parent)
 
virtual void removeLastWidget ()
 
virtual void removeWidget (QWidget *widget)
 
virtual void setNumberOfShownWidgetsTo (int count)
 
QList< QWidget * > widgets () const
 
int widgetsMaximum () const
 
int widgetsMinimum () const
 

Detailed Description

Widget that manages a list of other widgets (incl.

'more', 'fewer' and 'clear' buttons).

Simple widget that nonetheless does a lot of the dirty work for the filter edit widgets (KMSearchPatternEdit and KMFilterActionEdit). It provides a growable and shrinkable area where widget may be displayed in rows. Widgets can be added by hitting the provided 'More' button, removed by the 'Fewer' button and cleared (e.g. reset, if an derived class implements that and removed for all but mMinWidgets).

To use this widget, derive from it with the template changed to the type of widgets this class should list. Then reimplement addWidgetAtEnd, removeLastWidget, calling the original implementation as necessary. Instantiate an object of the class and put it in your dialog.

Author
Marc Mutz Marc@.nosp@m.Mutz.nosp@m..com
See also
KMSearchPatternEdit::WidgetLister KMFilterActionEdit::WidgetLister

Definition at line 63 of file kwidgetlister.h.

Constructor & Destructor Documentation

KWidgetLister::KWidgetLister ( int  minWidgets = 1,
int  maxWidgets = 8,
QWidget *  parent = 0 
)
explicit

Creates a new widget lister.

Parameters
minWidgetsThe minimum number of widgets to stay on the screen.
maxWidgetsThe maximum number of widgets to stay on the screen.
parentThe parent widget.

Definition at line 103 of file kwidgetlister.cpp.

KWidgetLister::KWidgetLister ( bool  fewerMoreButton,
int  minWidgets = 1,
int  maxWidgets = 8,
QWidget *  parent = 0 
)
explicit

Creates a new widget lister.

Parameters
fewerMoreButtonAdd or Not fewerMoreButton
minWidgetsThe minimum number of widgets to stay on the screen.
maxWidgetsThe maximum number of widgets to stay on the screen.
parentThe parent widget.

Definition at line 95 of file kwidgetlister.cpp.

KWidgetLister::~KWidgetLister ( )
virtual

Destroys the widget lister.

Definition at line 111 of file kwidgetlister.cpp.

Member Function Documentation

void KWidgetLister::addWidgetAfterThisWidget ( QWidget *  currentWidget,
QWidget *  widget = 0 
)
protectedvirtual

Add widget after specific widget.

Definition at line 278 of file kwidgetlister.cpp.

void KWidgetLister::addWidgetAtEnd ( QWidget *  widget = 0)
protectedvirtual

Adds a single widget.

Doesn't care if there are already mMaxWidgets on screen and whether it should enable/disable any controls. It simply does what it is asked to do. You want to reimplement this method if you want to initialize the widget when showing it on screen. Make sure you call this implementaion, though, since you cannot put the widget on screen from derived classes (mLayout is private). Make sure the parent of the QWidget to add is this KWidgetLister.

Definition at line 196 of file kwidgetlister.cpp.

void KWidgetLister::clearWidget ( QWidget *  w)
protectedvirtual

Called to clear a given widget.

The default implementation does nothing.

Definition at line 219 of file kwidgetlister.cpp.

void KPIM::KWidgetLister::clearWidgets ( )
signal

This signal is emitted whenever the clear button is clicked.

QWidget * KWidgetLister::createWidget ( QWidget *  parent)
protectedvirtual

Returns a new widget that shall be added to the lister.

Parameters
parentThe parent widget of the new widget.

Definition at line 224 of file kwidgetlister.cpp.

void KWidgetLister::removeLastWidget ( )
protectedvirtual

Removes a single (always the last) widget.

Doesn't care if there are still only mMinWidgets left on screen and whether it should enable/disable any controls. It simply does what it is asked to do. You want to reimplement this method if you want to save the widget's state before removing it from screen. Make sure you call this implementaion, though, since you should not remove the widget from screen from derived classes.

Definition at line 210 of file kwidgetlister.cpp.

void KWidgetLister::removeWidget ( QWidget *  widget)
protectedvirtual

Remove specific widget.

Definition at line 260 of file kwidgetlister.cpp.

void KWidgetLister::setNumberOfShownWidgetsTo ( int  count)
protectedvirtual

Sets the number of widgets on scrren to exactly count.

Doesn't check if count is inside the range [mMinWidgets,mMaxWidgets].

Definition at line 229 of file kwidgetlister.cpp.

void KWidgetLister::slotClear ( )
protectedvirtualslot

Called whenever the user clicks on the 'clear' button.

Reimplementations should call this method, because this implementation does all the dirty work with removing all but mMinWidgets widgets from the layout and enabling/disabling the control buttons.

Definition at line 183 of file kwidgetlister.cpp.

void KWidgetLister::slotFewer ( )
protectedvirtualslot

Called whenever the user clicks on the 'fewer' button.

Reimplementations should call this method, because this implementation does all the dirty work with removing the widgets from the layout (through removeLastWidget) and enabling/disabling the control buttons.

Definition at line 172 of file kwidgetlister.cpp.

void KWidgetLister::slotMore ( )
protectedvirtualslot

Called whenever the user clicks on the 'more' button.

Reimplementations should call this method, because this implementation does all the dirty work with adding the widgets to the layout (through addWidgetAtEnd) and enabling/disabling the control buttons.

Definition at line 161 of file kwidgetlister.cpp.

void KPIM::KWidgetLister::widgetAdded ( )
signal

This signal is emitted whenever a widget was added.

void KPIM::KWidgetLister::widgetAdded ( QWidget *  widget)
signal

This signal is emitted whenever a widget was added.

Parameters
widgetThe added widget.
void KPIM::KWidgetLister::widgetRemoved ( )
signal

This signal is emitted whenever a widget was removed.

void KPIM::KWidgetLister::widgetRemoved ( QWidget *  widget)
signal

This signal is emitted whenever a widget was removed.

QList< QWidget * > KWidgetLister::widgets ( ) const
protected

Returns the list of widgets.

Definition at line 245 of file kwidgetlister.cpp.

int KWidgetLister::widgetsMaximum ( ) const
protected

The maximum number of widgets that are to be shown on screen.

Definition at line 255 of file kwidgetlister.cpp.

int KWidgetLister::widgetsMinimum ( ) const
protected

The minimum number of widgets that are to stay on screen.

Definition at line 250 of file kwidgetlister.cpp.


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

KDE's Doxygen guidelines are available online.

libkdepim

Skip menu "libkdepim"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Modules

kdepim API Reference

Skip menu "kdepim API Reference"
  • akonadi_next
  • akregator
  • blogilo
  • calendarsupport
  • console
  •   kabcclient
  •   konsolekalendar
  • kaddressbook
  • kalarm
  •   lib
  • kdgantt2
  • kjots
  • kleopatra
  • kmail
  • knode
  • knotes
  • kontact
  • korgac
  • korganizer
  • ktimetracker
  • libkdepim
  • libkleo
  • libkpgp
  • mailcommon
  • messagelist
  • messageviewer

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