Qt: fixed bug while introducing OwnerData. SetAllocBy() is dummy now

git-svn-id: trunk@22796 -
This commit is contained in:
zeljko 2009-11-26 11:17:36 +00:00
parent c1fdc5e879
commit c5007165e5
2 changed files with 10 additions and 4 deletions

View File

@ -7438,7 +7438,10 @@ var
Items: TPtrIntArray;
Item: QTreeWidgetItemH;
begin
if AValue = ItemCount then
exit;
BeginUpdate;
try
ClearItems;
SetLength(Items, AValue);
for i := 0 to High(Items) do
@ -7446,8 +7449,11 @@ begin
Item := QTreeWidgetItem_create(QTreeWidgetH(Widget), 0);
Items[i] := PtrUInt(Item);
end;
QTreeWidget_addTopLevelItems(QTreeWidgetH(Widget), @Items);
EndUpdate;
if length(Items) > 0 then
QTreeWidget_addTopLevelItems(QTreeWidgetH(Widget), @Items);
finally
EndUpdate;
end;
end;
procedure TQtTreeWidget.setMaxColSize(ACol: Integer; const AValue: Integer);

View File

@ -1348,8 +1348,8 @@ var
begin
if not WSCheckHandleAllocated(ALV, 'SetAllocBy') then
Exit;
QtTreeWidget := TQtTreeWidget(ALV.Handle);
QtTreeWidget.ItemCount := AValue;
// QtTreeWidget := TQtTreeWidget(ALV.Handle);
// QtTreeWidget.ItemCount := AValue;
end;
class procedure TQtWSCustomListView.SetItemsCount(const ALV: TCustomListView;