summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorSami Merila <sami.merila@nokia.com>2010-09-01 08:14:10 (GMT)
committerSami Merila <sami.merila@nokia.com>2010-09-01 08:14:10 (GMT)
commit1ec0155c191e2818f56815ee4ddbf5d8982f1267 (patch)
tree8fbc40341b2d85b9207c74f3f334452a32f2957a /src
parent1760f0e50cc2f5b39edb5fc751198a2f28871d83 (diff)
downloadQt-1ec0155c191e2818f56815ee4ddbf5d8982f1267.zip
Qt-1ec0155c191e2818f56815ee4ddbf5d8982f1267.tar.gz
Qt-1ec0155c191e2818f56815ee4ddbf5d8982f1267.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
Diffstat (limited to 'src')
-rw-r--r--src/gui/styles/qs60style.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/gui/styles/qs60style.cpp b/src/gui/styles/qs60style.cpp
index e28403b..0ba1bc6 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);
}