![]() |
CTK
0.1.0
The Common Toolkit is a community effort to provide support code for medical image analysis, surgical navigation, and related projects.
|
#include <Libs/Widgets/ctkMenuComboBox.h>
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... | |
ctkCompleter * | searchCompleter () 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 |
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.
typedef QWidget ctkMenuComboBox::Superclass |
Superclass typedef.
Definition at line 88 of file ctkMenuComboBox.h.
Enumerator | |
---|---|
NotEditable | |
Editable | |
EditableOnFocus | |
EditableOnPopup |
Definition at line 80 of file ctkMenuComboBox.h.
ctkMenuComboBox::ctkMenuComboBox | ( | QWidget * | parent = 0 | ) |
|
virtual |
|
signal |
|
slot |
QIcon ctkMenuComboBox::defaultIcon | ( | ) | const |
QString ctkMenuComboBox::defaultText | ( | ) | const |
EditableBehavior ctkMenuComboBox::editableBehavior | ( | ) | const |
|
protectedvirtual |
bool ctkMenuComboBox::isSearchIconVisible | ( | ) | const |
QMenu* ctkMenuComboBox::menu | ( | ) | const |
QComboBox* ctkMenuComboBox::menuComboBoxInternal | ( | ) | const |
Return the internal combo box.
|
protectedslot |
Change the current text/icon on the QComboBox And trigger the action. action selected from the menu.
|
protectedslot |
action selected from the line edit or the completer.
|
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.
void ctkMenuComboBox::setSearchIconVisible | ( | bool | state | ) |
|
slot |
QToolButton* ctkMenuComboBox::toolButtonInternal | ( | ) | const |
Return the internal tool button.
Qt::ToolButtonStyle ctkMenuComboBox::toolButtonStyle | ( | ) | const |
|
protected |
Definition at line 145 of file ctkMenuComboBox.h.
|
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.
|
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.
|
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
Definition at line 1 of file ctkMenuComboBox.h.
|
readwrite |
This property controls whether the search tool button is visible or hidden. True by default
Definition at line 1 of file ctkMenuComboBox.h.
|
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.
Definition at line 1 of file ctkMenuComboBox.h.