diff options
author | Marc Mutz <marc.mutz@kdab.com> | 2015-11-02 15:40:58 +0100 |
---|---|---|
committer | Marc Mutz <marc.mutz@kdab.com> | 2015-11-02 18:43:35 +0000 |
commit | d2bb036d5083d95d1ab7bef53eac012f3520a633 (patch) | |
tree | 4ef6faa4622723edbd3d6eb718120386285a05a6 /src/widgets/doc/snippets/javastyle.cpp | |
parent | 595d6797beab5f4275b4e544c9683a99b48f4801 (diff) |
[docs] widgets: remove remaining references to QStyleOption*V<N>
They are all obsolete since Qt 5.0.
Change-Id: Ie56b99ad470fddb87f277f3f4f3845764828d10a
Reviewed-by: Jens Bache-Wiig <jensbw@gmail.com>
Diffstat (limited to 'src/widgets/doc/snippets/javastyle.cpp')
-rw-r--r-- | src/widgets/doc/snippets/javastyle.cpp | 25 |
1 files changed, 10 insertions, 15 deletions
diff --git a/src/widgets/doc/snippets/javastyle.cpp b/src/widgets/doc/snippets/javastyle.cpp index b0b548e731..4997e25ada 100644 --- a/src/widgets/doc/snippets/javastyle.cpp +++ b/src/widgets/doc/snippets/javastyle.cpp @@ -236,9 +236,8 @@ void JavaStyle::drawControl(ControlElement control, const QStyleOption *option, break; } case CE_DockWidgetTitle: { - const QStyleOptionDockWidgetV2 *docker = - new QStyleOptionDockWidgetV2( - *qstyleoption_cast<const QStyleOptionDockWidget *>(option)); + const QStyleOptionDockWidget *docker = + qstyleoption_cast<const QStyleOptionDockWidget *>(option); QRect rect = docker->rect; QRect titleRect = rect; @@ -366,11 +365,9 @@ void JavaStyle::drawControl(ControlElement control, const QStyleOption *option, break; } case CE_ProgressBar: { - const QStyleOptionProgressBar *bar1 = + const QStyleOptionProgressBar *bar = qstyleoption_cast<const QStyleOptionProgressBar *>(option); - QStyleOptionProgressBarV2 *bar = new QStyleOptionProgressBarV2(*bar1); - QRect rect = bar->rect; if (bar->orientation == Qt::Vertical) { rect = QRect(rect.left(), rect.top(), rect.height(), rect.width()); @@ -416,7 +413,6 @@ void JavaStyle::drawControl(ControlElement control, const QStyleOption *option, if (bar->textVisible) drawControl(CE_ProgressBarLabel, &subBar, painter, widget); - delete bar; break; } case CE_ProgressBarGroove: { @@ -2366,18 +2362,17 @@ void JavaStyle::drawPrimitive(PrimitiveElement element, case PE_FrameLineEdit: { const QStyleOptionFrame *frame = qstyleoption_cast<const QStyleOptionFrame *>(option); - const QStyleOptionFrameV2 frameV2(*frame); painter->setPen(frame->palette.color(QPalette::Mid)); - painter->drawRect(frameV2.rect.adjusted(0, 0, -2, -2)); + painter->drawRect(frame->rect.adjusted(0, 0, -2, -2)); painter->setPen(Qt::white); - painter->drawRect(frameV2.rect.adjusted(1, 1, -1, -1)); - painter->setPen(frameV2.palette.color(QPalette::Active, + painter->drawRect(frame->rect.adjusted(1, 1, -1, -1)); + painter->setPen(frame->palette.color(QPalette::Active, QPalette::Background)); - painter->drawLine(frameV2.rect.bottomLeft(), - frameV2.rect.bottomLeft() + QPoint(1, -1)); - painter->drawLine(frameV2.rect.topRight(), - frameV2.rect.topRight() + QPoint(-1, 1)); + painter->drawLine(frame->rect.bottomLeft(), + frame->rect.bottomLeft() + QPoint(1, -1)); + painter->drawLine(frame->rect.topRight(), + frame->rect.topRight() + QPoint(-1, 1)); break; } case PE_FrameFocusRect: { |