1 /**************************************************************************** |
1 /**************************************************************************** |
2 ** |
2 ** |
3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). |
3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). |
4 ** All rights reserved. |
4 ** All rights reserved. |
5 ** Contact: Nokia Corporation (qt-info@nokia.com) |
5 ** Contact: Nokia Corporation (qt-info@nokia.com) |
6 ** |
6 ** |
7 ** This file is part of the QtGui module of the Qt Toolkit. |
7 ** This file is part of the QtGui module of the Qt Toolkit. |
8 ** |
8 ** |
5609 case SE_ItemViewItemText: |
5609 case SE_ItemViewItemText: |
5610 case SE_ItemViewItemDecoration: |
5610 case SE_ItemViewItemDecoration: |
5611 case SE_ItemViewItemFocusRect: |
5611 case SE_ItemViewItemFocusRect: |
5612 if (const QStyleOptionViewItemV4 *vopt = qstyleoption_cast<const QStyleOptionViewItemV4 *>(opt)) { |
5612 if (const QStyleOptionViewItemV4 *vopt = qstyleoption_cast<const QStyleOptionViewItemV4 *>(opt)) { |
5613 QRenderRule subRule = renderRule(w, opt, PseudoElement_ViewItem); |
5613 QRenderRule subRule = renderRule(w, opt, PseudoElement_ViewItem); |
5614 QStyleOptionViewItemV4 optCopy(*vopt); |
|
5615 optCopy.rect = subRule.contentsRect(vopt->rect); |
|
5616 QRect rect = ParentStyle::subElementRect(se, &optCopy, w); |
|
5617 PseudoElement pe = PseudoElement_None; |
5614 PseudoElement pe = PseudoElement_None; |
5618 if (se == SE_ItemViewItemText || se == SE_ItemViewItemFocusRect) |
5615 if (se == SE_ItemViewItemText || se == SE_ItemViewItemFocusRect) |
5619 pe = PseudoElement_ViewItemText; |
5616 pe = PseudoElement_ViewItemText; |
5620 else if (se == SE_ItemViewItemDecoration && vopt->features & QStyleOptionViewItemV2::HasDecoration) |
5617 else if (se == SE_ItemViewItemDecoration && vopt->features & QStyleOptionViewItemV2::HasDecoration) |
5621 pe = PseudoElement_ViewItemIcon; |
5618 pe = PseudoElement_ViewItemIcon; |
5622 else if (se == SE_ItemViewItemCheckIndicator && vopt->features & QStyleOptionViewItemV2::HasCheckIndicator) |
5619 else if (se == SE_ItemViewItemCheckIndicator && vopt->features & QStyleOptionViewItemV2::HasCheckIndicator) |
5623 pe = PseudoElement_ViewItemIndicator; |
5620 pe = PseudoElement_ViewItemIndicator; |
5624 else |
5621 else |
5625 break; |
5622 break; |
5626 QRenderRule subRule2 = renderRule(w, opt, pe); |
5623 if (subRule.hasGeometry() || subRule.hasBox() || !subRule.hasNativeBorder() || hasStyleRule(w, pe)) { |
5627 return positionRect(w, subRule2, pe, rect, opt->direction); |
5624 QRenderRule subRule2 = renderRule(w, opt, pe); |
|
5625 QStyleOptionViewItemV4 optCopy(*vopt); |
|
5626 optCopy.rect = subRule.contentsRect(vopt->rect); |
|
5627 QRect rect = ParentStyle::subElementRect(se, &optCopy, w); |
|
5628 return positionRect(w, subRule2, pe, rect, opt->direction); |
|
5629 } |
5628 } |
5630 } |
5629 break; |
5631 break; |
5630 #endif // QT_NO_ITEMVIEWS |
5632 #endif // QT_NO_ITEMVIEWS |
5631 |
5633 |
5632 case SE_HeaderArrow: { |
5634 case SE_HeaderArrow: { |