src/gui/widgets/qabstractscrollarea.cpp
changeset 22 79de32ba3296
parent 18 2f34d5167611
child 30 5dc02b23752f
equal deleted inserted replaced
19:fcece45ef507 22:79de32ba3296
   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