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

◆ Superclass

Definition at line 63 of file ctkThumbnailLabel.h.

Constructor & Destructor Documentation

◆ ctkThumbnailLabel()

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

◆ ~ctkThumbnailLabel()

virtual ctkThumbnailLabel::~ctkThumbnailLabel ( )
virtual

Member Function Documentation

◆ doubleClicked

void ctkThumbnailLabel::doubleClicked ( const ctkThumbnailLabel widget)
signal

◆ heightForWidth()

virtual int ctkThumbnailLabel::heightForWidth ( int  width) const
virtual

◆ isSelected()

bool ctkThumbnailLabel::isSelected ( ) const

◆ minimumSizeHint()

virtual QSize ctkThumbnailLabel::minimumSizeHint ( ) const
virtual

◆ mouseDoubleClickEvent()

virtual void ctkThumbnailLabel::mouseDoubleClickEvent ( QMouseEvent *  event)
protectedvirtual

◆ mousePressEvent()

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

◆ paintEvent()

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

◆ pixmap()

const QPixmap* ctkThumbnailLabel::pixmap ( ) const

◆ resizeEvent()

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

◆ selected

void ctkThumbnailLabel::selected ( const ctkThumbnailLabel widget)
signal

◆ selectedColor()

QColor ctkThumbnailLabel::selectedColor ( ) const

◆ setPixmap()

void ctkThumbnailLabel::setPixmap ( const QPixmap &  pixmap)

◆ setSelected()

void ctkThumbnailLabel::setSelected ( bool  selected)

◆ setSelectedColor()

void ctkThumbnailLabel::setSelectedColor ( const QColor &  color)

◆ setText()

void ctkThumbnailLabel::setText ( const QString &  text)

◆ setTextPosition()

void ctkThumbnailLabel::setTextPosition ( const Qt::Alignment &  alignment)

◆ setTransformationMode()

void ctkThumbnailLabel::setTransformationMode ( Qt::TransformationMode  mode)

◆ sizeHint()

virtual QSize ctkThumbnailLabel::sizeHint ( ) const
virtual

◆ text()

QString ctkThumbnailLabel::text ( ) const

◆ textPosition()

Qt::Alignment ctkThumbnailLabel::textPosition ( ) const

◆ transformationMode()

Qt::TransformationMode ctkThumbnailLabel::transformationMode ( ) const

Member Data Documentation

◆ d_ptr

QScopedPointer<ctkThumbnailLabelPrivate> ctkThumbnailLabel::d_ptr
protected

Definition at line 90 of file ctkThumbnailLabel.h.

Property Documentation

◆ pixmap

QPixmap ctkThumbnailLabel::pixmap
readwrite

Optional pixmap for the label. No pixmap by default

Definition at line 1 of file ctkThumbnailLabel.h.

◆ selected

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 1 of file ctkThumbnailLabel.h.

◆ selectedColor

QColor ctkThumbnailLabel::selectedColor
readwrite

Color of the selected rectangle. Palette highlight color by default

Definition at line 1 of file ctkThumbnailLabel.h.

◆ text

QString ctkThumbnailLabel::text
readwrite

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

Definition at line 1 of file ctkThumbnailLabel.h.

◆ textPosition

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 1 of file ctkThumbnailLabel.h.

◆ transformationMode

Qt::TransformationMode ctkThumbnailLabel::transformationMode
readwrite

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

Definition at line 1 of file ctkThumbnailLabel.h.


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