Ticket #57751: patch-src_plugins_accessible_widgets_itemviews_cpp

File patch-src_plugins_accessible_widgets_itemviews_cpp, 1.0 KB (added by devernay (Frédéric Devernay), 5 years ago)
Line 
1$OpenBSD$
2
3Fix build with gcc 6:
4error: invalid conversion from 'int' to
5'QItemSelectionModel::SelectionFlag' [-fpermissive]
6
7Columns & Deselect = 0x0040 & 0x0004 = 0 is an int, but
8Columns | Deselect calls Qt's operator | and returns a Qt internal type
9to allow the conversion.  Qt also allows a conversion from constant 0,
10but gcc 6 seems not to allow Columns & Deselect as constant 0.
11
12Index: src/plugins/accessible/widgets/itemviews.cpp
13--- src/plugins/accessible/widgets/itemviews.cpp.orig
14+++ src/plugins/accessible/widgets/itemviews.cpp
15@@ -393,7 +393,7 @@ bool QAccessibleTable2::unselectColumn(int column)
16     QModelIndex index = view()->model()->index(0, column, view()->rootIndex());
17     if (!index.isValid() || view()->selectionMode() & QAbstractItemView::NoSelection)
18         return false;
19-    view()->selectionModel()->select(index, QItemSelectionModel::Columns & QItemSelectionModel::Deselect);
20+    view()->selectionModel()->select(index, QItemSelectionModel::Columns | QItemSelectionModel::Deselect);
21     return true;
22 }
23