Commit 8e53c467 authored by Željan Rikalo's avatar Željan Rikalo 🏊🏼
Browse files

Qt, Qt5: fixed ItemShow - scroll to item. issue #32078

git-svn-id: trunk@55554 -
parent 21265ba8
......@@ -1523,6 +1523,7 @@ type
procedure setHeaderVisible(AVisible: Boolean);
procedure setItemSelected(AItem: QTreeWidgetItemH; ASelect: Boolean);
procedure setStretchLastSection(AValue: Boolean);
procedure scrollToItem(Item: QTreeWidgetItemH; hint: QAbstractItemViewScrollHint);
{$IFDEF TEST_QT_SORTING}
// direct Qt sorting via QtUserData ptr = our TListItem, crashes sometimes - qt bug.
procedure sortItems(Acolumn: Integer; AOrder: QtSortOrder);
......@@ -15393,6 +15394,12 @@ begin
Header.setStretchLastSection(AValue);
end;
 
procedure TQtTreeWidget.scrollToItem(Item: QTreeWidgetItemH;
hint: QAbstractItemViewScrollHint);
begin
QTreeWidget_scrollToItem(QTreeWidgetH(Widget), Item, hint);
end;
{$IFDEF TEST_QT_SORTING}
procedure TQtTreeWidget.sortItems(Acolumn: Integer; AOrder: QtSortOrder);
var
......
......@@ -1548,11 +1548,15 @@ begin
QtListWidget := TQtListWidget(ALV.Handle);
LWI := QtListWidget.getItem(AIndex);
QtListWidget.setItemVisible(LWI, True);
if not PartialOK then
QtListWidget.scrollToItem(AIndex, QAbstractItemViewEnsureVisible);
end else
begin
QtTreeWidget := TQtTreeWidget(ALV.Handle);
TWI := QtTreeWidget.topLevelItem(AIndex);
QtTreeWidget.setItemVisible(TWI, True);
if not PartialOK then
QtTreeWidget.scrollToItem(TWI, QAbstractItemViewEnsureVisible);
end;
end;
......
......@@ -1523,6 +1523,7 @@ type
procedure setHeaderVisible(AVisible: Boolean);
procedure setItemSelected(AItem: QTreeWidgetItemH; ASelect: Boolean);
procedure setStretchLastSection(AValue: Boolean);
procedure scrollToItem(Item: QTreeWidgetItemH; hint: QAbstractItemViewScrollHint);
{$IFDEF TEST_QT_SORTING}
// direct Qt sorting via QtUserData ptr = our TListItem, crashes sometimes - qt bug.
procedure sortItems(Acolumn: Integer; AOrder: QtSortOrder);
......@@ -15373,6 +15374,12 @@ begin
Header.setStretchLastSection(AValue);
end;
 
procedure TQtTreeWidget.scrollToItem(Item: QTreeWidgetItemH;
hint: QAbstractItemViewScrollHint);
begin
QTreeWidget_scrollToItem(QTreeWidgetH(Widget), Item, hint);
end;
{$IFDEF TEST_QT_SORTING}
procedure TQtTreeWidget.sortItems(Acolumn: Integer; AOrder: QtSortOrder);
var
......
......@@ -1547,11 +1547,15 @@ begin
QtListWidget := TQtListWidget(ALV.Handle);
LWI := QtListWidget.getItem(AIndex);
QtListWidget.setItemVisible(LWI, True);
if not PartialOK then
QtListWidget.scrollToItem(AIndex, QAbstractItemViewEnsureVisible);
end else
begin
QtTreeWidget := TQtTreeWidget(ALV.Handle);
TWI := QtTreeWidget.topLevelItem(AIndex);
QtTreeWidget.setItemVisible(TWI, True);
if not PartialOK then
QtTreeWidget.scrollToItem(TWI, QAbstractItemViewEnsureVisible);
end;
end;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment