Skip to content

Commit

Permalink
QTreeView::viewOptions() doesn't exist in qt 6
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Jul 20, 2021
1 parent ea43f6b commit 6d7d7cc
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/gui/layertree/qgslayertreeviewitemdelegate.cpp
Expand Up @@ -204,7 +204,12 @@ void QgsLayerTreeViewItemDelegate::onClicked( const QModelIndex &index )
if ( indicators.isEmpty() )
return;

#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
QStyleOptionViewItem opt( mLayerTreeView->viewOptions() );
#else
QStyleOptionViewItem opt;
mLayerTreeView->initViewItemOption( &opt );
#endif
opt.rect = mLayerTreeView->visualRect( index );
initStyleOption( &opt, index );
_fixStyleOption( opt );
Expand Down

0 comments on commit 6d7d7cc

Please sign in to comment.