Replace QAbstractItemView::viewOptions with initViewItemOption
This commit is contained in:
@@ -230,7 +230,12 @@ QModelIndex GroupedIconView::indexAt(const QPoint &p) const {
|
|||||||
void GroupedIconView::paintEvent(QPaintEvent *e) {
|
void GroupedIconView::paintEvent(QPaintEvent *e) {
|
||||||
// This code was adapted from QListView::paintEvent(), changed to use the visualRect() of items, and to draw headers.
|
// 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())
|
if (isWrapping())
|
||||||
option.features = QStyleOptionViewItem::WrapText;
|
option.features = QStyleOptionViewItem::WrapText;
|
||||||
option.locale = locale();
|
option.locale = locale();
|
||||||
|
|||||||
Reference in New Issue
Block a user