Qt,Qt5: Fixed slowness with TListBox. issue #39311

This commit is contained in:
Željan Rikalo 2021-08-28 14:20:36 +02:00
parent 81a1feb88d
commit ce63f619fc
2 changed files with 6 additions and 0 deletions

View File

@ -455,6 +455,8 @@ begin
else
QtListWidget.setFrameShape(QFrameNoFrame);
QtListWidget.setUniformItemSizes(TCustomListBox(AWinControl).Style in [lbStandard, lbOwnerDrawFixed]);
QtListWidget.AttachEvents;
// create our FList helper
@ -693,6 +695,7 @@ class procedure TQtWSCustomListBox.SetStyle(const ACustomListBox: TCustomListBox
begin
if not WSCheckHandleAllocated(ACustomListBox, 'SetStyle') then
Exit;
TQtListWidget(ACustomListBox.Handle).setUniformItemSizes(ACustomListBox.Style in [lbStandard, lbOwnerDrawFixed]);
TQtListWidget(ACustomListBox.Handle).OwnerDrawn :=
ACustomListBox.Style in [lbOwnerDrawFixed, lbOwnerDrawVariable];
end;

View File

@ -457,6 +457,8 @@ begin
else
QtListWidget.setFrameShape(QFrameNoFrame);
QtListWidget.setUniformItemSizes(TCustomListBox(AWinControl).Style in [lbStandard, lbOwnerDrawFixed]);
QtListWidget.AttachEvents;
// create our FList helper
@ -695,6 +697,7 @@ class procedure TQtWSCustomListBox.SetStyle(const ACustomListBox: TCustomListBox
begin
if not WSCheckHandleAllocated(ACustomListBox, 'SetStyle') then
Exit;
TQtListWidget(ACustomListBox.Handle).setUniformItemSizes(ACustomListBox.Style in [lbStandard, lbOwnerDrawFixed]);
TQtListWidget(ACustomListBox.Handle).OwnerDrawn :=
ACustomListBox.Style in [lbOwnerDrawFixed, lbOwnerDrawVariable];
end;