Vidalia  0.2.21
Public Slots | Signals | Public Member Functions | Protected Member Functions | Properties | Private Attributes | List of all members
VClickLabel Class Reference

#include <VClickLabel.h>

Inheritance diagram for VClickLabel:

Public Slots

void enableFlashing ()
 
void disableFlashing ()
 

Signals

void clicked ()
 

Public Member Functions

 VClickLabel (QWidget *parent=0)
 
virtual QSize sizeHint () const
 
virtual QSize minimumSizeHint () const
 
void setText (const QString &text)
 
void setPixmap (const QPixmap &img)
 
const QString & text () const
 
const QPixmap & pixmap () const
 

Protected Member Functions

virtual void paintEvent (QPaintEvent *e)
 
virtual void mousePressEvent (QMouseEvent *e)
 
virtual void mouseReleaseEvent (QMouseEvent *e)
 

Properties

QString text
 
QPixmap pixmap
 

Private Attributes

QString _text
 
QPixmap _pixmap
 
bool _flashToggle
 
bool _isPressed
 

Detailed Description

Definition at line 25 of file VClickLabel.h.

Constructor & Destructor Documentation

VClickLabel::VClickLabel ( QWidget *  parent = 0)

Default constructor.

Definition at line 23 of file VClickLabel.cpp.

References _flashToggle, and _isPressed.

Member Function Documentation

void VClickLabel::clicked ( )
signal

Emitted when the widget is left-clicked.

Referenced by mouseReleaseEvent().

void VClickLabel::disableFlashing ( )
slot

Disables the background color modification

Definition at line 134 of file VClickLabel.cpp.

References _flashToggle.

void VClickLabel::enableFlashing ( )
slot

Enables painting a different background color for this label

Definition at line 127 of file VClickLabel.cpp.

References _flashToggle.

QSize VClickLabel::minimumSizeHint ( ) const
virtual

Returns the minimum size hint for this widget's current contents.

Definition at line 42 of file VClickLabel.cpp.

References sizeHint().

void VClickLabel::mousePressEvent ( QMouseEvent *  e)
protectedvirtual

Overloaded mouse event to remember click state.

Definition at line 89 of file VClickLabel.cpp.

References _isPressed.

void VClickLabel::mouseReleaseEvent ( QMouseEvent *  e)
protectedvirtual

Overloaded mouse event to catch left mouse button clicks.

Definition at line 100 of file VClickLabel.cpp.

References _isPressed, and clicked().

void VClickLabel::paintEvent ( QPaintEvent *  e)
protectedvirtual

Overloaded paint event to draw a pixmap and a text label.

Definition at line 49 of file VClickLabel.cpp.

References _flashToggle, _isPressed, _pixmap, _text, p(), and vApp.

const QPixmap& VClickLabel::pixmap ( ) const
inline

Definition at line 44 of file VClickLabel.h.

References _pixmap.

Referenced by setPixmap().

void VClickLabel::setPixmap ( const QPixmap &  pixmap)

Sets the widget's image to img.

Definition at line 120 of file VClickLabel.cpp.

References _pixmap, and pixmap().

void VClickLabel::setText ( const QString &  text)

Sets the label text to text.

Definition at line 112 of file VClickLabel.cpp.

References _text, and text().

QSize VClickLabel::sizeHint ( ) const
virtual

Returns the current size hint for this widget's current contents.

Definition at line 33 of file VClickLabel.cpp.

References _pixmap, and _text.

Referenced by minimumSizeHint().

const QString& VClickLabel::text ( ) const
inline

Definition at line 43 of file VClickLabel.h.

References _text.

Referenced by setText().

Member Data Documentation

bool VClickLabel::_flashToggle
private

Bool toggle for flashing the button.

Definition at line 70 of file VClickLabel.h.

Referenced by disableFlashing(), enableFlashing(), paintEvent(), and VClickLabel().

bool VClickLabel::_isPressed
private

Remember if label is currently pressed.

Definition at line 71 of file VClickLabel.h.

Referenced by mousePressEvent(), mouseReleaseEvent(), paintEvent(), and VClickLabel().

QPixmap VClickLabel::_pixmap
private

Image to display in the widget.

Definition at line 69 of file VClickLabel.h.

Referenced by paintEvent(), pixmap(), setPixmap(), and sizeHint().

QString VClickLabel::_text
private

Text label to display in the widget.

Definition at line 68 of file VClickLabel.h.

Referenced by paintEvent(), setText(), sizeHint(), and text().

Property Documentation

QPixmap VClickLabel::pixmap
readwrite

Definition at line 46 of file VClickLabel.h.

QString VClickLabel::text
readwrite

Definition at line 46 of file VClickLabel.h.


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