Eneboo - Documentación para desarrolladores
Clases | Tipos públicos | Señales | Métodos públicos | Métodos protegidos | Propiedades
Referencia de la Clase QwtCounter

The Counter Widget. Más...

#include <qwt_counter.h>

Diagrama de herencias de QwtCounter
QWidget QwtDoubleRange QObject QPaintDevice QObject QPaintDevice Qt Qt Qt Qt

Lista de todos los miembros.

Clases

class  PrivateData

Tipos públicos

enum  Button { Button1, Button2, Button3, ButtonCnt }

Señales

void buttonReleased (double value)
void valueChanged (double value)

Métodos públicos

 QwtCounter (QWidget *parent=NULL)
 QwtCounter (QWidget *parent, const char *name)
virtual ~QwtCounter ()
 Destructor.
bool editable () const
void setEditable (bool)
 Allow/disallow the user to manually edit the value.
void setNumButtons (int n)
 Specify the number of buttons on each side of the label.
int numButtons () const
void setIncSteps (QwtCounter::Button btn, int nSteps)
int incSteps (QwtCounter::Button btn) const
virtual void setValue (double)
 Set a new value.
virtual QSize sizeHint () const
 A size hint.
virtual void polish ()
double step () const
 returns the step size
void setStep (double s)
 sets the step size
double minVal () const
 returns the minimum value of the range
void setMinValue (double m)
 sets the minimum value of the range
double maxVal () const
 returns the maximum value of the range
void setMaxValue (double m)
 sets the maximum value of the range
void setStepButton1 (int nSteps)
 set the number of increment steps for button 1
int stepButton1 () const
void setStepButton2 (int nSteps)
 set the number of increment steps for button 2
int stepButton2 () const
void setStepButton3 (int nSteps)
 set the number of increment steps for button 3
int stepButton3 () const
virtual double value () const
 Returns the current value.

Métodos protegidos

virtual bool event (QEvent *)
virtual void wheelEvent (QWheelEvent *)
virtual void keyPressEvent (QKeyEvent *)
virtual void rangeChange ()
 Notify change of range.

Propiedades

int numButtons
double basicstep
double minValue
double maxValue
int stepButton1
 returns the number of increment steps for button 1
int stepButton2
 returns the number of increment steps for button 2
int stepButton3
 returns the number of increment steps for button 3
double value
bool editable
 returns whether the line edit is edatble. (default is yes)

Descripción detallada

The Counter Widget.

A Counter consists of a label displaying a number and one ore more (up to three) push buttons on each side of the label which can be used to increment or decrement the counter's value.

A Counter has a range from a minimum value to a maximum value and a step size. The range can be specified using QwtDblRange::setRange(). The counter's value is an integer multiple of the step size. The number of steps by which a button increments or decrements the value can be specified using QwtCounter::setIncSteps(). The number of buttons can be changed with QwtCounter::setNumButtons().

Holding the space bar down with focus on a button is the fastest method to step through the counter values. When the counter underflows/overflows, the focus is set to the smallest up/down button and counting is disabled. Counting is re-enabled on a button release event (mouse or space bar).

Example:

#include "../include/qwt_counter.h>

QwtCounter *cnt;

cnt = new QwtCounter(parent, name);

cnt->setRange(0.0, 100.0, 1.0);             // From 0.0 to 100, step 1.0
cnt->setNumButtons(2);                      // Two buttons each side
cnt->setIncSteps(QwtCounter::Button1, 1);   // Button 1 increments 1 step
cnt->setIncSteps(QwtCounter::Button2, 20);  // Button 2 increments 20 steps

connect(cnt, SIGNAL(valueChanged(double)), my_class, SLOT(newValue(double)));

Documentación de las enumeraciones miembro de la clase

Button index

Valores de enumeraciones:
Button1 
Button2 
Button3 
ButtonCnt 

Documentación del constructor y destructor

QwtCounter::QwtCounter ( QWidget parent = NULL) [explicit]

The default number of buttons is set to 2. The default increments are:

  • Button 1: 1 step
  • Button 2: 10 steps
  • Button 3: 100 steps
Parámetros:
parent
QwtCounter::QwtCounter ( QWidget parent,
const char *  name 
) [explicit]

The default number of buttons is set to 2. The default increments are:

  • Button 1: 1 step
  • Button 2: 10 steps
  • Button 3: 100 steps
Parámetros:
parent
QwtCounter::~QwtCounter ( ) [virtual]

Destructor.


Documentación de las funciones miembro

void QwtCounter::buttonReleased ( double  value) [signal]

