Replace QAbstractItemView::viewOptions with initViewItemOption

This commit is contained in:
Jonas Kvinge 2020-08-26 23:35:33 +02:00
parent 0d5edd35ea
commit e52cda193e
1 changed files with 6 additions and 1 deletions

View File

@ -230,7 +230,12 @@ QModelIndex GroupedIconView::indexAt(const QPoint &p) const {
void GroupedIconView::paintEvent(QPaintEvent *e) {
// This code was adapted from QListView::paintEvent(), changed to use the visualRect() of items, and to draw headers.
QStyleOptionViewItem option(viewOptions());
QStyleOptionViewItem option;
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
initViewItemOption(&option);
#else
option = viewOptions();
#endif
if (isWrapping())
option.features = QStyleOptionViewItem::WrapText;
option.locale = locale();