QDoubleSpinBox2 Class Reference

#include <qdoublespinbox2.h>

Inheritance diagram for QDoubleSpinBox2:

QDoubleSpinBox

Public Member Functions

 QDoubleSpinBox2 (QWidget *parent=0)
 ~QDoubleSpinBox2 ()
void setValue (double valor)
QString const text ()
virtual bool eventFilter (QObject *obj, QEvent *event)

Detailed Description

Definition at line 34 of file qdoublespinbox2.h.


Constructor & Destructor Documentation

QDoubleSpinBox2::QDoubleSpinBox2 ( QWidget parent = 0  ) 

Parameters:
parent 

Definition at line 28 of file qdoublespinbox2.cpp.

References _depura().

00028                                                 : QDoubleSpinBox(parent) {
00029     _depura("QDoubleSpinBox2::QDoubleSpinBox2", 0);
00030     installEventFilter(this);
00031     setAlignment(Qt::AlignRight);
00032     setButtonSymbols(QAbstractSpinBox::PlusMinus);
00033     _depura("EDN QDoubleSpinBox2::QDoubleSpinBox2", 0);
00034 }

QDoubleSpinBox2::~QDoubleSpinBox2 (  ) 

Definition at line 40 of file qdoublespinbox2.cpp.

References _depura().

00040                                   {
00041     _depura("QDoubleSpinBox2::~QDoubleSpinBox2", 0);
00042     _depura("END QDoubleSpinBox2::~QDoubleSpinBox2", 0);
00043 }


Member Function Documentation

void QDoubleSpinBox2::setValue ( double  valor  ) 

Parameters:
valor 

Definition at line 62 of file qdoublespinbox2.cpp.

References _depura().

Referenced by QSubForm2BtDelegate::setEditorData(), QSubForm2BfDelegate::setEditorData(), and QSubForm2BcDelegate::setEditorData().

00062                                            {
00063     _depura("QDoubleSpinBox2::setValue", 0);
00064     QDoubleSpinBox::setValue(valor);
00065     _depura("END QDoubleSpinBox2::setValue", 0);
00066 }

QString const QDoubleSpinBox2::text (  ) 

Returns:

Definition at line 49 of file qdoublespinbox2.cpp.

References _depura().

00049                                     {
00050     _depura("QDoubleSpinBox2::text", 0);
00051     QString a = QDoubleSpinBox::text();
00052     //a = a.replace(",", ".");
00053     _depura("END QDoubleSpinBox2::text", 0);
00054     return a;
00055 }

bool QDoubleSpinBox2::eventFilter ( QObject obj,
QEvent *  event 
) [virtual]

Parameters:
obj 
event 
Returns:

Si es una pulsacion o release de tecla se hace la funcionalidad especificada.

Se pone esto para que funcione el teclado numerico la introduccion del 'punto' como separador decimal.

Comprueba que en el texto no haya ya una 'coma'.

Definition at line 74 of file qdoublespinbox2.cpp.

References _depura(), and TRUE.

00074                                                              {
00075     _depura("QDoubleSpinBox2::eventFilter", 0);
00077     if (event->type() == QEvent::KeyPress) {
00078         QKeyEvent *keyEvent = static_cast<QKeyEvent *>(event);
00079         int key = keyEvent->key();
00080         Qt::KeyboardModifiers mod = keyEvent->modifiers();
00081         switch (key) {
00082             case Qt::Key_Period:
00085                 QLineEdit *linea = QAbstractSpinBox::lineEdit();
00087                 QString strLinea = linea->text();
00088                 if (!strLinea.contains(",", Qt::CaseInsensitive)) {
00089                     linea->setText(linea->text() + ",");
00090                 } // end if
00091                 return TRUE;
00092         } // end switch
00093     } // end if
00094     _depura("END QDoubleSpinBox2::eventFilter", 0);
00095     return QDoubleSpinBox::eventFilter(obj, event);
00096 }


The documentation for this class was generated from the following files:
Generated on Sat Dec 15 00:02:10 2007 for BulmaGes by  doxygen 1.5.1