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

#include <Libs/Widgets/ctkCrosshairLabel.h>

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

Public Types

enum  CrosshairType { SimpleCrosshair = 0 , BullsEyeCrosshair }
 Enumeration over types of crosshairs. More...
 
typedef QLabel Superclass
 Constructors. More...
 

Public Member Functions

int bullsEyeWidth () const
 
QColor crosshairColor () const
 
QPen crosshairPen () const
 
CrosshairTypes crosshairType () const
 Set/get the crosshair type. Default SimpleCrosshair. More...
 
 ctkCrosshairLabel (QWidget *parent=0)
 
virtual bool hasHeightForWidth () const
 
virtual int heightForWidth (int width) const
 
int lineWidth () const
 
QColor marginColor () const
 
virtual QSize minimumSizeHint () const
 Size hints. More...
 
void setBullsEyeWidth (int newWidth)
 
void setCrosshairColor (const QColor &newColor)
 
void setCrosshairPen (const QPen &newPen)
 
void setCrosshairType (const CrosshairTypes &newType)
 
void setLineWidth (int newWidth)
 
void setMarginColor (const QColor &newColor)
 
void setShowCrosshair (bool newShow)
 
bool showCrosshair () const
 Set/get whether or not to draw the crosshair. Default True. More...
 
virtual QSize sizeHint () const
 
virtual ~ctkCrosshairLabel ()
 

Protected Member Functions

virtual void paintEvent (QPaintEvent *event)
 

Protected Attributes

QScopedPointer< ctkCrosshairLabelPrivate > d_ptr
 

Properties

int bullsEyeWidth
 
QColor crosshairColor
 
QPen crosshairPen
 
CrosshairTypes crosshairType
 
int lineWidth
 
QColor marginColor
 
bool showCrosshair
 

Detailed Description

Draws a crosshair onto a QLabel. This widget is designed to be used to show a crosshair overlaid onto an image (the QLabel's pixmap). Since painting must be done in discrete pixels, this widget looks best when the widget size and the crosshair line width are both either even or odd. If using a bulls-eye crosshair, this widget looks best if the crosshair line width and the bullsEyeWidth are both either even or odd.

Definition at line 43 of file ctkCrosshairLabel.h.

Member Typedef Documentation

◆ Superclass

Constructors.

Definition at line 60 of file ctkCrosshairLabel.h.

Member Enumeration Documentation

◆ CrosshairType

Enumeration over types of crosshairs.

Enumerator
SimpleCrosshair 
BullsEyeCrosshair 

Definition at line 65 of file ctkCrosshairLabel.h.

Constructor & Destructor Documentation

◆ ctkCrosshairLabel()

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

◆ ~ctkCrosshairLabel()

virtual ctkCrosshairLabel::~ctkCrosshairLabel ( )
virtual

Member Function Documentation

◆ bullsEyeWidth()

int ctkCrosshairLabel::bullsEyeWidth ( ) const

Set/get the width of the crosshair when in BullsEye mode. Looks best when the BullsEye width and the widget size are both either even or odd, preferably odd. Default 15. Since painting must be done in discrete pixels, this widget looks best if the crosshair pen width and the bullsEyeWidth are both either even or odd.

◆ crosshairColor()

QColor ctkCrosshairLabel::crosshairColor ( ) const

Temporary: Set/get the crosshair color (via QPen). This will be removed once Qt Designer supports QPen properties.

◆ crosshairPen()

QPen ctkCrosshairLabel::crosshairPen ( ) const

Set/get the pen used to draw the crosshair. Default color is from the widget's palette's Highlight role, default width is 0 (which draws at 1 pixel wide regardless of painter transformation). Since painting must be done in discrete pixels, this widget looks best when the widget size and the crosshair pen width are both either even or odd.

◆ crosshairType()

CrosshairTypes ctkCrosshairLabel::crosshairType ( ) const

Set/get the crosshair type. Default SimpleCrosshair.

◆ hasHeightForWidth()

virtual bool ctkCrosshairLabel::hasHeightForWidth ( ) const
virtual

◆ heightForWidth()

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

◆ lineWidth()

int ctkCrosshairLabel::lineWidth ( ) const

Temporary: Set/get the crosshair line width (via QPen). This will be removed once Qt Designer supports QPen properties. Since painting must be done in discrete pixels, this widget looks best when the widget size and the crosshair pen width are both either even or odd.

◆ marginColor()

QColor ctkCrosshairLabel::marginColor ( ) const

Set/get color to set the widget to when not magnifying or when label size is larger than pixmap size. Default is the color from the widget's palette Window role. Note that the Window role is overridden if you set this property. Does not support transparent colors.

◆ minimumSizeHint()

virtual QSize ctkCrosshairLabel::minimumSizeHint ( ) const
virtual

Size hints.

◆ paintEvent()

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

◆ setBullsEyeWidth()

void ctkCrosshairLabel::setBullsEyeWidth ( int  newWidth)

◆ setCrosshairColor()

void ctkCrosshairLabel::setCrosshairColor ( const QColor &  newColor)

◆ setCrosshairPen()

void ctkCrosshairLabel::setCrosshairPen ( const QPen &  newPen)

◆ setCrosshairType()

void ctkCrosshairLabel::setCrosshairType ( const CrosshairTypes &  newType)

◆ setLineWidth()

void ctkCrosshairLabel::setLineWidth ( int  newWidth)

◆ setMarginColor()

void ctkCrosshairLabel::setMarginColor ( const QColor &  newColor)

◆ setShowCrosshair()

void ctkCrosshairLabel::setShowCrosshair ( bool  newShow)

◆ showCrosshair()

bool ctkCrosshairLabel::showCrosshair ( ) const

Set/get whether or not to draw the crosshair. Default True.

◆ sizeHint()

virtual QSize ctkCrosshairLabel::sizeHint ( ) const
virtual

Member Data Documentation

◆ d_ptr

QScopedPointer<ctkCrosshairLabelPrivate> ctkCrosshairLabel::d_ptr
protected

Definition at line 121 of file ctkCrosshairLabel.h.

Property Documentation

◆ bullsEyeWidth

int ctkCrosshairLabel::bullsEyeWidth
readwrite

Definition at line 1 of file ctkCrosshairLabel.h.

◆ crosshairColor

QColor ctkCrosshairLabel::crosshairColor
readwrite

Definition at line 1 of file ctkCrosshairLabel.h.

◆ crosshairPen

QPen ctkCrosshairLabel::crosshairPen
readwrite

Definition at line 1 of file ctkCrosshairLabel.h.

◆ crosshairType

CrosshairTypes ctkCrosshairLabel::crosshairType
readwrite

Definition at line 1 of file ctkCrosshairLabel.h.

◆ lineWidth

int ctkCrosshairLabel::lineWidth
readwrite

Definition at line 1 of file ctkCrosshairLabel.h.

◆ marginColor

QColor ctkCrosshairLabel::marginColor
readwrite

Definition at line 1 of file ctkCrosshairLabel.h.

◆ showCrosshair

bool ctkCrosshairLabel::showCrosshair
readwrite

Definition at line 1 of file ctkCrosshairLabel.h.


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