KDE 4.7 PyKDE API Reference

- KDE's Python API

# KIntValidator Class Reference

`from PyKDE4.kdeui import *`

Inherits: QValidator → QObject

## Detailed Description

QValidator for integers.

This can be used by QLineEdit or subclass to provide validated text entry. Can be provided with a base value (default is 10), to allow the proper entry of hexadecimal, octal, or any other base numeric data.

Author:
  Glen Parker <glenebob@nwlink.com>

Version: 0.0.1

## Methods

| __init__ (self, QWidget parent, int base=10)
| __init__ (self, int bottom, int top, QWidget parent, int base=10)
int | base (self)
int | bottom (self)
| fixup (self, QString a0)
| setBase (self, int base)
| setRange (self, int bottom, int top)
int | top (self)
QValidator::State | validate (self, QString a0, int a1)

## Method Documentation

__init__ | ( | self, |
|  | QWidget | parent,
|  | int | base=10
| ) |  |  |

Constructor. Also sets the base value.

__init__ | ( | self, |
|  | int | bottom,
|  | int | top,
|  | QWidget | parent,
|  | int | base=10
| ) |  |  |

Constructor. Also sets the minimum, maximum, and numeric base values.

int base | ( |  | self ) |

Returns the current numeric base.

int bottom | ( |  | self ) |

Returns the current minimum value allowed.

fixup | ( | self, |
|  | QString | a0
| ) |  |  |

Fixes the text if possible, providing a valid string. The parameter may be modified.

setBase | ( | self, |
|  | int | base
| ) |  |  |

Sets the numeric base value. base must be between 2 and 36.

setRange | ( | self, |
|  | int | bottom,
|  | int | top
| ) |  |  |

Sets the minimum and maximum values allowed. If top is greater than bottom, it is set to the value of bottom.

int top | ( |  | self ) |

Returns the current maximum value allowed.

QValidator::State validate | ( | self, |
|  | QString | a0,
|  | int | a1
| ) |  |  |

Validates the text, and return the result. Does not modify the parameters.