ctkComboBox is an advanced QComboBox. It adds multiple features:
More...
#include <Libs/Widgets/ctkComboBox.h>
|
| QScopedPointer< ctkComboBoxPrivate > | d_ptr |
| |
ctkComboBox is an advanced QComboBox. It adds multiple features:
- Display a default text and/or icon when the combobox current index is invalid (-1). A typical default text would be "Select a XXX...". forceDefault can force the display of the default text at all time (with a valid current index). The text displayed in the combo box can be elided when the size is too small.
- Optionally prevent the mouse scroll events from changing the current index. ctkComboBox works exactly the same as QComboBox by default.
- See also
- QComboBox
Definition at line 44 of file ctkComboBox.h.
◆ ScrollEffect
\tbd turn into flags ?
| Enumerator |
|---|
| NeverScroll | Scrolling is not possible with the mouse wheel.
|
| AlwaysScroll | Scrolling is always possible with the mouse wheel.
|
| ScrollWithFocus | Scrolling is only possible if the combobox has the focus. The focus policy is automatically set to Qt::StrongFocus
|
| ScrollWithNoVScrollBar | Scrolling is not possible when the combobox is inside a scroll area with a visible vertical scrollbar.
|
Definition at line 83 of file ctkComboBox.h.
◆ ctkComboBox()
| ctkComboBox::ctkComboBox |
( |
QWidget * |
parent = 0 | ) |
|
|
explicit |
Constructor, build a ctkComboBox that behaves like QComboBox.
◆ ~ctkComboBox()
| virtual ctkComboBox::~ctkComboBox |
( |
| ) |
|
|
virtual |
◆ changeEvent()
| virtual void ctkComboBox::changeEvent |
( |
QEvent * |
event | ) |
|
|
protectedvirtual |
◆ currentUserDataAsString()
| QString ctkComboBox::currentUserDataAsString |
( |
| ) |
const |
Get current item's user data as string.
◆ defaultIcon()
| QIcon ctkComboBox::defaultIcon |
( |
| ) |
const |
◆ defaultText()
| QString ctkComboBox::defaultText |
( |
| ) |
const |
◆ elideMode()
| Qt::TextElideMode ctkComboBox::elideMode |
( |
| ) |
const |
◆ forceDefault()
| void ctkComboBox::forceDefault |
( |
bool |
forceDefault | ) |
|
Force the display of the text/icon at all time (not only when the current index is invalid). False by default.
◆ isDefaultForced()
| bool ctkComboBox::isDefaultForced |
( |
| ) |
const |
◆ minimumSizeHint()
| virtual QSize ctkComboBox::minimumSizeHint |
( |
| ) |
const |
|
virtual |
Reimplemented for internal reasons.
◆ paintEvent()
| virtual void ctkComboBox::paintEvent |
( |
QPaintEvent * |
event | ) |
|
|
protectedvirtual |
Reimplemented for internal reasons.
◆ scrollWheelEffect()
Return the scrollWheelEffect property value.
- See also
- scrollEffect
◆ setCurrentUserDataAsString
| void ctkComboBox::setCurrentUserDataAsString |
( |
QString |
userData | ) |
|
|
slot |
Set current item based on user data.
◆ setDefaultIcon()
| void ctkComboBox::setDefaultIcon |
( |
const QIcon & |
| ) |
|
Empty by default (same behavior as QComboBox)
◆ setDefaultText()
| void ctkComboBox::setDefaultText |
( |
const QString & |
| ) |
|
Empty by default (same behavior as QComboBox)
◆ setElideMode()
| void ctkComboBox::setElideMode |
( |
const Qt::TextElideMode & |
newMode | ) |
|
setElideMode can elide the text displayed on the combobox. Qt::ElideNone by default (same behavior as QComboBox)
◆ setScrollWheelEffect()
| void ctkComboBox::setScrollWheelEffect |
( |
ScrollEffect |
scroll | ) |
|
Set the scrollWheelEffect property value.
- See also
- scrollEffect
◆ sizeHint()
| virtual QSize ctkComboBox::sizeHint |
( |
| ) |
const |
|
virtual |
Reimplemented for internal reasons.
◆ wheelEvent()
| virtual void ctkComboBox::wheelEvent |
( |
QWheelEvent * |
event | ) |
|
|
protectedvirtual |
◆ d_ptr
| QScopedPointer<ctkComboBoxPrivate> ctkComboBox::d_ptr |
|
protected |
◆ currentUserDataAsString
| QString ctkComboBox::currentUserDataAsString |
|
readwrite |
Current item's user data as string (Qt::UserRole role)
Definition at line 1 of file ctkComboBox.h.
◆ defaultIcon
| QIcon ctkComboBox::defaultIcon |
|
readwrite |
◆ defaultText
| QString ctkComboBox::defaultText |
|
readwrite |
◆ elideMode
| Qt::TextElideMode ctkComboBox::elideMode |
|
readwrite |
◆ forceDefault
| bool ctkComboBox::forceDefault |
|
readwrite |
◆ scrollWheelEffect
This property controls the behavior of the mouse scroll wheel. ScrollOn by default. /sa scrollWheelEffect, setScrollWheelEffect
Definition at line 1 of file ctkComboBox.h.
The documentation for this class was generated from the following file: