From 0b3ba26d86d4825a9be2bc13e791c9f0feb8e7f0 Mon Sep 17 00:00:00 2001 From: Andrei Kortunov Date: Sun, 15 Jan 2023 18:23:21 +0400 Subject: [PATCH] Init style in Qt6-compatible way --- apps/opencs/view/widget/completerpopup.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/apps/opencs/view/widget/completerpopup.cpp b/apps/opencs/view/widget/completerpopup.cpp index 0a52295642..91b0902659 100644 --- a/apps/opencs/view/widget/completerpopup.cpp +++ b/apps/opencs/view/widget/completerpopup.cpp @@ -22,7 +22,12 @@ int CSVWidget::CompleterPopup::sizeHintForRow(int row) const ensurePolished(); QModelIndex index = model()->index(row, modelColumn()); +#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) + QStyleOptionViewItem option; + initViewItemOption(&option); +#else QStyleOptionViewItem option = viewOptions(); +#endif QAbstractItemDelegate* delegate = itemDelegate(index); return delegate->sizeHint(option, index).height(); }