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
ctkAddRemoveComboBox Class Reference

#include <Libs/Widgets/ctkAddRemoveComboBox.h>

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

Public Types

typedef QWidget Superclass
 Superclass typedef. More...
 

Public Slots

void setCurrentIndex (int index)
 

Signals

void activated (int index)
 
void currentIndexChanged (int index)
 
void itemAboutToBeRemoved (int index)
 
void itemAdded (int index)
 
void itemRemoved (int index)
 

Public Member Functions

bool addEnabled () const
 
void addItem (const QIcon &icon, const QString &text, const QVariant &userDataVariable=QVariant())
 
void addItem (const QString &text, const QVariant &userDataVariable=QVariant())
 
void addItems (const QStringList &texts)
 
void clear ()
 
bool comboBoxEnabled () const
 
int count () const
 
 ctkAddRemoveComboBox (QWidget *parent=0)
 Constructors. More...
 
QVariant currentData (int role=Qt::UserRole) const
 
int currentIndex () const
 
QString currentText () const
 
bool editEnabled () const
 
bool empty () const
 
QString emptyText () const
 
int findData (const QVariant &data, int role=Qt::UserRole, Qt::MatchFlags flags=Qt::MatchExactly|Qt::MatchCaseSensitive) const
 
int findText (const QString &text, Qt::MatchFlags flags=Qt::MatchExactly|Qt::MatchCaseSensitive) const
 
void insertItem (int index, const QIcon &icon, const QString &text, const QVariant &userDataVariable=QVariant())
 
void insertItem (int index, const QString &text, const QVariant &userDataVariable=QVariant())
 
void insertItems (int index, const QStringList &texts)
 
QVariant itemData (int index, int role=Qt::UserRole) const
 
QString itemText (int index) const
 
virtual void printAdditionalInfo ()
 
void removeCurrentItem ()
 
bool removeEnabled () const
 
void removeItem (int index)
 
void setAddEnabled (bool enable)
 
void setComboBoxEnabled (bool enable)
 
void setEditEnabled (bool enable)
 
void setEmptyText (const QString &text)
 
void setItemData (int index, const QVariant &data, int role=Qt::UserRole)
 
void setItemText (int index, const QString &text)
 
void setRemoveEnabled (bool enable)
 
virtual ~ctkAddRemoveComboBox ()
 

Protected Slots

virtual void onAdd ()
 
virtual void onEdit ()
 
virtual void onRemove ()
 

Protected Member Functions

QAbstractItemModel * model () const
 
int modelColumn () const
 
QModelIndex rootModelIndex () const
 
void setComboBox (QComboBox *comboBox)
 
void setRootModelIndex (const QModelIndex &root)
 

Protected Attributes

QScopedPointer< ctkAddRemoveComboBoxPrivate > d_ptr
 

Properties

bool addEnabled
 
bool editEnabled
 
QString emptyText
 
bool removeEnabled
 

Detailed Description

QComboBox with tool buttons to add/remove entries to the menu list

Definition at line 40 of file ctkAddRemoveComboBox.h.

Member Typedef Documentation

◆ Superclass

Superclass typedef.

Definition at line 50 of file ctkAddRemoveComboBox.h.

Constructor & Destructor Documentation

◆ ctkAddRemoveComboBox()

ctkAddRemoveComboBox::ctkAddRemoveComboBox ( QWidget *  parent = 0)
explicit

Constructors.

◆ ~ctkAddRemoveComboBox()

virtual ctkAddRemoveComboBox::~ctkAddRemoveComboBox ( )
virtual

Member Function Documentation

◆ activated

void ctkAddRemoveComboBox::activated ( int  index)
signal

◆ addEnabled()

bool ctkAddRemoveComboBox::addEnabled ( ) const

◆ addItem() [1/2]

void ctkAddRemoveComboBox::addItem ( const QIcon &  icon,
const QString &  text,
const QVariant &  userDataVariable = QVariant() 
)
inline

Definition at line 84 of file ctkAddRemoveComboBox.h.

◆ addItem() [2/2]

void ctkAddRemoveComboBox::addItem ( const QString &  text,
const QVariant &  userDataVariable = QVariant() 
)
inline

Definition at line 82 of file ctkAddRemoveComboBox.h.

◆ addItems()

void ctkAddRemoveComboBox::addItems ( const QStringList &  texts)
inline

Definition at line 86 of file ctkAddRemoveComboBox.h.

◆ clear()

void ctkAddRemoveComboBox::clear ( )

Remove all the items

◆ comboBoxEnabled()

bool ctkAddRemoveComboBox::comboBoxEnabled ( ) const

◆ count()

int ctkAddRemoveComboBox::count ( ) const

Return the number of item

◆ currentData()

QVariant ctkAddRemoveComboBox::currentData ( int  role = Qt::UserRole) const
inline

Definition at line 116 of file ctkAddRemoveComboBox.h.

◆ currentIndex()

int ctkAddRemoveComboBox::currentIndex ( ) const

Return the current item

◆ currentIndexChanged

void ctkAddRemoveComboBox::currentIndexChanged ( int  index)
signal

◆ currentText()

QString ctkAddRemoveComboBox::currentText ( ) const
inline

Definition at line 114 of file ctkAddRemoveComboBox.h.

◆ editEnabled()

bool ctkAddRemoveComboBox::editEnabled ( ) const

