KDE 4.9 PyKDE API Reference

- KDE's Python API

# KDoubleValidator Class Reference

`from PyKDE4.kdeui import *`

Inherits: QDoubleValidator → QValidator → QObject

## Detailed Description

A locale-aware QDoubleValidator

KDoubleValidator extends QDoubleValidator to be locale-aware. That means that - subject to not being disabled - KLocale.decimalSymbol(), KLocale.thousandsSeparator() and KLocale.positiveSign() and KLocale.negativeSign() are respected.

Author:
  Marc Mutz <mutz@kde.org>

See also:
  KIntValidator

## Methods

| __init__ (self, QObject parent)
| __init__ (self, float bottom, float top, int decimals, QObject parent)
bool | acceptLocalizedNumbers (self)
| setAcceptLocalizedNumbers (self, bool accept)
QValidator::State | validate (self, QString input, int pos)

## Method Documentation

__init__ | ( | self, |
|  | QObject | parent
| ) |  |  |

Constuct a locale-aware KDoubleValidator with default range (whatever QDoubleValidator uses for that) and parent @p parent

__init__ | ( | self, |
|  | float | bottom,
|  | float | top,
|  | int | decimals,
|  | QObject | parent
| ) |  |  |

Constuct a locale-aware KDoubleValidator for range [@p bottom,@p top] and a precision of decimals decimals after the decimal point.

bool acceptLocalizedNumbers | ( |  | self ) |

Returns:
  whether localized numbers are accepted (default: true)

setAcceptLocalizedNumbers | ( | self, |
|  | bool | accept
| ) |  |  |

Sets whether to accept localized numbers (default: true)

QValidator::State validate | ( | self, |
|  | QString | input,
|  | int | pos
| ) |  |  |

Overloaded for internal reasons. The API is not affected.