Qt 4.8
Classes | Macros | Functions
qvalidator.cpp File Reference
#include <qdebug.h>
#include "qvalidator.h"
#include "private/qobject_p.h"
#include "private/qlocale_p.h"
#include <limits.h>
#include <math.h>

Go to the source code of this file.

Classes

class  QDoubleValidatorPrivate
 
class  QValidatorPrivate
 

Macros

#define LLONG_MAX   Q_INT64_C(0x7fffffffffffffff)
 

Functions

static int numDigits (qlonglong n)
 
static qlonglong pow10 (int exp)
 

Macro Definition Documentation

◆ LLONG_MAX

#define LLONG_MAX   Q_INT64_C(0x7fffffffffffffff)

Definition at line 686 of file qvalidator.cpp.

Referenced by QDoubleValidatorPrivate::validateWithLocale().

Function Documentation

◆ numDigits()

static int numDigits ( qlonglong  n)
static

Definition at line 385 of file qvalidator.cpp.

Referenced by getSegments(), QSettingsPrivate::iniUnescapedKey(), QTextList::itemText(), and QDoubleValidatorPrivate::validateWithLocale().

386 {
387  if (n == 0)
388  return 1;
389  return (int)log10(double(n)) + 1;
390 }

◆ pow10()

static qlonglong pow10 ( int  exp)
static

Definition at line 392 of file qvalidator.cpp.

Referenced by QDoubleValidatorPrivate::validateWithLocale().

393 {
394  qlonglong result = 1;
395  for (int i = 0; i < exp; ++i)
396  result *= 10;
397  return result;
398 }
qint64 qlonglong
Definition: qglobal.h:951