mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-17 18:09:32 +02: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,
|
||||
// LCL
|
||||
Spin, SysUtils, Controls, Classes, LCLType, LCLProc, LCLIntf, Forms, StdCtrls,
|
||||
//RTL
|
||||
Math,
|
||||
// Widgetset
|
||||
WsProc, WSSpin, WSLCLClasses;
|
||||
|
||||
@ -69,9 +71,16 @@ begin
|
||||
try
|
||||
if ASpinWidget is TQtFloatSpinBox then
|
||||
TQtFloatSpinBox(ASpinWidget).setDecimals(ACustomFloatSpinEdit.DecimalPlaces);
|
||||
|
||||
ASpinWidget.setMinimum(ACustomFloatSpinEdit.MinValue);
|
||||
ASpinWidget.setMaximum(ACustomFloatSpinEdit.MaxValue);
|
||||
if (ACustomFloatSpinEdit.MaxValue > ACustomFloatSpinEdit.MinValue) then
|
||||
begin
|
||||
ASpinWidget.setMinimum(ACustomFloatSpinEdit.MinValue);
|
||||
ASpinWidget.setMaximum(ACustomFloatSpinEdit.MaxValue);
|
||||
end
|
||||
else
|
||||
begin
|
||||
ASpinWidget.setMinimum(-MaxDouble);
|
||||
ASpinWidget.setMaximum(MaxDouble);
|
||||
end;
|
||||
ASpinWidget.setSingleStep(ACustomFloatSpinEdit.Increment);
|
||||
finally
|
||||
ASpinWidget.EndUpdate;
|
||||
|
Loading…
Reference in New Issue
Block a user