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

◆ Superclass

typedef QWidget ctkMenuComboBox::Superclass

Superclass typedef.

Definition at line 88 of file ctkMenuComboBox.h.

Member Enumeration Documentation

◆ EditableBehavior

Enumerator
NotEditable 
Editable 
EditableOnFocus 
EditableOnPopup 

Definition at line 80 of file ctkMenuComboBox.h.

Constructor & Destructor Documentation

◆ ctkMenuComboBox()

ctkMenuComboBox::ctkMenuComboBox ( QWidget *  parent = 0)

◆ ~ctkMenuComboBox()

virtual ctkMenuComboBox::~ctkMenuComboBox ( )
virtual

Member Function Documentation

◆ actionChanged

void ctkMenuComboBox::actionChanged ( QAction *  action)
signal

◆ clearActiveAction

void ctkMenuComboBox::clearActiveAction ( )
slot

◆ defaultIcon()

QIcon ctkMenuComboBox::defaultIcon ( ) const

◆ defaultText()

QString ctkMenuComboBox::defaultText ( ) const

◆ editableBehavior()

EditableBehavior ctkMenuComboBox::editableBehavior ( ) const

◆ eventFilter()

virtual bool ctkMenuComboBox::eventFilter ( QObject *  target,
QEvent *  event 
)
protectedvirtual

◆ isSearchIconVisible()

bool ctkMenuComboBox::isSearchIconVisible ( ) const

◆ menu()

QMenu* ctkMenuComboBox::menu ( ) const

◆ menuComboBoxInternal()

QComboBox* ctkMenuComboBox::menuComboBoxInternal ( ) const

Return the internal combo box.

◆ onActionSelected

void ctkMenuComboBox::onActionSelected ( QAction *  action)
protectedslot

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

◆ onEditingFinished

void ctkMenuComboBox::onEditingFinished ( )
protectedslot

action selected from the line edit or the completer.

◆ popupShown

void ctkMenuComboBox::popupShown ( )
signal

◆ searchCompleter()

ctkCompleter* ctkMenuComboBox::searchCompleter ( ) const

Return the internal completer.

◆ setDefaultIcon()

void ctkMenuComboBox::setDefaultIcon ( const QIcon &  )

◆ setDefaultText()

void ctkMenuComboBox::setDefaultText ( const QString &  )

◆ setEditableBehavior()

void ctkMenuComboBox::setEditableBehavior ( EditableBehavior  editBehavior)

◆ setMenu()

void ctkMenuComboBox::setMenu ( QMenu *  menu)

Add a menu to the QcomboBox and set a QCompleter.

◆ setMinimumContentsLength()

void ctkMenuComboBox::setMinimumContentsLength ( int  characters)

Set the minimum width of the combobox.

See also
QComboBox::setMinimumContentsLength()

◆ setSearchIconVisible()

void ctkMenuComboBox::setSearchIconVisible ( bool  state)

◆ setToolButtonStyle

void ctkMenuComboBox::setToolButtonStyle ( Qt::ToolButtonStyle  style)
slot

◆ toolButtonInternal()

QToolButton* ctkMenuComboBox::toolButtonInternal ( ) const

Return the internal tool button.

◆ toolButtonStyle()

Qt::ToolButtonStyle ctkMenuComboBox::toolButtonStyle ( ) const

Member Data Documentation

◆ d_ptr

QScopedPointer<ctkMenuComboBoxPrivate> ctkMenuComboBox::d_ptr
protected

Definition at line 145 of file ctkMenuComboBox.h.

Property Documentation

◆ defaultIcon

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 1 of file ctkMenuComboBox.h.

◆ defaultText

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 1 of file ctkMenuComboBox.h.

◆ editBehavior

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 1 of file ctkMenuComboBox.h.

◆ searchIconVisible

bool ctkMenuComboBox::searchIconVisible
readwrite

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

Definition at line 1 of file ctkMenuComboBox.h.

◆ toolButtonStyle

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 1 of file ctkMenuComboBox.h.


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