This is similar to the patch
05aa8c6c12509cce87d1a3811c5ea1dd83fa0898
which was applied to QListView.
Task-number: QTBUG-26548
Change-Id: I38ff07230673a93a32b01a7f1951d0378d94185b
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Reviewed-by: Oliver Wolff <oliver.wolff@digia.com>
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
}
}
+QStyleOptionViewItem QTableViewPrivate::viewOptions() const
+{
+ QStyleOptionViewItem option = QAbstractItemViewPrivate::viewOptions();
+ option.showDecorationSelected = true;
+ return option;
+}
+
/*!
\reimp
*/
QStyleOptionViewItem QTableView::viewOptions() const
{
- QStyleOptionViewItem option = QAbstractItemView::viewOptions();
- option.showDecorationSelected = true;
- return option;
+ Q_D(const QTableView);
+ return d->viewOptions();
}
/*!
void init();
void trimHiddenSelections(QItemSelectionRange *range) const;
+ QStyleOptionViewItem viewOptions() const;
+
inline bool isHidden(int row, int col) const {
return verticalHeader->isSectionHidden(row)
|| horizontalHeader->isSectionHidden(col);
void task234926_setHeaderSorting();
void changeHeaderData();
+ void viewOptions();
};
// Testing get/set functions
return QTableView::sizeHintForRow(row);
}
+ QStyleOptionViewItem viewOptions() const {
+ return QTableView::viewOptions();
+ }
+
bool checkSignalOrder;
public slots:
void currentChanged(QModelIndex , QModelIndex ) {
QCOMPARE(orderedHeight, reorderedHeight);
}
+void tst_QTableView::viewOptions()
+{
+ QtTestTableView view;
+ QStyleOptionViewItem options = view.viewOptions();
+ QVERIFY(options.showDecorationSelected);
+}
+
QTEST_MAIN(tst_QTableView)
#include "tst_qtableview.moc"