mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-15 07:29:34 +02:00
Qt,Qt5,Qt6: do not clear editable combobox edit text if items are cleared. issue #40734
(cherry picked from commit 1dbfb8fee2
)
This commit is contained in:
parent
89282a94ee
commit
2f07be9f42
@ -604,13 +604,21 @@ begin
|
||||
end;
|
||||
|
||||
procedure TQtComboStrings.Clear;
|
||||
var
|
||||
AText: WideString;
|
||||
begin
|
||||
inherited Clear;
|
||||
|
||||
if Assigned(FWinControl) and (FWinControl.HandleAllocated) then
|
||||
begin
|
||||
FOwner.BeginUpdate;
|
||||
if FOwner.getEditable then
|
||||
AText := FOwner.LineEdit.getText
|
||||
else
|
||||
AText := '';
|
||||
FOwner.ClearItems;
|
||||
if (AText <> '') then
|
||||
FOwner.setText(AText);
|
||||
FOwner.EndUpdate;
|
||||
end;
|
||||
end;
|
||||
|
@ -605,13 +605,21 @@ begin
|
||||
end;
|
||||
|
||||
procedure TQtComboStrings.Clear;
|
||||
var
|
||||
AText: WideString;
|
||||
begin
|
||||
inherited Clear;
|
||||
|
||||
if Assigned(FWinControl) and (FWinControl.HandleAllocated) then
|
||||
begin
|
||||
FOwner.BeginUpdate;
|
||||
if FOwner.getEditable then
|
||||
AText := FOwner.LineEdit.getText
|
||||
else
|
||||
AText := '';
|
||||
FOwner.ClearItems;
|
||||
if (AText <> '') then
|
||||
FOwner.setText(AText);
|
||||
FOwner.EndUpdate;
|
||||
end;
|
||||
end;
|
||||
|
@ -608,13 +608,21 @@ begin
|
||||
end;
|
||||
|
||||
procedure TQtComboStrings.Clear;
|
||||
var
|
||||
AText: WideString;
|
||||
begin
|
||||
inherited Clear;
|
||||
|
||||
if Assigned(FWinControl) and (FWinControl.HandleAllocated) then
|
||||
begin
|
||||
FOwner.BeginUpdate;
|
||||
if FOwner.getEditable then
|
||||
AText := FOwner.LineEdit.getText
|
||||
else
|
||||
AText := '';
|
||||
FOwner.ClearItems;
|
||||
if (AText <> '') then
|
||||
FOwner.setText(AText);
|
||||
FOwner.EndUpdate;
|
||||
end;
|
||||
end;
|
||||
|
Loading…
Reference in New Issue
Block a user