mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-11-10 05:09:26 +01:00
QT: Fix TFloatSpinEdit not being unconstrained when MinValue = MaxValue.
git-svn-id: trunk@51620 -
This commit is contained in:
parent
49551b7691
commit
0d6dc19e67
@ -28,6 +28,8 @@ uses
|
|||||||
qtwidgets,
|
qtwidgets,
|
||||||
// LCL
|
// LCL
|
||||||
Spin, SysUtils, Controls, Classes, LCLType, LCLProc, LCLIntf, Forms, StdCtrls,
|
Spin, SysUtils, Controls, Classes, LCLType, LCLProc, LCLIntf, Forms, StdCtrls,
|
||||||
|
//RTL
|
||||||
|
Math,
|
||||||
// Widgetset
|
// Widgetset
|
||||||
WsProc, WSSpin, WSLCLClasses;
|
WsProc, WSSpin, WSLCLClasses;
|
||||||
|
|
||||||
@ -69,9 +71,16 @@ begin
|
|||||||
try
|
try
|
||||||
if ASpinWidget is TQtFloatSpinBox then
|
if ASpinWidget is TQtFloatSpinBox then
|
||||||
TQtFloatSpinBox(ASpinWidget).setDecimals(ACustomFloatSpinEdit.DecimalPlaces);
|
TQtFloatSpinBox(ASpinWidget).setDecimals(ACustomFloatSpinEdit.DecimalPlaces);
|
||||||
|
if (ACustomFloatSpinEdit.MaxValue > ACustomFloatSpinEdit.MinValue) then
|
||||||
|
begin
|
||||||
ASpinWidget.setMinimum(ACustomFloatSpinEdit.MinValue);
|
ASpinWidget.setMinimum(ACustomFloatSpinEdit.MinValue);
|
||||||
ASpinWidget.setMaximum(ACustomFloatSpinEdit.MaxValue);
|
ASpinWidget.setMaximum(ACustomFloatSpinEdit.MaxValue);
|
||||||
|
end
|
||||||
|
else
|
||||||
|
begin
|
||||||
|
ASpinWidget.setMinimum(-MaxDouble);
|
||||||
|
ASpinWidget.setMaximum(MaxDouble);
|
||||||
|
end;
|
||||||
ASpinWidget.setSingleStep(ACustomFloatSpinEdit.Increment);
|
ASpinWidget.setSingleStep(ACustomFloatSpinEdit.Increment);
|
||||||
finally
|
finally
|
||||||
ASpinWidget.EndUpdate;
|
ASpinWidget.EndUpdate;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user