mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-12-02 20:51:11 +01:00
Qt: set tristate handling (allowgrayed) on TQtCheckBox. part of #20740
git-svn-id: trunk@33751 -
This commit is contained in:
parent
37f6b6943c
commit
efd91117a1
@ -637,6 +637,7 @@ type
|
||||
public
|
||||
function CheckState: QtCheckState;
|
||||
procedure setCheckState(state: QtCheckState);
|
||||
procedure setTriState(AAllowGrayed: Boolean);
|
||||
public
|
||||
procedure AttachEvents; override;
|
||||
procedure DetachEvents; override;
|
||||
@ -5937,6 +5938,11 @@ begin
|
||||
QCheckBox_setCheckState(QCheckBoxH(Widget), state);
|
||||
end;
|
||||
|
||||
procedure TQtCheckBox.setTriState(AAllowGrayed: Boolean);
|
||||
begin
|
||||
QCheckBox_setTristate(QCheckBoxH(Widget), AAllowGrayed);
|
||||
end;
|
||||
|
||||
procedure TQtCheckBox.AttachEvents;
|
||||
begin
|
||||
inherited AttachEvents;
|
||||
|
||||
@ -1175,6 +1175,7 @@ begin
|
||||
//enclose the call between Begin/EndUpdate to avoid send LM_CHANGE message
|
||||
QtCheckBox := TQtCheckBox(ACustomCheckBox.Handle);
|
||||
QtCheckBox.BeginUpdate;
|
||||
QtCheckBox.setTriState(ACustomCheckBox.AllowGrayed);
|
||||
case NewState of
|
||||
cbGrayed: QtCheckBox.setCheckState(QtPartiallyChecked);
|
||||
cbChecked: QtCheckBox.setCheckState(QtChecked);
|
||||
@ -1196,6 +1197,7 @@ var
|
||||
QtCheckBox: TQtCheckBox;
|
||||
begin
|
||||
QtCheckBox := TQtCheckBox.Create(AWinControl, AParams);
|
||||
QtCheckBox.setTriState(TCustomCheckBox(AWinControl).AllowGrayed);
|
||||
QtCheckBox.AttachEvents;
|
||||
|
||||
Result := TLCLIntfHandle(QtCheckBox);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user