mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-18 07:19:22 +02:00
T(Float)SpinEdit: QT(4): fix not obeying the value of EditorEnabled if ReadOnly is set to False
git-svn-id: trunk@65015 -
This commit is contained in:
parent
694d81628d
commit
52e1881c23
@ -51,6 +51,7 @@ type
|
|||||||
class procedure SetAlignment(const ACustomEdit: TCustomEdit; const AAlignment: TAlignment); override;
|
class procedure SetAlignment(const ACustomEdit: TCustomEdit; const AAlignment: TAlignment); override;
|
||||||
|
|
||||||
class procedure SetEditorEnabled(const ACustomFloatSpinEdit: TCustomFloatSpinEdit; AValue: Boolean); override;
|
class procedure SetEditorEnabled(const ACustomFloatSpinEdit: TCustomFloatSpinEdit; AValue: Boolean); override;
|
||||||
|
class procedure SetReadOnly(const ACustomEdit: TCustomEdit; NewReadOnly: boolean); override;
|
||||||
|
|
||||||
(*TODO: seperation into properties instead of bulk update
|
(*TODO: seperation into properties instead of bulk update
|
||||||
class procedure SetIncrement(const ACustomFloatSpinEdit: TCustomFloatSpinEdit; NewIncrement: Double); virtual;
|
class procedure SetIncrement(const ACustomFloatSpinEdit: TCustomFloatSpinEdit; NewIncrement: Double); virtual;
|
||||||
@ -148,6 +149,23 @@ begin
|
|||||||
QLineEdit_setReadOnly(LineEdit, NewRO);
|
QLineEdit_setReadOnly(LineEdit, NewRO);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
class procedure TQtWSCustomFloatSpinEdit.SetReadOnly(
|
||||||
|
const ACustomEdit: TCustomEdit; NewReadOnly: boolean);
|
||||||
|
var
|
||||||
|
Widget: TQtWidget;
|
||||||
|
QtEdit: IQtEdit;
|
||||||
|
begin
|
||||||
|
if not WSCheckHandleAllocated(ACustomEdit, 'SetReadOnly') then
|
||||||
|
Exit;
|
||||||
|
Widget := TQtWidget(ACustomEdit.Handle);
|
||||||
|
if Supports(Widget, IQtEdit, QtEdit) then
|
||||||
|
QtEdit.setReadOnly(NewReadOnly);
|
||||||
|
//if we set ReadOnly to False, the internal LineEdit will become ReadWrite as well, which may be unwanted.
|
||||||
|
if (not NewReadOnly) and (ACustomEdit is TCustomFloatSpinEdit) and (not TCustomFloatSpinEdit(ACustomEdit).EditorEnabled) then
|
||||||
|
SetEditorEnabled(TCustomFloatSpinEdit(ACustomEdit), False);
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
class procedure TQtWSCustomFloatSpinEdit.UpdateControl(const ACustomFloatSpinEdit: TCustomFloatSpinEdit);
|
class procedure TQtWSCustomFloatSpinEdit.UpdateControl(const ACustomFloatSpinEdit: TCustomFloatSpinEdit);
|
||||||
var
|
var
|
||||||
CurrentSpinWidget: TQtAbstractSpinBox;
|
CurrentSpinWidget: TQtAbstractSpinBox;
|
||||||
|
Loading…
Reference in New Issue
Block a user