This signal is emitted when a button has been released

Parámetros:
valueThe new value
bool QwtCounter::editable ( ) const
bool QwtCounter::event ( QEvent e) [protected, virtual]

Handle PolishRequest events

Reimplementado de QWidget.

int QwtCounter::incSteps ( QwtCounter::Button  btn) const
Devuelve:
the number of steps by which a specified button increments the value or 0 if the button is invalid.
Parámetros:
btnOne of QwtCounter::Button1, QwtCounter::Button2, QwtCounter::Button3
void QwtCounter::keyPressEvent ( QKeyEvent e) [protected, virtual]

Handles key events

Reimplementado de QWidget.

double QwtCounter::maxVal ( ) const

returns the maximum value of the range

double QwtCounter::minVal ( ) const

returns the minimum value of the range

int QwtCounter::numButtons ( ) const
void QwtCounter::polish ( ) [virtual]

Sets the minimum width for the buttons

Reimplementado de QWidget.

void QwtCounter::rangeChange ( ) [protected, virtual]

Notify change of range.

This function updates the enabled property of all buttons contained in QwtCounter.

Reimplementado de QwtDoubleRange.

void QwtCounter::setEditable ( bool  editable)

Allow/disallow the user to manually edit the value.

Parámetros:
editabletrue enables editing
Ver también:
editable()
void QwtCounter::setIncSteps ( QwtCounter::Button  btn,
int  nSteps 
)

Specify the number of steps by which the value is incremented or decremented when a specified button is pushed.

Parámetros:
btnOne of QwtCounter::Button1, QwtCounter::Button2, QwtCounter::Button3
nStepsNumber of steps
void QwtCounter::setMaxValue ( double  m)

sets the maximum value of the range

void QwtCounter::setMinValue ( double  m)

sets the minimum value of the range

void QwtCounter::setNumButtons ( int  n)

Specify the number of buttons on each side of the label.

Parámetros:
nNumber of buttons
void QwtCounter::setStep ( double  s)

sets the step size

Reimplementado de QwtDoubleRange.

void QwtCounter::setStepButton1 ( int  nSteps)

set the number of increment steps for button 1

void QwtCounter::setStepButton2 ( int  nSteps)

set the number of increment steps for button 2

void QwtCounter::setStepButton3 ( int  nSteps)

set the number of increment steps for button 3

void QwtCounter::setValue ( double  v) [virtual]

Set a new value.

Parámetros:
vnew value Calls QwtDoubleRange::setValue and does all visual updates.
Ver también:
QwtDoubleRange::setValue

Reimplementado de QwtDoubleRange.

QSize QwtCounter::sizeHint ( ) const [virtual]

A size hint.

Reimplementado de QWidget.

double QwtCounter::step ( ) const

returns the step size

Reimplementado de QwtDoubleRange.

int QwtCounter::stepButton1 ( ) const
int QwtCounter::stepButton2 ( ) const
int QwtCounter::stepButton3 ( ) const
virtual double QwtCounter::value ( ) const [virtual]

Returns the current value.

Reimplementado de QwtDoubleRange.

void QwtCounter::valueChanged ( double  value) [signal]

This signal is emitted when the counter's value has changed

Parámetros:
valueThe new value
void QwtCounter::wheelEvent ( QWheelEvent e) [protected, virtual]

This event handler, for event e, can be reimplemented in a subclass to receive wheel events for the widget.

If you reimplement this handler, it is very important that you ignore() the event if you do not handle it, so that the widget's parent can interpret it.

The default implementation ignores the event.

Ver también:
QWheelEvent::ignore(), QWheelEvent::accept(), event(), QWheelEvent

Reimplementado de QWidget.


Documentación de propiedades

double QwtCounter::basicstep [read, write]
bool QwtCounter::editable [read, write]

returns whether the line edit is edatble. (default is yes)

double QwtCounter::maxValue [read, write]
double QwtCounter::minValue [read, write]
int QwtCounter::numButtons [read, write]
Devuelve:
The number of buttons on each side of the widget.
int QwtCounter::stepButton1 [read, write]

returns the number of increment steps for button 1

int QwtCounter::stepButton2 [read, write]

returns the number of increment steps for button 2

int QwtCounter::stepButton3 [read, write]

returns the number of increment steps for button 3

double QwtCounter::value [read, write]

La documentación para esta clase fue generada a partir de los siguientes ficheros:
 Todo Clases Namespaces Archivos Funciones Variables 'typedefs' Enumeraciones Valores de enumeraciones Propiedades Amigas 'defines'