[rkward-cvs] rkward/rkward/misc rkspinbox.cpp,1.3,1.4
Thomas Friedrichsmeier
tfry at users.sourceforge.net
Wed Mar 22 19:46:43 UTC 2006
Update of /cvsroot/rkward/rkward/rkward/misc
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7172
Modified Files:
rkspinbox.cpp
Log Message:
yet another small fix to real spinbox
Index: rkspinbox.cpp
===================================================================
RCS file: /cvsroot/rkward/rkward/rkward/misc/rkspinbox.cpp,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** rkspinbox.cpp 22 Mar 2006 18:41:25 -0000 1.3
--- rkspinbox.cpp 22 Mar 2006 19:46:41 -0000 1.4
***************
*** 61,73 ****
RK_DO (qDebug ("min %f max %f initial %f defp %d maxp %d", min, max, initial, default_precision, max_precision), PLUGIN, DL_DEBUG);
- mode = Real;
- QValidator *new_validator = new QDoubleValidator (min, max, max_precision, this);
divisor = (int) (pow (10, max_precision));
- setValidator (new_validator);
- delete validator;
- validator = new_validator;
! int max_max = INT_MAX / divisor;
! int min_min = INT_MIN / divisor;
if (max > max_max) max = max_max;
if (max < min_min) max = min_min;
--- 61,68 ----
RK_DO (qDebug ("min %f max %f initial %f defp %d maxp %d", min, max, initial, default_precision, max_precision), PLUGIN, DL_DEBUG);
divisor = (int) (pow (10, max_precision));
! double max_max = (double) INT_MAX / (double) divisor;
! double min_min = (double) (-(INT_MAX-1)) / (double) divisor;
if (max > max_max) max = max_max;
if (max < min_min) max = min_min;
***************
*** 75,78 ****
--- 70,79 ----
if (min > max_max) min = max_max;
+ mode = Real;
+ QValidator *new_validator = new QDoubleValidator (min, max, max_precision, this);
+ setValidator (new_validator);
+ delete validator;
+ validator = new_validator;
+
setMinValue ((int) (min * divisor));
setMaxValue ((int) (max * divisor));
More information about the rkward-tracker
mailing list