mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-30 15:50:25 +02:00
Qt,Qt5,Qt6: fixed error with sorted TQtComboStrings. issue #40353
(cherry picked from commit dcf14bec5a
)
This commit is contained in:
parent
37e1398b1c
commit
21f35c1381
@ -566,15 +566,17 @@ begin
|
||||
end;
|
||||
|
||||
function TQtComboStrings.Add(const S: String): Integer;
|
||||
var
|
||||
I: Integer;
|
||||
begin
|
||||
if FSorted then
|
||||
Result := inherited Add(S);
|
||||
if FSorted and Assigned(FWinControl) and (FWinControl.HandleAllocated) then
|
||||
begin
|
||||
Find(S, Result);
|
||||
FChanging := True;
|
||||
Insert(Result, S);
|
||||
FChanging := False;
|
||||
end else
|
||||
Result := inherited Add(S);
|
||||
FOwner.BeginUpdate;
|
||||
for I := 0 to Count - 1 do
|
||||
FOwner.setItemText(I, Strings[I]);
|
||||
FOwner.EndUpdate;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TQtComboStrings.Assign(Source: TPersistent);
|
||||
|
@ -570,15 +570,17 @@ begin
|
||||
end;
|
||||
|
||||
function TQtComboStrings.Add(const S: String): Integer;
|
||||
var
|
||||
I: Integer;
|
||||
begin
|
||||
if FSorted then
|
||||
Result := inherited Add(S);
|
||||
if FSorted and Assigned(FWinControl) and (FWinControl.HandleAllocated) then
|
||||
begin
|
||||
Find(S, Result);
|
||||
FChanging := True;
|
||||
Insert(Result, S);
|
||||
FChanging := False;
|
||||
end else
|
||||
Result := inherited Add(S);
|
||||
FOwner.BeginUpdate;
|
||||
for I := 0 to Count - 1 do
|
||||
FOwner.setItemText(I, Strings[I]);
|
||||
FOwner.EndUpdate;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TQtComboStrings.Assign(Source: TPersistent);
|
||||
|
@ -570,15 +570,17 @@ begin
|
||||
end;
|
||||
|
||||
function TQtComboStrings.Add(const S: String): Integer;
|
||||
var
|
||||
I: Integer;
|
||||
begin
|
||||
if FSorted then
|
||||
Result := inherited Add(S);
|
||||
if FSorted and Assigned(FWinControl) and (FWinControl.HandleAllocated) then
|
||||
begin
|
||||
Find(S, Result);
|
||||
FChanging := True;
|
||||
Insert(Result, S);
|
||||
FChanging := False;
|
||||
end else
|
||||
Result := inherited Add(S);
|
||||
FOwner.BeginUpdate;
|
||||
for I := 0 to Count - 1 do
|
||||
FOwner.setItemText(I, Strings[I]);
|
||||
FOwner.EndUpdate;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TQtComboStrings.Assign(Source: TPersistent);
|
||||
|
Loading…
Reference in New Issue
Block a user