itom 2.2.0
|
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. More...
#include <comboBox.h>
Public Types | |
enum | ScrollEffect { NeverScroll, AlwaysScroll, ScrollWithFocus, ScrollWithNoVScrollBar } |
turn into flags ? More... | |
Public Member Functions | |
Q_ENUMS (ScrollEffect) | |
ComboBox (QWidget *parent=0) | |
Constructor, build a ComboBox that behave 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 |
ScrollEffect | scrollWheelEffect () const |
void | setScrollWheelEffect (ScrollEffect scroll) |
virtual QSize | minimumSizeHint () const |
Reimplemented for internal reasons. | |
virtual QSize | sizeHint () const |
Reimplemented for internal reasons. | |
Protected Member Functions | |
virtual void | paintEvent (QPaintEvent *event) |
Reimplemented for internal reasons. | |
virtual void | changeEvent (QEvent *event) |
virtual void | wheelEvent (QWheelEvent *event) |
Protected Attributes | |
QScopedPointer< ComboBoxPrivate > | d_ptr |
Properties | |
QString | defaultText |
QIcon | defaultIcon |
bool | forceDefault |
Qt::TextElideMode | elideMode |
ScrollEffect | scrollWheelEffect |
Private Member Functions | |
Q_DECLARE_PRIVATE (ComboBox) | |
Q_DISABLE_COPY (ComboBox) |
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.
turn into flags ?
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.
ScrollEffect ComboBox::scrollWheelEffect | ( | ) | const |
Return the scrollWheelEffect property value.
void ComboBox::setElideMode | ( | const Qt::TextElideMode & | newMode | ) |
setElideMode can elide the text displayed on the combobox. Qt::ElideNone by default (same behavior as QComboBox)
void ComboBox::setScrollWheelEffect | ( | ComboBox::ScrollEffect | scroll | ) |
Set the scrollWheelEffect property value.
QSize ComboBox::sizeHint | ( | ) | const [virtual] |
Reimplemented for internal reasons.
This implementation caches the size hint to avoid resizing when the contents change dynamically. To invalidate the cached value change the sizeAdjustPolicy.
ComboBox::ScrollEffect ComboBox::scrollWheelEffect [read, write] |
This property controls the behavior of the mouse scroll wheel. ScrollOn by default. /sa scrollWheelEffect, setScrollWheelEffect