CTK  0.1.0
The Common Toolkit is a community effort to provide support code for medical image analysis, surgical navigation, and related projects.
Public Types | Public Slots | Signals | Public Member Functions | Protected Slots | Protected Member Functions | Protected Attributes | Properties | List of all members
ctkMenuComboBox Class Reference

#include <Libs/Widgets/ctkMenuComboBox.h>

Inheritance diagram for ctkMenuComboBox:
Inheritance graph
[legend]
Collaboration diagram for ctkMenuComboBox:
Collaboration graph
[legend]

Public Types

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

Public Slots

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

Signals

void actionChanged (QAction *action)
 
void popupShown ()
 

Public Member Functions

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

Protected Slots

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

Protected Member Functions

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

Protected Attributes

QScopedPointer< ctkMenuComboBoxPrivate > d_ptr
 

Properties

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

Detailed Description

QComboBox linked with a QMenu. See ctkMenuComboBox::setMenu() ctkMenuComboBox 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 ctkMenuComboBox'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 ctkMenuComboBox has the same behavior as a QPushButton. You can't filter the menu. By default ctkMenuComboBox is not editable with the search icon visible. See ctkmenuComboBox::setEditableType() to change the default behavior. and setIconSearchVisible() to show/hide the icon.

Definition at line 53 of file ctkMenuComboBox.h.

Member Typedef Documentation

typedef QWidget ctkMenuComboBox::Superclass

Superclass typedef.

Definition at line 88 of file ctkMenuComboBox.h.

Member Enumeration Documentation

Enumerator
NotEditable 
Editable 
EditableOnFocus 
EditableOnPopup 

Definition at line 80 of file ctkMenuComboBox.h.

Constructor & Destructor Documentation

ctkMenuComboBox::ctkMenuComboBox ( QWidget *  parent = 0)
virtual ctkMenuComboBox::~ctkMenuComboBox ( )
virtual

Member Function Documentation

void ctkMenuComboBox::actionChanged ( QAction *  action)
signal
void ctkMenuComboBox::clearActiveAction ( )
slot
QIcon ctkMenuComboBox::defaultIcon ( ) const
QString ctkMenuComboBox::defaultText ( ) const
EditableBehavior ctkMenuComboBox::editableBehavior ( ) const
virtual bool ctkMenuComboBox::eventFilter ( QObject *  target,
QEvent *  event 
)
protectedvirtual
bool ctkMenuComboBox::isSearchIconVisible ( ) const
QMenu* ctkMenuComboBox::menu ( ) const
QComboBox* ctkMenuComboBox::menuComboBoxInternal ( ) const

Return the internal combo box.

void ctkMenuComboBox::onActionSelected ( QAction *  action)
protectedslot

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

void ctkMenuComboBox::onEditingFinished ( )
protectedslot

action selected from the line edit or the completer.

void ctkMenuComboBox::popupShown ( )
signal
ctkCompleter* ctkMenuComboBox::searchCompleter ( ) const

Return the internal completer.

void ctkMenuComboBox::setDefaultIcon ( const QIcon &  )
void ctkMenuComboBox::setDefaultText ( const QString &  )
void ctkMenuComboBox::setEditableBehavior ( EditableBehavior  editBehavior)
void ctkMenuComboBox::setMenu ( QMenu *  menu)

Add a menu to the QcomboBox and set a QCompleter.

void ctkMenuComboBox::setMinimumContentsLength ( int  characters)

Set the minimum width of the combobox.

See also
QComboBox::setMinimumContentsLength()
void ctkMenuComboBox::setSearchIconVisible ( bool  state)
void ctkMenuComboBox::setToolButtonStyle ( Qt::ToolButtonStyle  style)
slot
QToolButton* ctkMenuComboBox::toolButtonInternal ( ) const

Return the internal tool button.

Qt::ToolButtonStyle ctkMenuComboBox::toolButtonStyle ( ) const

Member Data Documentation

QScopedPointer<ctkMenuComboBoxPrivate> ctkMenuComboBox::d_ptr
protected

Definition at line 145 of file ctkMenuComboBox.h.

Property Documentation

QIcon ctkMenuComboBox::defaultIcon
readwrite

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

Definition at line 64 of file ctkMenuComboBox.h.

QString ctkMenuComboBox::defaultText
readwrite

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

Definition at line 60 of file ctkMenuComboBox.h.

EditableBehavior ctkMenuComboBox::editBehavior
readwrite

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. ctkMenuComboBox::NotEditable by default

See also
EditableType

Definition at line 70 of file ctkMenuComboBox.h.

bool ctkMenuComboBox::searchIconVisible
readwrite

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

Definition at line 73 of file ctkMenuComboBox.h.

Qt::ToolButtonStyle ctkMenuComboBox::toolButtonStyle
readwrite

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

Definition at line 78 of file ctkMenuComboBox.h.


The documentation for this class was generated from the following file: