ComboBox is an advanced QComboBox. It adds multiple features:
More...
#include <comboBox.h>
|
void | setCurrentUserDataAsString (QString userData) |
| Set current item based on user data.
|
|
|
| ComboBox (QWidget *parent=0) |
| Constructor, build a ComboBox that behaves like QComboBox.
|
|
void | setDefaultText (const QString &) |
| Empty by default (same behavior as QComboBox)
|
|
QString | defaultText () const |
|
void | setDefaultIcon (const QIcon &) |
| Empty by default (same behavior as QComboBox)
|
|
QIcon | defaultIcon () const |
|
void | forceDefault (bool forceDefault) |
|
bool | isDefaultForced () const |
|
void | setElideMode (const Qt::TextElideMode &newMode) |
|
Qt::TextElideMode | elideMode () const |
|
| Q_ENUM (ScrollEffect) |
|
ScrollEffect | scrollWheelEffect () const |
|
void | setScrollWheelEffect (ScrollEffect scroll) |
|
virtual QSize | minimumSizeHint () const |
| Reimplemented for internal reasons.
|
|
virtual QSize | sizeHint () const |
| Reimplemented for internal reasons.
|
|
QString | currentUserDataAsString () const |
| Get current item's user data as string.
|
|
|
virtual void | paintEvent (QPaintEvent *event) |
| Reimplemented for internal reasons.
|
|
virtual void | changeEvent (QEvent *event) |
|
virtual void | wheelEvent (QWheelEvent *event) |
|
|
QString | defaultText |
|
QIcon | defaultIcon |
|
bool | forceDefault |
|
Qt::TextElideMode | elideMode |
|
ScrollEffect | scrollWheelEffect |
|
QString | currentUserDataAsString |
| Current item's user data as string (Qt::UserRole role)
|
|
ComboBox 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. ComboBox works exactly the same as QComboBox by default.
- See also
- QComboBox
◆ 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.
|
◆ forceDefault()
void ComboBox::forceDefault |
( |
bool | forceDefault | ) |
|
Force the display of the text/icon at all time (not only when the current index is invalid). False by default.
◆ scrollWheelEffect()
Return the scrollWheelEffect property value.
- See also
- scrollEffect
◆ setElideMode()
void ComboBox::setElideMode |
( |
const Qt::TextElideMode & | newMode | ) |
|
setElideMode can elide the text displayed on the combobox. Qt::ElideNone by default (same behavior as QComboBox)
◆ setScrollWheelEffect()
Set the scrollWheelEffect property value.
- See also
- scrollEffect
◆ sizeHint()
QSize ComboBox::sizeHint |
( |
| ) |
const |
|
virtual |
Reimplemented for internal reasons.
\reimp
This implementation caches the size hint to avoid resizing when the contents change dynamically. To invalidate the cached value change the \l sizeAdjustPolicy.
◆ scrollWheelEffect
This property controls the behavior of the mouse scroll wheel. ScrollOn by default. /sa scrollWheelEffect, setScrollWheelEffect
The documentation for this class was generated from the following files:
- C:/Workspace/itom_development_VS2019_Qt5.15.2_x64/itomProject/itom/itomWidgets/comboBox.h
- C:/Workspace/itom_development_VS2019_Qt5.15.2_x64/itomProject/itom/itomWidgets/comboBox.cpp