mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-12 16:29:38 +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
|
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;
|
||||||
|
|
||||||
{------------------------------------------------------------------------------
|
{------------------------------------------------------------------------------
|
||||||
|
Loading…
Reference in New Issue
Block a user