Qt: Fixed crash in TQtWSCustomListBox.GetItemRect()

git-svn-id: trunk@15130 -
This commit is contained in:
zeljko 2008-05-14 07:30:15 +00:00
parent 4a64a58cce
commit c18febb872

View File

@ -485,13 +485,14 @@ class function TQtWSCustomListBox.GetItemRect(
const ACustomListBox: TCustomListBox; Index: integer; var ARect: TRect const ACustomListBox: TCustomListBox; Index: integer; var ARect: TRect
): boolean; ): boolean;
var var
ModelIndex: QModelIndexH; Item: QListWidgetItemH;
begin begin
ModelIndex := QModelIndex_create(); Item := QListWidget_item(QListWidgetH(TQtListWidget(ACustomListBox.Handle).Widget), Index);
TQtListWidget(ACustomListBox.Handle).ModelIndex(ModelIndex, Index, 0); Result := Item <> nil;
ARect := TQtListWidget(ACustomListBox.Handle).visualRect(ModelIndex); if Result then
QModelIndex_destroy(ModelIndex); QListWidget_visualItemRect(QListWidgetH(TQtListWidget(ACustomListBox.Handle).Widget), @ARect, Item)
Result := True; else
ARect := Rect(-1,-1,-1,-1);
end; end;
{------------------------------------------------------------------------------ {------------------------------------------------------------------------------