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

ctkComboBox is an advanced QComboBox. It adds multiple features: More...

#include <Libs/Widgets/ctkComboBox.h>

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

Public Types

enum  ScrollEffect { NeverScroll , AlwaysScroll , ScrollWithFocus , ScrollWithNoVScrollBar }
 \tbd turn into flags ? More...
 

Public Slots

void setCurrentUserDataAsString (QString userData)
 Set current item based on user data. More...
 

Public Member Functions

 ctkComboBox (QWidget *parent=0)
 Constructor, build a ctkComboBox that behaves like QComboBox. More...
 
QString currentUserDataAsString () const
 Get current item's user data as string. More...
 
QIcon defaultIcon () const
 
QString defaultText () const
 
Qt::TextElideMode elideMode () const
 
void forceDefault (bool forceDefault)
 
bool isDefaultForced () const
 
virtual QSize minimumSizeHint () const
 Reimplemented for internal reasons. More...
 
ScrollEffect scrollWheelEffect () const
 
void setDefaultIcon (const QIcon &)
 Empty by default (same behavior as QComboBox) More...
 
void setDefaultText (const QString &)
 Empty by default (same behavior as QComboBox) More...
 
void setElideMode (const Qt::TextElideMode &newMode)
 
void setScrollWheelEffect (ScrollEffect scroll)
 
virtual QSize sizeHint () const
 Reimplemented for internal reasons. More...
 
virtual ~ctkComboBox ()
 

Protected Member Functions

virtual void changeEvent (QEvent *event)
 
virtual void paintEvent (QPaintEvent *event)
 Reimplemented for internal reasons. More...
 
virtual void wheelEvent (QWheelEvent *event)
 

Protected Attributes

QScopedPointer< ctkComboBoxPrivate > d_ptr
 

Properties

QString currentUserDataAsString
 Current item's user data as string (Qt::UserRole role) More...
 
QIcon defaultIcon
 
QString defaultText
 
Qt::TextElideMode elideMode
 
bool forceDefault
 
ScrollEffect scrollWheelEffect
 

Detailed Description

ctkComboBox is an advanced QComboBox. It adds multiple features:

Definition at line 44 of file ctkComboBox.h.

Member Enumeration Documentation

◆ ScrollEffect

\tbd turn into flags ?

Enumerator
NeverScroll 

Scrolling is not possible with the mouse wheel.

AlwaysScroll 

Scrolling is always possible with the mouse wheel.

ScrollWithFocus 

Scrolling is only possible if the combobox has the focus. The focus policy is automatically set to Qt::StrongFocus

ScrollWithNoVScrollBar 

Scrolling is not possible when the combobox is inside a scroll area with a visible vertical scrollbar.

Definition at line 83 of file ctkComboBox.h.

Constructor & Destructor Documentation

◆ ctkComboBox()

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

Constructor, build a ctkComboBox that behaves like QComboBox.

◆ ~ctkComboBox()

virtual ctkComboBox::~ctkComboBox ( )
virtual

Member Function Documentation

◆ changeEvent()

virtual void ctkComboBox::changeEvent ( QEvent *  event)
protectedvirtual

◆ currentUserDataAsString()

QString ctkComboBox::currentUserDataAsString ( ) const

Get current item's user data as string.

◆ defaultIcon()

QIcon ctkComboBox::defaultIcon ( ) const

◆ defaultText()

QString ctkComboBox::defaultText ( ) const

◆ elideMode()

Qt::TextElideMode ctkComboBox::elideMode ( ) const

◆ forceDefault()

void ctkComboBox::forceDefault ( bool  forceDefault)

Force the display of the text/icon at all time (not only when the current index is invalid). False by default.

◆ isDefaultForced()

bool ctkComboBox::isDefaultForced ( ) const

◆ minimumSizeHint()

virtual QSize ctkComboBox::minimumSizeHint ( ) const
virtual

Reimplemented for internal reasons.

◆ paintEvent()

virtual void ctkComboBox::paintEvent ( QPaintEvent *  event)
protectedvirtual

Reimplemented for internal reasons.

◆ scrollWheelEffect()

ScrollEffect ctkComboBox::scrollWheelEffect ( ) const

Return the scrollWheelEffect property value.

See also
scrollEffect

◆ setCurrentUserDataAsString

void ctkComboBox::setCurrentUserDataAsString ( QString  userData)
slot

Set current item based on user data.

◆ setDefaultIcon()

void ctkComboBox::setDefaultIcon ( const QIcon &  )

Empty by default (same behavior as QComboBox)

◆ setDefaultText()

void ctkComboBox::setDefaultText ( const QString &  )

Empty by default (same behavior as QComboBox)

◆ setElideMode()

void ctkComboBox::setElideMode ( const Qt::TextElideMode &  newMode)

setElideMode can elide the text displayed on the combobox. Qt::ElideNone by default (same behavior as QComboBox)

◆ setScrollWheelEffect()

void ctkComboBox::setScrollWheelEffect ( ScrollEffect  scroll)

Set the scrollWheelEffect property value.

See also
scrollEffect

◆ sizeHint()

virtual QSize ctkComboBox::sizeHint ( ) const
virtual

Reimplemented for internal reasons.

◆ wheelEvent()

virtual void ctkComboBox::wheelEvent ( QWheelEvent *  event)
protectedvirtual

Member Data Documentation

◆ d_ptr

QScopedPointer<ctkComboBoxPrivate> ctkComboBox::d_ptr
protected

Definition at line 122 of file ctkComboBox.h.

Property Documentation

◆ currentUserDataAsString

QString ctkComboBox::currentUserDataAsString
readwrite

Current item's user data as string (Qt::UserRole role)

Definition at line 1 of file ctkComboBox.h.

◆ defaultIcon

QIcon ctkComboBox::defaultIcon
readwrite

Definition at line 1 of file ctkComboBox.h.

◆ defaultText

QString ctkComboBox::defaultText
readwrite

Definition at line 1 of file ctkComboBox.h.

◆ elideMode

Qt::TextElideMode ctkComboBox::elideMode
readwrite

Definition at line 1 of file ctkComboBox.h.

◆ forceDefault

bool ctkComboBox::forceDefault
readwrite

Definition at line 1 of file ctkComboBox.h.

◆ scrollWheelEffect

ScrollEffect ctkComboBox::scrollWheelEffect
readwrite

This property controls the behavior of the mouse scroll wheel. ScrollOn by default. /sa scrollWheelEffect, setScrollWheelEffect

Definition at line 1 of file ctkComboBox.h.


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