From 804a18ef0ec4a054778e223c8cec6ee26dec3f76 Mon Sep 17 00:00:00 2001 From: Volker Hilsheimer Date: Wed, 15 May 2019 13:42:16 +0200 Subject: Document that QHeaderView rendered with themed style might ignore roles While this is generally true for widgets, QHeaderView's documentation about how appearance related data roles are respected can be misleading. Fixes: QTBUG-31804 Change-Id: I93c6562e59ecf771d938d282723169202ac15bc2 Reviewed-by: Richard Moe Gustavsen --- src/widgets/itemviews/qheaderview.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/widgets/itemviews') diff --git a/src/widgets/itemviews/qheaderview.cpp b/src/widgets/itemviews/qheaderview.cpp index 7bfa51337d..ed418f143c 100644 --- a/src/widgets/itemviews/qheaderview.cpp +++ b/src/widgets/itemviews/qheaderview.cpp @@ -146,7 +146,10 @@ static const int maxSizeSection = 1048575; // since section size is in a bitfiel Not all \l{Qt::}{ItemDataRole}s will have an effect on a QHeaderView. If you need to draw other roles, you can subclass QHeaderView and reimplement \l{QHeaderView::}{paintEvent()}. - QHeaderView respects the following item data roles: + QHeaderView respects the following item data roles, unless they are + in conflict with the style (which can happen for styles that follow + the desktop theme): + \l{Qt::}{TextAlignmentRole}, \l{Qt::}{DisplayRole}, \l{Qt::}{FontRole}, \l{Qt::}{DecorationRole}, \l{Qt::}{ForegroundRole}, and \l{Qt::}{BackgroundRole}. -- cgit v1.2.3