◆ empty()

bool ctkAddRemoveComboBox::empty ( ) const

◆ emptyText()

QString ctkAddRemoveComboBox::emptyText ( ) const

◆ findData()

int ctkAddRemoveComboBox::findData ( const QVariant &  data,
int  role = Qt::UserRole,
Qt::MatchFlags  flags = Qt::MatchExactly|Qt::MatchCaseSensitive 
) const

◆ findText()

int ctkAddRemoveComboBox::findText ( const QString &  text,
Qt::MatchFlags  flags = Qt::MatchExactly|Qt::MatchCaseSensitive 
) const

Returns the index of the item containing the given text; otherwise returns -1. The flags specify how the items in the combobox are searched.

◆ insertItem() [1/2]

void ctkAddRemoveComboBox::insertItem ( int  index,
const QIcon &  icon,
const QString &  text,
const QVariant &  userDataVariable = QVariant() 
)

◆ insertItem() [2/2]

void ctkAddRemoveComboBox::insertItem ( int  index,
const QString &  text,
const QVariant &  userDataVariable = QVariant() 
)

◆ insertItems()

void ctkAddRemoveComboBox::insertItems ( int  index,
const QStringList &  texts 
)

◆ itemAboutToBeRemoved

void ctkAddRemoveComboBox::itemAboutToBeRemoved ( int  index)
signal

◆ itemAdded

void ctkAddRemoveComboBox::itemAdded ( int  index)
signal

This signal is sent after the method 'addItem' has been called programmatically

◆ itemData()

QVariant ctkAddRemoveComboBox::itemData ( int  index,
int  role = Qt::UserRole 
) const

◆ itemRemoved

void ctkAddRemoveComboBox::itemRemoved ( int  index)
signal

◆ itemText()

QString ctkAddRemoveComboBox::itemText ( int  index) const

◆ model()

QAbstractItemModel* ctkAddRemoveComboBox::model ( ) const
protected

◆ modelColumn()

int ctkAddRemoveComboBox::modelColumn ( ) const
protected

◆ onAdd

virtual void ctkAddRemoveComboBox::onAdd ( )
protectedvirtualslot

◆ onEdit

virtual void ctkAddRemoveComboBox::onEdit ( )
protectedvirtualslot

◆ onRemove

virtual void ctkAddRemoveComboBox::onRemove ( )
protectedvirtualslot

◆ printAdditionalInfo()

virtual void ctkAddRemoveComboBox::printAdditionalInfo ( )
virtual

◆ removeCurrentItem()

void ctkAddRemoveComboBox::removeCurrentItem ( )
inline

Definition at line 122 of file ctkAddRemoveComboBox.h.

◆ removeEnabled()

bool ctkAddRemoveComboBox::removeEnabled ( ) const

◆ removeItem()

void ctkAddRemoveComboBox::removeItem ( int  index)

Remove the item currently selected. See signal 'itemRemoved'

◆ rootModelIndex()

QModelIndex ctkAddRemoveComboBox::rootModelIndex ( ) const
protected

◆ setAddEnabled()

void ctkAddRemoveComboBox::setAddEnabled ( bool  enable)

Enable/Disable the add button.

◆ setComboBox()

void ctkAddRemoveComboBox::setComboBox ( QComboBox *  comboBox)
protected

◆ setComboBoxEnabled()

void ctkAddRemoveComboBox::setComboBoxEnabled ( bool  enable)

Enable/Disable the add button.

◆ setCurrentIndex

void ctkAddRemoveComboBox::setCurrentIndex ( int  index)
slot

Select the current index

◆ setEditEnabled()

void ctkAddRemoveComboBox::setEditEnabled ( bool  enable)

Enable/Disable the edit button.

◆ setEmptyText()

void ctkAddRemoveComboBox::setEmptyText ( const QString &  text)

Set text that should be displayed in the comboBox when it is empty

◆ setItemData()

void ctkAddRemoveComboBox::setItemData ( int  index,
const QVariant &  data,
int  role = Qt::UserRole 
)

◆ setItemText()

void ctkAddRemoveComboBox::setItemText ( int  index,
const QString &  text 
)

◆ setRemoveEnabled()

void ctkAddRemoveComboBox::setRemoveEnabled ( bool  enable)

Enable/Disable the add button.

◆ setRootModelIndex()

void ctkAddRemoveComboBox::setRootModelIndex ( const QModelIndex &  root)
protected

Member Data Documentation

◆ d_ptr

QScopedPointer<ctkAddRemoveComboBoxPrivate> ctkAddRemoveComboBox::d_ptr
protected

Definition at line 166 of file ctkAddRemoveComboBox.h.

Property Documentation

◆ addEnabled

bool ctkAddRemoveComboBox::addEnabled
readwrite

Definition at line 1 of file ctkAddRemoveComboBox.h.

◆ editEnabled

bool ctkAddRemoveComboBox::editEnabled
readwrite

Definition at line 1 of file ctkAddRemoveComboBox.h.

◆ emptyText

QString ctkAddRemoveComboBox::emptyText
readwrite

Definition at line 1 of file ctkAddRemoveComboBox.h.

◆ removeEnabled

bool ctkAddRemoveComboBox::removeEnabled
readwrite

Definition at line 1 of file ctkAddRemoveComboBox.h.


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