diff options
author | Sami Merila <sami.merila@nokia.com> | 2010-09-01 08:14:10 (GMT) |
---|---|---|
committer | Jesper Thomschutz <jesper.thomschutz@nokia.com> | 2010-09-07 10:27:58 (GMT) |
commit | d45b5377822f37118ea3e322886eed406fae7c68 (patch) | |
tree | 9e0d61ea6a3506ea9760692357ce9d0afe6aaaf1 | |
parent | 07bbace404078dcfd82eff717daa97299b8ba52c (diff) | |
download | Qt-d45b5377822f37118ea3e322886eed406fae7c68.zip Qt-d45b5377822f37118ea3e322886eed406fae7c68.tar.gz Qt-d45b5377822f37118ea3e322886eed406fae7c68.tar.bz2 |
QS60Style: Itemviews are drawn incorrectly
When running QS60Style on hardware, all the itemview items without
any special background (i.e. not "pressed", not "highlighted", not
"alternate") are drawn with "pressed button" graphics.
This is due that the internal drawing function gets called without
any enum value set and it seem to pick the second enumeration constant
from theme element list. The enumeration constant is not defined
to match to any integer value.
As a solution, style will not call the drawing function when theme
element is not defined.
Task-number: QTBUG-11601
Reviewed-by: Liang Qi
(cherry picked from commit 1ec0155c191e2818f56815ee4ddbf5d8982f1267)
-rw-r--r-- | src/gui/styles/qs60style.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/gui/styles/qs60style.cpp b/src/gui/styles/qs60style.cpp index 88fffa1..da23532 100644 --- a/src/gui/styles/qs60style.cpp +++ b/src/gui/styles/qs60style.cpp @@ -2340,16 +2340,20 @@ void QS60Style::drawPrimitive(PrimitiveElement element, const QStyleOption *opti tableView = true; QS60StylePrivate::SkinElements element; + bool themeGraphicDefined = false; QRect elementRect = option->rect; //draw item is drawn as pressed, if it already has focus. if (isPressed && (hasFocus || isSelected)) { + themeGraphicDefined = true; element = tableView ? QS60StylePrivate::SE_TableItemPressed : QS60StylePrivate::SE_ListItemPressed; } else if (hasFocus || (isSelected && selectionBehavior != QAbstractItemView::SelectItems)) { element = QS60StylePrivate::SE_ListHighlight; elementRect = highlightRect; + themeGraphicDefined = true; } - QS60StylePrivate::drawSkinElement(element, painter, elementRect, flags); + if (themeGraphicDefined) + QS60StylePrivate::drawSkinElement(element, painter, elementRect, flags); } else { QCommonStyle::drawPrimitive(element, option, painter, widget); } |