392 // In FrameOnlyAroundContents mode the frame is drawn between the controls and |
392 // In FrameOnlyAroundContents mode the frame is drawn between the controls and |
393 // the viewport, else the frame rect is equal to the widget rect. |
393 // the viewport, else the frame rect is equal to the widget rect. |
394 if ((frameStyle != QFrame::NoFrame) && |
394 if ((frameStyle != QFrame::NoFrame) && |
395 q->style()->styleHint(QStyle::SH_ScrollView_FrameOnlyAroundContents, &opt, q)) { |
395 q->style()->styleHint(QStyle::SH_ScrollView_FrameOnlyAroundContents, &opt, q)) { |
396 controlsRect = widgetRect; |
396 controlsRect = widgetRect; |
397 const int extra = q->style()->pixelMetric(QStyle::PM_ScrollView_ScrollBarSpacing); |
397 const int extra = q->style()->pixelMetric(QStyle::PM_ScrollView_ScrollBarSpacing, &opt, q); |
398 const QPoint cornerExtra(needv ? extra : 0, needh ? extra : 0); |
398 const QPoint cornerExtra(needv ? extra : 0, needh ? extra : 0); |
399 QRect frameRect = widgetRect; |
399 QRect frameRect = widgetRect; |
400 frameRect.adjust(0, 0, -cornerOffset.x() - cornerExtra.x(), -cornerOffset.y() - cornerExtra.y()); |
400 frameRect.adjust(0, 0, -cornerOffset.x() - cornerExtra.x(), -cornerOffset.y() - cornerExtra.y()); |
401 q->setFrameRect(QStyle::visualRect(opt.direction, opt.rect, frameRect)); |
401 q->setFrameRect(QStyle::visualRect(opt.direction, opt.rect, frameRect)); |
402 // The frame rect needs to be in logical coords, however we need to flip |
402 // The frame rect needs to be in logical coords, however we need to flip |