itom 2.2.1
MenuComboBox Class Reference

#include <menuComboBox.h>

List of all members.

Public Types

enum  EditableBehavior { NotEditable = 0, Editable, EditableOnFocus, EditableOnPopup }
typedef QWidget Superclass
 Superclass typedef.

Public Slots

void clearActiveAction ()
void setToolButtonStyle (Qt::ToolButtonStyle style)

Signals

void actionChanged (QAction *action)
void popupShown ()

Public Member Functions

 MenuComboBox (QWidget *parent=0)
void setMenu (QMenu *menu)
 Add a menu to the QcomboBox and set a QCompleter.
QMenu * menu () const
void setDefaultText (const QString &)
QString defaultText () const
void setDefaultIcon (const QIcon &)
QIcon defaultIcon () const
void setEditableBehavior (EditableBehavior editBehavior)
EditableBehavior editableBehavior () const
void setSearchIconVisible (bool state)
bool isSearchIconVisible () const
Qt::ToolButtonStyle toolButtonStyle () const
void setMinimumContentsLength (int characters)
QComboBox * menuComboBoxInternal () const
 Return the internal combo box.
QToolButton * toolButtonInternal () const
 Return the internal tool button.
CompletersearchCompleter () const
 Return the internal completer.

Protected Slots

void onActionSelected (QAction *action)
void onEditingFinished ()
 action selected from the line edit or the completer.

Protected Member Functions

virtual bool eventFilter (QObject *target, QEvent *event)

Protected Attributes

QScopedPointer
< MenuComboBoxPrivate
d_ptr

Properties

QString defaultText
QIcon defaultIcon
EditableBehavior editBehavior
bool searchIconVisible
Qt::ToolButtonStyle toolButtonStyle

Private Member Functions

 Q_DECLARE_PRIVATE (MenuComboBox)
 Q_DISABLE_COPY (MenuComboBox)

Detailed Description

QComboBox linked with a QMenu. See MenuComboBox::setMenu() MenuComboBox can be editable, disable, editable on focus or editable on double click. if it is editable : the comboBox is always editable, you can filter the Menu or show it. if it is editable on focus - on double click: the combobox become editable when it has the focus in. So MenuComboBox's purpose is to filter a menu, if you edit the current text or show the menu, if you click on the arrow. if it is disabled : the MenuComboBox has the same behavior as a QPushButton. You can't filter the menu. By default MenuComboBox is not editable with the search icon visible. See MenuComboBox::setEditableType() to change the default behavior. and setIconSearchVisible() to show/hide the icon.


Member Function Documentation

void MenuComboBox::onActionSelected ( QAction *  action) [protected, slot]

Change the current text/icon on the QComboBox And trigger the action. action selected from the menu.

Set the action selected in the combobox.

void MenuComboBox::setMinimumContentsLength ( int  characters)

Set the minimum width of the combobox.

See also:
QComboBox::setMinimumContentsLength()

Property Documentation

QIcon MenuComboBox::defaultIcon [read, write]

This property holds the icon shown on the combobox when the current item (QAction) doesn't have any icon associated. Empty by default

QString MenuComboBox::defaultText [read, write]

This property holds the text shown on the combobox when there is no selected item. Empty by default.

EditableBehavior MenuComboBox::editBehavior [read, write]

This property holds the edit behavior of the combobox, it defines what action is needed to turn the combobox into a search mode where the user can type the name of the item to select using the combobox line edit. MenuComboBox::NotEditable by default

See also:
EditableType
bool MenuComboBox::searchIconVisible [read, write]

This property controls whether the search tool button is visible or hidden. True by default

Qt::ToolButtonStyle MenuComboBox::toolButtonStyle [read, write]

This property holds whether the search tool button displays an icon only, text only, or text beside/below the icon. The default is Qt::ToolButtonIconOnly.

See also:
QToolButton::toolButtonStyle

The documentation for this class was generated from the following files:
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Properties Friends