libkdepim
#include <kwidgetlister.h>
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.
- See also
- KMSearchPatternEdit::WidgetLister KMFilterActionEdit::WidgetLister
Definition at line 63 of file kwidgetlister.h.
Constructor & Destructor Documentation
|
explicit |
Creates a new widget lister.
- Parameters
-
minWidgets The minimum number of widgets to stay on the screen. maxWidgets The maximum number of widgets to stay on the screen. parent The parent widget.
Definition at line 103 of file kwidgetlister.cpp.
|
explicit |
Creates a new widget lister.
- Parameters
-
fewerMoreButton Add or Not fewerMoreButton minWidgets The minimum number of widgets to stay on the screen. maxWidgets The maximum number of widgets to stay on the screen. parent The parent widget.
Definition at line 95 of file kwidgetlister.cpp.
|
virtual |
Destroys the widget lister.
Definition at line 111 of file kwidgetlister.cpp.
Member Function Documentation
|
protectedvirtual |
Add widget after specific widget.
Definition at line 278 of file kwidgetlister.cpp.
|
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.
|
protectedvirtual |
Called to clear a given widget.
The default implementation does nothing.
Definition at line 219 of file kwidgetlister.cpp.
|
signal |
This signal is emitted whenever the clear button is clicked.
Returns a new widget that shall be added to the lister.
- Parameters
-
parent The parent widget of the new widget.
Definition at line 224 of file kwidgetlister.cpp.
|
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.
|
protectedvirtual |
Remove specific widget.
Definition at line 260 of file kwidgetlister.cpp.
|
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.
|
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.
|
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.
|
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.
|
signal |
This signal is emitted whenever a widget was added.
|
signal |
This signal is emitted whenever a widget was added.
- Parameters
-
widget The added widget.
|
signal |
This signal is emitted whenever a widget was removed.
|
signal |
This signal is emitted whenever a widget was removed.
Returns the list of widgets.
Definition at line 245 of file kwidgetlister.cpp.
|
protected |
The maximum number of widgets that are to be shown on screen.
Definition at line 255 of file kwidgetlister.cpp.
|
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:
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.