![]() |
CTK
0.1.0
The Common Toolkit is a community effort to provide support code for medical image analysis, surgical navigation, and related projects.
|
#include <Libs/Widgets/ctkCrosshairLabel.h>
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 |
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.
typedef QLabel ctkCrosshairLabel::Superclass |
Constructors.
Definition at line 60 of file ctkCrosshairLabel.h.
Enumeration over types of crosshairs.
Enumerator | |
---|---|
SimpleCrosshair | |
BullsEyeCrosshair |
Definition at line 65 of file ctkCrosshairLabel.h.
|
explicit |
|
virtual |
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.
QColor ctkCrosshairLabel::crosshairColor | ( | ) | const |
Temporary: Set/get the crosshair color (via QPen). This will be removed once Qt Designer supports QPen properties.
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.
CrosshairTypes ctkCrosshairLabel::crosshairType | ( | ) | const |
Set/get the crosshair type. Default SimpleCrosshair.
|
virtual |
|
virtual |
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.
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.
|
virtual |
Size hints.
|
protectedvirtual |
void ctkCrosshairLabel::setBullsEyeWidth | ( | int | newWidth | ) |
void ctkCrosshairLabel::setCrosshairColor | ( | const QColor & | newColor | ) |
void ctkCrosshairLabel::setCrosshairPen | ( | const QPen & | newPen | ) |
void ctkCrosshairLabel::setCrosshairType | ( | const CrosshairTypes & | newType | ) |
void ctkCrosshairLabel::setLineWidth | ( | int | newWidth | ) |
void ctkCrosshairLabel::setMarginColor | ( | const QColor & | newColor | ) |
void ctkCrosshairLabel::setShowCrosshair | ( | bool | newShow | ) |
bool ctkCrosshairLabel::showCrosshair | ( | ) | const |
Set/get whether or not to draw the crosshair. Default True.
|
virtual |
|
protected |
Definition at line 121 of file ctkCrosshairLabel.h.
|
readwrite |
Definition at line 1 of file ctkCrosshairLabel.h.
|
readwrite |
Definition at line 1 of file ctkCrosshairLabel.h.
|
readwrite |
Definition at line 1 of file ctkCrosshairLabel.h.
|
readwrite |
Definition at line 1 of file ctkCrosshairLabel.h.
|
readwrite |
Definition at line 1 of file ctkCrosshairLabel.h.
|
readwrite |
Definition at line 1 of file ctkCrosshairLabel.h.
|
readwrite |
Definition at line 1 of file ctkCrosshairLabel.h.