[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-core-devel
Subject: [patch] KInputDialog patch for int & double limits
From: Jarosław_Staniek <js () iidea ! pl>
Date: 2006-10-30 8:00:07
Message-ID: 200610300900.08063.js () iidea ! pl
[Download RAW message or body]
Changes: the header is cleaner now.
The patch is a result of the previous discussion about INT_MIN/MAX.
--
regards / pozdrawiam, Jaroslaw Staniek
Sponsored by OpenOffice Polska (http://www.openoffice.com.pl/en) to work on
Kexi & KOffice: http://www.kexi-project.org, http://www.koffice.org
KDE3 & KDE4 Libraries for MS Windows: http://kdelibs.com, http://www.kde.org
["kinputdialog.patch" (text/x-diff)]
Index: kdeui/dialogs/kinputdialog.h
===================================================================
--- kdeui/dialogs/kinputdialog.h (wersja 600283)
+++ kdeui/dialogs/kinputdialog.h (kopia robocza)
@@ -31,6 +31,8 @@
class KListBox;
#include <kdialog.h>
+#include <limits.h>
+#include <float.h>
/**
* The KInputDialog class provides a simple dialog to get a single value
@@ -161,7 +163,7 @@
*/
static int getInteger( const QString &caption, const QString &label,
- int value=0, int minValue=-2147483647, int maxValue=2147483647,
+ int value=0, int minValue=INT_MIN, int maxValue=INT_MAX,
int step=1, int base=10, bool *ok=0, QWidget *parent=0 );
/**
@@ -169,7 +171,7 @@
* above except it assumes base to be 10, i.e. accepts decimal numbers.
*/
static int getInteger( const QString &caption, const QString &label,
- int value=0, int minValue=-2147483647, int maxValue=2147483647,
+ int value=0, int minValue=INT_MIN, int maxValue=INT_MAX,
int step=1, bool *ok=0, QWidget *parent=0 );
/**
@@ -195,8 +197,8 @@
* @return Number user entered if Ok was pressed, else 0
*/
static double getDouble( const QString &caption, const QString &label,
- double value=0, double minValue=-2147483647,
- double maxValue=2147483647, double step=0.1, int decimals=1,
+ double value=0, double minValue=-DBL_MAX,
+ double maxValue=DBL_MAX, double step=0.1, int decimals=1,
bool *ok=0, QWidget *parent=0 );
/**
@@ -204,8 +206,8 @@
* the above function.
*/
static double getDouble( const QString &caption, const QString &label,
- double value=0, double minValue=-2147483647,
- double maxValue=2147483647, int decimals=1, bool *ok=0,
+ double value=0, double minValue=-DBL_MAX,
+ double maxValue=DBL_MAX, int decimals=1, bool *ok=0,
QWidget *parent=0 );
/**
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic