Qt 4.8
Public Functions | Public Variables | List of all members
QDoubleValidatorPrivate Class Reference
Inheritance diagram for QDoubleValidatorPrivate:
QValidatorPrivate QObjectPrivate QObjectData

Public Functions

 QDoubleValidatorPrivate ()
 
QValidator::State validateWithLocale (QString &input, QLocalePrivate::NumberMode numMode, const QLocale &locale) const
 
- Public Functions inherited from QValidatorPrivate
 QValidatorPrivate ()
 
- Public Functions inherited from QObjectPrivate
void _q_reregisterTimers (void *pointer)
 
void addConnection (int signal, Connection *c)
 
void cleanConnectionLists ()
 
void connectNotify (const char *signal)
 
void deleteChildren ()
 
void disconnectNotify (const char *signal)
 
bool isSender (const QObject *receiver, const char *signal) const
 
bool isSignalConnected (uint signalIdx) const
 Returns true if the signal with index signal_index from object sender is connected. More...
 
void moveToThread_helper ()
 
 QObjectPrivate (int version=QObjectPrivateVersion)
 
QObjectList receiverList (const char *signal) const
 
QObjectList senderList () const
 
void setParent_helper (QObject *)
 
void setThreadData_helper (QThreadData *currentData, QThreadData *targetData)
 
int signalIndex (const char *signalName) const
 Returns the signal index used in the internal connectionLists vector. More...
 
virtual ~QObjectPrivate ()
 
- Public Functions inherited from QObjectData
virtual ~QObjectData ()=0
 

Public Variables

QDoubleValidator::Notation notation
 
- Public Variables inherited from QValidatorPrivate
QLocale locale
 
- Public Variables inherited from QObjectPrivate
union {
   QObject *   currentChildBeingDeleted
 
   QAbstractDeclarativeData *   declarativeData
 
}; 
 
quint32 connectedSignals [2]
 
QObjectConnectionListVectorconnectionLists
 
SendercurrentSender
 
QList< QPointer< QObject > > eventFilters
 
ExtraDataextraData
 
QString objectName
 
Connectionsenders
 
QAtomicPointer< QtSharedPointer::ExternalRefCountData > sharedRefcount
 
QThreadDatathreadData
 
void * unused
 
- Public Variables inherited from QObjectData
uint blockSig: 1
 
QObjectList children
 
uint hasGuards: 1
 
uint inEventHandler: 1
 
uint inThreadChangeEvent: 1
 
uint isWidget: 1
 
QMetaObjectmetaObject
 
uint ownObjectName: 1
 
QObjectparent
 
uint pendTimer: 1
 
int postedEvents
 
QObjectq_ptr
 
uint receiveChildEvents: 1
 
uint sendChildEvents: 1
 
uint unused: 22
 
uint wasDeleted: 1
 

Additional Inherited Members

- Public Types inherited from QObjectPrivate
typedef void(* StaticMetaCallFunction) (QObject *, QMetaObject::Call, int, void **)
 
- Static Public Functions inherited from QObjectPrivate
static void clearGuards (QObject *)
 
static QObjectPrivateget (QObject *o)
 
static void resetCurrentSender (QObject *receiver, Sender *currentSender, Sender *previousSender)
 
static SendersetCurrentSender (QObject *receiver, Sender *sender)
 
static void signalSignature (const QMetaMethod &signal, QVarLengthArray< char > *result)
 

Detailed Description

Definition at line 520 of file qvalidator.cpp.

Constructors and Destructors

◆ QDoubleValidatorPrivate()

QDoubleValidatorPrivate::QDoubleValidatorPrivate ( )
inline

Definition at line 524 of file qvalidator.cpp.

Functions

◆ validateWithLocale()

QValidator::State QDoubleValidatorPrivate::validateWithLocale ( QString input,
QLocalePrivate::NumberMode  numMode,
const QLocale locale 
) const

Definition at line 710 of file qvalidator.cpp.

711 {
712  Q_Q(const QDoubleValidator);
713  QByteArray buff;
714  if (!locale.d()->validateChars(input, numMode, &buff, q->dec))
715  return QValidator::Invalid;
716 
717  if (buff.isEmpty())
719 
720  if (q->b >= 0 && buff.startsWith('-'))
721  return QValidator::Invalid;
722 
723  if (q->t < 0 && buff.startsWith('+'))
724  return QValidator::Invalid;
725 
726  bool ok, overflow;
727  double i = QLocalePrivate::bytearrayToDouble(buff.constData(), &ok, &overflow);
728  if (overflow)
729  return QValidator::Invalid;
730  if (!ok)
732 
733  if (i >= q->b && i <= q->t)
734  return QValidator::Acceptable;
735 
737  double max = qMax(qAbs(q->b), qAbs(q->t));
738  if (max < LLONG_MAX) {
739  qlonglong n = pow10(numDigits(qlonglong(max))) - 1;
740  if (qAbs(i) > n)
741  return QValidator::Invalid;
742  }
743  }
744 
746 }
The QByteArray class provides an array of bytes.
Definition: qbytearray.h:135
static double bytearrayToDouble(const char *num, bool *ok, bool *overflow=0)
Definition: qlocale.cpp:3134
Q_DECL_CONSTEXPR T qAbs(const T &t)
Definition: qglobal.h:1201
bool startsWith(const QByteArray &a) const
Returns true if this byte array starts with byte array ba; otherwise returns false.
Q_DECL_CONSTEXPR const T & qMax(const T &a, const T &b)
Definition: qglobal.h:1217
#define Q_Q(Class)
Definition: qglobal.h:2483
QDoubleValidator::Notation notation
Definition: qvalidator.cpp:530
static int numDigits(qlonglong n)
Definition: qvalidator.cpp:385
#define LLONG_MAX
Definition: qvalidator.cpp:686
const char * constData() const
Returns a pointer to the data stored in the byte array.
Definition: qbytearray.h:433
const QLocalePrivate * d() const
Definition: qlocale.cpp:761
static qlonglong pow10(int exp)
Definition: qvalidator.cpp:392
bool validateChars(const QString &str, NumberMode numMode, QByteArray *buff, int decDigits=-1) const
Definition: qlocale.cpp:2999
bool isEmpty() const
Returns true if the byte array has size 0; otherwise returns false.
Definition: qbytearray.h:421
qint64 qlonglong
Definition: qglobal.h:951
The QDoubleValidator class provides range checking of floating-point numbers.
Definition: qvalidator.h:134

Properties

◆ notation

QDoubleValidator::Notation QDoubleValidatorPrivate::notation

Definition at line 530 of file qvalidator.cpp.


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