libkdepim
#include <kcheckcombobox.h>
Public Slots | |
void | setCheckedItems (const QStringList &items, int role=Qt::DisplayRole) |
Signals | |
void | checkedItemsChanged (const QStringList &items) |
Public Member Functions | |
KCheckComboBox (QWidget *parent=0) | |
virtual | ~KCheckComboBox () |
bool | alwaysShowDefaultText () const |
QStringList | checkedItems (int role=Qt::DisplayRole) const |
QString | defaultText () const |
virtual void | hidePopup () |
Qt::CheckState | itemCheckState (int index) const |
bool | itemEnabled (int index) |
QString | separator () const |
void | setAlwaysShowDefaultText (bool always) |
void | setDefaultText (const QString &text) |
void | setItemCheckState (int index, Qt::CheckState state) |
void | setItemEnabled (int index, bool enabled=true) |
void | setSeparator (const QString &separator) |
void | setSqueezeText (bool squeeze) |
bool | squeezeText () const |
Protected Member Functions | |
virtual bool | eventFilter (QObject *receiver, QEvent *event) |
virtual void | keyPressEvent (QKeyEvent *event) |
virtual void | resizeEvent (QResizeEvent *event) |
virtual void | wheelEvent (QWheelEvent *event) |
Properties | |
QStringList | checkedItems |
QString | defaultText |
QString | separator |
bool | squeezeText |
Detailed Description
A combobox that shows its items in such a way that they can be checked in the drop menu.
It provides methods to set the default text when no items are selected and the separator that is used to show the items that are selected in the line edit.
Definition at line 42 of file kcheckcombobox.h.
Constructor & Destructor Documentation
|
explicit |
Creates a new checkable combobox.
Class KCheckComboBox.
- Parameters
-
parent The parent widget.
Definition at line 141 of file kcheckcombobox.cpp.
|
virtual |
Destroys the time zone combobox.
Definition at line 167 of file kcheckcombobox.cpp.
Member Function Documentation
bool KCheckComboBox::alwaysShowDefaultText | ( | ) | const |
Returns whether the default text is always shown, even if there are no checked items.
Definition at line 352 of file kcheckcombobox.cpp.
QStringList KCheckComboBox::checkedItems | ( | int | role = Qt::DisplayRole | ) | const |
Returns The currently selected items.
- Parameters
-
role The role the returned values belong to.
Definition at line 190 of file kcheckcombobox.cpp.
|
signal |
Signal to notify listeners that the current selections has changed.
- Parameters
-
items The new selection.
QString KPIM::KCheckComboBox::defaultText | ( | ) | const |
Returns the default text that is shown when no items are selected.
|
protectedvirtual |
Definition at line 312 of file kcheckcombobox.cpp.
|
virtual |
Hides the popup list if it is currently shown.
Definition at line 172 of file kcheckcombobox.cpp.
Qt::CheckState KCheckComboBox::itemCheckState | ( | int | index | ) | const |
Returns the check state of item at given index.
- Parameters
-
index The index for which to return the check state.
Definition at line 180 of file kcheckcombobox.cpp.
bool KCheckComboBox::itemEnabled | ( | int | index | ) |
Return whether or not the item at.
- Parameters
-
index is enabled, i.e. if the user can (un)check the item.
Definition at line 242 of file kcheckcombobox.cpp.
|
protectedvirtual |
Definition at line 277 of file kcheckcombobox.cpp.
|
protectedvirtual |
Definition at line 305 of file kcheckcombobox.cpp.
QString KPIM::KCheckComboBox::separator | ( | ) | const |
Returns the current separator used to separate the selected items in the line edit of the combo box.
void KCheckComboBox::setAlwaysShowDefaultText | ( | bool | always | ) |
Sets if the default text should always be shown even if there are no checked items.
Default is false.
Definition at line 357 of file kcheckcombobox.cpp.
|
slot |
Sets the currently selected items.
Items that are not found in the model are silently ignored.
- Parameters
-
items The items that will be set to checked. role The role items
belong to.
Definition at line 204 of file kcheckcombobox.cpp.
void KCheckComboBox::setDefaultText | ( | const QString & | text | ) |
Sets the default text that is shown when no items are selected.
- Parameters
-
text The new default text
Definition at line 221 of file kcheckcombobox.cpp.
void KCheckComboBox::setItemCheckState | ( | int | index, |
Qt::CheckState | state | ||
) |
Changes the check state of the given index to the given state.
- Parameters
-
index The index of which the state needs to be changed state The new state
Definition at line 185 of file kcheckcombobox.cpp.
void KCheckComboBox::setItemEnabled | ( | int | index, |
bool | enabled = true |
||
) |
Set the item at.
- Parameters
-
index to enabled,i.e. if the user can (un)check the item.
Definition at line 253 of file kcheckcombobox.cpp.
void KCheckComboBox::setSeparator | ( | const QString & | separator | ) |
Sets the separator used to separate items in the line edit.
- Parameters
-
separator The new separator
Definition at line 269 of file kcheckcombobox.cpp.
void KCheckComboBox::setSqueezeText | ( | bool | squeeze | ) |
Sets whether or not the text must be squeezed.
- Parameters
-
squeeze The new squeeze status
Definition at line 234 of file kcheckcombobox.cpp.
bool KPIM::KCheckComboBox::squeezeText | ( | ) | const |
Returns whether or not the text will be squeezed to fit in the combo's line edit.
This property is false by default.
- See also
- KSqueezedTextLabel
|
protectedvirtual |
Definition at line 298 of file kcheckcombobox.cpp.
Property Documentation
|
readwrite |
Definition at line 49 of file kcheckcombobox.h.
|
readwrite |
Definition at line 47 of file kcheckcombobox.h.
|
readwrite |
Definition at line 46 of file kcheckcombobox.h.
|
readwrite |
Definition at line 48 of file kcheckcombobox.h.
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:03 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.