mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-18 06:19:32 +02:00
(Qt): Commited workaround for issue #9746 (ListOutOfBounds in TCustomListView), fixed warning about uninitialized variable in EnumFontFamiliesEx()
git-svn-id: trunk@12117 -
This commit is contained in:
parent
e05a24834f
commit
7da21924fb
@ -1370,6 +1370,7 @@ begin
|
|||||||
(lpLogFont^.lfFaceName= '') and
|
(lpLogFont^.lfFaceName= '') and
|
||||||
(lpLogFont^.lfPitchAndFamily = 0) then
|
(lpLogFont^.lfPitchAndFamily = 0) then
|
||||||
begin
|
begin
|
||||||
|
FontType := 0;
|
||||||
FontList := TStringList.create;
|
FontList := TStringList.create;
|
||||||
try
|
try
|
||||||
if QtGetFontFamilies(FontList) > 0 then
|
if QtGetFontFamilies(FontList) > 0 then
|
||||||
|
@ -910,11 +910,28 @@ end;
|
|||||||
class procedure TQtWSCustomListView.ItemDelete(const ALV: TCustomListView; const AIndex: Integer);
|
class procedure TQtWSCustomListView.ItemDelete(const ALV: TCustomListView; const AIndex: Integer);
|
||||||
var
|
var
|
||||||
TW: QTreeWidgetH;
|
TW: QTreeWidgetH;
|
||||||
|
QtItem: QTreeWidgetItemH;
|
||||||
|
Item: TListItem;
|
||||||
begin
|
begin
|
||||||
if not WSCheckHandleAllocated(ALV, 'ItemDelete') then
|
if not WSCheckHandleAllocated(ALV, 'ItemDelete') then
|
||||||
Exit;
|
Exit;
|
||||||
TW := QTreeWidgetH(TQtTreeWidget(ALV.Handle).Widget);
|
TW := QTreeWidgetH(TQtTreeWidget(ALV.Handle).Widget);
|
||||||
QTreeWidget_takeTopLevelItem(TW, AIndex);
|
QTreeWidget_takeTopLevelItem(TW, AIndex);
|
||||||
|
|
||||||
|
{$note FIXME workaround issue #9746}
|
||||||
|
{workaround for ListOutOfBounds in some cases. Described with issue #9746}
|
||||||
|
QtItem := QTreeWidget_currentItem(TW);
|
||||||
|
|
||||||
|
if QtItem <> nil then
|
||||||
|
begin
|
||||||
|
Item := ALV.Selected;
|
||||||
|
if Assigned(Item) then
|
||||||
|
begin
|
||||||
|
if Item.Index <> QTreeWidget_indexOfTopLevelItem(TW, QtItem) then
|
||||||
|
TListView(ALV).Items[QTreeWidget_indexOfTopLevelItem(TW, QtItem)].Selected := True;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{------------------------------------------------------------------------------
|
{------------------------------------------------------------------------------
|
||||||
|
Loading…
Reference in New Issue
Block a user