Ensure that rects from wxListCtrl are also offset by the header height

This commit is contained in:
Matthew Griffin
2019-06-13 10:55:02 +01:00
parent f3ccc74a56
commit e3f35e1082

View File

@@ -595,6 +595,7 @@ bool wxListCtrl::GetItemRect(long item, wxRect& rect, int WXUNUSED(code)) const
if ( qitem != NULL )
{
rect = wxQtConvertRect( m_qtTreeWidget->visualItemRect(qitem) );
rect.Offset(0, m_qtTreeWidget->header()->height());
return true;
}
else
@@ -612,6 +613,7 @@ bool wxListCtrl::GetSubItemRect(long item, long subItem, wxRect& rect, int WXUNU
wxT("invalid column index in GetSubItemRect") );
QModelIndex qindex = m_qtTreeWidget->model()->index(item, subItem);
rect = wxQtConvertRect( m_qtTreeWidget->visualRect(qindex) );
rect.Offset(0, m_qtTreeWidget->header()->height());
return true;
}
else