![]() |
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/ctkSearchBox.h>
Public Types | |
typedef QLineEdit | Superclass |
Superclass typedef. More... | |
Public Member Functions | |
bool | alwaysShowClearIcon () const |
QIcon | clearIcon () const |
Get the current clear icon. More... | |
ctkSearchBox (QWidget *parent=0) | |
QString | placeholderText () const |
QIcon | searchIcon () const |
Get the current search icon. More... | |
void | setAlwaysShowClearIcon (bool show) |
False by default. More... | |
void | setClearIcon (const QIcon &icon) |
Set the clear icon. More... | |
void | setPlaceholderText (const QString &defaultText) |
void | setSearchIcon (const QIcon &icon) |
Set the search icon. More... | |
void | setShowSearchIcon (bool show) |
False by default. More... | |
bool | showSearchIcon () const |
virtual | ~ctkSearchBox () |
Protected Slots | |
void | updateClearButtonState () |
Change the clear icon's state to enabled or disabled. More... | |
Protected Member Functions | |
virtual void | mouseMoveEvent (QMouseEvent *event) |
virtual void | mousePressEvent (QMouseEvent *event) |
virtual void | paintEvent (QPaintEvent *) |
virtual void | resizeEvent (QResizeEvent *event) |
Protected Attributes | |
QScopedPointer< ctkSearchBoxPrivate > | d_ptr |
Properties | |
QIcon | clearIcon |
QString | placeholderText |
QIcon | searchIcon |
bool | showSearchIcon |
QLineEdit with two QIcons on each side: search and clear. "Search" selects all the text "Clear" clears the current text See QLineEdit::text to set/get the current text. ctkSearchBox's purpose is to be used to filter other widgets. e.g.: ctkSearchBox searchBox; QSortFilterProxyModel filterModel; QObject::connect(&searchBox, SIGNAL(textChanged(QString)), &filterModel, SLOT(setFilterFixedString(QString))); ...
Definition at line 47 of file ctkSearchBox.h.
typedef QLineEdit ctkSearchBox::Superclass |
Superclass typedef.
Definition at line 68 of file ctkSearchBox.h.
ctkSearchBox::ctkSearchBox | ( | QWidget * | parent = 0 | ) |
|
virtual |
bool ctkSearchBox::alwaysShowClearIcon | ( | ) | const |
QIcon ctkSearchBox::clearIcon | ( | ) | const |
Get the current clear icon.
|
protectedvirtual |
|
protectedvirtual |
|
protectedvirtual |
QString ctkSearchBox::placeholderText | ( | ) | const |
|
protectedvirtual |
QIcon ctkSearchBox::searchIcon | ( | ) | const |
Get the current search icon.
void ctkSearchBox::setAlwaysShowClearIcon | ( | bool | show | ) |
False by default.
void ctkSearchBox::setClearIcon | ( | const QIcon & | icon | ) |
Set the clear icon.
void ctkSearchBox::setPlaceholderText | ( | const QString & | defaultText | ) |
void ctkSearchBox::setSearchIcon | ( | const QIcon & | icon | ) |
Set the search icon.
void ctkSearchBox::setShowSearchIcon | ( | bool | show | ) |
False by default.
bool ctkSearchBox::showSearchIcon | ( | ) | const |
|
protectedslot |
Change the clear icon's state to enabled or disabled.
|
protected |
Definition at line 105 of file ctkSearchBox.h.
|
readwrite |
The QIcon to use for the clear icon. The default is a round grey button with a white cross.
Definition at line 1 of file ctkSearchBox.h.
|
readwrite |
Qt < 4.7 don't have a placeholderText property, as we need it, we define it manually.
Definition at line 1 of file ctkSearchBox.h.
|
readwrite |
The QIcon to use for the search icon at the left. The default is a magnifying glass icon.
Definition at line 1 of file ctkSearchBox.h.
|
readwrite |
Show an icon at left side of the line edit, indicating that the text field is used to search/filter something. The default is false
.
Definition at line 1 of file ctkSearchBox.h.