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

#include <Libs/Widgets/ctkThumbnailLabel.h>

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

Public Types

typedef QWidget Superclass
 

Signals

void doubleClicked (const ctkThumbnailLabel &widget)
 
void selected (const ctkThumbnailLabel &widget)
 

Public Member Functions

 ctkThumbnailLabel (QWidget *parent=0)
 
virtual int heightForWidth (int width) const
 
bool isSelected () const
 
virtual QSize minimumSizeHint () const
 
const QPixmap * pixmap () const
 
QColor selectedColor () const
 
void setPixmap (const QPixmap &pixmap)
 
void setSelected (bool selected)
 
void setSelectedColor (const QColor &color)
 
void setText (const QString &text)
 
void setTextPosition (const Qt::Alignment &alignment)
 
void setTransformationMode (Qt::TransformationMode mode)
 
virtual QSize sizeHint () const
 
QString text () const
 
Qt::Alignment textPosition () const
 
Qt::TransformationMode transformationMode () const
 
virtual ~ctkThumbnailLabel ()
 

Protected Member Functions

virtual void mouseDoubleClickEvent (QMouseEvent *event)
 
virtual void mousePressEvent (QMouseEvent *event)
 
virtual void paintEvent (QPaintEvent *event)
 
virtual void resizeEvent (QResizeEvent *event)
 

Protected Attributes

QScopedPointer< ctkThumbnailLabelPrivate > d_ptr
 

Properties

QPixmap pixmap
 
bool selected
 
QColor selectedColor
 
QString text
 
Qt::Alignment textPosition
 
Qt::TransformationMode transformationMode
 

Detailed Description

ctkThumbnailLabel is an advanced label that gives control over the pixmap size and text location. If a pixmap is set, it is resized to fit the available space but its original width/height ratio is always respected. The widget can be selected or not (a rectangle is drawn around)

Definition at line 38 of file ctkThumbnailLabel.h.

Member Typedef Documentation

Definition at line 63 of file ctkThumbnailLabel.h.

Constructor & Destructor Documentation

ctkThumbnailLabel::ctkThumbnailLabel ( QWidget *  parent = 0)
explicit
virtual ctkThumbnailLabel::~ctkThumbnailLabel ( )
virtual

Member Function Documentation

void ctkThumbnailLabel::doubleClicked ( const ctkThumbnailLabel widget)
signal
virtual int ctkThumbnailLabel::heightForWidth ( int  width) const
virtual
bool ctkThumbnailLabel::isSelected ( ) const
virtual QSize ctkThumbnailLabel::minimumSizeHint ( ) const
virtual
virtual void ctkThumbnailLabel::mouseDoubleClickEvent ( QMouseEvent *  event)
protectedvirtual
virtual void ctkThumbnailLabel::mousePressEvent ( QMouseEvent *  event)
protectedvirtual
virtual void ctkThumbnailLabel::paintEvent ( QPaintEvent *  event)
protectedvirtual
const QPixmap* ctkThumbnailLabel::pixmap ( ) const
virtual void ctkThumbnailLabel::resizeEvent ( QResizeEvent *  event)
protectedvirtual
void ctkThumbnailLabel::selected ( const ctkThumbnailLabel widget)
signal
QColor ctkThumbnailLabel::selectedColor ( ) const
void ctkThumbnailLabel::setPixmap ( const QPixmap &  pixmap)
void ctkThumbnailLabel::setSelected ( bool  selected)
void ctkThumbnailLabel::setSelectedColor ( const QColor &  color)
void ctkThumbnailLabel::setText ( const QString &  text)
void ctkThumbnailLabel::setTextPosition ( const Qt::Alignment &  alignment)
void ctkThumbnailLabel::setTransformationMode ( Qt::TransformationMode  mode)
virtual QSize ctkThumbnailLabel::sizeHint ( ) const
virtual
QString ctkThumbnailLabel::text ( ) const
Qt::Alignment ctkThumbnailLabel::textPosition ( ) const
Qt::TransformationMode ctkThumbnailLabel::transformationMode ( ) const

Member Data Documentation

QScopedPointer<ctkThumbnailLabelPrivate> ctkThumbnailLabel::d_ptr
protected

Definition at line 90 of file ctkThumbnailLabel.h.

Property Documentation

QPixmap ctkThumbnailLabel::pixmap
readwrite

Optional pixmap for the label. No pixmap by default

Definition at line 51 of file ctkThumbnailLabel.h.

bool ctkThumbnailLabel::selected
readwrite

Control whether or not the label is selected. When selected, a rectangle is drawn around the widget with the selectedColor color. Not selected by default

Definition at line 58 of file ctkThumbnailLabel.h.

QColor ctkThumbnailLabel::selectedColor
readwrite

Color of the selected rectangle. Palette highlight color by default

Definition at line 61 of file ctkThumbnailLabel.h.

QString ctkThumbnailLabel::text
readwrite

If the text is empty, the space allocated for the text is hidden Empty by default

Definition at line 43 of file ctkThumbnailLabel.h.

Qt::Alignment ctkThumbnailLabel::textPosition
readwrite

Position of the text relative to the pixmap. Qt::AlignTop | Qt::AlignHCenter by default. For now, if the alignment is HCenter|VCenter (same location than the pixmap), no text is shown.

Definition at line 48 of file ctkThumbnailLabel.h.

Qt::TransformationMode ctkThumbnailLabel::transformationMode
readwrite

Controls the quality of the resizing of the pixmap. Qt::FastTransformation by default

Definition at line 54 of file ctkThumbnailLabel.h.


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