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 Member Functions | Protected Slots | Protected Member Functions | Protected Attributes | Properties | List of all members
ctkSearchBox Class Reference

#include <Libs/Widgets/ctkSearchBox.h>

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

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
 

Detailed Description

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.

Member Typedef Documentation

◆ Superclass

typedef QLineEdit ctkSearchBox::Superclass

Superclass typedef.

Definition at line 68 of file ctkSearchBox.h.

Constructor & Destructor Documentation

◆ ctkSearchBox()

ctkSearchBox::ctkSearchBox ( QWidget *  parent = 0)

◆ ~ctkSearchBox()

virtual ctkSearchBox::~ctkSearchBox ( )
virtual

Member Function Documentation

◆ alwaysShowClearIcon()

bool ctkSearchBox::alwaysShowClearIcon ( ) const

◆ clearIcon()

QIcon ctkSearchBox::clearIcon ( ) const

Get the current clear icon.

◆ mouseMoveEvent()

virtual void ctkSearchBox::mouseMoveEvent ( QMouseEvent *  event)
protectedvirtual

◆ mousePressEvent()

virtual void ctkSearchBox::mousePressEvent ( QMouseEvent *  event)
protectedvirtual

◆ paintEvent()

virtual void ctkSearchBox::paintEvent ( QPaintEvent *  )
protectedvirtual

◆ placeholderText()

QString ctkSearchBox::placeholderText ( ) const

◆ resizeEvent()

virtual void ctkSearchBox::resizeEvent ( QResizeEvent *  event)
protectedvirtual

◆ searchIcon()

QIcon ctkSearchBox::searchIcon ( ) const

Get the current search icon.

◆ setAlwaysShowClearIcon()

void ctkSearchBox::setAlwaysShowClearIcon ( bool  show)

False by default.

◆ setClearIcon()

void ctkSearchBox::setClearIcon ( const QIcon &  icon)

Set the clear icon.

◆ setPlaceholderText()

void ctkSearchBox::setPlaceholderText ( const QString &  defaultText)

◆ setSearchIcon()

void ctkSearchBox::setSearchIcon ( const QIcon &  icon)

Set the search icon.

◆ setShowSearchIcon()

void ctkSearchBox::setShowSearchIcon ( bool  show)

False by default.

◆ showSearchIcon()

bool ctkSearchBox::showSearchIcon ( ) const

◆ updateClearButtonState

void ctkSearchBox::updateClearButtonState ( )
protectedslot

Change the clear icon's state to enabled or disabled.

Member Data Documentation

◆ d_ptr

QScopedPointer<ctkSearchBoxPrivate> ctkSearchBox::d_ptr
protected

Definition at line 105 of file ctkSearchBox.h.

Property Documentation

◆ clearIcon

QIcon ctkSearchBox::clearIcon
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.

◆ placeholderText

QString ctkSearchBox::placeholderText
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.

◆ searchIcon

QIcon ctkSearchBox::searchIcon
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.

◆ showSearchIcon

bool ctkSearchBox::showSearchIcon
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.


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