summaryrefslogtreecommitdiffstats
path: root/src/gui/styles/qcommonstyle.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/styles/qcommonstyle.cpp')
-rw-r--r--src/gui/styles/qcommonstyle.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/gui/styles/qcommonstyle.cpp b/src/gui/styles/qcommonstyle.cpp
index 7b8b75e..ba23499 100644
--- a/src/gui/styles/qcommonstyle.cpp
+++ b/src/gui/styles/qcommonstyle.cpp
@@ -3176,8 +3176,10 @@ QRect QCommonStyle::subElementRect(SubElement sr, const QStyleOption *opt,
if (const QStyleOptionViewItemV4 *vopt = qstyleoption_cast<const QStyleOptionViewItemV4 *>(opt)) {
if (!d->isViewItemCached(*vopt)) {
d->viewItemLayout(vopt, &d->checkRect, &d->decorationRect, &d->displayRect, false);
- if (d->cachedOption)
+ if (d->cachedOption) {
delete d->cachedOption;
+ d->cachedOption = 0;
+ }
d->cachedOption = new QStyleOptionViewItemV4(*vopt);
}
if (sr == SE_ViewItemCheckIndicator)