mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-11 20:36:09 +02:00
Qt: Fixed crash in TQtWSCustomListBox.GetItemRect()
git-svn-id: trunk@15130 -
This commit is contained in:
parent
4a64a58cce
commit
c18febb872
@ -485,13 +485,14 @@ class function TQtWSCustomListBox.GetItemRect(
|
||||
const ACustomListBox: TCustomListBox; Index: integer; var ARect: TRect
|
||||
): boolean;
|
||||
var
|
||||
ModelIndex: QModelIndexH;
|
||||
Item: QListWidgetItemH;
|
||||
begin
|
||||
ModelIndex := QModelIndex_create();
|
||||
TQtListWidget(ACustomListBox.Handle).ModelIndex(ModelIndex, Index, 0);
|
||||
ARect := TQtListWidget(ACustomListBox.Handle).visualRect(ModelIndex);
|
||||
QModelIndex_destroy(ModelIndex);
|
||||
Result := True;
|
||||
Item := QListWidget_item(QListWidgetH(TQtListWidget(ACustomListBox.Handle).Widget), Index);
|
||||
Result := Item <> nil;
|
||||
if Result then
|
||||
QListWidget_visualItemRect(QListWidgetH(TQtListWidget(ACustomListBox.Handle).Widget), @ARect, Item)
|
||||
else
|
||||
ARect := Rect(-1,-1,-1,-1);
|
||||
end;
|
||||
|
||||
{------------------------------------------------------------------------------
|
||||
|
Loading…
Reference in New Issue
Block a user